/* ============================================================
   VAP Neuro Nexus CMS — Premium Design System
   ============================================================ */

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

:root {
  /* Brand */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --primary-glow: rgba(99,102,241,0.18);

  --admin-grad: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --user-grad:  linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

  /* Neutrals */
  --bg:        #f8fafc;
  --surface:   #ffffff;
  --border:    #e2e8f0;
  --border-2:  #cbd5e1;
  --muted:     #94a3b8;
  --text:      #0f172a;
  --text-2:    #475569;
  --text-3:    #64748b;

  /* Semantic */
  --success:   #10b981;
  --success-bg:#ecfdf5;
  --error:     #ef4444;
  --error-bg:  #fef2f2;
  --warning:   #f59e0b;
  --warning-bg:#fffbeb;
  --info:      #3b82f6;
  --info-bg:   #eff6ff;

  /* Sizing */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
  --shadow-xl: 0 20px 60px rgba(0,0,0,.15);

  /* Transitions */
  --ease: cubic-bezier(.4,0,.2,1);
  --dur:  200ms;
}

/* ── Reset ── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration:none; color:inherit; }
img { max-width:100%; display:block; }
button { font-family:inherit; cursor:pointer; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--border-2); border-radius:99px; }
::-webkit-scrollbar-thumb:hover { background:var(--muted); }

/* ============================================================
   LAYOUT
   ============================================================ */
.app-layout { display:flex; min-height:100vh; }

/* ── Sidebar ── */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform var(--dur) var(--ease);
}
.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-brand img { height:40px; width:auto; }
.sidebar-brand-text { font-size:15px; font-weight:700; color:var(--text); line-height:1.2; }
.sidebar-brand-text span { display:block; font-size:11px; font-weight:500; color:var(--muted); margin-top:2px; }

.sidebar-nav { flex:1; padding:16px 12px; overflow-y:auto; }
.nav-section-label {
  font-size:10px; font-weight:700; letter-spacing:.08em;
  text-transform:uppercase; color:var(--muted);
  padding:8px 8px 6px; margin-top:8px;
}
.nav-item {
  display:flex; align-items:center; gap:10px;
  padding:10px 12px; border-radius:var(--radius-sm);
  color:var(--text-2); font-weight:500; font-size:13.5px;
  transition:all var(--dur) var(--ease);
  margin-bottom:2px;
}
.nav-item:hover { background:var(--bg); color:var(--text); }
.nav-item.active { background:var(--primary-glow); color:var(--primary); }
.nav-item svg { width:18px; height:18px; flex-shrink:0; }
.nav-badge {
  margin-left:auto; background:var(--primary);
  color:#fff; font-size:10px; font-weight:700;
  padding:2px 7px; border-radius:99px;
}

.sidebar-footer {
  padding:16px 12px;
  border-top:1px solid var(--border);
}
.sidebar-user {
  display:flex; align-items:center; gap:10px;
  padding:10px 12px; border-radius:var(--radius-sm);
  background:var(--bg);
}
.sidebar-avatar {
  width:34px; height:34px; border-radius:50%;
  background:var(--admin-grad);
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-weight:700; font-size:13px; flex-shrink:0;
}
.sidebar-user-info { flex:1; min-width:0; }
.sidebar-user-name { font-weight:600; font-size:13px; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-user-role { font-size:11px; color:var(--muted); }

/* ── Main Content ── */
.main-content {
  flex:1;
  margin-left:260px;
  display:flex;
  flex-direction:column;
  min-height:100vh;
}

/* ── Topbar ── */
.topbar {
  height:64px;
  background:var(--surface);
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 28px;
  position:sticky; top:0; z-index:50;
}
.topbar-left { display:flex; align-items:center; gap:16px; }
.topbar-title { font-size:18px; font-weight:700; color:var(--text); }
.breadcrumb { display:flex; align-items:center; gap:6px; font-size:13px; color:var(--muted); }
.breadcrumb a { color:var(--muted); transition:color var(--dur); }
.breadcrumb a:hover { color:var(--primary); }
.breadcrumb-sep { color:var(--border-2); }

.topbar-right { display:flex; align-items:center; gap:12px; }
.topbar-btn {
  width:38px; height:38px; border-radius:var(--radius-sm);
  border:1px solid var(--border); background:var(--surface);
  display:flex; align-items:center; justify-content:center;
  color:var(--text-2); transition:all var(--dur) var(--ease);
}
.topbar-btn:hover { background:var(--bg); color:var(--text); border-color:var(--border-2); }
.topbar-btn svg { width:18px; height:18px; }

/* ── Page Body ── */
.page-body { flex:1; padding:28px; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-sm);
}
.card-header {
  padding:20px 24px 0;
  display:flex; align-items:center; justify-content:space-between;
}
.card-title { font-size:15px; font-weight:700; color:var(--text); }
.card-subtitle { font-size:12px; color:var(--muted); margin-top:2px; }
.card-body { padding:20px 24px; }
.card-footer {
  padding:16px 24px;
  border-top:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
}

