/* ═══════════════════════════════════════════════════════════════
   BitBookOS Design System — Global CSS
   Version: 1.0.0 | Task 1 Design Foundation
   ═══════════════════════════════════════════════════════════════ */

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

/* ─── CSS RESET ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── DESIGN TOKENS ─── */
:root {
  /* Colors */
  --bg-main:           #0B0F14;
  --surface:           #121821;
  --surface-elevated:  #161F2B;
  --border:            #1E2A38;
  --divider:           #1A2430;
  --text-primary:      #E6EDF3;
  --text-secondary:    #9FB0C3;
  --text-muted:        #6B7C8F;
  --accent:            #4F8CFF;
  --accent-hover:      #3B73E0;
  --success:           #2ECC71;
  --warning:           #F5A623;
  --danger:            #FF5A5F;
  --info:              #5DADE2;

  /* Typography */
  --font-family:       'Inter', system-ui, -apple-system, sans-serif;
  --font-size-page-title:   28px;
  --font-size-section-header: 20px;
  --font-size-card-title:   16px;
  --font-size-body:         14px;
  --font-size-small:        12px;
  --font-weight-title:      600;
  --font-weight-body:       400;

  /* Spacing (8px grid) */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  16px;
  --space-4:  24px;
  --space-5:  32px;
  --space-6:  48px;

  /* Layout */
  --sidebar-width:     240px;
  --topbar-height:     64px;
  --content-max-width: 1280px;

  /* Radii */
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;

  /* Shadows */
  --shadow-card:  0 1px 3px rgba(0,0,0,0.4), 0 0 0 1px var(--border);
  --shadow-modal: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px var(--border);

  /* Transitions */
  --transition-fast: 120ms ease;
  --transition-ui:   150ms ease;
}

/* ─── BASE ─── */
html {
  height: 100%;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  height: 100%;
  background: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-body);
  line-height: 1.6;
}

/* ─── TYPOGRAPHY UTILITIES ─── */
.text-page-title {
  font-size: var(--font-size-page-title);
  font-weight: var(--font-weight-title);
  line-height: 1.25;
}

.text-section-header {
  font-size: var(--font-size-section-header);
  font-weight: var(--font-weight-title);
  line-height: 1.3;
}

.text-card-title {
  font-size: var(--font-size-card-title);
  font-weight: var(--font-weight-title);
  line-height: 1.4;
}

.text-body   { font-size: var(--font-size-body);  font-weight: 400; }
.text-small  { font-size: var(--font-size-small); font-weight: 400; }
.text-label  { font-size: var(--font-size-small); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-accent    { color: var(--accent); }
.text-success   { color: var(--success); }
.text-warning   { color: var(--warning); }
.text-danger    { color: var(--danger); }

/* ─── FOCUS ─── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar        { width: 5px; height: 5px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ════════════════════════════════════════════
   APP SHELL LAYOUT
   ════════════════════════════════════════════ */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-main);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 30;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.sidebar-logo-mark {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-2) 0;
  list-style: none;
}

.sidebar-nav-item {
  position: relative;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 9px var(--space-3);
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.sidebar-nav-link:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}

.sidebar-nav-link.active {
  border-left-color: var(--accent);
  background: rgba(79, 140, 255, 0.08);
  color: var(--text-primary);
  font-weight: 500;
}

.sidebar-nav-link.active .nav-icon {
  color: var(--accent);
}

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.sidebar-nav-link:hover .nav-icon {
  color: var(--text-secondary);
}

.sidebar-section-label {
  padding: var(--space-3) var(--space-3) var(--space-1);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ─── MAIN AREA (topbar + content) ─── */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── TOP BAR ─── */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-main);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-5);
  gap: var(--space-3);
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.hamburger-btn {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.hamburger-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb-sep { margin: 0 2px; }
.breadcrumb-current { color: var(--text-primary); font-weight: 500; }

/* ─── CONTENT AREA ─── */
.content-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.content-inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-5);
}

