/* ============================================================
   Parlisto — Premium Auto Workshop Platform
   Deep Navy + Royal Gold · Built to Perform
   ============================================================ */

:root {
  /* Yüzey renkleri */
  --bg: #fbf7ed;              /* krem arka plan */
  --surface: #ffffff;
  --surface-2: #f7f3e9;       /* açık krem */
  --border: #e6ddc5;          /* altın tonlu kenarlık */
  --text: #1f2937;
  --text-muted: #6b7280;

  /* Marka — Lacivert */
  --primary: #0f1b2d;         /* logo ana lacivert */
  --primary-dark: #060c17;
  --primary-light: #2a3a55;

  /* Marka — Altın Sarı */
  --accent: #d4a24a;          /* logo ana altın */
  --accent-dark: #b8863a;
  --accent-light: #e6b85c;
  --accent-soft: #f2e4c2;     /* hover/arkaplan */

  /* Sistem renkleri */
  --green: #059669;
  --red: #dc2626;
  --yellow: #d4a24a;          /* sarıyı altınla eşle */
  --blue: #0F1B2D;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, .08);
  --shadow: 0 2px 8px rgba(15, 27, 45, .1);
  --shadow-lg: 0 10px 30px rgba(15, 27, 45, .15);
  --shadow-gold: 0 4px 14px rgba(212, 162, 74, .25);
}

[data-theme="dark"] {
  --bg: #0a1220;
  --surface: #0f1b2d;
  --surface-2: #1a2540;
  --border: #2a3a55;
  --text: #f5ecd4;
  --text-muted: #a0a8b7;
  --primary: #d4a24a;          /* dark modda altın öne çıksın */
  --primary-dark: #b8863a;
  --primary-light: #e6b85c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   Layout — üst şeritli (orkestra'dan farklı!)
   ============================================================ */
/* ============================================================
   TOPBAR — Parlisto Navbar (v1.6 düzeltmeli)
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow);
  overflow: visible;
}
.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 0;
}

/* --- Brand / Logo --- */
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
  text-decoration: none;
  margin-right: 12px;
}
.topbar .brand:hover { text-decoration: none; }
.topbar .brand-name {
  color: var(--accent);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .3px;
}

/* --- Nav --- */
.topbar nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: visible;
  padding: 0;
  position: static;
  margin-right: 12px;
}

.topbar nav > a,
.topbar nav > .nav-dropdown > a {
  display: inline-flex;
  align-items: center;
  color: rgba(255,255,255,.85);
  padding: 7px 11px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 13px;
  transition: background .15s, color .15s;
  white-space: nowrap;
  line-height: 1;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}
.topbar nav > a:hover,
.topbar nav > .nav-dropdown > a:hover {
  background: rgba(212,162,74,.18);
  color: var(--accent);
  text-decoration: none;
}
.topbar nav > a.active,
.topbar nav > .nav-dropdown.has-active > a {
  background: var(--accent);
  color: var(--primary);
  font-weight: 700;
}

/* --- Dropdown --- */
.nav-dropdown { position: relative; }
.nav-dropdown > a { cursor: pointer; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #1a2540;
  border: 1px solid rgba(212,162,74,0.35);
  border-radius: 8px;
  padding: 6px;
  min-width: 200px;
  box-shadow: 0 10px 32px rgba(0,0,0,0.35);
  z-index: 500;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block !important;
  padding: 9px 14px !important;
  border-radius: 5px;
  color: rgba(255,255,255,0.85) !important;
  white-space: nowrap;
  font-size: 13px !important;
  font-weight: 500;
  transition: background .12s, color .12s;
  text-decoration: none !important;
}
.nav-dropdown-menu a:hover {
  background: rgba(212,162,74,0.2);
  color: var(--accent) !important;
}
.nav-dropdown-menu a.active {
  background: rgba(212,162,74,0.15);
  color: var(--accent) !important;
  font-weight: 700;
}

/* --- User menu --- */
.topbar .user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  margin-left: 8px;
  border-left: 1px solid rgba(255,255,255,.2);
  flex-shrink: 0;
}

