/* ============================================================
   VPN Bot Admin Panel — Mobile-First Design
   ============================================================ */

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

:root {
  --bg:           #0a0d14;
  --surface:      #131928;
  --surface2:     #1c2438;
  --surface3:     #232d42;
  --border:       rgba(255,255,255,.07);
  --border2:      rgba(255,255,255,.12);

  --accent:       #6366f1;
  --accent-soft:  rgba(99,102,241,.14);
  --accent-glow:  rgba(99,102,241,.3);

  --green:        #22c55e;
  --green-soft:   rgba(34,197,94,.12);
  --yellow:       #f59e0b;
  --yellow-soft:  rgba(245,158,11,.12);
  --red:          #ef4444;
  --red-soft:     rgba(239,68,68,.12);
  --cyan:         #06b6d4;
  --cyan-soft:    rgba(6,182,212,.12);

  --text:         #f1f5f9;
  --text-2:       #94a3b8;
  --text-3:       #475569;

  --r-sm:   8px;
  --r:      12px;
  --r-lg:   16px;
  --r-xl:   20px;

  --nav-h:  60px;   /* bottom nav height on mobile */
  --safe-b: env(safe-area-inset-bottom, 0px);
}

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

html { font-size: 14px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

/* ============================================================
   LAYOUT  (mobile-first: single column + bottom nav)
   ============================================================ */

#layout {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ---- TOPBAR ---- */
#topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: rgba(10,13,20,.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.topbar-logo .logo-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.topbar-logo .logo-name {
  font-size: 13px;
  font-weight: 700;
}

#topbar-title {
  font-size: 15px;
  font-weight: 700;
  flex: 1;
  text-align: center;
}

.topbar-action {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: background .15s;
  flex-shrink: 0;
}
.topbar-action:active { background: var(--surface3); }

/* ---- MAIN SCROLL AREA ---- */
#main {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
}

#content { padding: 14px 14px 4px; }

/* ---- BOTTOM NAV (mobile) ---- */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(19,25,40,.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-family: inherit;
  transition: color .15s;
  position: relative;
  padding: 6px 0;
}

.nav-item.active { color: var(--accent); }

.nav-item .nav-icon {
  font-size: 20px;
  line-height: 1;
}

.nav-item .nav-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .01em;
}

.nav-item .nav-dot {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(calc(-50% - 8px));
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  border: 1.5px solid var(--bg);
  display: none;
}

.nav-item .nav-dot.show { display: block; }

/* ---- MORE DRAWER (hidden pages) ---- */
#more-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
}

#more-drawer.open { display: block; }

.drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
}

.drawer-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border-top: 1px solid var(--border2);
  padding: 12px 16px calc(var(--nav-h) + var(--safe-b) + 8px);
  animation: slideUp .22s cubic-bezier(.34,1.2,.64,1);
}

.drawer-handle {
  width: 36px;
  height: 4px;
  border-radius: 99px;
  background: var(--border2);
  margin: 0 auto 16px;
}

.drawer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, border-color .15s;
}

.drawer-item:active { background: var(--surface3); border-color: var(--border2); }

.drawer-item .d-icon {
  font-size: 22px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: var(--r-sm);
}

