/* ==========================================================================
   Form C Plus Dashboard — design system
   Tokens, layout chrome, and component vocabulary for admin + client areas.
   Mirrors the landing page (assets/css/home.css). Single source of truth.
   ========================================================================== */

:root {
  /* Surfaces */
  --bg:        #FBF7F2;
  --bg-2:      #F4EEE6;
  --card:      #FFFFFF;

  /* Ink */
  --ink:       #1A1613;
  --ink-2:     #3D342D;
  --muted:     #7A6B5F;

  /* Lines */
  --line:      #E6DDD1;
  --line-2:    #D9CCB9;

  /* Accent (orange = admin default; client area overrides via inline style) */
  --accent:        #F39240;
  --accent-2:      #E47A23;
  --accent-soft:   #FFE5CE;
  --accent-ink:    #8a4a15;

  /* Status */
  --green:     #2F7D5B;
  --green-bg:  #e8f1ec;
  --red:       #B84A3A;
  --red-bg:    #f4e0db;
  --amber:     #A6691A;
  --amber-bg:  #fbefe1;
  --info:      #2B5A8C;
  --info-bg:   #e1ecf6;

  /* Radii */
  --radius:    14px;
  --radius-lg: 22px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(26,22,19,.04), 0 1px 1px rgba(26,22,19,.03);
  --shadow-md: 0 4px 12px rgba(26,22,19,.06), 0 2px 4px rgba(26,22,19,.04);
  --shadow-lg: 0 24px 48px -12px rgba(26,22,19,.14), 0 8px 16px -4px rgba(26,22,19,.06);

  /* Type */
  --font-display: "Fraunces", "Times New Roman", Georgia, serif;
  --font-sans:    "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Layout */
  --sidebar-w: 64px;
}

body.sidebar-expanded { --sidebar-w: 260px; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* ==========================================================================
   Type
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 450;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
  color: var(--ink);
}
h1 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.025em; }
h2 { font-size: clamp(22px, 2.4vw, 28px); }
h3 { font-size: 20px; font-weight: 500; letter-spacing: -0.018em; }
h4 { font-size: 17px; font-weight: 500; letter-spacing: -0.012em; }
h5 { font-size: 15px; font-weight: 500; }
h6 { font-size: 13px; font-weight: 500; letter-spacing: 0; }
p  { margin: 0; }

.serif-em { font-family: var(--font-display); font-style: italic; font-weight: 400; }

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--ink-2);
}

pre {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  color: var(--ink-2);
  line-height: 1.5;
}

/* ==========================================================================
   Eyebrow
   ========================================================================== */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}
.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(243,146,64,.15);
}

/* ==========================================================================
   Layout chrome
   ========================================================================== */

#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  z-index: 50;
  overflow: visible;
  transition: width 200ms ease;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 14px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}
.sidebar-brand .brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.sidebar-brand img { height: 36px; width: auto; flex-shrink: 0; }
.sidebar-brand .brand-text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  opacity: 1;
  transition: opacity 150ms ease;
}
.sidebar-brand .brand-text .plus { color: var(--accent); }

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--muted);
  flex-shrink: 0;
  transition: color 150ms ease, background 150ms ease;
}
.sidebar-toggle:hover { color: var(--ink); background: var(--card); }

#sidebar nav {
  flex: 1;
  padding: 10px 8px;
  overflow-y: auto;
}
body:not(.sidebar-expanded) #sidebar nav { overflow: visible; }

.nav-section-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 12px 6px;
  white-space: nowrap;
  overflow: hidden;
  opacity: 1;
  transition: opacity 150ms ease;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--ink-2);
  transition: background 150ms ease, color 150ms ease;
}
.nav-item i {
  font-size: 17px;
  color: var(--muted);
  flex-shrink: 0;
  transition: color 150ms ease;
}
.nav-item:hover { background: var(--card); color: var(--ink); }
.nav-item:hover i { color: var(--ink-2); }
.nav-item.active {
  background: var(--card);
  color: var(--ink);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.nav-item.active i { color: var(--accent); }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.nav-label {
  white-space: nowrap;
  overflow: hidden;
  opacity: 1;
  transition: opacity 150ms ease;
}

body:not(.sidebar-expanded) #sidebar .nav-label,
body:not(.sidebar-expanded) #sidebar .brand-text { opacity: 0; width: 0; }

body:not(.sidebar-expanded) #sidebar .nav-section-title {
  opacity: 0; width: 0; height: 0; padding: 0; margin: 0; overflow: hidden;
}

body:not(.sidebar-expanded) .nav-item.active::before { left: -4px; }

/* Tooltip when collapsed */
.nav-tooltip {
  display: none;
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--ink);
  color: #FBF7F2;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}
body:not(.sidebar-expanded) .nav-item:hover .nav-tooltip { display: block; }

.sidebar-divider {
  border-top: 1px solid var(--line);
  margin: 12px 12px;
}

