/* MonarchBot — Apple-inspired Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
  /* Apple-inspired palette */
  --bg:        #F5F5F7;   /* Apple gray bg  */
  --surface:   #FFFFFF;   /* Pure white card */
  --surface2:  #FAFAFA;   /* Subtle inner bg */
  --surface3:  #F2F2F7;   /* Table zebra     */
  --border:    #D1D1D6;   /* Apple border    */
  --border-l:  #E5E5EA;   /* Lighter border  */

  /* Text */
  --text:      #1C1C1E;   /* Apple near-black */
  --text2:     #48484A;   /* Secondary label  */
  --muted:     #8E8E93;   /* Tertiary label   */

  /* Brand */
  --primary:   #5B4FE9;
  --primary-l: #7B70F5;
  --primary-dim: rgba(91,79,233,.10);
  --primary-dim2: rgba(91,79,233,.05);

  /* Semantic */
  --success:   #34C759;   /* Apple green  */
  --success-dim: rgba(52,199,89,.10);
  --warning:   #FF9F0A;   /* Apple orange */
  --warning-dim: rgba(255,159,10,.10);
  --danger:    #FF3B30;   /* Apple red    */
  --danger-dim:  rgba(255,59,48,.08);
  --info:      #007AFF;   /* Apple blue   */
  --info-dim:  rgba(0,122,255,.10);

  /* Spacing */
  --sidebar-w: 240px;
  --topbar-h:  60px;
  --radius:    10px;
  --radius-sm: 8px;
  --radius-lg: 14px;

  /* Shadows — Apple-style (very subtle) */
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.06);

  --transition: all .15s cubic-bezier(0.4,0,0.2,1);
}

/* ── RESET ──────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html,body { height:100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', sans-serif;
  font-size: 14px; line-height: 1.6;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: var(--primary); text-decoration: none; }
button,input,select,textarea { font-family: inherit; }
img { max-width:100%; }

/* ── SHELL ──────────────────────────────────────────────────── */
.shell { display:flex; height:100vh; overflow:hidden; }

/* ── SIDEBAR ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); background: #1C1C1E;
  display:flex; flex-direction:column;
  flex-shrink:0; height:100vh; overflow:hidden;
  z-index:20;
}
.sidebar-logo {
  display:flex; align-items:center; gap:10px;
  padding:20px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo-icon {
  width:34px; height:34px; flex-shrink:0;
  background: linear-gradient(135deg, var(--primary), var(--primary-l));
  border-radius:9px; display:flex; align-items:center; justify-content:center;
  font-size:17px;
}
.sidebar-logo-text { flex:1; min-width:0; }
.sidebar-logo-name { font-size:15px; font-weight:700; color:#FFF; line-height:1.2; }
.sidebar-logo-badge { font-size:10px; color:rgba(255,255,255,.35); font-weight:500; text-transform:uppercase; letter-spacing:.06em; }

.sidebar-nav { flex:1; overflow-y:auto; padding:8px 8px; }
.sidebar-nav::-webkit-scrollbar { width:3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background:rgba(255,255,255,.15); border-radius:2px; }

.nav-section-label {
  font-size:10px; font-weight:600; letter-spacing:.1em; text-transform:uppercase;
  color:rgba(255,255,255,.28); padding:12px 10px 4px;
}
.nav-divider { height:1px; background:rgba(255,255,255,.07); margin:4px 8px; }

.nav-item {
  display:flex; align-items:center; gap:9px;
  padding:8px 10px; border-radius:8px;
  color:rgba(255,255,255,.60); font-size:13.5px; font-weight:500;
  cursor:pointer; transition:var(--transition); position:relative;
  user-select:none;
}
.nav-item:hover { background:rgba(255,255,255,.08); color:rgba(255,255,255,.9); }
.nav-item.active {
  background:rgba(255,255,255,.12); color:#FFF; font-weight:600;
}
.nav-item.active::before {
  content:''; position:absolute; left:0; top:8px; bottom:8px;
  width:3px; background:var(--primary-l); border-radius:0 2px 2px 0;
}
.nav-icon { font-size:15px; width:18px; text-align:center; flex-shrink:0; }
.nav-badge {
  margin-left:auto; background:var(--primary); color:#fff;
  border-radius:10px; padding:1px 7px; font-size:11px; font-weight:700;
  min-width:20px; text-align:center;
}

.sidebar-footer {
  padding:10px 8px 14px; border-top:1px solid rgba(255,255,255,.08);
}
.sidebar-user {
  display:flex; align-items:center; gap:9px;
  padding:8px 10px; border-radius:8px; cursor:pointer;
  transition:var(--transition);
}
.sidebar-user:hover { background:rgba(255,255,255,.08); }
.sidebar-avatar {
  width:30px; height:30px; border-radius:50%;
  background:linear-gradient(135deg,var(--primary),#f59e0b);
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-size:12px; font-weight:700; flex-shrink:0;
}
.sidebar-user-name { font-size:13px; font-weight:600; color:#fff; line-height:1.2; }
.sidebar-user-role { font-size:11px; color:rgba(255,255,255,.38); }

/* ── MAIN ───────────────────────────────────────────────────── */
.main { flex:1; display:flex; flex-direction:column; overflow:hidden; min-width:0; background:var(--bg); }