.drawer-item .d-label { font-size: 13px; font-weight: 600; }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.page-header h1 { font-size: 20px; font-weight: 800; }
.page-header p  { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* ============================================================
   STAT CARDS — 2-column grid on mobile
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px;
  position: relative;
  overflow: hidden;
  transition: transform .15s;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

.stat-card:active { transform: scale(.97); }

.stat-icon {
  font-size: 22px;
  margin-bottom: 8px;
  display: block;
  line-height: 1;
}

/* Remix Icons sizing */
[class^="ri-"], [class*=" ri-"] { line-height: inherit; }

.page-header h1 [class^="ri-"],
.page-header h1 [class*=" ri-"] {
  font-size: 20px;
  vertical-align: -2px;
}

.card-header h2 [class^="ri-"],
.card-header h2 [class*=" ri-"] {
  font-size: 15px;
  vertical-align: -1px;
}

.nav-icon { font-size: 20px !important; line-height: 1 !important; }
.t-icon   { font-size: 16px; flex-shrink: 0; }
.s-arrow  { font-size: 18px; color: var(--text-3); }

.e-icon {
  font-size: 40px !important;
  display: block;
  margin-bottom: 10px;
  opacity: .4;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label { font-size: 11px; color: var(--text-2); font-weight: 500; }

.stat-card.c-purple .stat-value { color: #a5b4fc; }
.stat-card.c-cyan   .stat-value { color: var(--cyan); }
.stat-card.c-green  .stat-value { color: var(--green); }
.stat-card.c-yellow .stat-value { color: var(--yellow); }
.stat-card.c-red    .stat-value { color: var(--red); }

.stat-card.wide { grid-column: span 2; }

.stat-card.c-cyan.wide {
  background: linear-gradient(135deg, rgba(6,182,212,.12), rgba(99,102,241,.08));
  border-color: rgba(6,182,212,.2);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 12px;
  overflow: hidden;
}

.card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-header h2   { font-size: 14px; font-weight: 700; }
.card-header p    { font-size: 11px; color: var(--text-2); margin-top: 2px; }

.card-body { padding: 14px 16px; }

/* ============================================================
   TABLES — horizontal scroll on mobile
   ============================================================ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; min-width: 520px; }

th {
  padding: 8px 12px;
  text-align: right;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: .05em;
  text-transform: uppercase;
  background: rgba(255,255,255,.02);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 11px 12px;
  font-size: 12px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:active td { background: rgba(255,255,255,.03); }

.td-muted { color: var(--text-2); font-size: 11px; }

/* ============================================================
   ORDER CARDS (mobile-friendly alternative to table)
   ============================================================ */
.order-list { display: flex; flex-direction: column; gap: 10px; }

.order-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  transition: border-color .15s;
}

.order-card:active { border-color: var(--border2); }

.order-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.order-card-id { font-size: 12px; color: var(--text-3); font-weight: 600; }

.order-card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.order-meta { display: flex; flex-direction: column; gap: 2px; }
.order-meta .label { font-size: 10px; color: var(--text-3); font-weight: 600; }
.order-meta .value { font-size: 13px; font-weight: 600; }

.order-actions { display: flex; gap: 8px; }
.order-actions .btn { flex: 1; justify-content: center; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-green  { background: var(--green-soft);  color: var(--green);  }
.badge-green::before  { background: var(--green);  }
.badge-yellow { background: var(--yellow-soft); color: var(--yellow); }
.badge-yellow::before { background: var(--yellow); }
.badge-red    { background: var(--red-soft);    color: var(--red);    }
.badge-red::before    { background: var(--red);    }
.badge-purple { background: var(--accent-soft); color: #a5b4fc; }
.badge-purple::before { background: #a5b4fc; }
.badge-cyan   { background: var(--cyan-soft);   color: var(--cyan);   }
.badge-cyan::before   { background: var(--cyan);  }

/* ============================================================
   BUTTONS — touch-friendly (min 44px)
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  transition: opacity .15s, transform .1s;
  white-space: nowrap;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { opacity: .8; transform: scale(.97); }

.btn-primary  { background: var(--accent);  color: #fff; box-shadow: 0 2px 12px var(--accent-glow); }
.btn-success  { background: var(--green);   color: #fff; }
.btn-danger   { background: var(--red);     color: #fff; }
.btn-ghost    { background: var(--surface2); color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:active { background: var(--surface3); }
.btn-accent-soft { background: var(--accent-soft); color: #a5b4fc; border: 1px solid rgba(99,102,241,.2); }

.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; border-radius: var(--r-sm); }
.btn-xs { min-height: 32px; padding: 0 12px; font-size: 12px; border-radius: var(--r-sm); }
.btn-full { width: 100%; }

/* ============================================================
   FORMS
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 6px; }

.field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
select,
textarea {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea { resize: vertical; min-height: 90px; }
input::placeholder, textarea::placeholder { color: var(--text-3); }

/* Toggle */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row .toggle-info .t-label { font-size: 14px; font-weight: 600; }
.toggle-row .toggle-info .t-sub   { font-size: 12px; color: var(--text-2); margin-top: 2px; }

.toggle {
  position: relative;
  width: 46px; height: 26px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--surface3);
  border: 1.5px solid var(--border);
  border-radius: 99px;
  transition: .2s;
  cursor: pointer;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 50%;
  transform: translateY(-50%);
  background: var(--text-3);
  border-radius: 50%;
  transition: .2s;
}
.toggle input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-slider::before { left: 21px; background: #fff; }

/* ============================================================
   UPLOAD ZONE
   ============================================================ */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--r-lg);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}

.upload-zone:active, .upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload-zone .u-icon  { font-size: 32px; margin-bottom: 8px; }
.upload-zone .u-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.upload-zone .u-sub   { font-size: 11px; color: var(--text-2); }

/* ============================================================
   PROGRESS
   ============================================================ */
.progress {
  background: var(--surface3);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  transition: width .5s ease;
}

/* ============================================================
   BAR CHART
   ============================================================ */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 60px;
}
.bar {
  flex: 1;
  border-radius: 4px 4px 0 0;
  background: var(--accent-soft);
  border: 1px solid rgba(99,102,241,.25);
  min-width: 14px;
  position: relative;
  transition: background .15s;
}
.bar:active { background: var(--accent); }

.bar-labels {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.bar-labels span {
  flex: 1;
  text-align: center;
  font-size: 9px;
  color: var(--text-3);
  font-weight: 600;
}

/* ============================================================
   STOCK ROWS
   ============================================================ */
.stock-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.stock-row:last-child { border-bottom: none; }
.stock-label { font-size: 13px; font-weight: 700; min-width: 62px; }
.stock-bar-wrap { flex: 1; }
.stock-count { font-size: 12px; color: var(--text-2); min-width: 70px; text-align: left; }

/* ============================================================
   FILTER TABS
   ============================================================ */
.filter-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px;
}
.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  cursor: pointer;
  border: none;
  background: var(--surface2);
  font-family: inherit;
  white-space: nowrap;
  transition: background .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 36px;
}
.filter-tab:active { opacity: .8; }
.filter-tab.active { background: var(--accent); color: #fff; box-shadow: 0 2px 8px var(--accent-glow); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  animation: fadeIn .15s ease;
}

.modal {
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border-top: 1px solid var(--border2);
  padding: 8px 16px calc(var(--nav-h) + var(--safe-b) + 16px);
  width: 100%;
  animation: slideUp .22s cubic-bezier(.34,1.2,.64,1);
  max-height: 85dvh;
  overflow-y: auto;
}

.modal-handle {
  width: 36px;
  height: 4px;
  border-radius: 99px;
  background: var(--border2);
  margin: 0 auto 16px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h3 { font-size: 16px; font-weight: 700; }

/* ============================================================
   TOAST
   ============================================================ */
#toast-container {
  position: fixed;
  top: 60px;
  left: 12px;
  right: 12px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  animation: toastIn .25s cubic-bezier(.34,1.4,.64,1);
  pointer-events: auto;
}

.toast-item.removing { animation: toastOut .2s ease forwards; }
.toast-item.success  { border-color: rgba(34,197,94,.4);   }
.toast-item.error    { border-color: rgba(239,68,68,.4);   }
.toast-item.info     { border-color: rgba(99,102,241,.4);  }
.toast-item .t-icon  { font-size: 18px; flex-shrink: 0; }

/* ============================================================
   SETTINGS SECTION
   ============================================================ */
.settings-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 12px;
  overflow: hidden;
}