.sidebar-footer {
  flex-shrink: 0;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
  overflow: hidden;
  min-height: 56px;
}
.sidebar-footer .label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.sidebar-footer .name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  overflow: hidden;
}
body:not(.sidebar-expanded) .sidebar-footer .label,
body:not(.sidebar-expanded) .sidebar-footer .name { opacity: 0; }

/* Main content */
#mainContent {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg);
  transition: margin-left 200ms ease;
}
.content-wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px 64px;
}

/* Mobile top bar */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 40;
}
.mobile-topbar img { height: 40px; }
.mobile-topbar button {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-2);
}

#sidebarOverlay {
  position: fixed; inset: 0;
  background: rgba(26,22,19,.45);
  z-index: 45;
  display: none;
}
#sidebarOverlay.active { display: block; }

@media (max-width: 1023px) {
  .mobile-topbar { display: flex; }
  #sidebar {
    width: 260px;
    transform: translateX(-100%);
    z-index: 60;
    transition: transform 200ms ease;
  }
  #sidebar.open { transform: translateX(0); }
  #mainContent { margin-left: 0; padding-top: 56px; }
  .content-wrap { padding: 0 20px 48px; }
  .nav-tooltip { display: none !important; }
  body:not(.sidebar-expanded) #sidebar .nav-label,
  body:not(.sidebar-expanded) #sidebar .brand-text,
  body:not(.sidebar-expanded) .sidebar-footer .label,
  body:not(.sidebar-expanded) .sidebar-footer .name { opacity: 1; width: auto; }
  body:not(.sidebar-expanded) #sidebar .nav-section-title {
    opacity: 1; width: auto; height: auto; padding: 14px 12px 6px;
  }
}

/* Scrollbar — warm cream variant */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) var(--bg); }
#sidebar::-webkit-scrollbar { width: 4px; }

/* Focus ring */
*:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(243,146,64,.25);
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* ==========================================================================
   Page header
   ========================================================================== */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
.page-header h1 { margin: 14px 0 0; }
.page-header .lede {
  color: var(--ink-2);
  font-size: 15px;
  margin-top: 8px;
  max-width: 620px;
}
.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
@media (max-width: 760px) {
  .page-header { flex-direction: column; align-items: stretch; }
}

/* Section divider with eyebrow */
.section-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 40px 0 20px;
}
.section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-2);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 14px;
  border: 1px solid transparent;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
  white-space: nowrap;
  cursor: pointer;
  font-family: var(--font-sans);
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg, .btn i { flex: 0 0 auto; }
.btn-sm { padding: 7px 13px; font-size: 12.5px; }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--ink);
  color: #FBF7F2;
}
.btn-primary:hover:not(:disabled) {
  background: #2a221c;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -10px rgba(26,22,19,.4);
}

.btn-accent {
  background: var(--accent);
  color: var(--ink);
}
.btn-accent:hover:not(:disabled) {
  background: var(--accent-2);
  color: #fff;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-2);
  color: var(--ink);
}
.btn-ghost:hover:not(:disabled) { background: var(--card); border-color: var(--ink); }

.btn-danger {
  background: var(--card);
  border-color: var(--red);
  color: var(--red);
}
.btn-danger:hover:not(:disabled) { background: var(--red); color: #fff; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  transition: all .15s ease;
}
.btn-icon:hover { color: var(--ink); border-color: var(--line-2); background: var(--bg-2); }
.btn-icon.danger:hover { color: var(--red); border-color: var(--red); background: var(--red-bg); }

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-soft { background: var(--bg-2); }
.card-dark {
  background: var(--ink);
  color: #FBF7F2;
  border-color: #3a2f27;
}
.card-dark h1, .card-dark h2, .card-dark h3 { color: #fff; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.card-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.018em;
}
.card-header .subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.card-body { padding: 24px; }
.card-body.tight { padding: 16px 24px; }

/* Card with pre-built header (used as wrapper) */
.card-flush {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* ==========================================================================
   Stat cards
   ========================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 980px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stats-grid { grid-template-columns: 1fr; } }

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-card .stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat-card .stat-value {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 32px;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1;
}
.stat-card .stat-meta {
  font-size: 12px;
  color: var(--muted);
}
.stat-card .stat-meta.up { color: var(--green); }
.stat-card .stat-meta.down { color: var(--red); }