/* ── TOPBAR ─────────────────────────────────────────────────── */
.topbar {
  height:var(--topbar-h); display:flex; align-items:center; gap:12px;
  padding:0 24px; background:var(--surface);
  border-bottom:1px solid var(--border-l); flex-shrink:0;
  box-shadow:0 1px 0 var(--border-l);
}
.topbar-title { font-size:17px; font-weight:700; color:var(--text); }
.topbar-search {
  flex:1; max-width:280px;
  display:flex; align-items:center; gap:8px;
  background:var(--surface3); border:1px solid var(--border-l);
  border-radius:9px; padding:0 12px; height:34px;
}
.topbar-search input {
  border:none; background:none; outline:none;
  font-size:13px; color:var(--text); width:100%;
}
.topbar-search input::placeholder { color:var(--muted); }
.topbar-actions { display:flex; align-items:center; gap:6px; margin-left:auto; }
.icon-btn {
  width:34px; height:34px; border-radius:8px;
  border:none; background:var(--surface3);
  display:flex; align-items:center; justify-content:center;
  font-size:15px; cursor:pointer; transition:var(--transition); color:var(--text2);
  position:relative;
}
.icon-btn:hover { background:var(--primary-dim); color:var(--primary); }
.badge-dot {
  position:absolute; top:6px; right:6px;
  width:7px; height:7px; background:var(--danger);
  border-radius:50%; border:1.5px solid var(--surface);
}

/* ── PAGE CONTENT ───────────────────────────────────────────── */
#pageContent { flex:1; overflow-y:auto; padding:28px; }
#pageContent::-webkit-scrollbar { width:5px; }
#pageContent::-webkit-scrollbar-thumb { background:var(--border); border-radius:3px; }

/* ── PAGE HEADER ────────────────────────────────────────────── */
.page-header {
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:16px; margin-bottom:24px; flex-wrap:wrap;
}
.page-title { font-size:22px; font-weight:800; color:var(--text); letter-spacing:-.3px; }
.page-subtitle { font-size:13.5px; color:var(--muted); margin-top:3px; }
.page-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }

/* ── CARDS ──────────────────────────────────────────────────── */
.card {
  background:var(--surface); border:1px solid var(--border-l);
  border-radius:var(--radius-lg); overflow:hidden; box-shadow:var(--shadow);
}
.card-header {
  padding:16px 20px; border-bottom:1px solid var(--border-l);
  display:flex; align-items:center; justify-content:space-between;
  background:var(--surface);
}
.card-title { font-size:15px; font-weight:700; color:var(--text); }
.card-body { padding:20px; }
.mb-4 { margin-bottom:16px; } .mb-6 { margin-bottom:24px; }