.settings-group-title {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-3);
  letter-spacing: .06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}

.setting-row {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .1s;
}
.setting-row:last-child { border-bottom: none; }
.setting-row:active { background: var(--surface2); }

.setting-row .s-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.setting-row .s-info { flex: 1; }
.setting-row .s-label { font-size: 14px; font-weight: 600; }
.setting-row .s-value { font-size: 12px; color: var(--text-2); margin-top: 2px; }

.setting-row .s-arrow { color: var(--text-3); font-size: 14px; }

/* ============================================================
   ADMIN CHIPS
   ============================================================ */
.admin-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 8px;
}

.admin-chip .chip-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.admin-chip .chip-id { flex: 1; font-size: 13px; font-weight: 600; }

/* ============================================================
   PREVIEW BUTTON
   ============================================================ */
#preview-btn {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  left: 12px;
  z-index: 9998;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  color: #fff;
  border: none;
  border-radius: 99px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--accent-glow);
  display: flex;
  align-items: center;
  gap: 6px;
  -webkit-tap-highlight-color: transparent;
}

#preview-btn:active { opacity: .85; transform: scale(.97); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-state .e-icon  { font-size: 42px; margin-bottom: 10px; opacity: .5; }
.empty-state .e-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.empty-state .e-sub   { font-size: 13px; color: var(--text-2); }

