/* ============================================================
   Suusad — design tokens + base styles
   Stripe-warm aesthetic. Cool neutrals, soft borders, depth.
   ============================================================ */

:root {
  /* surfaces */
  --bg: #F6F8FA;
  --surface: #FFFFFF;
  --surface-2: #FAFBFC;
  --surface-hover: #F4F6F8;
  --surface-selected: #EEF2FF;

  /* borders */
  --border: #E3E8EE;
  --border-strong: #C1C9D2;
  --border-subtle: #EBEEF2;

  /* text */
  --text-1: #1A1F36;        /* primary */
  --text-2: #3C4257;        /* body */
  --text-3: #697386;        /* secondary */
  --text-4: #8792A2;        /* muted */
  --text-disabled: #A3ACBA;

  /* primary action (the chosen accent — deep slate) */
  --primary: #1A1F36;
  --primary-hover: #2A2F46;
  --primary-active: #0E1226;
  --on-primary: #FFFFFF;

  /* status (sync) */
  --green: #15803D;
  --green-bg: #DCFCE7;
  --green-soft: #ECFDF3;
  --amber: #B45309;
  --amber-bg: #FEF3C7;
  --amber-soft: #FEFAEC;
  --red: #B42318;
  --red-bg: #FEE4E2;
  --red-soft: #FEF3F2;
  --blue: #1849A9;
  --blue-bg: #DBEAFE;
  --blue-soft: #EFF6FF;
  --grey: #667085;
  --grey-bg: #EAECF0;
  --grey-soft: #F4F6F8;

  /* depth */
  --shadow-xs: 0 1px 1px rgba(16, 24, 40, 0.04), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 2px 4px rgba(16, 24, 40, 0.06), 0 4px 12px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 6px 16px rgba(16, 24, 40, 0.08), 0 12px 32px rgba(16, 24, 40, 0.10);
  --shadow-btn-primary: 0 1px 1px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.18) inset, 0 -1px 0 rgba(0,0,0,0.15) inset;

  /* radius */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;

  /* type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body, #root {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01", "ss03";
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a { color: inherit; text-decoration: none; }

/* numbers tabular by default for tables */
.num, td.num, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }

/* ============================================================
   App chrome
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  background: #FFFFFF;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.sidebar-brand-mark {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: var(--text-1);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.sidebar-brand-mark svg { display: block; }
.sidebar-brand-name {
  font-weight: 600;
  letter-spacing: -0.011em;
  font-size: 14px;
  color: var(--text-1);
}
.sidebar-brand-env {
  margin-left: auto;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-4);
  font-weight: 600;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
}

.sidebar-section {
  padding: 10px 10px 4px;
}
.sidebar-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-4);
  font-weight: 600;
  padding: 6px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--text-2);
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 1px;
  user-select: none;
}
.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text-1);
}
.nav-item.active {
  background: #F1F5F9;
  color: var(--text-1);
  font-weight: 600;
}
.nav-item .icon {
  width: 16px; height: 16px;
  color: var(--text-3);
  flex-shrink: 0;
}
.nav-item.active .icon { color: var(--text-1); }
.nav-item-badge {
  margin-left: auto;
  background: var(--amber-bg);
  color: var(--amber);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.4;
}
.nav-sub {
  display: flex;
  align-items: center;
  padding: 4px 8px 4px 33px;
  font-size: 12.5px;
  color: var(--text-3);
  border-radius: var(--r-sm);
  cursor: pointer;
  margin-bottom: 1px;
}
.nav-sub:hover { color: var(--text-1); background: var(--surface-hover); }
.nav-sub.active { color: var(--text-1); font-weight: 600; }

.sidebar-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 8px 12px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-4);
}

/* topbar */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background: var(--bg);
}
.topbar {
  height: 52px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  padding: 0 22px;
  gap: 16px;
  flex-shrink: 0;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font-size: 13px;
}
.breadcrumb .crumb-sep { color: var(--text-4); }
.breadcrumb .crumb-current { color: var(--text-1); font-weight: 500; }

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  padding: 5px 10px;
  width: 260px;
  color: var(--text-3);
  font-size: 12.5px;
  cursor: text;
}
.topbar-search .kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0 5px;
  border-radius: 3px;
  color: var(--text-4);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 9px 3px 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
}
.user-chip:hover { background: var(--surface-hover); }
.user-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8B5CF6, #EC4899);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 10.5px;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 80px;
}
.content-wide { max-width: 1400px; }

