/* ============================================================
   SKEFA SOLUTIONS — CLIENT MANAGEMENT SYSTEM
   Design: Dark industrial-clean, teal+amber accents
   ============================================================ */

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

:root {
  --bg:       #0d1117;
  --surface:  #161b22;
  --card:     #1c2333;
  --card2:    #21293a;
  --border:   #30363d;
  --border2:  #3d444d;

  --teal:     #2dd4bf;
  --teal-dim: rgba(45,212,191,.12);
  --teal-glow:rgba(45,212,191,.25);
  --amber:    #fbbf24;
  --amber-dim:rgba(251,191,36,.12);
  --blue:     #60a5fa;
  --blue-dim: rgba(96,165,250,.1);
  --green:    #4ade80;
  --green-dim:rgba(74,222,128,.1);
  --red:      #f87171;
  --red-dim:  rgba(248,113,113,.12);
  --purple:   #c084fc;
  --purple-dim:rgba(192,132,252,.1);

  --text:     #e6edf3;
  --text2:    #8b949e;
  --muted:    #484f58;

  --radius:   10px;
  --radius-lg:14px;
  --shadow:   0 4px 24px rgba(0,0,0,.4);
}

a {
  text-decoration: none;
  color: inherit;
}

html, body { height: 100%; }
body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  height: 100vh;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ============================================================ SCROLLBAR */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

/* ============================================================ SIDEBAR */
#sidebar {
  width: 230px;
  min-width: 230px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  transition: width .25s ease, min-width .25s ease;
  z-index: 100;
}
#sidebar.collapsed { width: 60px; min-width: 60px; }
#sidebar.collapsed .logo-name,
#sidebar.collapsed .logo-sub,
#sidebar.collapsed .nav-item span,
#sidebar.collapsed .nav-section,
#sidebar.collapsed .badge,
#sidebar.collapsed .user-info,
#sidebar.collapsed .user-pill > i { display: none; }
#sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
#sidebar.collapsed .logo { justify-content: center; }
#sidebar.collapsed .logo-mark { margin-right: 0; }
#sidebar.collapsed .user-pill { justify-content: center; }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 18px;
  border-bottom: 1px solid var(--border);
}
.logo-mark {
  width: 38px; height: 38px;
  background: var(--teal-dim);
  border: 1px solid var(--teal-glow);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--teal);
  font-size: 16px;
  flex-shrink: 0;
}
.logo-name {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  color: #fff;
  white-space: nowrap;
}
.logo-sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-top: 1px;
}

.nav { padding: 10px 0; flex: 1; }
.nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--muted);
  padding: 12px 18px 5px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  margin: 2px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text2);
  font-size: 13.5px;
  font-weight: 400;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-item i { width: 18px; text-align: center; flex-shrink: 0; font-size: 13px; }
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active {
  background: var(--teal-dim);
  color: var(--teal);
  font-weight: 500;
  border: 1px solid rgba(45,212,191,.18);
}
.nav-item.active i { color: var(--teal); }
.badge {
  margin-left: auto;
  background: var(--teal);
  color: #000;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}
.badge.warn { background: var(--amber); }
.badge.red  { background: var(--red); }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s;
}
.user-pill:hover { background: var(--card); }
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--teal-dim);
  border: 1px solid var(--teal-glow);
  color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}
.avatar.amber { background: var(--amber-dim); border-color: rgba(251,191,36,.3); color: var(--amber); }
.avatar.blue  { background: var(--blue-dim);  border-color: rgba(96,165,250,.3); color: var(--blue); }
.avatar.purple{ background: var(--purple-dim);border-color:rgba(192,132,252,.3); color: var(--purple); }
.uname { font-size: 13px; font-weight: 500; }
.urole { font-size: 11px; color: var(--text2); }

