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

:root {
  --bg: #09090b;
  --bg-subtle: #0f0f12;
  --surface: #141419;
  --surface-hover: #1a1a22;
  --surface-raised: #1e1e27;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-muted: rgba(99, 102, 241, 0.12);
  --accent: #f59e0b;
  --accent-muted: rgba(245, 158, 11, 0.12);
  --success: #22c55e;
  --success-muted: rgba(34, 197, 94, 0.12);
  --danger: #ef4444;
  --danger-muted: rgba(239, 68, 68, 0.12);
  --warning: #eab308;
  --sidebar-w-collapsed: 72px;
  --sidebar-w-expanded: 260px;
  --sidebar-w: var(--sidebar-w-collapsed);
  --header-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.25);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ── App shell ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w-collapsed);
  background: var(--bg-subtle);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow: hidden;
  transition: width 0.22s ease, transform 0.25s ease, box-shadow 0.22s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  text-decoration: none;
  color: var(--text);
  min-height: 68px;
  flex-shrink: 0;
}

.sidebar-brand-text {
  overflow: hidden;
  white-space: nowrap;
  min-width: 0;
}

.brand-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff;
  flex-shrink: 0;
}

.brand-text { font-weight: 700; font-size: 15px; letter-spacing: -0.02em; }
.brand-sub { font-size: 11px; color: var(--text-muted); font-weight: 400; }

.sidebar-nav {
  flex: 1;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 16px 10px 6px;
  white-space: nowrap;
  overflow: hidden;
  max-height: 36px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  transition: background 0.15s, color 0.15s, padding 0.22s ease;
  white-space: nowrap;
}

.nav-label {
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.nav-item svg { width: 18px; height: 18px; opacity: .7; flex-shrink: 0; }
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active {
  background: var(--primary-muted);
  color: var(--primary-hover);
}
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: 12px 10px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.demo-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--accent-muted);
  border: 1px solid rgba(245,158,11,.2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  justify-content: center;
}

.demo-pill-label {
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.18s ease;
}

/* ── Desktop sidebar: collapsed rail, expand on hover or when pinned ── */
@media (min-width: 769px) {
  .sidebar-brand-text,
  .nav-label,
  .demo-pill-label {
    opacity: 0;
    pointer-events: none;
  }

  .nav-section-label {
    opacity: 0;
    max-height: 0;
    padding-top: 8px;
    padding-bottom: 0;
    overflow: hidden;
  }

  .nav-item {
    justify-content: center;
  }

  .sidebar:hover,
  .app-shell.sidebar-pinned .sidebar {
    width: var(--sidebar-w-expanded);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35);
  }

  .sidebar:hover .sidebar-brand-text,
  .sidebar:hover .nav-label,
  .sidebar:hover .demo-pill-label,
  .app-shell.sidebar-pinned .sidebar-brand-text,
  .app-shell.sidebar-pinned .nav-label,
  .app-shell.sidebar-pinned .demo-pill-label {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar:hover .nav-section-label,
  .app-shell.sidebar-pinned .nav-section-label {
    opacity: 1;
    max-height: 36px;
    padding-top: 16px;
    padding-bottom: 6px;
  }

  .sidebar:hover .nav-item,
  .app-shell.sidebar-pinned .nav-item {
    justify-content: flex-start;
    padding-left: 12px;
    padding-right: 12px;
  }

  .sidebar:hover .sidebar-brand,
  .app-shell.sidebar-pinned .sidebar-brand {
    padding-left: 20px;
    padding-right: 20px;
  }

  .sidebar:hover .demo-pill,
  .app-shell.sidebar-pinned .demo-pill {
    justify-content: flex-start;
    padding-left: 12px;
  }

  .main-wrap {
    margin-left: var(--sidebar-w-collapsed);
    transition: margin-left 0.22s ease;
  }

  .app-shell:has(.sidebar:hover) .main-wrap,
  .app-shell.sidebar-pinned .main-wrap {
    margin-left: var(--sidebar-w-expanded);
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .menu-toggle.is-pinned {
    background: var(--primary-muted);
    border-color: rgba(99, 102, 241, 0.35);
    color: var(--primary-hover);
  }
}

.demo-dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* ── Main content ── */
.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-w-collapsed);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  overflow-x: hidden;
  transition: margin-left 0.22s ease;
}

.topbar {
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: rgba(9,9,11,.8);
  backdrop-filter: blur(12px);
  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: 12px; }