/* ════════════════════════════════════════════
   CARD COMPONENT
   ════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.card-elevated {
  background: var(--surface-elevated);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

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

/* KPI Card */
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.kpi-label {
  font-size: var(--font-size-small);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.kpi-value {
  font-size: 26px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.kpi-delta {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.kpi-delta.positive { color: var(--success); }
.kpi-delta.negative { color: var(--danger); }

/* ════════════════════════════════════════════
   BUTTON COMPONENTS
   ════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 40px;
  padding: 0 var(--space-3);
  font-family: var(--font-family);
  font-size: var(--font-size-body);
  font-weight: 500;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
  line-height: 1;
}

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

/* Primary */
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

/* Secondary */
.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* Danger */
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #e04447; }

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

/* Sizes */
.btn-sm { height: 32px; padding: 0 var(--space-2); font-size: var(--font-size-small); }
.btn-lg { height: 48px; padding: 0 var(--space-4); font-size: 15px; }

/* ════════════════════════════════════════════
   TABLE SHELL
   ════════════════════════════════════════════ */
.table-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-body);
}

.data-table thead {
  background: var(--surface-elevated);
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table th {
  padding: 0 var(--space-3);
  height: 44px;
  text-align: left;
  font-size: var(--font-size-small);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 0 var(--space-3);
  height: 48px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
}

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

.data-table tbody tr:hover td {
  background: var(--surface-elevated);
}

/* Column size hints */
.col-date      { width: 140px; }
.col-type      { width: 120px; }
.col-amount    { width: 140px; text-align: right; }
.col-chain     { width: 100px; }
.col-protocol  { width: 120px; }
.col-confidence { width: 120px; }
.col-status    { width: 110px; }
.col-actions   { width: 80px; text-align: right; }

.col-amount { text-align: right; }
.data-table th.col-amount { text-align: right; }

/* Monospace for addresses/hashes */
.mono {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
}

/* ════════════════════════════════════════════
   BADGE / PILL
   ════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

.badge-success {
  background: rgba(46, 204, 113, 0.12);
  color: var(--success);
  border: 1px solid rgba(46, 204, 113, 0.2);
}

.badge-warning {
  background: rgba(245, 166, 35, 0.12);
  color: var(--warning);
  border: 1px solid rgba(245, 166, 35, 0.2);
}

.badge-danger {
  background: rgba(255, 90, 95, 0.12);
  color: var(--danger);
  border: 1px solid rgba(255, 90, 95, 0.2);
}

.badge-info {
  background: rgba(93, 173, 226, 0.12);
  color: var(--info);
  border: 1px solid rgba(93, 173, 226, 0.2);
}

.badge-neutral {
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.badge-accent {
  background: rgba(79, 140, 255, 0.12);
  color: var(--accent);
  border: 1px solid rgba(79, 140, 255, 0.2);
}

/* Dot indicator */
.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* ════════════════════════════════════════════
   MODAL SHELL
   ════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-ui);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - var(--space-6));
  display: flex;
  flex-direction: column;
  transform: translateY(8px) scale(0.99);
  transition: transform var(--transition-ui);
  overflow: hidden;
}

.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-size: var(--font-size-card-title);
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ════════════════════════════════════════════
   DRAWER SHELL (right-side)
   ════════════════════════════════════════════ */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-ui);
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 420px;
  max-width: calc(100vw - 40px);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 40px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  z-index: 151;
  transform: translateX(100%);
  transition: transform var(--transition-ui);
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-title {
  font-size: var(--font-size-card-title);
  font-weight: 600;
  color: var(--text-primary);
}

.drawer-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.drawer-close:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
}