/* ============================================================ MAIN */
#main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topbar {
  height: 58px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;
  flex-shrink: 0;
}
.sidebar-toggle {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 34px; height: 34px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s;
}
.sidebar-toggle:hover { color: var(--text); }
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  flex: 1;
  color: #fff;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  width: 220px;
  transition: border-color .15s;
}
.search-box:focus-within { border-color: var(--teal); }
.search-box i { color: var(--muted); font-size: 13px; }
.search-box input {
  background: none; border: none;
  color: var(--text); font-size: 13px;
  width: 100%; outline: none;
  font-family: 'Outfit', sans-serif;
}
.search-box input::placeholder { color: var(--muted); }
.icon-btn {
  width: 34px; height: 34px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text2); font-size: 13px;
  transition: color .15s, border-color .15s;
  position: relative;
}
.icon-btn:hover { color: var(--text); border-color: var(--border2); }
.notif-dot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--teal);
  border-radius: 50%;
  border: 1.5px solid var(--surface);
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================ BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  cursor: pointer; border: none;
  font-family: 'Outfit', sans-serif;
  transition: all .15s;
  white-space: nowrap;
}
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-primary { background: var(--teal); color: #000; }
.btn-primary:hover { background: #14b8a6; }
.btn-amber  { background: var(--amber); color: #000; }
.btn-amber:hover { background: #f59e0b; }
.btn-ghost  { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--border2); }
.btn-danger { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248,113,113,.25); }
.btn-danger:hover { background: rgba(248,113,113,.2); }
.btn-blue   { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(96,165,250,.2); }

/* ============================================================ STAT CARDS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; flex-direction: column; gap: 6px;
  position: relative; overflow: hidden;
  transition: border-color .2s;
}
.stat-card:hover { border-color: var(--border2); }
.stat-card .accent-line {
  position: absolute; top: 0; left: 0;
  height: 3px; width: 100%;
}
.stat-card.teal  .accent-line { background: var(--teal); }
.stat-card.amber .accent-line { background: var(--amber); }
.stat-card.blue  .accent-line { background: var(--blue); }
.stat-card.green .accent-line { background: var(--green); }
.stat-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text2); margin-top: 6px; }
.stat-val { font-size: 28px; font-weight: 700; letter-spacing: -.5px; }
.stat-card.teal  .stat-val { color: var(--teal); }
.stat-card.amber .stat-val { color: var(--amber); }
.stat-card.blue  .stat-val { color: var(--blue); }
.stat-card.green .stat-val { color: var(--green); }
.stat-meta { font-size: 12px; color: var(--text2); }
.stat-meta .up   { color: var(--green); }
.stat-meta .down { color: var(--red); }
.stat-icon {
  position: absolute; right: 18px; top: 50%;
  transform: translateY(-50%);
  font-size: 28px; opacity: .08;
}

/* ============================================================ PAGE HEADER */
.page-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.page-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 20px; color: #fff;
}
.page-header p { font-size: 13px; color: var(--text2); margin-top: 2px; }

/* ============================================================ CARDS */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.card-sub   { font-size: 12px; color: var(--text2); margin-top: 2px; }

/* ============================================================ TABLE */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text2);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}
tbody td {
  padding: 12px 14px;
  font-size: 13.5px;
  border-bottom: 1px solid rgba(48,54,61,.5);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(255,255,255,.02); }
.td-name { display: flex; align-items: center; gap: 10px; }

/* ============================================================ STATUS BADGES */
.status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}
.status::before {
  content: ''; width: 5px; height: 5px;
  border-radius: 50%; flex-shrink: 0;
}
.status-paid    { background: var(--green-dim); color: var(--green); }
.status-paid::before { background: var(--green); }
.status-pending { background: var(--amber-dim); color: var(--amber); }
.status-pending::before { background: var(--amber); }
.status-overdue { background: var(--red-dim); color: var(--red); }
.status-overdue::before { background: var(--red); }
.status-active  { background: var(--teal-dim); color: var(--teal); }
.status-active::before { background: var(--teal); }
.status-inactive{ background: rgba(72,79,88,.4); color: var(--text2); }
.status-inactive::before { background: var(--muted); }
.status-draft   { background: var(--blue-dim); color: var(--blue); }
.status-draft::before { background: var(--blue); }

