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

:root {
  --bg: #f0f2f5;
  --surface: #ffffff;
  --surface-hover: #f8f9fb;
  --border: #e1e5eb;
  --border-light: #eef0f4;

  --text: #1a1d23;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-text: #1e40af;

  --success: #059669;
  --success-light: #ecfdf5;
  --success-text: #065f46;

  --danger: #dc2626;
  --danger-light: #fef2f2;
  --danger-text: #991b1b;

  --warning: #d97706;
  --warning-light: #fffbeb;
  --warning-text: #92400e;

  --sidebar-w: 250px;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-text-hover: #f1f5f9;
  --sidebar-active-bg: rgba(37, 99, 235, 0.12);
  --sidebar-active-text: #60a5fa;
  --sidebar-border: rgba(255,255,255,0.06);

  --topbar-h: 56px;

  --radius: 10px;
  --radius-lg: 14px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.04);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; color: var(--text); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

/* ═══════════════════════════════════════
   APP LAYOUT: sidebar + main
   ═══════════════════════════════════════ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ═══════════════════════════════════════
   SIDEBAR – always visible on desktop
   ═══════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: #fff;
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.sidebar-brand strong {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: block;
}
.sidebar-brand .brand-bike { color: #ffffff; }
.sidebar-brand .brand-ino  { color: #60a5fa; }
.sidebar-brand .brand-meta {
  display: block;
  font-size: 11.5px;
  color: var(--sidebar-text);
  font-weight: 400;
  margin-top: 6px;
  line-height: 1.4;
}

.sidebar-nav {
  flex: 1 1 auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-section {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.25);
  padding: 18px 12px 6px;
  line-height: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.3;
}
.sidebar-nav a:hover {
  background: rgba(255,255,255,0.06);
  color: var(--sidebar-text-hover);
}
.sidebar-nav a.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
}
.sidebar-nav a svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  opacity: 0.6;
}
.sidebar-nav a:hover svg,
.sidebar-nav a.active svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 10px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #f87171;
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
}
.sidebar-footer a:hover {
  background: rgba(248,113,113,0.1);
  color: #fca5a5;
}
.sidebar-footer a svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

/* ═══════════════════════════════════════
   MOBILE TOPBAR – hidden on desktop
   ═══════════════════════════════════════ */
.topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: var(--sidebar-bg);
  z-index: 51;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
}
.topbar-brand strong {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.topbar .brand-bike { color: #fff; }
.topbar .brand-ino  { color: #60a5fa; }

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #ffffff;
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  cursor: pointer;
  transition: background var(--transition);
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.15); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 49;
}
.sidebar-overlay.active { display: block; }

/* ═══════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════ */
.main-content {
  flex: 1 1 auto;
  margin-left: var(--sidebar-w);
  min-width: 0;
}

.container {
  max-width: 1100px;
  padding: 28px 28px 40px;
}

/* ═══════════════════════════════════════
   CARDS
   ═══════════════════════════════════════ */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }

.compact-card { padding: 14px; }
.compact-card h2 { margin-top: 0; font-size: 17px; }
.compact-card .form-group { margin-bottom: 8px; }
.compact-card input,
.compact-card select,
.compact-card textarea { font-size: 13px; padding: 7px 10px; }

/* ═══════════════════════════════════════
   GRID
   ═══════════════════════════════════════ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.card .muted + h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-top: 4px;
  letter-spacing: -0.5px;
}

/* ═══════════════════════════════════════
   CHARTS
   ═══════════════════════════════════════ */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.chart-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  min-width: 0;
}
.chart-card h3 {
  margin-bottom: 16px;
}
.chart-wrap {
  position: relative;
  width: 100%;
  height: 260px;
}

/* ═══════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.btn:hover { background: var(--primary-hover); box-shadow: var(--shadow); transform: translateY(-1px); color: #fff; }
.btn:active { transform: translateY(0); }

.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-hover); border-color: #cbd5e1; color: var(--text); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #047857; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: var(--radius-sm); }

/* ═══════════════════════════════════════
   TABLES
   ═══════════════════════════════════════ */
table { width: 100%; border-collapse: separate; border-spacing: 0; }
thead th {
  text-align: left; padding: 10px 14px; font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary);
  background: var(--surface-hover); border-bottom: 2px solid var(--border);
}
thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
td {
  padding: 12px 14px; font-size: 13.5px;
  border-bottom: 1px solid var(--border-light); color: var(--text); vertical-align: middle;
}
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: none; }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.product-thumb { width: 40px; height: 40px; border-radius: var(--radius-sm); object-fit: cover; background: var(--bg); border: 1px solid var(--border-light); }

/* ═══════════════════════════════════════
   FORMS
   ═══════════════════════════════════════ */