/* Notif buttons (sound + bell) */
.topbar .notif-sound-btn,
.topbar .notif-bell {
  background: transparent;
  border: 0;
  color: rgba(255,255,255,.85);
  font-size: 16px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s;
  line-height: 1;
  flex-shrink: 0;
}
.topbar .notif-sound-btn:hover,
.topbar .notif-bell:hover {
  background: rgba(212,162,74,.18);
}
.topbar .notif-wrap {
  position: relative;
  flex-shrink: 0;
}
.topbar .notif-badge {
  position: absolute;
  top: 0; right: 0;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 8px;
  text-align: center;
}
.topbar .user-avatar {
  width: 30px; height: 30px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--primary);
  flex-shrink: 0;
}
.topbar .user-meta { line-height: 1.2; }
.topbar .user-meta .name {
  font-size: 12px; font-weight: 600;
  max-width: 110px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block;
}
.topbar .user-meta .role { font-size: 10px; opacity: .7; }
.topbar a.profile-link,
.topbar a.logout {
  color: rgba(255,255,255,.75);
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color .15s;
  text-decoration: none;
}
.topbar a.profile-link:hover,
.topbar a.logout:hover { color: var(--accent); text-decoration: none; }

/* --- Mobile toggle --- */
.mobile-toggle {
  display: none;
  background: transparent;
  color: #fff;
  border: 0;
  font-size: 22px;
  cursor: pointer;
  margin-left: auto;
  padding: 4px 8px;
}

.mobile-only-bottom { display: none; }

/* --- Responsive: 1100px --- */
@media (max-width: 1100px) {
  .topbar nav > a,
  .topbar nav > .nav-dropdown > a { font-size: 12px; padding: 6px 8px; }
}

/* --- Responsive: 768px (Mobile) --- */
@media (max-width: 768px) {
  .topbar { position: sticky; top: 0; z-index: 100; }
  .topbar-inner {
    padding: 0 12px;
    height: 56px;
    min-height: 56px;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
  }
  .topbar .brand {
    padding: 0;
    flex: 1;
    min-width: 0;        /* logo metnini taşırmasın */
  }
  .topbar .brand img { height: 32px !important; }
  .topbar .brand-name { font-size: 16px; }

  .mobile-toggle {
    display: block;
    order: 0;
    margin-left: auto;
    margin-right: 8px;
    z-index: 102;
  }

  /* Mobil menü artık yandan açılan tam yükseklikte panel */
  .topbar nav {
    display: flex;
    position: fixed;
    top: 0;
    right: -100%;        /* başlangıçta gizli, sağda */
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: #0F1B2D;
    flex-direction: column;
    align-items: stretch;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 70px 0 20px;
    border-left: 1px solid rgba(212,162,74,.2);
    transition: right .25s ease;
    box-shadow: -4px 0 20px rgba(0,0,0,.3);
    z-index: 9999;       /* topbar/sticky stacking context'inden tamamen kurtul */
    gap: 0;
  }
  .topbar nav.open { right: 0; }

  /* Backdrop kullanılmıyor — JS document.click handler dış tıklamayı yakalıyor.
     Bu sayede menünün içindeki linkler hiçbir şeye takılmadan çalışır */
  .nav-backdrop {
    display: none !important;
  }

  .topbar nav > a,
  .topbar nav > .nav-dropdown > a {
    font-size: 15px;
    padding: 14px 18px;
    width: 100%;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,.05);
    text-align: left;
  }
  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    background: rgba(255,255,255,.04);
    border-radius: 0;
    margin: 0;
    padding: 0;
  }
  .nav-dropdown-menu a {
    padding: 12px 30px !important;
    font-size: 14px !important;
  }

  /* Mobil menüde alt buton bölgesi (Profil + Çıkış) */
  .mobile-only-bottom {
    display: flex;
    flex-direction: column;
    margin-top: auto;          /* dipte kalsın */
    padding: 16px 18px 24px;
    border-top: 1px solid rgba(212,162,74,.25);
    gap: 8px;
  }
  .mobile-bottom-link {
    display: block;
    padding: 13px 16px;
    background: rgba(255,255,255,.05);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    transition: background .15s;
  }
  .mobile-bottom-link:hover { background: rgba(255,255,255,.12); }
  .mobile-logout {
    background: #d4a24a !important;
    color: #0F1B2D !important;
    margin-top: 4px;
  }
  .mobile-logout:hover { background: #e0b15a !important; }

  /* User menü düzeni mobilde */
  .topbar .user-meta { display: none; }
  .topbar .user-menu {
    margin-left: 0;
    margin-right: 8px;
    flex-shrink: 0;
  }
  /* Profil/Çıkış butonları üst barda gizli — mobil menünün dibine taşındı */
  .topbar a.profile-link,
  .topbar a.logout {
    display: none;
  }

  /* Body scroll lock when menu open */
  body.nav-open { overflow: hidden; }
}