/* ════════════════════════════════════════════
   TOAST COMPONENT
   ════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  font-size: 13.5px;
  color: var(--text-primary);
  pointer-events: auto;
  min-width: 240px;
  max-width: 360px;
  animation: toastIn 0.15s ease forwards;
}

.toast.removing {
  animation: toastOut 0.15s ease forwards;
}

.toast-icon { flex-shrink: 0; width: 16px; height: 16px; }
.toast-success .toast-icon { color: var(--success); }
.toast-error   .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info    .toast-icon { color: var(--info); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(8px); }
}

/* ════════════════════════════════════════════
   FORM ELEMENTS
   ════════════════════════════════════════════ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-label {
  font-size: var(--font-size-small);
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  height: 40px;
  padding: 0 var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-size-body);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  width: 100%;
}

.form-input::placeholder { color: var(--text-muted); }
.form-select { cursor: pointer; appearance: none; }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.15);
}

.form-input.error { border-color: var(--danger); }
.form-error-msg {
  font-size: var(--font-size-small);
  color: var(--danger);
}

/* Large input variant */
.form-input-lg {
  height: 48px;
  padding: 0 var(--space-3);
  font-size: 15px;
  border-radius: 10px;
}

/* ════════════════════════════════════════════
   SKELETON / LOADING ANIMATIONS
   ════════════════════════════════════════════ */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface) 25%,
    var(--surface-elevated) 50%,
    var(--surface) 75%
  );
  background-size: 1200px 100%;
  animation: shimmer 1.6s infinite linear;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 14px;
  border-radius: 4px;
}

.skeleton-title {
  height: 20px;
  border-radius: 4px;
}

.skeleton-value {
  height: 32px;
  border-radius: 6px;
}

/* ─── Progress Step ─── */
.progress-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.progress-step-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.progress-step.done .progress-step-icon {
  background: rgba(46, 204, 113, 0.15);
  border-color: var(--success);
  color: var(--success);
}

.progress-step.active .progress-step-icon {
  background: rgba(79, 140, 255, 0.15);
  border-color: var(--accent);
  color: var(--accent);
  animation: pulse-ring 1.2s ease infinite;
}

@keyframes pulse-ring {
  0%  { box-shadow: 0 0 0 0 rgba(79,140,255,0.4); }
  70% { box-shadow: 0 0 0 6px rgba(79,140,255,0); }
  100%{ box-shadow: 0 0 0 0 rgba(79,140,255,0); }
}

.progress-step-label {
  font-size: 13.5px;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.progress-step.done .progress-step-label  { color: var(--text-secondary); }
.progress-step.active .progress-step-label { color: var(--text-primary); font-weight: 500; }

/* ════════════════════════════════════════════
   TRUST BAR
   ════════════════════════════════════════════ */
.trust-bar {
  height: 40px;
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: var(--font-size-small);
  color: var(--text-secondary);
  flex-shrink: 0;
  overflow: hidden;
}

.trust-bar-sep {
  color: var(--text-muted);
  font-size: 10px;
}

/* ════════════════════════════════════════════
   MOBILE SIDEBAR DRAWER
   ════════════════════════════════════════════ */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 25;
}

/* ════════════════════════════════════════════
   DIVIDER
   ════════════════════════════════════════════ */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-3) 0;
}

/* ════════════════════════════════════════════
   UTILITY
   ════════════════════════════════════════════ */
.hidden  { display: none !important; }
.flex    { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.w-full { width: 100%; }
.flex-1 { flex: 1; }

/* Grid helpers */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

/* ════════════════════════════════════════════
   RESPONSIVE — TABLET (≤1024px)
   ════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .content-inner {
    padding: var(--space-4);
  }
}

/* ════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤768px)
   ════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Sidebar becomes overlay drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform var(--transition-ui);
    z-index: 30;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
  }

  .sidebar-backdrop.open {
    display: block;
    pointer-events: auto;
  }

  .sidebar-backdrop {
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-ui);
  }

  .sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .hamburger-btn {
    display: flex;
  }

  .content-inner {
    padding: var(--space-3);
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .topbar {
    padding: 0 var(--space-3);
  }
}

/* ════════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE (≤375px)
   ════════════════════════════════════════════ */
@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .trust-bar {
    font-size: 10px;
    gap: 4px;
  }

  .trust-bar-item:not(:first-child) { display: none; }

  .content-inner {
    padding: var(--space-2) var(--space-3);
  }
}
