/* ============================================================
   style.css — Sistema de Assistência Técnica
   Dark Mode Premium + Glassmorphism
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg-base:        #0d0d1a;
  --bg-surface:     #111127;
  --bg-elevated:    #191932;
  --glass-bg:       rgba(255,255,255,0.04);
  --glass-border:   rgba(255,255,255,0.08);
  --glass-hover:    rgba(255,255,255,0.07);

  --primary:        #7c6eff;
  --primary-light:  #a89bff;
  --primary-dark:   #5d4dcc;
  --primary-glow:   rgba(124,110,255,0.25);

  --accent:         #00d4aa;
  --accent-glow:    rgba(0,212,170,0.2);

  --success:        #2ecc71;
  --warning:        #f39c12;
  --danger:         #e74c3c;
  --info:           #3498db;
  --neutral:        #6b7280;

  --text-primary:   #f0f0ff;
  --text-secondary: #9a9ab8;
  --text-muted:     #5c5c7a;

  --sidebar-w:      260px;
  --radius-sm:      6px;
  --radius-md:      12px;
  --radius-lg:      18px;
  --radius-xl:      24px;

  --shadow-sm:      0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:      0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:      0 8px 48px rgba(0,0,0,0.5);
  --shadow-primary: 0 4px 24px rgba(124,110,255,0.3);

  --transition:     all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(ellipse at 20% 20%, rgba(124,110,255,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(0,212,170,0.05) 0%, transparent 50%),
    var(--bg-base);
  background-attachment: fixed;
}

a { color: var(--primary-light); text-decoration: none; cursor: pointer; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }
code { font-family: 'Courier New', monospace; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Root ───────────────────────────────────────────────────── */
#root { height: 100vh; overflow: hidden; }

/* ── App Layout ─────────────────────────────────────────────── */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid var(--glass-border);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  z-index: 10;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: var(--shadow-primary);
}

.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.sidebar-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 16px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  margin-bottom: 2px;
  text-decoration: none;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(124,110,255,0.2), rgba(124,110,255,0.1));
  color: var(--primary-light);
  border: 1px solid rgba(124,110,255,0.2);
}

.nav-item.active .nav-icon { filter: none; }

.nav-item-danger:hover { color: var(--danger); }

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  display: none;
}