/* ============================================================
   Main content
   ============================================================ */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}
.page-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 16px;
  font-weight: 600;
}

/* Stat card grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
}
.stat-card .label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 600;
}
.stat-card .value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin: 6px 0;
}
.stat-card .hint { font-size: 12px; color: var(--text-muted); }
.stat-card.primary::before { background: var(--primary); }
.stat-card.green::before   { background: var(--green); }
.stat-card.red::before     { background: var(--red); }

/* ============================================================
   Forms
   ============================================================ */
.form-group { margin-bottom: 16px; }
label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
label .required { color: var(--red); }
input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="tel"], input[type="date"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212,162,74,.2);
}
textarea { min-height: 80px; resize: vertical; }
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.help-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); text-decoration: none; color: #fff; }
.btn-accent {
  background: var(--accent);
  color: var(--primary);
  font-weight: 700;
  box-shadow: var(--shadow-gold);
}
.btn-accent:hover:not(:disabled) {
  background: var(--accent-light);
  text-decoration: none;
  color: var(--primary);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover { background: var(--surface-2); text-decoration: none; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; text-decoration: none; color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-block { width: 100%; }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  background: var(--surface-2);
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.badge-primary { background: rgba(15,27,45,.1); color: var(--primary); }
.badge-accent { background: rgba(255,107,53,.1); color: var(--accent); }
.badge-green { background: rgba(16,185,129,.1); color: var(--green); }
.badge-red { background: rgba(239,68,68,.1); color: var(--red); }
.badge-yellow { background: rgba(245,158,11,.1); color: var(--yellow); }
.badge-gray { background: var(--border); color: var(--text-muted); }

/* Status badges */
.status-draft { background: var(--border); color: var(--text-muted); }
.status-sent, .status-pending, .status-submitted { background: rgba(59,130,246,.1); color: var(--blue); }
.status-offered, .status-reviewed { background: rgba(245,158,11,.1); color: var(--yellow); }
.status-ordered, .status-preparing, .status-shipped { background: rgba(255,107,53,.1); color: var(--accent); }
.status-delivered, .status-completed, .status-active { background: rgba(16,185,129,.1); color: var(--green); }
.status-cancelled, .status-suspended { background: rgba(239,68,68,.1); color: var(--red); }
.status-banned { background: rgba(127,0,0,.15); color: #7f0000; font-weight: 700; }

/* ============================================================
   Alerts / Flash messages
   ============================================================ */
.flash-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 200;
  max-width: 360px;
}
.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  background: var(--surface);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: slideIn .3s;
}
.flash-success { border-left-color: var(--green); }
.flash-error { border-left-color: var(--red); }
.flash-warning { border-left-color: var(--yellow); }
.flash-info { border-left-color: var(--blue); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   Login page
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 20px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}
.auth-logo .mark {
  width: 60px; height: 60px;
  background: var(--accent);
  border-radius: 12px;
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  font-size: 28px;
  color: #fff;
}
.auth-title { font-size: 22px; font-weight: 700; }
.auth-subtitle { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.auth-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   Utility
   ============================================================ */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.flex { display: flex; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.text-bold { font-weight: 600; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* Empty state */
.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty .icon { font-size: 48px; margin-bottom: 12px; }
.empty .title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty .hint { font-size: 13px; margin-bottom: 16px; }

/* Responsive — genel */
@media (max-width: 768px) {
  .main { padding: 16px; }
  .page-header { flex-direction: column; align-items: flex-start; }

  /* Form ve grid'ler her zaman tek sütun */
  .grid-2,
  .grid[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Tablolar mobile'da: scroll yerine sıkıştır + sarma izin ver */
  table {
    width: 100%;
    font-size: 13px;
  }
  table th, table td {
    padding: 8px 6px;
    word-break: break-word;
    white-space: normal;
  }

  /* "card-table" sınıfı varsa: tablo satırlarını kart gibi göster */
  .card-table {
    display: block;
  }
  .card-table thead {
    display: none;
  }
  .card-table tbody {
    display: block;
  }
  .card-table tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 10px 12px;
    background: #fff;
  }
  .card-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
    text-align: right;
  }
  .card-table td:last-child {
    border-bottom: none;
  }
  .card-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6b7280;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: left;
    flex-shrink: 0;
    margin-right: 12px;
  }

  /* Form input'lar tam genişlik */
  input, select, textarea, button {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Kartlar padding azalt */
  .card {
    padding: 16px;
    margin-bottom: 12px;
  }

  /* Page title küçült */
  .page-title { font-size: 22px; }
  .page-subtitle { font-size: 13px; }

  /* Topbar kaymıyor */
  .topbar { overflow-x: auto; }

  /* Modal mobile dostu */
  .modal-content {
    max-width: 100% !important;
    margin: 8px;
    max-height: 90vh;
    overflow-y: auto;
  }

  /* Tab'ler wrap */
  .tabs {
    flex-wrap: wrap;
    gap: 4px;
  }
  .tab-btn {
    font-size: 12px !important;
    padding: 6px 10px !important;
  }
}

/* Çok dar ekranlar (telefon dikey) */
@media (max-width: 480px) {
  .main { padding: 12px; }
  .card { padding: 12px; }
  .btn { font-size: 13px; padding: 8px 12px; }
  h1 { font-size: 20px; }
  h2 { font-size: 18px; }
  h3 { font-size: 16px; }
}

/* ============================================================
   v0.2.0 EKLEMELERI — Modal, Filter Bar, Tabs, Card Highlight
   ============================================================ */

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-content h3 {
  margin-bottom: 16px;
  font-size: 18px;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.filter-pill {
  padding: 6px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.filter-pill:hover {
  background: var(--border);
}
.filter-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
}
.tab-btn {
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.tab-btn:hover {
  color: var(--text);
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* Card highlight (unread) */
.card-highlight {
  border-left: 3px solid var(--accent);
  background: linear-gradient(to right, rgba(255,107,53,0.04), transparent 30%);
}

/* Flash close */
.flash {
  cursor: pointer;
  position: relative;
  padding-right: 40px;
}
.flash-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: 700;
  opacity: 0.6;
}
.flash:hover .flash-close {
  opacity: 1;
}

/* Badge variations */
.badge-red {
  background: #fee2e2;
  color: #991b1b;
}
.badge-yellow {
  background: #fef3c7;
  color: #92400e;
}
.badge-green {
  background: #d1fae5;
  color: #065f46;
}
.badge-gray {
  background: var(--surface-2);
  color: var(--text-muted);
}

/* Status badges */
.status-draft { background: var(--surface-2); color: var(--text-muted); }
.status-sent { background: #dbeafe; color: #1e40af; }
.status-offered { background: #fef3c7; color: #92400e; }
.status-pending { background: #fed7aa; color: #9a3412; }
.status-submitted { background: #d1fae5; color: #065f46; }
.status-accepted { background: #a7f3d0; color: #064e3b; }
.status-ordered { background: #bfdbfe; color: #1e3a8a; }
.status-reviewed { background: #e0e7ff; color: #3730a3; }
.status-preparing { background: #fef3c7; color: #92400e; }
.status-shipped { background: #ddd6fe; color: #5b21b6; }
.status-delivered { background: #d1fae5; color: #065f46; }
.status-completed { background: #a7f3d0; color: #064e3b; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-rejected { background: #fecaca; color: #991b1b; }
.status-requested { background: #fef3c7; color: #92400e; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-active { background: #d1fae5; color: #065f46; }
.status-suspended { background: #fee2e2; color: #991b1b; }
.status-deleted { background: var(--surface-2); color: var(--text-muted); }

/* Profile/Logout buttons in topbar */
.profile-link, .logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 4px;
  transition: all 0.15s;
}
.profile-link:hover, .logout:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Text accent helper */
.text-accent { color: var(--accent); }
.btn-danger {
  background: var(--red);
  color: #fff;
  border: 1px solid var(--red);
}
.btn-danger:hover {
  background: #dc2626;
}

/* Required indicator */
.required { color: var(--red); }

/* Code tag */
code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 12px;
  color: var(--accent-dark);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .modal-content {
    padding: 16px;
  }
  .tabs {
    gap: 0;
  }
  .tab-btn {
    padding: 8px 10px;
    font-size: 13px;
  }
  .filter-bar {
    padding: 8px;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Checkbox grid fix */
label[style*="display:flex"] input[type="checkbox"] {
  flex-shrink: 0;
}

/* Badge fallback */
.badge {
  display: inline-block;
  padding: 3px 10px;
  background: var(--surface-2);
  color: var(--text);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