/* ============================================================
   Page header
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 16px;
}
.page-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.018em;
  color: var(--text-1);
  margin: 0 0 2px;
  line-height: 1.2;
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-3);
  margin: 0;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--r-md);
  padding: 0 12px;
  height: 30px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-2);
  white-space: nowrap;
  transition: background 80ms, border-color 80ms, color 80ms;
  font-variant-numeric: tabular-nums;
  user-select: none;
}
.btn .icon { width: 14px; height: 14px; }
.btn:focus-visible {
  outline: 2px solid #93C5FD;
  outline-offset: 1px;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-btn-primary);
  border-color: transparent;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}
.btn-primary:disabled,
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-2);
  box-shadow: var(--shadow-xs);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--border-strong); }

.btn-quiet {
  background: transparent;
  color: var(--text-2);
}
.btn-quiet:hover:not(:disabled) { background: var(--surface-hover); }

.btn-danger {
  background: var(--surface);
  border-color: var(--border);
  color: var(--red);
  box-shadow: var(--shadow-xs);
}
.btn-danger:hover:not(:disabled) { background: var(--red-soft); border-color: #FCA5A5; }

.btn-link {
  background: transparent;
  color: var(--text-1);
  padding: 0;
  height: auto;
  text-decoration: underline;
  text-decoration-color: var(--text-4);
  text-underline-offset: 3px;
}
.btn-link:hover { text-decoration-color: var(--text-1); }

.btn-sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn-lg { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ============================================================
   Inputs
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
.field-help {
  font-size: 11.5px;
  color: var(--text-4);
  line-height: 1.4;
}
.field-error {
  font-size: 11.5px;
  color: var(--red);
}

.input, .select, .textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 6px 10px;
  height: 32px;
  font-size: 13px;
  color: var(--text-1);
  width: 100%;
  box-shadow: 0 1px 1px rgba(16,24,40,0.04);
  transition: border-color 80ms, box-shadow 80ms;
  font-feature-settings: "tnum" 1;
}
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input:hover, .select:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: #6E83C9;
  box-shadow: 0 0 0 3px rgba(70,93,168,0.18);
}
.textarea {
  min-height: 80px;
  height: auto;
  padding: 8px 10px;
  resize: vertical;
}
.input-mono { font-family: var(--font-mono); font-size: 12.5px; }
.input-lg { height: 38px; font-size: 14px; }
.input-error { border-color: var(--red); }
.input-error:focus { box-shadow: 0 0 0 3px rgba(180,35,24,0.15); }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap .input-icon-left {
  position: absolute;
  left: 9px;
  color: var(--text-4);
  width: 14px; height: 14px;
  pointer-events: none;
}
.input-wrap .input-icon-left ~ .input { padding-left: 30px; }
.input-wrap .input-icon-right {
  position: absolute;
  right: 9px;
  color: var(--text-4);
  width: 14px; height: 14px;
  cursor: pointer;
}

/* checkbox + radio */
.checkbox, .radio {
  appearance: none;
  width: 14px; height: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--surface);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
  transition: background 80ms, border-color 80ms;
}
.radio { border-radius: 50%; }
.checkbox:hover, .radio:hover { border-color: var(--text-3); }
.checkbox:checked, .radio:checked {
  background: var(--primary);
  border-color: var(--primary);
}
.checkbox:checked::after {
  content: "";
  width: 8px; height: 5px;
  border-left: 1.6px solid white;
  border-bottom: 1.6px solid white;
  transform: rotate(-45deg) translate(0.5px, -0.5px);
}
.radio:checked::after {
  content: "";
  width: 5px; height: 5px;
  background: white;
  border-radius: 50%;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 3px 0;
  font-size: 13px;
  color: var(--text-2);
}