/* ── STAT CARDS ─────────────────────────────────────────────── */
.stats-grid {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr));
  gap:14px; margin-bottom:24px;
}
.stat-card {
  background:var(--surface); border:1px solid var(--border-l);
  border-radius:var(--radius-lg); padding:20px 20px 16px;
  box-shadow:var(--shadow); transition:var(--transition);
}
.stat-card:hover { box-shadow:var(--shadow-md); transform:translateY(-1px); }
.stat-header { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:10px; }
.stat-label { font-size:12px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; }
.stat-icon { font-size:20px; opacity:.8; }
.stat-value { font-size:28px; font-weight:800; color:var(--text); letter-spacing:-.5px; line-height:1; margin-bottom:6px; }
.stat-change { font-size:12px; color:var(--muted); }
.stat-change.up { color:var(--success); }
.stat-change.down { color:var(--danger); }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display:inline-flex; align-items:center; gap:6px;
  padding:8px 16px; border-radius:8px;
  font-size:13.5px; font-weight:600; border:none;
  cursor:pointer; font-family:inherit; transition:var(--transition);
  white-space:nowrap; line-height:1.4;
}
.btn-primary { background:var(--primary); color:#fff; box-shadow:0 1px 4px rgba(91,79,233,.3); }
.btn-primary:hover { background:var(--primary-l); box-shadow:0 2px 8px rgba(91,79,233,.35); transform:translateY(-1px); }
.btn-secondary { background:var(--surface); color:var(--text2); border:1px solid var(--border); }
.btn-secondary:hover { background:var(--surface3); color:var(--text); border-color:var(--border); }
.btn-success { background:var(--success); color:#fff; }
.btn-success:hover { opacity:.9; }
.btn-danger { background:var(--danger-dim); color:var(--danger); border:1px solid rgba(255,59,48,.2); }
.btn-danger:hover { background:var(--danger); color:#fff; }
.btn-warning { background:var(--warning-dim); color:var(--warning); border:1px solid rgba(255,159,10,.2); }
.btn-ghost { background:none; color:var(--text2); }
.btn-ghost:hover { background:var(--surface3); color:var(--text); }
.btn-sm { padding:6px 12px; font-size:12px; border-radius:7px; }
.btn-xs { padding:4px 9px; font-size:11px; border-radius:6px; }
.btn-lg { padding:11px 22px; font-size:15px; }
.btn-block { width:100%; justify-content:center; }
.btn:disabled { opacity:.45; cursor:not-allowed; transform:none !important; }

/* ── FORMS ──────────────────────────────────────────────────── */
.form-group { margin-bottom:14px; }
.form-group label, .form-label {
  display:block; font-size:12.5px; font-weight:600;
  color:var(--text2); margin-bottom:5px;
}
.form-control {
  width:100%; padding:9px 12px;
  border:1px solid var(--border); border-radius:var(--radius-sm);
  font-size:13.5px; font-family:inherit;
  background:var(--surface); color:var(--text);
  outline:none; transition:var(--transition);
}
.form-control:focus {
  border-color:var(--primary);
  box-shadow:0 0 0 3px var(--primary-dim);
  background:var(--surface);
}
.form-control::placeholder { color:var(--muted); }
textarea.form-control { resize:vertical; min-height:80px; }
.form-hint { font-size:12px; color:var(--muted); margin-top:4px; line-height:1.5; }
.form-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:20px; padding-top:16px; border-top:1px solid var(--border-l); }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.grid-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; }
.checkbox-row { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.checkbox-row label { margin:0; font-weight:500; }

/* ── TABLES ─────────────────────────────────────────────────── */
.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; }
thead th {
  padding:9px 14px; text-align:left;
  font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  color:var(--muted); background:var(--surface3);
  border-bottom:1px solid var(--border-l); white-space:nowrap;
}
tbody td { padding:11px 14px; border-bottom:1px solid var(--border-l); font-size:13.5px; vertical-align:middle; }
tbody tr:last-child td { border-bottom:none; }
tbody tr:hover { background:var(--surface3); }
.table-empty { text-align:center; padding:48px 24px !important; color:var(--muted); }

/* ── BADGES ─────────────────────────────────────────────────── */
.badge {
  display:inline-flex; align-items:center;
  padding:2px 9px; border-radius:20px;
  font-size:11.5px; font-weight:600; white-space:nowrap;
}
.badge-active,.badge-paid,.badge-connected,.badge-online { background:rgba(52,199,89,.1); color:#1a7f37; border:1px solid rgba(52,199,89,.25); }
.badge-trial,.badge-pending { background:rgba(255,159,10,.1); color:#b45309; border:1px solid rgba(255,159,10,.25); }
.badge-paused,.badge-inactive,.badge-disconnected,.badge-offline { background:var(--surface3); color:var(--muted); border:1px solid var(--border); }
.badge-cancelled,.badge-failed,.badge-urgent { background:rgba(255,59,48,.08); color:#c41230; border:1px solid rgba(255,59,48,.2); }
.badge-high { background:rgba(255,159,10,.1); color:#b45309; border:1px solid rgba(255,159,10,.2); }
.badge-medium,.badge-monthly,.badge-open { background:var(--primary-dim); color:var(--primary); border:1px solid rgba(91,79,233,.2); }
.badge-low,.badge-info { background:var(--info-dim); color:#0055b3; border:1px solid rgba(0,122,255,.2); }
.badge-resolved,.badge-closed { background:rgba(52,199,89,.1); color:#1a7f37; border:1px solid rgba(52,199,89,.2); }
.badge-yearly { background:rgba(52,199,89,.1); color:#1a7f37; border:1px solid rgba(52,199,89,.2); }
.badge-lifetime { background:rgba(255,159,10,.1); color:#b45309; border:1px solid rgba(255,159,10,.2); }
.badge-starter,.badge-none { background:var(--surface3); color:var(--muted); border:1px solid var(--border); }
.badge-growth { background:var(--primary-dim); color:var(--primary); border:1px solid rgba(91,79,233,.2); }
.badge-empire,.badge-superadmin,.badge-admin { background:rgba(255,159,10,.1); color:#b45309; border:1px solid rgba(255,159,10,.2); }

/* ── ALERTS ─────────────────────────────────────────────────── */
.alert {
  padding:11px 14px; border-radius:8px;
  font-size:13.5px; margin-bottom:14px;
  display:flex; gap:9px; align-items:flex-start;
}
.alert-success { background:rgba(52,199,89,.08); border:1px solid rgba(52,199,89,.25); color:#1a7f37; }
.alert-error,.alert-danger { background:var(--danger-dim); border:1px solid rgba(255,59,48,.2); color:#c41230; }
.alert-warning { background:var(--warning-dim); border:1px solid rgba(255,159,10,.25); color:#92400e; }
.alert-info,.alert-primary { background:var(--info-dim); border:1px solid rgba(0,122,255,.2); color:#0055b3; }

/* ── MODALS ─────────────────────────────────────────────────── */
.modal-overlay {
  display:none; position:fixed; inset:0; z-index:1000;
  background:rgba(0,0,0,.35); backdrop-filter:blur(4px);
  align-items:center; justify-content:center; padding:20px;
}
.modal-overlay.open { display:flex; }
.modal {
  background:var(--surface); border-radius:14px;
  box-shadow:var(--shadow-lg); max-width:600px; width:100%;
  max-height:90vh; overflow:hidden; display:flex; flex-direction:column;
  border:1px solid var(--border-l);
}
.modal-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 22px; border-bottom:1px solid var(--border-l);
}
.modal-title { font-size:16px; font-weight:700; }
.modal-close {
  width:30px; height:30px; border-radius:7px;
  border:none; background:var(--surface3); color:var(--text2);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; font-size:15px; transition:var(--transition);
}
.modal-close:hover { background:var(--danger-dim); color:var(--danger); }
#modalBody { overflow-y:auto; padding:22px; flex:1; }
.modal-footer {
  padding:14px 22px; border-top:1px solid var(--border-l);
  display:flex; gap:8px; justify-content:flex-end;
  background:var(--surface3);
}

/* ── LOADING / EMPTY ────────────────────────────────────────── */
.loading { display:flex; align-items:center; justify-content:center; min-height:180px; }
.spinner {
  width:32px; height:32px; border:2.5px solid var(--border);
  border-top-color:var(--primary); border-radius:50%;
  animation:spin .7s linear infinite;
}
@keyframes spin { to { transform:rotate(360deg); } }
.empty-state {
  display:flex; flex-direction:column; align-items:center;
  justify-content:center; padding:56px 24px; text-align:center;
  color:var(--muted);
}
.empty-icon { font-size:44px; margin-bottom:14px; opacity:.6; }
.empty-title { font-size:16px; font-weight:700; color:var(--text2); margin-bottom:5px; }
.empty-text,.empty-sub { font-size:13.5px; max-width:280px; line-height:1.6; }

/* ── FILTERS / PAGINATION ───────────────────────────────────── */
.filters-bar {
  display:flex; align-items:center; gap:10px;
  margin-bottom:16px; flex-wrap:wrap;
}
.filters-bar input, .filters-bar select {
  height:36px; padding:0 11px;
  border:1px solid var(--border); border-radius:8px;
  font-size:13px; background:var(--surface); color:var(--text);
  outline:none; transition:var(--transition); font-family:inherit;
}
.filters-bar input:focus,.filters-bar select:focus { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-dim); }
.pagination { display:flex; align-items:center; gap:8px; margin-top:14px; }
.page-btn {
  padding:5px 12px; border-radius:7px; border:1px solid var(--border);
  background:var(--surface); font-size:13px; cursor:pointer;
  transition:var(--transition); color:var(--text2);
}
.page-btn:hover:not(:disabled) { border-color:var(--primary); color:var(--primary); }
.page-btn:disabled { opacity:.4; cursor:not-allowed; }

/* ── TOAST ──────────────────────────────────────────────────── */
#toastContainer {
  position:fixed; bottom:22px; right:22px; z-index:9999;
  display:flex; flex-direction:column; gap:7px;
}
.toast {
  display:flex; align-items:center; gap:9px;
  padding:11px 15px; border-radius:9px;
  box-shadow:var(--shadow-lg); font-size:13.5px; font-weight:500;
  max-width:340px; background:var(--surface); border:1px solid var(--border-l);
  color:var(--text); animation:toastIn .2s ease;
}
.toast-success { border-left:3px solid var(--success); }
.toast-error   { border-left:3px solid var(--danger); }
.toast-warn    { border-left:3px solid var(--warning); }
.toast-info    { border-left:3px solid var(--primary); }
@keyframes toastIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:none} }

/* ── SETTINGS ───────────────────────────────────────────────── */
.settings-layout { display:grid; grid-template-columns:210px 1fr; gap:18px; align-items:start; }
.settings-nav { background:var(--surface); border:1px solid var(--border-l); border-radius:var(--radius-lg); padding:6px; box-shadow:var(--shadow); }
.settings-nav-item {
  display:flex; align-items:center; gap:9px;
  padding:9px 12px; border-radius:8px;
  font-size:13.5px; font-weight:500; color:var(--text2);
  cursor:pointer; transition:var(--transition);
  width:100%; border:none; background:none; text-align:left; font-family:inherit;
}
.settings-nav-item:hover { background:var(--surface3); color:var(--text); }
.settings-nav-item.active { background:var(--primary-dim); color:var(--primary); font-weight:600; }
.settings-nav-icon { font-size:15px; }

/* ── PAYMENT GATEWAYS ───────────────────────────────────────── */
.gateway-card {
  border:1.5px solid var(--border-l); border-radius:var(--radius-lg);
  padding:18px; transition:var(--transition); margin-bottom:12px;
  background:var(--surface);
}
.gateway-card.active { border-color:var(--primary); background:var(--primary-dim2); }
.gateway-card:hover { border-color:var(--primary); }

/* ── UPLOAD ZONE ────────────────────────────────────────────── */
.upload-zone {
  border:1.5px dashed var(--border); border-radius:var(--radius-lg);
  padding:36px; text-align:center; cursor:pointer;
  transition:var(--transition); background:var(--surface3);
}
.upload-zone:hover,.upload-zone.dragover { border-color:var(--primary); background:var(--primary-dim2); }
.upload-zone-icon { font-size:36px; margin-bottom:10px; }
.upload-zone-title { font-size:14px; font-weight:700; margin-bottom:4px; }
.upload-zone-sub { font-size:12.5px; color:var(--muted); }

/* ── EMBED CODE ─────────────────────────────────────────────── */
.embed-code-box {
  background:#1C1C1E; border-radius:var(--radius);
  padding:14px 16px; font-family:'SF Mono','Fira Code',monospace;
  font-size:12px; color:#a5f3fc; word-break:break-all; position:relative;
  white-space:pre-wrap; line-height:1.7;
}
.embed-copy-btn {
  position:absolute; top:8px; right:8px;
  background:var(--primary); color:#fff;
  border:none; border-radius:6px; padding:4px 10px;
  font-size:11px; font-weight:600; cursor:pointer; font-family:inherit;
  transition:var(--transition);
}
.embed-copy-btn:hover { background:var(--primary-l); }

/* ── CHARTS ─────────────────────────────────────────────────── */
.chart-bars { display:flex; align-items:flex-end; gap:4px; height:120px; padding:0 20px 0; }
.chart-bar { flex:1; background:var(--primary); border-radius:3px 3px 0 0; cursor:pointer; transition:var(--transition); min-height:4px; opacity:.8; }
.chart-bar:hover { opacity:1; transform:scaleY(1.03); }
.chart-labels { display:flex; gap:4px; padding:4px 20px 12px; }
.chart-label { flex:1; text-align:center; font-size:10px; color:var(--muted); }
.legend-item { display:flex; align-items:center; gap:8px; padding:4px 0; font-size:13px; }
.legend-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.donut-wrap { display:flex; align-items:center; gap:24px; padding:20px; }
.donut-svg { flex-shrink:0; }
.donut-legend { flex:1; display:flex; flex-direction:column; gap:2px; }
.donut-svg text { fill:var(--text) !important; }

/* ── HELPERS ────────────────────────────────────────────────── */
.flex { display:flex; }
.items-center { align-items:center; }
.justify-between { justify-content:space-between; }
.gap-2 { gap:8px; } .gap-3 { gap:12px; } .gap-4 { gap:16px; }
.mt-2 { margin-top:8px; } .mt-3 { margin-top:12px; } .mt-4 { margin-top:16px; }
.mb-2 { margin-bottom:8px; } .mb-3 { margin-bottom:12px; }
.text-muted { color:var(--muted); } .text-sm { font-size:12.5px; } .text-xs { font-size:11.5px; }
.text-green { color:var(--success); } .text-blue { color:var(--info); }
.text-amber { color:var(--warning); } .text-red { color:var(--danger); }
.font-bold { font-weight:700; } .font-mono { font-family:'SF Mono','Fira Code',monospace; }
.truncate { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.w-full { width:100%; } .p-4 { padding:16px; } .p-5 { padding:20px; }

/* ── DETAIL ROWS ────────────────────────────────────────────── */
.detail-row { display:flex; align-items:flex-start; gap:10px; padding:8px 0; border-bottom:1px solid var(--border-l); font-size:13.5px; }
.detail-row:last-child { border-bottom:none; }
.detail-label { color:var(--muted); min-width:130px; font-size:12.5px; font-weight:600; flex-shrink:0; }
.detail-value { color:var(--text); font-weight:500; word-break:break-word; }

/* ── PROGRESS ───────────────────────────────────────────────── */
.progress-bar { height:5px; background:var(--surface3); border-radius:3px; overflow:hidden; }
.progress-fill { height:100%; background:linear-gradient(90deg,var(--primary),var(--primary-l)); border-radius:3px; transition:width .4s; }
.progress-fill.red { background:linear-gradient(90deg,var(--danger),#ff6b6b); }
.progress-fill.amber { background:linear-gradient(90deg,var(--warning),#fcd34d); }

/* ── DARK MODE ──────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:        #000000;
  --surface:   #1C1C1E;
  --surface2:  #2C2C2E;
  --surface3:  #3A3A3C;
  --border:    #38383A;
  --border-l:  #48484A;
  --text:      #FFFFFF;
  --text2:     #EBEBF5;
  --muted:     #8E8E93;
  --shadow:    0 2px 8px rgba(0,0,0,.5);
  --shadow-md: 0 8px 24px rgba(0,0,0,.6);
}
[data-theme="dark"] .card { background:var(--surface); border-color:var(--border); }
[data-theme="dark"] .form-control { background:var(--surface2); border-color:var(--border); color:var(--text); }
[data-theme="dark"] .btn-secondary { background:var(--surface2); border-color:var(--border); color:var(--text2); }
[data-theme="dark"] thead th { background:var(--surface2); }
[data-theme="dark"] tbody tr:hover { background:var(--surface2); }
[data-theme="dark"] .modal { background:var(--surface); border-color:var(--border); }
[data-theme="dark"] .modal-footer { background:var(--surface2); }
[data-theme="dark"] .settings-nav { background:var(--surface); border-color:var(--border); }
[data-theme="dark"] .topbar { background:var(--surface); border-color:var(--border); }
[data-theme="dark"] .toast { background:var(--surface); border-color:var(--border); }
[data-theme="dark"] .upload-zone { background:var(--surface2); }
[data-theme="dark"] .gateway-card { background:var(--surface); border-color:var(--border); }
[data-theme="dark"] .gateway-card.active { background:var(--surface2); }
[data-theme="dark"] .stat-card { background:var(--surface); border-color:var(--border); }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media(max-width:768px) {
  :root { --sidebar-w:56px; }
  .nav-item span:not(.nav-icon):not(.nav-badge) { display:none; }
  .sidebar-logo-text,.sidebar-user-name,.sidebar-user-role { display:none; }
  .sidebar-user { justify-content:center; }
  .settings-layout { grid-template-columns:1fr; }
}