/* ── Stat Cards ── */
.stats-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:20px; margin-bottom:28px; }
.stat-card {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:22px 24px;
  display:flex; align-items:flex-start; gap:16px;
  box-shadow:var(--shadow-sm);
  transition:box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.stat-card:hover { box-shadow:var(--shadow); transform:translateY(-2px); }
.stat-icon {
  width:48px; height:48px; border-radius:var(--radius);
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
}
.stat-icon svg { width:22px; height:22px; }
.stat-icon.purple { background:rgba(99,102,241,.12); color:var(--primary); }
.stat-icon.pink   { background:rgba(245,87,108,.12); color:#f5576c; }
.stat-icon.green  { background:rgba(16,185,129,.12); color:var(--success); }
.stat-icon.blue   { background:rgba(59,130,246,.12); color:var(--info); }
.stat-info { flex:1; }
.stat-number { font-size:28px; font-weight:800; color:var(--text); line-height:1; margin-bottom:4px; }
.stat-label  { font-size:12px; font-weight:500; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; }
.stat-trend  { font-size:11px; font-weight:600; margin-top:6px; }
.stat-trend.up   { color:var(--success); }
.stat-trend.down { color:var(--error); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display:inline-flex; align-items:center; gap:7px;
  padding:9px 18px; border-radius:var(--radius-sm);
  font-size:13.5px; font-weight:600; border:none;
  transition:all var(--dur) var(--ease); cursor:pointer;
  white-space:nowrap; text-decoration:none;
}
.btn svg { width:16px; height:16px; }
.btn:disabled { opacity:.5; cursor:not-allowed; }

.btn-primary {
  background:var(--primary); color:#fff;
  box-shadow:0 2px 8px rgba(99,102,241,.3);
}
.btn-primary:hover { background:var(--primary-dark); box-shadow:0 4px 16px rgba(99,102,241,.4); transform:translateY(-1px); }

.btn-admin {
  background:linear-gradient(135deg,#f093fb,#f5576c); color:#fff;
  box-shadow:0 2px 8px rgba(245,87,108,.3);
}
.btn-admin:hover { box-shadow:0 4px 16px rgba(245,87,108,.4); transform:translateY(-1px); }

.btn-success {
  background:var(--success); color:#fff;
  box-shadow:0 2px 8px rgba(16,185,129,.3);
}
.btn-success:hover { background:#059669; transform:translateY(-1px); }

.btn-danger {
  background:var(--error); color:#fff;
  box-shadow:0 2px 8px rgba(239,68,68,.3);
}
.btn-danger:hover { background:#dc2626; transform:translateY(-1px); }

.btn-outline {
  background:transparent; color:var(--text-2);
  border:1px solid var(--border);
}
.btn-outline:hover { background:var(--bg); border-color:var(--border-2); color:var(--text); }

.btn-ghost {
  background:transparent; color:var(--text-2);
}
.btn-ghost:hover { background:var(--bg); color:var(--text); }

.btn-sm { padding:6px 13px; font-size:12.5px; }
.btn-lg { padding:13px 28px; font-size:15px; }
.btn-full { width:100%; justify-content:center; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom:20px; }
.form-label {
  display:block; margin-bottom:7px;
  font-size:13px; font-weight:600; color:var(--text-2);
}
.form-label .req { color:var(--error); margin-left:2px; }
.form-control {
  width:100%; padding:10px 14px;
  border:1.5px solid var(--border);
  border-radius:var(--radius-sm);
  font-size:14px; font-family:inherit;
  color:var(--text); background:var(--surface);
  transition:border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  outline:none;
}
.form-control:focus {
  border-color:var(--primary);
  box-shadow:0 0 0 3px var(--primary-glow);
}
.form-control::placeholder { color:var(--muted); }
.form-control.error { border-color:var(--error); }
.form-control.error:focus { box-shadow:0 0 0 3px rgba(239,68,68,.15); }

.form-row { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.form-hint { font-size:12px; color:var(--muted); margin-top:5px; }
.form-error { font-size:12px; color:var(--error); margin-top:5px; font-weight:500; }

/* Input with icon */
.input-wrap { position:relative; }
.input-wrap .input-icon {
  position:absolute; left:12px; top:50%; transform:translateY(-50%);
  color:var(--muted); width:17px; height:17px; pointer-events:none;
}
.input-wrap .form-control { padding-left:38px; }
.input-wrap .input-icon-right {
  position:absolute; right:12px; top:50%; transform:translateY(-50%);
  color:var(--muted); width:17px; height:17px; cursor:pointer;
  background:none; border:none; padding:0;
  display:flex; align-items:center; justify-content:center;
}

/* File Upload */
.file-drop {
  border:2px dashed var(--border-2);
  border-radius:var(--radius);
  padding:36px 24px;
  text-align:center;
  cursor:pointer;
  transition:all var(--dur) var(--ease);
  background:var(--bg);
}
.file-drop:hover, .file-drop.drag-over {
  border-color:var(--primary);
  background:var(--primary-glow);
}
.file-drop input[type=file] { display:none; }
.file-drop-icon { width:44px; height:44px; margin:0 auto 12px; color:var(--muted); }
.file-drop-text { font-size:14px; color:var(--text-2); font-weight:500; }
.file-drop-hint { font-size:12px; color:var(--muted); margin-top:4px; }
.file-selected {
  display:flex; align-items:center; gap:10px;
  background:var(--success-bg); border:1.5px solid var(--success);
  border-radius:var(--radius-sm); padding:10px 14px; margin-top:12px;
}
.file-selected svg { color:var(--success); width:18px; height:18px; flex-shrink:0; }
.file-selected-name { font-size:13px; font-weight:600; color:var(--success); }

/* ============================================================
   ALERTS / MESSAGES
   ============================================================ */
.alert {
  display:flex; align-items:flex-start; gap:12px;
  padding:14px 16px; border-radius:var(--radius-sm);
  font-size:13.5px; font-weight:500; margin-bottom:20px;
  border:1px solid transparent;
}
.alert svg { width:18px; height:18px; flex-shrink:0; margin-top:1px; }
.alert-success { background:var(--success-bg); color:#065f46; border-color:#a7f3d0; }
.alert-error   { background:var(--error-bg);   color:#991b1b; border-color:#fecaca; }
.alert-warning { background:var(--warning-bg); color:#92400e; border-color:#fde68a; }
.alert-info    { background:var(--info-bg);    color:#1e40af; border-color:#bfdbfe; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x:auto; border-radius:var(--radius-lg); border:1px solid var(--border); }
table { width:100%; border-collapse:collapse; }
thead tr { background:var(--bg); }
th {
  padding:12px 16px; text-align:left;
  font-size:11.5px; font-weight:700; color:var(--muted);
  text-transform:uppercase; letter-spacing:.06em;
  border-bottom:1px solid var(--border); white-space:nowrap;
}
td {
  padding:14px 16px; font-size:13.5px; color:var(--text-2);
  border-bottom:1px solid var(--border);
  vertical-align:middle;
}
tbody tr:last-child td { border-bottom:none; }
tbody tr { transition:background var(--dur) var(--ease); }
tbody tr:hover { background:#f8fafc; }
.td-name { font-weight:600; color:var(--text); }
.td-mono { font-family:monospace; font-size:12.5px; background:var(--bg); padding:3px 8px; border-radius:5px; color:var(--text-2); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display:inline-flex; align-items:center; gap:5px;
  padding:3px 10px; border-radius:99px;
  font-size:11.5px; font-weight:600;
}
.badge-purple { background:rgba(99,102,241,.12); color:var(--primary); }
.badge-green  { background:rgba(16,185,129,.12);  color:#059669; }
.badge-red    { background:rgba(239,68,68,.12);   color:#dc2626; }
.badge-blue   { background:rgba(59,130,246,.12);  color:#2563eb; }
.badge-gray   { background:var(--bg); color:var(--muted); border:1px solid var(--border); }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height:100vh; display:flex;
  background:var(--bg);
}
.login-left {
  flex:1; display:flex; flex-direction:column;
  justify-content:center; align-items:center;
  padding:60px 48px; position:relative; overflow:hidden;
}
.login-left-inner { position:relative; z-index:2; text-align:center; max-width:420px; }
.login-left-logo { height:80px; width:auto; margin:0 auto 32px; }
.login-left h1 { font-size:32px; font-weight:800; color:#fff; margin-bottom:12px; line-height:1.2; }
.login-left p  { font-size:16px; color:rgba(255,255,255,.8); line-height:1.6; }
.login-left-decor {
  position:absolute; border-radius:50%;
  background:rgba(255,255,255,.06);
}
.login-left-decor.d1 { width:400px; height:400px; top:-100px; right:-100px; }
.login-left-decor.d2 { width:250px; height:250px; bottom:-60px; left:-60px; }
.login-left-decor.d3 { width:150px; height:150px; top:40%; left:10%; }

.login-right {
  width:480px; display:flex; flex-direction:column;
  justify-content:center; padding:60px 48px;
  background:var(--surface);
  box-shadow:-20px 0 60px rgba(0,0,0,.06);
}
.login-form-header { margin-bottom:32px; }
.login-form-header h2 { font-size:24px; font-weight:800; color:var(--text); margin-bottom:6px; }
.login-form-header p  { font-size:14px; color:var(--muted); }

.login-footer-text {
  margin-top:32px; text-align:center;
  font-size:12px; color:var(--muted); line-height:1.8;
}
.login-footer-text a { color:var(--primary); }

/* ============================================================
   CHANGE PASSWORD PAGE
   ============================================================ */
.cp-page {
  min-height:100vh; display:flex;
  align-items:center; justify-content:center;
  padding:24px;
}
.cp-card {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-xl);
  box-shadow:var(--shadow-xl);
  width:100%; max-width:480px;
  padding:40px;
}
.cp-header { text-align:center; margin-bottom:28px; }
.cp-header h1 { font-size:22px; font-weight:800; color:var(--text); margin-bottom:4px; }
.cp-header p  { font-size:13px; color:var(--muted); }

/* Password strength */
.strength-bar-wrap { height:4px; background:var(--border); border-radius:99px; margin-top:8px; overflow:hidden; }
.strength-bar { height:100%; border-radius:99px; transition:all .3s var(--ease); width:0; }
.strength-bar.weak   { width:33%; background:var(--error); }
.strength-bar.medium { width:66%; background:var(--warning); }
.strength-bar.strong { width:100%; background:var(--success); }
.strength-label { font-size:11px; font-weight:600; margin-top:4px; }
.strength-label.weak   { color:var(--error); }
.strength-label.medium { color:var(--warning); }
.strength-label.strong { color:var(--success); }

.req-list { list-style:none; display:flex; flex-direction:column; gap:5px; margin-top:10px; }
.req-list li { font-size:12px; color:var(--muted); display:flex; align-items:center; gap:7px; }
.req-list li.met { color:var(--success); }
.req-list li::before { content:'○'; font-size:10px; }
.req-list li.met::before { content:'✓'; }

/* ============================================================
   PROFILE GRID
   ============================================================ */
.profile-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:16px; }
.profile-item {
  padding:16px; background:var(--bg);
  border:1px solid var(--border); border-radius:var(--radius);
}
.profile-item-label { font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; margin-bottom:6px; }
.profile-item-value { font-size:14px; font-weight:600; color:var(--text); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align:center; padding:60px 24px;
  color:var(--muted);
}
.empty-state svg { width:64px; height:64px; margin:0 auto 16px; opacity:.35; }
.empty-state h3 { font-size:16px; font-weight:700; color:var(--text-2); margin-bottom:6px; }
.empty-state p  { font-size:13px; }

/* ============================================================
   MODALS / POPUPS
   ============================================================ */
.modal {
  display:none; position:fixed; inset:0;
  background:rgba(0,0,0,.6); z-index:9999;
  align-items:center; justify-content:center;
  backdrop-filter:blur(3px);
  padding:20px;
}
.modal-content {
  background:var(--surface);
  border-radius:var(--radius-lg);
  width:100%; max-width:800px;
  height:90vh; max-height:800px;
  display:flex; flex-direction:column;
  box-shadow:var(--shadow-xl);
  animation: modalIn var(--dur) var(--ease);
}
@keyframes modalIn {
  from { opacity:0; transform:translateY(20px) scale(0.98); }
  to { opacity:1; transform:translateY(0) scale(1); }
}
.modal-header {
  padding:16px 24px; border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
}
.modal-title { font-size:16px; font-weight:700; color:var(--text); }
.modal-close {
  background:none; border:none; font-size:24px; line-height:1;
  color:var(--muted); cursor:pointer; padding:4px; transition:color var(--dur);
}
.modal-close:hover { color:var(--error); }
.modal-body {
  flex:1; padding:0; position:relative; overflow:hidden;
  background:var(--bg); border-radius:0 0 var(--radius-lg) var(--radius-lg);
}
.modal-body iframe {
  width:100%; height:100%; border:none; display:block;
}

/* ============================================================
   FOOTER
   ============================================================ */
.app-footer {
  padding:20px 28px;
  border-top:1px solid var(--border);
  background:var(--surface);
  display:flex; align-items:center; justify-content:space-between;
  font-size:12px; color:var(--muted);
}
.app-footer a { color:var(--primary); }
.app-footer-heart { color:#f5576c; }

/* ============================================================
   UTILITIES
   ============================================================ */
.flex { display:flex; }
.flex-center { display:flex; align-items:center; justify-content:center; }
.flex-between { display:flex; align-items:center; justify-content:space-between; }
.gap-2 { gap:8px; }
.gap-3 { gap:12px; }
.gap-4 { gap:16px; }
.mt-1 { margin-top:4px; }
.mt-2 { margin-top:8px; }
.mt-3 { margin-top:12px; }
.mt-4 { margin-top:16px; }
.mb-4 { margin-bottom:16px; }
.mb-6 { margin-bottom:24px; }
.text-muted { color:var(--muted); }
.text-sm { font-size:12px; }
.font-bold { font-weight:700; }
.w-full { width:100%; }

/* ============================================================
   RESPONSIVE — Mobile First
   ============================================================ */

/* ── Sidebar overlay backdrop ── */
.sidebar-backdrop {
  display:none;
  position:fixed; inset:0;
  background:rgba(0,0,0,.45);
  z-index:99;
  backdrop-filter:blur(2px);
}
.sidebar-backdrop.show { display:block; }

/* ── Hamburger button ── */
.hamburger {
  display:none;
  width:40px; height:40px;
  border-radius:var(--radius-sm);
  border:1px solid var(--border);
  background:var(--surface);
  align-items:center; justify-content:center;
  cursor:pointer; flex-shrink:0;
  color:var(--text-2);
}
.hamburger svg { width:20px; height:20px; }

/* ── Table → Card view on mobile ── */
.table-card-wrap { display:none; }
.mobile-card {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  margin-bottom:12px;
}
.mobile-card-row {
  display:flex; justify-content:space-between; align-items:center;
  padding:6px 0;
  border-bottom:1px solid var(--border);
  font-size:13px;
}
.mobile-card-row:last-child { border-bottom:none; }
.mobile-card-label { color:var(--muted); font-weight:600; font-size:11px; text-transform:uppercase; letter-spacing:.05em; }
.mobile-card-value { color:var(--text); font-weight:500; text-align:right; }
.mobile-card-actions { display:flex; gap:8px; margin-top:12px; flex-wrap:wrap; }
.mobile-card-actions .btn { flex:1; justify-content:center; min-width:80px; }

/* ── Bottom nav for mobile (user/vendor) ── */
.bottom-nav {
  display:none;
  position:fixed; bottom:0; left:0; right:0;
  background:var(--surface);
  border-top:1px solid var(--border);
  z-index:100;
  padding:8px 0 env(safe-area-inset-bottom, 8px);
}
.bottom-nav-inner { display:flex; justify-content:space-around; }
.bottom-nav-item {
  display:flex; flex-direction:column; align-items:center; gap:3px;
  padding:6px 16px; border-radius:var(--radius-sm);
  color:var(--muted); font-size:10px; font-weight:600;
  text-decoration:none; transition:color var(--dur);
  min-width:60px;
}
.bottom-nav-item svg { width:22px; height:22px; }
.bottom-nav-item.active { color:var(--primary); }
.bottom-nav-item.danger { color:var(--error); }

/* ── Tablet: 1024px ── */
@media (max-width:1024px) {
  .sidebar {
    transform:translateX(-100%);
    box-shadow:var(--shadow-xl);
    z-index:200;
  }
  .sidebar.open { transform:translateX(0); }
  .main-content { margin-left:0; }
  .form-row { grid-template-columns:1fr; }
  .hamburger { display:flex; }
}

/* ── Mobile: 768px ── */
@media (max-width:768px) {
  /* Login */
  .login-left { display:none; }
  .login-right { width:100%; padding:36px 24px; box-shadow:none; }
  
  .login-form-header { text-align: center; }
  .login-form-header::before {
    content: '';
    display: block;
    width: 240px;
    height: 80px;
    margin: 0 auto 20px;
    background: url("../images/VapNeuronexus.png") no-repeat center center;
    background-size: contain;
  }

  /* Layout */
  .page-body { padding:16px; padding-bottom:80px; }
  .topbar { padding:0 16px; height:56px; position:relative; }
  .topbar::after {
    content: '';
    display: block;
    width: 36px;
    height: 36px;
    background: url('../images/VapNeuronexus.png') no-repeat center center;
    background-size: contain;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
  }
  .topbar-title { font-size:16px; }

  /* Stats grid — 2 cols */
  .stats-grid { grid-template-columns:1fr 1fr; gap:12px; margin-bottom:20px; }
  .stat-card { padding:16px; gap:12px; }
  .stat-number { font-size:22px; }
  .stat-icon { width:40px; height:40px; }
  .stat-icon svg { width:18px; height:18px; }

  /* Cards */
  .card-header { padding:16px 16px 0; flex-wrap:wrap; gap:10px; }
  .card-body { padding:16px; }
  .card-title { font-size:14px; }

  /* Tables → card view */
  .table-wrap table thead { display:none; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display:block; width:100%; }
  .table-wrap tr {
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:var(--radius);
    margin:0 0 10px;
    padding:12px;
    position:relative;
  }
  .table-wrap td {
    padding:5px 0;
    border:none;
    display:flex;
    justify-content:space-between;
    align-items:center;
    font-size:13px;
    gap:8px;
  }
  .table-wrap td::before {
    content: attr(data-label);
    font-size:10px; font-weight:700;
    color:var(--muted); text-transform:uppercase;
    letter-spacing:.05em; flex-shrink:0; min-width:90px;
  }
  .table-wrap td:last-child { margin-top:8px; padding-top:10px; border-top:1px solid var(--border); }

  /* Profile grid */
  .profile-grid { grid-template-columns:1fr 1fr; gap:10px; }
  .profile-item { padding:12px; }

  /* Buttons */
  .btn-sm { padding:7px 12px; font-size:12px; }
  .topbar-right .btn { display:none; }
  .topbar-right .btn.always-show { display:inline-flex; }

  /* Footer */
  .app-footer { flex-direction:column; gap:4px; text-align:center; padding:16px; }

  /* cp-card */
  .cp-card { padding:28px 20px; margin:16px; }

  /* Vendor grid */
  [style*="grid-template-columns:1fr 340px"] { grid-template-columns:1fr !important; }
}

/* ── Small mobile: 480px ── */
@media (max-width:480px) {
  .stats-grid { grid-template-columns:1fr 1fr; gap:10px; }
  .stat-number { font-size:20px; }
  .login-right { padding:28px 20px; }
  .profile-grid { grid-template-columns:1fr; }
  .topbar-right { gap:8px; }
  .page-body { padding:12px; padding-bottom:80px; }
}