.nav-badge-warn { background: var(--warning); color: #000; }

/* ── Main Content ───────────────────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100vh;
}

#page-content {
  padding: 32px;
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100%;
}

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.page-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.page-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-body {
  padding: 20px 24px;
}

.mb-4 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.ml-1 { margin-left: 4px; }
.ml-2 { margin-left: 8px; }

/* ── Stats Grid ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255,255,255,0.15);
}

.stat-card.highlight {
  background: linear-gradient(135deg, rgba(124,110,255,0.15), rgba(0,212,170,0.08));
  border-color: rgba(124,110,255,0.3);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon-blue    { background: rgba(52,152,219,0.15); }
.stat-icon-warning { background: rgba(243,156,18,0.15); }
.stat-icon-info    { background: rgba(52,152,219,0.12); }
.stat-icon-primary { background: rgba(124,110,255,0.15); }
.stat-icon-success { background: rgba(46,204,113,0.15); }
.stat-icon-green   { background: rgba(46,204,113,0.12); }
.stat-icon-purple  { background: rgba(124,110,255,0.12); }
.stat-icon-neutral { background: rgba(107,114,128,0.15); }
.stat-icon-danger  { background: rgba(231,76,60,0.15); }
.stat-icon-gold    { background: rgba(255,215,0,0.1); }

.stat-info {
  min-width: 0;
  overflow: hidden;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Dashboard Grid ─────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
  gap: 20px;
}

/* ── Filters Bar ────────────────────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  pointer-events: none;
}

.search-input {
  padding-left: 38px !important;
}

.filter-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  transition: var(--transition);
}

.filter-tab:hover { color: var(--text-primary); background: var(--glass-hover); }

.filter-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 12px rgba(124,110,255,0.4);
}

.filter-select-wrap select { min-width: 180px; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table thead th {
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}

.table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr.clickable {
  cursor: pointer;
  transition: background 0.15s;
}

.table tbody tr.clickable:hover {
  background: rgba(255,255,255,0.03);
}

.table-compact th, .table-compact td { padding: 10px 14px; }

.table tfoot td {
  padding: 14px 16px;
  font-weight: 700;
  border-top: 2px solid var(--glass-border);
  background: rgba(255,255,255,0.03);
}

.table-total-row td { color: var(--text-primary); }

/* Row states */
.row-danger td { background: rgba(231,76,60,0.06); }
.row-warning td { background: rgba(243,156,18,0.06); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success { background: rgba(46,204,113,0.15); color: #2ecc71; }
.badge-warning { background: rgba(243,156,18,0.15); color: #f39c12; }
.badge-danger  { background: rgba(231,76,60,0.15); color: #e74c3c; }
.badge-info    { background: rgba(52,152,219,0.15); color: #3498db; }
.badge-primary { background: rgba(124,110,255,0.15); color: var(--primary-light); }
.badge-neutral { background: rgba(107,114,128,0.15); color: #9ca3af; }
.badge-purple  { background: rgba(124,110,255,0.15); color: var(--primary-light); }
.badge-blue    { background: rgba(52,152,219,0.15); color: #3498db; }

.code-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(124,110,255,0.1);
  border: 1px solid rgba(124,110,255,0.2);
  border-radius: 6px;
  color: var(--primary-light);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* ── Quantity badges ────────────────────────────────────────── */
.qtd-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 24px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.qtd-ok  { background: rgba(46,204,113,0.15); color: #2ecc71; }
.qtd-low { background: rgba(231,76,60,0.15); color: #e74c3c; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 2px 12px rgba(124,110,255,0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  box-shadow: var(--shadow-primary);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255,255,255,0.07);
  border-color: var(--glass-border);
  color: var(--text-primary);
}
.btn-secondary:hover { background: rgba(255,255,255,0.12); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--glass-hover); color: var(--text-primary); }

.btn-outline {
  background: transparent;
  border-color: var(--glass-border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary-light); }

.btn-danger-ghost {
  color: var(--text-muted);
}
.btn-danger-ghost:hover { color: var(--danger); background: rgba(231,76,60,0.1); }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-full { width: 100%; }

.btn-icon {
  padding: 6px 8px;
  min-width: 32px;
  background: rgba(255,255,255,0.04);
  border-color: var(--glass-border);
  font-size: 14px;
}
.btn-icon:hover { background: rgba(255,255,255,0.1); }

.btn-arrow { font-size: 18px; margin-left: 4px; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder { color: var(--text-muted); }

.form-control[readonly] {
  opacity: 0.7;
  cursor: default;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239a9ab8' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

select.form-control option { background: var(--bg-elevated); color: var(--text-primary); }

textarea.form-control { resize: vertical; min-height: 80px; }

.form-control-sm { padding: 7px 10px; font-size: 12px; }

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.input-with-btn {
  display: flex;
  gap: 8px;
}

.input-with-btn .form-control { flex: 1; }

.flex-2 { flex: 2; }

.section-divider {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 0;
  margin: 8px 0 16px;
  border-bottom: 1px solid var(--glass-border);
}

.form-section {
  margin-bottom: 20px;
  padding: 24px;
}

.form-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-border);
}

.form-page { display: flex; flex-direction: column; gap: 0; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 0;
}

.align-end { align-items: flex-end; }

/* Checkbox grid */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  color: var(--text-secondary);
}

.checkbox-label:hover { background: var(--glass-hover); color: var(--text-primary); }

.checkbox-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-label:has(input:checked) {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(124,110,255,0.1);
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden { display: none; }

.modal {
  border-radius: var(--radius-xl);
  max-width: 760px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-header {
  padding: 24px 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  padding: 0;
}

.modal-close:hover { background: rgba(231,76,60,0.2); color: var(--danger); }

.modal-body { padding: 24px 28px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 0 0;
  border-top: 1px solid var(--glass-border);
  margin-top: 20px;
}

/* ── Login ──────────────────────────────────────────────────── */
.login-screen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 30% 30%, rgba(124,110,255,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 70%, rgba(0,212,170,0.1) 0%, transparent 60%),
    var(--bg-base);
}

.login-card {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  animation: slideUp 0.3s ease;
}

.login-logo {
  text-align: center;
  margin-bottom: 40px;
}

.login-logo-icon {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
}

.login-title {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

.login-form { display: flex; flex-direction: column; gap: 16px; }

.login-error {
  background: rgba(231,76,60,0.15);
  border: 1px solid rgba(231,76,60,0.3);
  color: #e74c3c;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  text-align: center;
  animation: shake 0.3s ease;
}

.login-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 20px;
}

.login-hint code {
  color: var(--primary-light);
  background: rgba(124,110,255,0.1);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ── Toast ──────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  min-width: 260px;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show { opacity: 1; transform: translateX(0); }

.toast-success { border-color: rgba(46,204,113,0.3); }
.toast-error   { border-color: rgba(231,76,60,0.3); }
.toast-info    { border-color: rgba(52,152,219,0.3); }

.toast-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.toast-success .toast-icon { background: rgba(46,204,113,0.2); color: #2ecc71; }
.toast-error .toast-icon   { background: rgba(231,76,60,0.2); color: #e74c3c; }
.toast-info .toast-icon    { background: rgba(52,152,219,0.2); color: #3498db; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-danger {
  background: rgba(231,76,60,0.1);
  border: 1px solid rgba(231,76,60,0.25);
  color: #f1948a;
}

.alert-warning {
  background: rgba(243,156,18,0.1);
  border: 1px solid rgba(243,156,18,0.25);
  color: #f0b27a;
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 40px;
}

.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state p { color: var(--text-muted); margin-bottom: 20px; font-size: 15px; }

/* ── Detail View ────────────────────────────────────────────── */
.detalhe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.detalhe-rows { display: flex; flex-direction: column; gap: 12px; }

.detalhe-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  gap: 16px;
}

.detalhe-row:last-child { border-bottom: none; padding-bottom: 0; }

.detalhe-row span:first-child {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.total-row { padding-top: 12px; border-top: 2px solid var(--glass-border); }
.total-row span:first-child { color: var(--text-secondary); font-size: 13px; }

.empresa-logo {
  max-height: 60px;
  max-width: 180px;
  object-fit: contain;
}

.empresa-bloco {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ── Logo Upload (Configurações) ──────────────────── */
.logo-upload-group { margin-bottom: 20px; }

.logo-upload-area {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.logo-upload-area:hover { border-color: var(--primary); }

.logo-preview-wrap {
  width: 120px;
  height: 80px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.logo-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.logo-placeholder {
  text-align: center;
  color: var(--text-muted);
}

.logo-placeholder span { font-size: 24px; display: block; }
.logo-placeholder p { font-size: 11px; margin-top: 4px; }

.logo-upload-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

/* ── Relatórios em Lote ─────────────────────────────────────── */
.quick-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
  margin-top: 4px;
}

.quick-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.rel-summary-bar {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.rel-summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 20px;
  flex: 1;
  min-width: 140px;
  text-align: center;
}

.rel-summary-item span {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.rel-summary-item strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
}

.rel-summary-sep {
  width: 1px;
  background: var(--glass-border);
  align-self: stretch;
  flex-shrink: 0;
}

.table-scroll {
  overflow-x: auto;
}

/* ── Config Grid ────────────────────────────────────────────── */
.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.uso-stats { display: flex; flex-direction: column; gap: 12px; }
.uso-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.uso-label { color: var(--text-muted); font-size: 13px; }
.uso-valor { font-weight: 700; color: var(--text-primary); }

.backup-actions { display: flex; flex-direction: column; gap: 16px; }

/* ── Peças lista ────────────────────────────────────────────── */
.peca-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.peca-nome { flex: 1; font-size: 13px; }
.peca-qtd { font-size: 12px; color: var(--text-muted); }

/* ── Action Buttons ─────────────────────────────────────────── */
.action-buttons {
  display: flex;
  gap: 4px;
}

/* ── Utilities ──────────────────────────────────────────────── */
.hidden { display: none !important; }
.font-medium { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: 'Courier New', monospace; letter-spacing: 1px; }
.text-primary { color: var(--primary-light) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-gold    { color: #ffd700 !important; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-sm { font-size: 12px; }

/* Spinner */
.spinner-small {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .config-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 220px; }
  #page-content { padding: 20px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .detalhe-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .sidebar { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  .page-header { flex-direction: column; gap: 12px; }
}