/* ============================================================ FORMS */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { font-size: 12px; font-weight: 500; color: var(--text2); text-transform: uppercase; letter-spacing: .8px; }
.form-input, .form-select, .form-textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: 13.5px;
  padding: 9px 12px;
  outline: none;
  transition: border-color .15s;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(45,212,191,.08);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--muted); }
.form-select option { background: var(--card); }
.form-textarea { resize: vertical; min-height: 90px; }
.form-section {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--muted); margin: 20px 0 10px;
  border-top: 1px solid var(--border); padding-top: 14px;
}
.form-row { display: flex; gap: 12px; align-items: center; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }

/* ============================================================ GRID LAYOUTS */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-3-eq { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* ============================================================ CLIENT CARDS */
.clients-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.client-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.client-card:hover { border-color: var(--teal); transform: translateY(-2px); }
.cc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cc-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600; flex-shrink: 0;
}
.cc-name { font-size: 14px; font-weight: 600; }
.cc-type { font-size: 12px; color: var(--text2); }
.cc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cc-stat { background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.cc-stat-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.cc-stat-val { font-size: 14px; font-weight: 600; margin-top: 2px; color: var(--teal); }
.cc-footer { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; }

/* ============================================================ INVOICE PREVIEW */
.invoice-preview {
  background: #fff;
  color: #1a1a2e;
  border-radius: var(--radius-lg);
  padding: 36px;
  font-family: 'Outfit', sans-serif;
}
.inv-header { display: flex; justify-content: space-between; margin-bottom: 32px; }
.inv-brand { font-family: 'Playfair Display', serif; font-size: 22px; color: #0d1117; }
.inv-brand span { color: #0d9488; }
.inv-meta { text-align: right; font-size: 13px; color: #666; }
.inv-meta strong { color: #1a1a2e; }
.inv-title { font-size: 28px; font-weight: 700; color: #0d9488; margin-bottom: 24px; letter-spacing: -1px; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 28px; }
.inv-party-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: #999; margin-bottom: 5px; }
.inv-party-name { font-size: 15px; font-weight: 600; color: #1a1a2e; }
.inv-party-detail { font-size: 13px; color: #666; margin-top: 3px; }
.inv-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.inv-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #999; padding: 8px 10px; border-bottom: 1px solid #e5e7eb; }
.inv-table td { padding: 12px 10px; font-size: 13px; color: #444; border-bottom: 1px solid #f3f4f6; }
.inv-totals { margin-left: auto; width: 240px; }
.inv-total-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; color: #666; }
.inv-total-row.grand { font-size: 16px; font-weight: 700; color: #1a1a2e; border-top: 2px solid #0d9488; margin-top: 6px; padding-top: 10px; }
.inv-footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid #e5e7eb; font-size: 12px; color: #999; text-align: center; }

/* ============================================================ CHARTS (CSS bars) */
.bar-chart { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-lbl { width: 80px; font-size: 12px; color: var(--text2); text-align: right; flex-shrink: 0; }
.bar-track { flex: 1; height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; transition: width .6s cubic-bezier(.4,0,.2,1); }
.bar-fill.teal  { background: var(--teal); }
.bar-fill.amber { background: var(--amber); }
.bar-fill.blue  { background: var(--blue); }
.bar-val { width: 50px; font-size: 12px; font-weight: 500; color: var(--text); }

.sparkline { display: flex; align-items: flex-end; gap: 4px; height: 48px; }
.spark-bar { flex: 1; border-radius: 4px 4px 0 0; background: var(--teal-dim); transition: background .15s; }
.spark-bar:hover { background: var(--teal); }

/* ============================================================ TIMELINE / SCHEDULE */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 14px; }
.tl-line { display: flex; flex-direction: column; align-items: center; }
.tl-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--teal); flex-shrink: 0;
  margin-top: 4px;
}
.tl-dot.amber { background: var(--amber); }
.tl-dot.blue  { background: var(--blue); }
.tl-connector { width: 1px; flex: 1; background: var(--border); margin: 4px 0; min-height: 20px; }
.tl-item:last-child .tl-connector { display: none; }
.tl-content { padding-bottom: 16px; flex: 1; }
.tl-time { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.tl-title { font-size: 13.5px; font-weight: 500; }
.tl-detail { font-size: 12px; color: var(--text2); margin-top: 2px; }

/* ============================================================ FILTER BAR */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.filter-bar .search-box { width: 240px; }
.filter-tab {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text2);
  transition: all .15s;
}
.filter-tab:hover, .filter-tab.active {
  background: var(--teal-dim);
  color: var(--teal);
  border-color: rgba(45,212,191,.25);
}

/* ============================================================ EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text2);
}
.empty-state i { font-size: 40px; color: var(--muted); margin-bottom: 14px; }
.empty-state h3 { font-size: 16px; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ============================================================ MODAL */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.65);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeIn .15s ease;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 540px; max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: slideUp .2s ease;
}
.modal.wide { width: 720px; }
@keyframes slideUp { from { opacity:0; transform: translateY(16px); } to { opacity:1; transform: translateY(0); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 15px; font-weight: 600; }
.modal-close {
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text2); width: 28px; height: 28px;
  border-radius: 7px; cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s;
}
.modal-close:hover { color: var(--red); }
.modal-body { padding: 20px 22px; }
.modal-footer { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ============================================================ TOAST */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: slideToast .25s ease;
  display: flex; align-items: center; gap: 10px;
}
.toast.hidden { display: none; }
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--teal); }
@keyframes slideToast { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================ TABS */
.tabs { display: flex; gap: 2px; background: var(--bg); padding: 4px; border-radius: var(--radius); margin-bottom: 20px; width: fit-content; }
.tab {
  padding: 7px 16px; border-radius: 7px; font-size: 13px;
  cursor: pointer; color: var(--text2); transition: all .15s;
}
.tab.active { background: var(--card); color: var(--text); font-weight: 500; }

/* ============================================================ TAGS */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 500;
}
.tag-teal   { background: var(--teal-dim);   color: var(--teal); }
.tag-amber  { background: var(--amber-dim);  color: var(--amber); }
.tag-blue   { background: var(--blue-dim);   color: var(--blue); }
.tag-purple { background: var(--purple-dim); color: var(--purple); }
.tag-red    { background: var(--red-dim);    color: var(--red); }

/* ============================================================ QUICK STATS ROW */
.quick-stats { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.qs-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 16px;
  display: flex; align-items: center; gap: 10px;
}
.qs-icon { font-size: 16px; }
.qs-val { font-size: 16px; font-weight: 600; }
.qs-lbl { font-size: 11px; color: var(--text2); }

/* ============================================================ MOBILE BACKDROP */
#sidebarBackdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 99;
  backdrop-filter: blur(2px);
  animation: fadeIn .2s ease;
}
#sidebarBackdrop.visible { display: block; }

/* ============================================================ RESPONSIVE */
@media (max-width: 900px) {
  #sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    z-index: 100;
    min-width: 230px;
    width: 230px;
  }
  #sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,.6);
  }
  /* Collapsed state has no meaning on mobile — reset it */
  #sidebar.collapsed {
    width: 230px; min-width: 230px;
    transform: translateX(-100%);
  }
  #sidebar.collapsed.mobile-open {
    transform: translateX(0);
  }
  #sidebar.collapsed .logo-name,
  #sidebar.collapsed .logo-sub,
  #sidebar.collapsed .nav-item span,
  #sidebar.collapsed .nav-section,
  #sidebar.collapsed .badge,
  #sidebar.collapsed .user-info,
  #sidebar.collapsed .user-pill > i { display: revert; }
  #sidebar.collapsed .nav-item { justify-content: flex-start; padding: 9px 14px; }
  #sidebar.collapsed .logo { justify-content: flex-start; }
  #sidebar.collapsed .user-pill { justify-content: flex-start; }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .clients-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .clients-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-3-eq { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; gap: 10px; }
  .search-box { display: none; }
  .page-title { font-size: 15px; }
}