/* ==========================================================================
   Pills
   ========================================================================== */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.pill .d {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.pill-success { background: var(--green-bg); color: var(--green); }
.pill-pending { background: var(--amber-bg); color: var(--amber); }
.pill-draft   { background: var(--bg-2); color: var(--muted); }
.pill-danger  { background: var(--red-bg); color: var(--red); }
.pill-info    { background: var(--info-bg); color: var(--info); }
.pill-accent  { background: var(--accent-soft); color: var(--accent-ink); }

/* ==========================================================================
   Tables
   ========================================================================== */

.table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-scroll { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table thead th {
  background: var(--bg-2);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
  color: var(--ink-2);
}
.data-table tbody tr:first-child td { border-top: 0; }
.data-table tbody tr:hover { background: var(--bg-2); }
.data-table tbody tr.is-warning { background: rgba(184,74,58,0.04); }

.cell-primary { color: var(--ink); font-weight: 500; }
.cell-secondary { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cell-mono { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }

.row-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form {
  display: grid;
  gap: 18px;
  max-width: 720px;
}
.form-group { display: flex; flex-direction: column; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.form-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.form-label .req { color: var(--red); margin-left: 2px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--muted); opacity: 0.7; }
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(243,146,64,.12);
  background: var(--card);
}
.form-textarea { resize: vertical; min-height: 110px; line-height: 1.5; }

.form-help { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.form-error-msg { font-size: 12px; color: var(--red); margin-top: 6px; }

.form-section {
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 18px;
}
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin-bottom: 4px;
}
.form-section-hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: -10px;
  margin-bottom: 4px;
}

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.form-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ==========================================================================
   Alerts
   ========================================================================== */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  margin-bottom: 18px;
}
.alert .alert-icon {
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
}
.alert .alert-body { flex: 1; line-height: 1.45; }
.alert .alert-title { font-weight: 500; margin-bottom: 2px; }
.alert .alert-close {
  margin-left: auto;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  color: inherit;
  opacity: 0.55;
  font-size: 16px;
  line-height: 1;
  border-radius: 6px;
}
.alert .alert-close:hover { opacity: 1; background: rgba(0,0,0,0.05); }

.alert-success { background: var(--green-bg); color: var(--green); border-color: rgba(47,125,91,0.2); }
.alert-success .alert-icon { background: var(--green); color: #fff; }
.alert-error { background: var(--red-bg); color: var(--red); border-color: rgba(184,74,58,0.2); }
.alert-error .alert-icon { background: var(--red); color: #fff; }
.alert-warning { background: var(--amber-bg); color: var(--amber); border-color: rgba(166,105,26,0.2); }
.alert-warning .alert-icon { background: var(--amber); color: #fff; }
.alert-info { background: var(--info-bg); color: var(--info); border-color: rgba(43,90,140,0.2); }
.alert-info .alert-icon { background: var(--info); color: #fff; }

/* ==========================================================================
   Empty state
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
}
.empty-state .icon {
  font-size: 36px;
  color: var(--line-2);
  margin-bottom: 12px;
  display: block;
}
.empty-state h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  margin: 8px 0;
  color: var(--ink);
}
.empty-state p {
  color: var(--muted);
  max-width: 420px;
  margin: 0 auto 22px;
  font-size: 14px;
}

/* ==========================================================================
   Modal (uses native <dialog>)
   ========================================================================== */

.dialog-modal {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 520px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-lg);
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-sans);
}
.dialog-modal::backdrop { background: rgba(26,22,19,.55); }
.dialog-modal[open] { display: flex; flex-direction: column; }

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.dialog-head h3 { font-size: 18px; font-weight: 500; }
.dialog-close {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted);
  border-radius: 6px;
  font-size: 18px;
  line-height: 1;
}
.dialog-close:hover { background: var(--bg-2); color: var(--ink); }
.dialog-body { padding: 24px; }
.dialog-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin: 24px 0 8px;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--ink-2);
  font-family: var(--font-mono);
  transition: background .15s, color .15s;
}
.pagination a:hover { background: var(--bg-2); color: var(--ink); }
.pagination .current {
  background: var(--ink);
  color: #FBF7F2;
}

/* ==========================================================================
   Detail grid (key/value pairs in a card)
   ========================================================================== */

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px 28px;
}
.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.detail-item .k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.detail-item .v {
  font-size: 15px;
  color: var(--ink);
}

/* ==========================================================================
   Auth layout (login, force-reset for admin/client)
   ========================================================================== */

body.auth-layout {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  position: relative;
  overflow-x: hidden;
}

.auth-blob {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
}
.auth-blob.b1 { top: -120px; left: -120px; width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(243,146,64,0.35), transparent 70%); }
.auth-blob.b2 { bottom: -120px; right: -120px; width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(228,122,35,0.25), transparent 70%); }

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}
.auth-brand img { height: 52px; }
.auth-brand .brand-text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 26px;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.auth-brand .brand-text .plus { color: var(--accent); }

.auth-eyebrow {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.auth-card h1 {
  font-family: var(--font-display);
  font-weight: 450;
  font-size: 30px;
  letter-spacing: -0.025em;
  text-align: center;
  margin: 0 0 8px;
}
.auth-lede {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}

.auth-form { display: grid; gap: 16px; }
.auth-form .form-label { margin-bottom: 6px; }
.auth-form .btn { width: 100%; }

.auth-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.auth-foot a {
  color: var(--accent-2);
  font-weight: 500;
}
.auth-foot a:hover { color: var(--ink); }

/* ==========================================================================
   Misc helpers
   ========================================================================== */

.text-mono { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.text-muted { color: var(--muted); }
.text-ink { color: var(--ink); }
.text-success { color: var(--green); }
.text-danger { color: var(--red); }
.text-warning { color: var(--amber); }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; } .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; } .mt-5 { margin-top: 20px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 20px; } .mb-6 { margin-bottom: 24px; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* Spinner */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