.form-group { margin-bottom: 14px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; padding: 9px 12px; border-radius: var(--radius);
  border: 1.5px solid var(--border); font-size: 14px; font-family: inherit;
  background: var(--surface); color: var(--text); transition: all var(--transition); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--primary); }
textarea { resize: vertical; min-height: 80px; }

/* ═══════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════ */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 14px; font-size: 13.5px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.alert-success { background: var(--success-light); color: var(--success-text); border: 1px solid #a7f3d0; }
.alert-error   { background: var(--danger-light);  color: var(--danger-text);  border: 1px solid #fecaca; }

/* ═══════════════════════════════════════
   BADGES
   ═══════════════════════════════════════ */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 100px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-success { background: var(--success-light); color: var(--success-text); }
.badge-danger  { background: var(--danger-light);  color: var(--danger-text); }
.badge-warning { background: var(--warning-light); color: var(--warning-text); }
.badge-neutral { background: #f1f5f9; color: #64748b; }
.badge-primary { background: var(--primary-light); color: var(--primary-text); }

/* ═══════════════════════════════════════
   MISC
   ═══════════════════════════════════════ */
.muted { color: var(--text-secondary); font-size: 12.5px; font-weight: 500; }
.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 4px; }
td a { font-weight: 500; font-size: 13px; }

/* ═══════════════════════════════════════
   CAISSE BANNER
   ═══════════════════════════════════════ */
.caisse-banner {
  background: var(--success-light); border: 1.5px solid #6ee7b7; border-radius: var(--radius-lg);
  padding: 14px 20px; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px; margin-bottom: 16px;
}
.caisse-banner .caisse-label  { font-size: 12px; color: var(--success); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.caisse-banner .caisse-amount { font-size: 24px; font-weight: 800; color: var(--success-text); letter-spacing: -0.5px; }
.caisse-banner .caisse-meta   { font-size: 12px; color: var(--success); }
.caisse-actions {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.caisse-report-form {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.caisse-counted-input {
  width: 160px; padding: 10px 12px; font-size: 13px;
  border: 1px solid #6ee7b7; border-radius: var(--radius);
  background: #fff;
}
.caisse-pdf-btn {
  font-size: 14px !important; padding: 10px 18px !important;
  font-weight: 700 !important; white-space: nowrap;
}

/* ═══════════════════════════════════════
   BOTTOM NAV (mobile quick actions)
   ═══════════════════════════════════════ */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
  padding: 8px 16px; z-index: 40; display: none;
}
.bottom-nav-inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 600px; margin: 0 auto; }
.bottom-nav a {
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 10px 8px; border-radius: var(--radius); background: var(--primary); color: #fff;
  font-weight: 600; font-size: 13px; transition: all var(--transition); box-shadow: var(--shadow-sm);
}
.bottom-nav a:hover { background: var(--primary-hover); color: #fff; }

/* ═══════════════════════════════════════
   MODAL
   ═══════════════════════════════════════ */
.modal-overlay { position: fixed; inset: 0; background: rgba(17,24,39,0.6); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 60; }
.modal-overlay.active { display: flex; }
.modal-content { width: min(900px, 94vw); height: min(85vh, 720px); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.modal-close { position: absolute; top: 10px; right: 10px; border: none; background: var(--sidebar-bg); color: #fff; border-radius: var(--radius); width: 34px; height: 34px; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; transition: all var(--transition); z-index: 5; }
.modal-close:hover { background: var(--danger); }
.modal-iframe { width: 100%; height: 100%; border: none; }

/* ═══════════════════════════════════════
   PERMISSIONS
   ═══════════════════════════════════════ */
.permissions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.permission-item { display: flex; align-items: center; gap: 10px; background: var(--surface-hover); border: 1.5px solid var(--border-light); padding: 10px 14px; border-radius: var(--radius); cursor: pointer; transition: all var(--transition); }
.permission-item:hover { border-color: var(--primary); background: var(--primary-light); }
.permission-item input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.permission-item span { font-size: 13.5px; color: var(--text); font-weight: 500; }

/* ═══════════════════════════════════════
   CLIENT PORTAL
   ═══════════════════════════════════════ */
.client-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
}

.client-sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin: 0 10px 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--sidebar-border);
  border-radius: 10px;
}
.client-avatar-img,
.client-avatar-fallback {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}
.client-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 800;
  font-size: 18px;
}
.client-sidebar-profile-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.client-sidebar-profile-text strong {
  font-size: 13px;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-sidebar-profile-text span {
  font-size: 11.5px;
  color: var(--sidebar-text);
}

.due-banner {
  background: var(--danger-light);
  border: 1.5px solid #fecaca;
  border-radius: var(--radius-lg);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}
.due-banner.is-clear {
  background: var(--success-light);
  border-color: #6ee7b7;
}
.due-banner-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.due-banner.due-banner--danger .due-banner-icon {
  background: var(--danger);
  color: #fff;
}
.due-banner.due-banner--success .due-banner-icon {
  background: var(--success);
  color: #fff;
}
.due-banner-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 2px;
}
.due-banner--danger .due-banner-label { color: var(--danger); }
.due-banner--success .due-banner-label { color: var(--success); }
.due-banner-amount {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.due-banner--danger .due-banner-amount { color: var(--danger-text); }
.due-banner--success .due-banner-amount { color: var(--success-text); font-size: 15px; font-weight: 700; }
.due-banner-meta { font-size: 12.5px; margin-top: 4px; }
.due-banner--danger .due-banner-meta { color: var(--danger); }
.due-banner--success .due-banner-meta { color: var(--success); }

.kpi-card {
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: 4px 0 0 4px;
}
.kpi-card--primary::before { background: var(--primary); }
.kpi-card--warning::before { background: var(--warning); }
.kpi-card--danger::before { background: var(--danger); }
.kpi-card--success::before { background: var(--success); }
.kpi-card .kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.kpi-card--primary .kpi-icon { background: var(--primary-light); color: var(--primary); }
.kpi-card--warning .kpi-icon { background: var(--warning-light); color: var(--warning); }
.kpi-card--danger .kpi-icon { background: var(--danger-light); color: var(--danger); }
.kpi-card--success .kpi-icon { background: var(--success-light); color: var(--success); }

.tab-bar {
  display: inline-flex;
  background: var(--surface-hover);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 4px;
  gap: 4px;
}
.tab-bar a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
}
.tab-bar a:hover { color: var(--text); background: rgba(255,255,255,0.6); }
.tab-bar a.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.card-header-row h3 { margin: 0; }

.repair-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 12px;
  background: var(--surface);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.repair-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}
.repair-card:last-child { margin-bottom: 0; }
.repair-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.repair-card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.repair-card-issue { font-size: 13px; color: var(--text-secondary); margin-top: 4px; line-height: 1.45; }
.repair-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.repair-card-amount { text-align: right; }
.repair-card-total { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; }
.repair-card-remaining { font-size: 12.5px; font-weight: 700; color: var(--danger); margin-top: 4px; }
.repair-card-paid { font-size: 12px; font-weight: 600; color: var(--success); margin-top: 4px; }
.repair-cost-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.repair-cost-row strong { color: var(--text); }
.repair-parts-box {
  background: var(--surface-hover);
  border-radius: var(--radius);
  padding: 12px 14px;
  border: 1px solid var(--border-light);
}
.repair-parts-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.repair-parts-table { width: 100%; }
.repair-parts-table td { padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--border-light); }
.repair-parts-table tr:last-child td { border-bottom: none; }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state svg { opacity: 0.35; margin-bottom: 12px; }
.empty-state p { font-size: 14px; font-weight: 500; }