/* ============================================================
   Pills + status
   ============================================================ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1;
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.pill-green { background: var(--green-soft); color: var(--green); border-color: #BBF7D0; }
.pill-green .pill-dot { background: var(--green); }
.pill-amber { background: var(--amber-soft); color: var(--amber); border-color: #FDE68A; }
.pill-amber .pill-dot { background: var(--amber); }
.pill-red { background: var(--red-soft); color: var(--red); border-color: #FECACA; }
.pill-red .pill-dot { background: var(--red); }
.pill-blue { background: var(--blue-soft); color: var(--blue); border-color: #BFDBFE; }
.pill-blue .pill-dot { background: var(--blue); }
.pill-grey { background: var(--grey-soft); color: var(--text-3); border-color: var(--border); }
.pill-grey .pill-dot { background: var(--text-3); }

/* sync channel badge */
.sync-chip {
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 20px;
  padding: 0;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}
.sync-chip:hover { border-color: var(--border-strong); }
.sync-chip-label {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 0 5px;
  color: var(--text-3);
  display: grid;
  place-items: center;
  height: 100%;
}
.sync-chip-glyph {
  padding: 0 6px;
  display: grid;
  place-items: center;
  height: 100%;
}
.sync-chip-green { background: var(--green-soft); }
.sync-chip-green .sync-chip-glyph { color: var(--green); }
.sync-chip-amber { background: var(--amber-soft); }
.sync-chip-amber .sync-chip-glyph { color: var(--amber); }
.sync-chip-red { background: var(--red-soft); }
.sync-chip-red .sync-chip-glyph { color: var(--red); }
.sync-chip-grey .sync-chip-glyph { color: var(--text-4); }
.sync-chip-blue { background: var(--blue-soft); }
.sync-chip-blue .sync-chip-glyph { color: var(--blue); }

.sync-chips-row { display: inline-flex; gap: 4px; }

/* ============================================================
   Cards / panels
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.card-pad { padding: 18px 18px; }
.card-pad-lg { padding: 22px 22px; }
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-1);
  margin: 0;
  letter-spacing: -0.005em;
}
.card-subtitle {
  font-size: 12px;
  color: var(--text-3);
  margin: 2px 0 0;
}
.card-body { padding: 16px 18px; }
.card-section {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.card-section:last-child { border-bottom: 0; }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-weight: 600;
  color: var(--text-3);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 12px;
  position: sticky;
  top: 0;
  z-index: 1;
}
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--text-1); }
.tbl td {
  border-bottom: 1px solid var(--border-subtle);
  padding: 7px 12px;
  font-size: 12.5px;
  color: var(--text-2);
  vertical-align: middle;
  height: 40px;
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--surface-hover); }
.tbl tr.selected td { background: var(--surface-selected); }
.tbl td.right, .tbl th.right { text-align: right; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td.compact, .tbl th.compact { width: 1%; white-space: nowrap; }

/* product image thumbnails */
.thumb {
  width: 32px; height: 32px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--text-4);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.thumb-lg { width: 48px; height: 48px; border-radius: 6px; }

/* ============================================================
   KPI cards
   ============================================================ */
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.kpi-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.kpi-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.02em;
  font-feature-settings: "tnum" 1;
  margin: 2px 0 1px;
}
.kpi-delta {
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  color: var(--text-3);
}
.kpi-delta-up { color: var(--green); }
.kpi-delta-down { color: var(--red); }