.menu-toggle {
  display: none;
  background: none; border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 6px 8px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.page-content {
  flex: 1;
  padding: 28px 32px 40px;
  max-width: 1440px;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.page-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-header .subtitle {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb-sep { opacity: .4; }

/* ── Stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color .15s;
}

.stat-card:hover { border-color: var(--border-strong); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--stat-accent, var(--primary));
  opacity: .8;
}

.stat-card.blue { --stat-accent: #6366f1; }
.stat-card.amber { --stat-accent: #f59e0b; }
.stat-card.green { --stat-accent: #22c55e; }
.stat-card.purple { --stat-accent: #a855f7; }

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── Layout grids ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.grid-sidebar-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.grid-sidebar-layout > * { min-width: 0; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.card-header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-body { padding: 20px; }
.card-body.flush { padding: 0; }

.card + .card { margin-top: 20px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  transition: background .15s, border-color .15s, transform .1s;
  white-space: nowrap;
}

.btn:hover { background: var(--surface-hover); border-color: rgba(255,255,255,.2); }
.btn:active { transform: scale(.98); }

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 600;
}
.btn.accent:hover { filter: brightness(1.08); }

.btn.danger {
  background: var(--danger-muted);
  border-color: rgba(239,68,68,.3);
  color: #fca5a5;
}
.btn.danger:hover { background: rgba(239,68,68,.2); }

.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.large { padding: 11px 20px; font-size: 14px; }
.btn.icon-only { padding: 8px; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead th {
  text-align: left;
  padding: 10px 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-hover); }
.mapping-row { cursor: pointer; }
.mapping-row-new { background: rgba(99,102,241,.08); }
.mapping-row .td-link { color: inherit; text-decoration: none; display: block; }

.td-primary { font-weight: 500; color: var(--text); }
.td-secondary { color: var(--text-secondary); font-size: 13px; }

/* ── Status badges ── */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.01em;
}

.status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .7;
}

.status.new { background: rgba(99,102,241,.15); color: #a5b4fc; }
.status.prepared, .status.payment_pending { background: rgba(245,158,11,.15); color: #fcd34d; }
.status.placed, .status.shipped, .status.fulfilled { background: rgba(34,197,94,.15); color: #86efac; }
.status.error, .status.cancelled { background: rgba(239,68,68,.15); color: #fca5a5; }
.status.ready { background: rgba(99,102,241,.15); color: #a5b4fc; }
.status.draft { background: rgba(161,161,170,.12); color: #d4d4d8; }
.status.published { background: rgba(34,197,94,.15); color: #86efac; }
.status.active_on_ebay { background: rgba(34,197,94,.15); color: #86efac; }
.status.synced { background: rgba(34,197,94,.15); color: #86efac; }
.status.active { background: rgba(34,197,94,.15); color: #86efac; }
.status.unpublished { background: rgba(245,158,11,.15); color: #fcd34d; }
.status.ended, .status.inactive { background: rgba(161,161,170,.12); color: #d4d4d8; }
.listing-preview { font-size: 14px; line-height: 1.5; max-width: 100%; overflow-x: auto; }
.listing-preview img { max-width: 100%; height: auto; border-radius: 8px; display: block; }
.listing-preview table { max-width: 100%; table-layout: fixed; word-break: break-word; }

.image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 100%;
}

.image-gallery a {
  flex: 0 0 auto;
  display: block;
}

.image-gallery img,
.image-strip img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

.image-strip img {
  width: 64px;
  height: 64px;
}

/* ── Filters ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.chip {
  padding: 5px 12px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  transition: all .15s;
}

.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--primary-muted); border-color: rgba(99,102,241,.4); color: var(--primary-hover); }

.orders-toolbar {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.orders-search {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 520px;
}

.orders-search input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

.orders-search input[type="search"]:focus {
  outline: none;
  border-color: rgba(99,102,241,.5);
}

/* ── Detail lists ── */
.detail-grid {
  display: grid;
  gap: 14px;
}

.detail-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  align-items: baseline;
}

.detail-row dt { color: var(--text-muted); font-size: 13px; font-weight: 500; margin: 0; }
.detail-row dd { margin: 0; font-size: 13.5px; }

.detail-list { display: grid; gap: 14px; margin: 0; }
.detail-list dt { color: var(--text-muted); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.detail-list dd { margin: 2px 0 0; font-size: 14px; }

/* ── Forms ── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-grid .full-width { grid-column: 1 / -1; }

.form-grid label, .form-vertical label, .field label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-grid input, .form-grid select,
.form-vertical input, .form-vertical textarea,
.field input, .field textarea, .inline-form input {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}

.form-grid input:focus, .form-vertical input:focus,
.form-vertical textarea:focus, .field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-muted);
}

.form-vertical { display: flex; flex-direction: column; gap: 16px; }

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}

.title-counter {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.title-counter.over-limit { color: var(--danger, #ef4444); }

.form-vertical input.input-invalid,
.form-vertical textarea.input-invalid {
  border-color: var(--danger, #ef4444);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35);
}

.field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.field-hint-error { color: var(--danger, #ef4444); }

.publish-blockers {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  margin-bottom: 12px;
}

.publish-blockers ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }

.import-bar {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.import-bar .field { flex: 1; }
.import-bar .field-markup { width: 120px; flex-shrink: 0; }

/* ── Alerts ── */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 13.5px;
  border: 1px solid;
}

.alert.success { background: var(--success-muted); border-color: rgba(34,197,94,.25); color: #86efac; }
.alert.error { background: var(--danger-muted); border-color: rgba(239,68,68,.25); color: #fca5a5; }
.alert.info { background: var(--primary-muted); border-color: rgba(99,102,241,.25); color: #a5b4fc; }

/* ── Workflow steps ── */
.steps { display: flex; flex-direction: column; gap: 0; }

.step {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.step:last-child { border-bottom: none; padding-bottom: 0; }

.step-num {
  width: 28px; height: 28px;
  background: var(--primary-muted);
  color: var(--primary-hover);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}

.step-content strong { display: block; font-size: 13.5px; margin-bottom: 2px; }
.step-content span { font-size: 13px; color: var(--text-secondary); }

/* ── Connection cards ── */
.conn-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.conn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.conn-logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}

.conn-logo.ebay { background: rgba(227,28,36,.15); color: #f87171; }
.conn-logo.ali { background: rgba(245,158,11,.15); color: #fbbf24; }

.conn-title { font-weight: 600; font-size: 15px; }
.conn-sub { font-size: 12px; color: var(--text-muted); }

.conn-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.conn-actions form { margin: 0; }

/* ── Action panel (order detail sidebar) ── */
.action-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.action-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
}

.action-panel-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-panel-body form { display: contents; }
.action-panel-body .btn { width: 100%; justify-content: center; }

.action-panel-note {
  padding: 12px 20px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  width: 48px; height: 48px;
  background: var(--surface-raised);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 22px;
}

.empty-state h3 { margin: 0 0 6px; color: var(--text-secondary); font-size: 15px; }
.empty-state p { margin: 0 0 16px; font-size: 13px; }

/* ── Misc ── */
code {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: #c4b5fd;
}

.positive { color: var(--success); font-weight: 600; }
.negative { color: var(--danger); font-weight: 600; }
.muted { color: var(--text-muted); }
.hint { font-size: 12.5px; color: var(--text-muted); margin-top: 12px; line-height: 1.5; }
.note { color: var(--accent); }

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.inline-form input { flex: 1; }

.image-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; max-width: 100%; }

.thumb {
  width: 72px; height: 72px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-muted);
}

.links { list-style: none; padding: 0; margin: 0; }
.links li { margin-bottom: 8px; }
.links a { color: var(--primary-hover); text-decoration: none; font-size: 13.5px; }
.links a:hover { text-decoration: underline; }

.address-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.margin-display {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* ── Overlay (mobile sidebar) ── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 90;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-sidebar-layout { grid-template-columns: 1fr; }
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.user-avatar {
  width: 32px; height: 32px;
  background: var(--primary-muted);
  color: var(--primary-hover);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: 13px; font-weight: 600; }
.user-email { font-size: 11px; color: var(--text-muted); }

/* ── Auth pages ── */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,.12) 0%, transparent 55%);
}

.auth-page {
  width: 100%;
  max-width: 420px;
  padding: 24px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.auth-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.auth-subtitle {
  margin: 0 0 24px;
  color: var(--text-secondary);
  font-size: 14px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.auth-form input {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-muted);
}

.auth-submit { width: 100%; margin-top: 4px; }

.auth-footer {
  margin: 20px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-footer a { color: var(--primary-hover); text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .user-info { display: none; }
}

@media (max-width: 768px) {
  .sidebar {
    width: var(--sidebar-w-expanded);
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open .sidebar-brand-text,
  .sidebar.open .nav-label,
  .sidebar.open .demo-pill-label,
  .sidebar.open .nav-section-label {
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar.open .nav-section-label {
    max-height: 36px;
    padding-top: 16px;
    padding-bottom: 6px;
  }
  .sidebar.open .nav-item {
    justify-content: flex-start;
    padding-left: 12px;
    padding-right: 12px;
  }
  .sidebar.open .sidebar-brand {
    padding-left: 20px;
    padding-right: 20px;
  }
  .sidebar.open .demo-pill {
    justify-content: flex-start;
    padding-left: 12px;
  }
  .sidebar-overlay.open { display: block; }
  .main-wrap { margin-left: 0; }
  .menu-toggle { display: flex; align-items: center; justify-content: center; }
  .page-content { padding: 20px 16px 32px; }
  .grid-2, .form-grid, .form-row, .stats-grid { grid-template-columns: 1fr; }
  .import-bar { flex-direction: column; align-items: stretch; }
  .import-bar .field-markup { width: 100%; }
  .detail-row { grid-template-columns: 1fr; gap: 4px; }
}