/* ============================================================
   MONO / CODE
   ============================================================ */
.mono {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  background: var(--surface3);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--cyan);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn  { from { opacity: 0; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(24px); } }
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes toastIn  { from { opacity:0; transform: translateY(-12px); } }
@keyframes toastOut { to   { opacity:0; transform: translateY(-12px); } }

/* Hide desktop sidebar on mobile by default */
#sidebar-desktop { display: none; }

/* Mobile: show cards, hide table */
.order-table-desktop { display: none; }
.order-list-mobile   { display: flex; flex-direction: column; gap: 10px; }

/* ============================================================
   DESKTOP OVERRIDE  (≥ 768px)
   ============================================================ */
@media (min-width: 768px) {
  :root { --nav-h: 0px; }

  #layout { flex-direction: row; }

  /* Sidebar replaces bottom nav */
  #bottom-nav { display: none; }

  #sidebar-desktop {
    display: flex;
    flex-direction: column;
    width: 220px;
    min-height: 100dvh;
    background: var(--surface);
    border-left: 1px solid var(--border);
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
    flex-shrink: 0;
    order: 2;
  }

  .sidebar-logo {
    padding: 20px 18px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
  }

  .sidebar-logo .logo-icon {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    box-shadow: 0 2px 8px var(--accent-glow);
  }

  .sidebar-logo .logo-text span:first-child { font-size: 13px; font-weight: 700; display: block; }
  .sidebar-logo .logo-text span:last-child  { font-size: 10px; color: var(--text-3); font-weight: 500; display: block; }

  .sidebar-section {
    padding: 4px 18px 2px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-3);
    letter-spacing: .07em;
    text-transform: uppercase;
    margin-top: 10px;
  }

  #sidebar-desktop nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: var(--text-2);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border-right: 3px solid transparent;
    transition: color .15s, background .15s;
    margin: 1px 0;
    -webkit-tap-highlight-color: transparent;
  }

  #sidebar-desktop nav a .s-nav-icon {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    border-radius: 7px;
    background: transparent;
    transition: background .15s;
    flex-shrink: 0;
  }

  #sidebar-desktop nav a:hover { color: var(--text); background: rgba(255,255,255,.04); }
  #sidebar-desktop nav a.active {
    color: var(--text);
    background: var(--accent-soft);
    border-right-color: var(--accent);
  }
  #sidebar-desktop nav a.active .s-nav-icon { background: var(--accent-soft); }

  #sidebar-desktop nav a .s-badge {
    margin-right: auto;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 99px;
  }

  .sidebar-footer {
    margin-top: auto;
    padding: 14px;
    border-top: 1px solid var(--border);
  }

  .sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--r);
    cursor: pointer;
    transition: background .15s;
  }
  .sidebar-user:hover { background: rgba(255,255,255,.05); }

  .sidebar-user .s-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
    flex-shrink: 0;
  }

  .sidebar-user .s-info .s-name { font-size: 13px; font-weight: 600; }
  .sidebar-user .s-info .s-role { font-size: 11px; color: var(--text-3); }

  /* Main area */
  #main { order: 1; flex: 1; }

  #topbar {
    height: 56px;
    padding: 0 24px;
  }

  .topbar-logo { display: none; } /* shown in sidebar */

  #content { padding: 24px; }

  /* Wider grids on desktop */
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-card.wide { grid-column: span 1; }

  table { min-width: unset; }

  /* Orders use table on desktop */
  .order-list-mobile { display: none; }
  .order-table-desktop { display: block; }

  #preview-btn { top: auto; bottom: 80px; right: 24px; }

  /* Modal — centered on desktop */
  .modal-overlay { align-items: center; justify-content: center; }
  .modal {
    border-radius: var(--r-xl);
    border-top: 1px solid var(--border2);
    max-width: 480px;
    padding: 20px 24px 24px;
    max-height: 80dvh;
  }
  .modal-handle { display: none; }

  /* More drawer not needed on desktop */
  #more-drawer { display: none !important; }
}