.amount-danger { color: var(--danger); font-weight: 700; }
.amount-success { color: var(--success); font-weight: 600; }

/* ═══════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════ */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-3 { margin-top: 12px; }
.text-center { text-align: center; }

/* ═══════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); }
.sidebar::-webkit-scrollbar-track { background: transparent; }

/* ═══════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card, .chart-card { animation: fadeIn 0.3s ease-out; }

/* ═══════════════════════════════════════
   RESPONSIVE – mobile / tablet
   On screens <= 900px: hide sidebar,
   show topbar, sidebar slides in on toggle
   ═══════════════════════════════════════ */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  }

  .topbar {
    display: flex;
  }

  .main-content {
    margin-left: 0;
  }

  .container {
    padding-top: calc(var(--topbar-h) + 20px);
  }
}

@media (max-width: 767px) {
  .bottom-nav { display: block; }
  .container { padding: calc(var(--topbar-h) + 16px) 14px 100px; }

  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .chart-grid { grid-template-columns: 1fr; }
  .chart-wrap { height: 220px; }

  .card { padding: 14px; border-radius: var(--radius); }
  .card .muted + h3 { font-size: 1.2rem; }
  h2 { font-size: 1.15rem; }

  table { min-width: 540px; }
  thead th, td { padding: 9px 10px; font-size: 12.5px; }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 8px; }
}

/* ═══════════════════════════════════════
   PRINT
   ═══════════════════════════════════════ */
@media print {
  .sidebar, .topbar, .bottom-nav, .modal-overlay, .sidebar-overlay { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .container { padding: 0; max-width: none; }
  .card, .chart-card { box-shadow: none; border: 1px solid #ddd; page-break-inside: avoid; animation: none; }
}