/* ============================================================
   Tabs
   ============================================================ */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  padding: 0 2px;
}
.tab {
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.tab:hover { color: var(--text-1); }
.tab.active {
  color: var(--text-1);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.tab-count {
  background: var(--grey-bg);
  color: var(--text-3);
  font-size: 11px;
  padding: 0 5px;
  border-radius: 8px;
  font-weight: 600;
  min-width: 16px;
  text-align: center;
}
.tab.active .tab-count {
  background: var(--text-1);
  color: white;
}

/* ============================================================
   Sticky save bar
   ============================================================ */
.sticky-savebar {
  position: sticky;
  bottom: 16px;
  margin: 24px 0 0;
  background: var(--text-1);
  color: white;
  border-radius: var(--r-lg);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.sticky-savebar .savebar-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.sticky-savebar .savebar-msg .pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #FDE68A;
}
.sticky-savebar .savebar-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.sticky-savebar .btn-ghost {
  background: transparent;
  border-color: rgba(255,255,255,0.2);
  color: white;
  box-shadow: none;
}
.sticky-savebar .btn-ghost:hover { background: rgba(255,255,255,0.08); }
.sticky-savebar .btn-primary {
  background: white;
  color: var(--text-1);
  box-shadow: none;
}
.sticky-savebar .btn-primary:hover { background: #F4F6F8; }

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

/* ============================================================
   Toasts
   ============================================================ */
.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
}
.toast {
  background: var(--text-1);
  color: white;
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 12.5px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 240px;
  animation: toastIn 200ms cubic-bezier(0.16,1,0.3,1);
  pointer-events: auto;
}
.toast .icon { width: 14px; height: 14px; flex-shrink: 0; }
.toast-success .icon { color: #4ADE80; }
.toast-error .icon { color: #F87171; }
.toast-info .icon { color: #93C5FD; }
@keyframes toastIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   Banners (alerts)
   ============================================================ */
.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 12.5px;
  border: 1px solid transparent;
  margin-bottom: 16px;
}
.banner .icon { width: 16px; height: 16px; flex-shrink: 0; }
.banner-info { background: var(--blue-soft); color: var(--blue); border-color: #BFDBFE; }
.banner-warn { background: var(--amber-soft); color: var(--amber); border-color: #FDE68A; }
.banner-error { background: var(--red-soft); color: var(--red); border-color: #FECACA; }
.banner-action { margin-left: auto; }

/* ============================================================
   Modal
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 32px;
  animation: fadeIn 120ms;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  width: 100%;
  overflow: hidden;
  animation: modalIn 180ms cubic-bezier(0.16,1,0.3,1);
}
.modal-lg { max-width: 720px; }
@keyframes modalIn {
  from { transform: translateY(8px) scale(0.99); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-weight: 600; font-size: 14px; color: var(--text-1); margin: 0; }
.modal-body { padding: 18px 20px; color: var(--text-2); font-size: 13px; line-height: 1.5; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-2);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ============================================================
   Drawer (slide-from-right)
   ============================================================ */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.3);
  z-index: 80;
  animation: fadeIn 120ms;
}
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 380px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  z-index: 81;
  display: flex;
  flex-direction: column;
  animation: drawerIn 200ms cubic-bezier(0.16,1,0.3,1);
}
@keyframes drawerIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.drawer-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 18px; }
.drawer-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  gap: 8px;
}

/* ============================================================
   Misc utilities
   ============================================================ */
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--border-subtle); margin: 12px 0; }
.muted { color: var(--text-3); }
.muted-2 { color: var(--text-4); }

.icon-btn {
  width: 28px; height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  color: var(--text-3);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text-1); }
.icon-btn .icon { width: 15px; height: 15px; }

.section-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.section-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.section-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* fancy login bg */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.06), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.05), transparent 40%),
    var(--bg);
  padding: 32px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  width: 380px;
  box-shadow: var(--shadow-lg);
  padding: 28px 28px 24px;
}

/* drop-shadow that suggests bedrock under the card */
.login-shell {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* small inline keystroke */
.kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 3px;
  color: var(--text-3);
  line-height: 1.4;
}
