/* ==========================================================================
   Paradosi — staff area styles
   Mobile-first, system fonts, no frameworks. Brand colour comes from
   --brand (set inline from the settings); everything else is neutral so
   the interface stays calm and readable for daily work.
   ========================================================================== */

:root {
  --brand: #1f4e79;
  --brand-hover: #1a4369;
  --brand-soft: #e8eef5;
  --brand-contrast: #ffffff;

  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #1e293b;
  --muted: #5b6b7f;          /* 5.3:1 on white — WCAG AA */
  --success: #15803d;
  --success-soft: #e9f7ee;
  --warning: #a35200;
  --warning-soft: #fff4e5;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --info: #1d4ed8;
  --info-soft: #eaf1ff;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .14);
  --focus: 0 0 0 3px rgba(37, 99, 235, .35);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar-w: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}
img { max-width: 100%; height: auto; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-hover); }
h1, h2, h3 { line-height: 1.25; margin: 0; color: var(--text); }
h1 { font-size: 1.5rem; font-weight: 650; }
h2 { font-size: 1.05rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .9em; }
[hidden] { display: none !important; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--surface); padding: 8px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.skip-link:focus { top: 12px; }

.icon { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.pre-line { white-space: pre-line; }
.grow { flex: 1 1 auto; }

/* ---------- Layout shell ------------------------------------------------ */

.shell { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar-w); max-width: 86vw;
  display: flex; flex-direction: column; gap: 16px;
  padding: 18px 14px;
  background: var(--surface); border-right: 1px solid var(--border);
  transform: translateX(-100%); transition: transform .2s ease;
  overflow-y: auto;
}
.sidebar.is-open { transform: none; box-shadow: var(--shadow-lg); }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(15, 23, 42, .4); }

.sidebar-brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 6px; }
.brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.brand-logo { max-height: 40px; max-width: 170px; object-fit: contain; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 8px; background: var(--brand); color: var(--brand-contrast); font-weight: 700;
}
.brand-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-weight: 500;
}
.nav-link .icon { color: var(--muted); }
.nav-link:hover { background: var(--surface-alt); color: var(--text); }
.nav-link.is-active { background: var(--brand-soft); color: var(--brand); }
.nav-link.is-active .icon { color: var(--brand); }

.sidebar-user {
  margin-top: auto; display: flex; align-items: center; gap: 6px;
  padding-top: 14px; border-top: 1px solid var(--border);
}
.sidebar-user form { margin: 0; }
.user-chip {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 8px; text-decoration: none; color: var(--text);
}
.user-chip:hover, .user-chip.is-active { background: var(--surface-alt); color: var(--text); }
.avatar {
  display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 650; font-size: .9rem;
}
.user-meta { display: grid; min-width: 0; }
.user-name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: .78rem; color: var(--muted); }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 12px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.content { padding: 20px 16px 48px; max-width: 1240px; margin: 0 auto; outline: none; }

@media (min-width: 1024px) {
  .sidebar { transform: none; box-shadow: none; }
  .sidebar-close, .sidebar-backdrop, .topbar { display: none !important; }
  .main-wrap { margin-left: var(--sidebar-w); }
  .content { padding: 32px 36px 64px; }
}

/* ---------- Buttons ----------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px;
  border: 1px solid transparent; border-radius: 8px;
  font: inherit; font-weight: 600; font-size: .92rem; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn .icon { width: 17px; height: 17px; }
.btn-primary { background: var(--brand); color: var(--brand-contrast); }
.btn-primary:hover { background: var(--brand-hover); color: var(--brand-contrast); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { background: var(--surface-alt); border-color: #94a3b8; color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-alt); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1c13; color: #fff; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .86rem; }
.btn-lg { min-height: 46px; padding: 10px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .55; cursor: not-allowed; }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-alt); color: var(--text); }
.icon-btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }

.button-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.button-row form { margin: 0; }

/* ---------- Page header, cards, grids ---------------------------------- */

.breadcrumb { font-size: .875rem; color: var(--muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--muted); }
.page-header {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px;
  margin-bottom: 22px;
}
.page-sub { margin-top: 6px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.dot-sep::before { content: "·"; margin-right: 10px; color: var(--border-strong); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.stack-lg > .card, .grid-2 > .card { margin-bottom: 0; }
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.card-header h2 { display: flex; align-items: center; gap: 10px; }
.card-body { padding: 18px; }
.card-footer { padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface-alt); border-radius: 0 0 var(--radius) var(--radius); }
.card.card-body { padding: 18px; }
.card-danger .card-header h2 { color: var(--text); }
.link-more { font-size: .9rem; font-weight: 500; }
.count {
  display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px;
  border-radius: 11px; background: var(--surface-alt); border: 1px solid var(--border);
  font-size: .78rem; font-weight: 600; color: var(--muted);
}
.step {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); font-size: .8rem; font-weight: 700;
}

.stack { display: grid; gap: 16px; }
.stack-lg { display: grid; gap: 20px; }
.grid-2, .grid-3 { display: grid; gap: 20px; }
.grid-2.tight, .grid-3.tight { gap: 16px; }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .span-2 { grid-column: span 2; }
}

.detail-grid { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1100px) { .detail-grid { grid-template-columns: minmax(0, 1fr) 340px; } }

/* ---------- Stats ------------------------------------------------------- */

.stats { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 22px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px;
  padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); text-decoration: none; color: var(--text);
  transition: border-color .15s;
}
.stat:hover { border-color: var(--border-strong); color: var(--text); }
.stat-icon {
  grid-row: span 2; display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 10px; background: var(--brand-soft); color: var(--brand);
}
.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: .84rem; color: var(--muted); }

/* ---------- Tables (become cards on small screens) --------------------- */

.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th {
  text-align: left; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em;
  color: var(--muted); padding: 10px 18px; background: var(--surface-alt); border-bottom: 1px solid var(--border);
}
.table td { padding: 12px 18px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fbfcfe; }
.table-compact td { padding: 8px 18px; }
.row-link { font-weight: 600; color: var(--text); text-decoration: none; }
.row-link:hover { color: var(--brand); text-decoration: underline; }
.cell-sub { display: block; font-size: .82rem; color: var(--muted); margin-top: 2px; }
.cell-actions { text-align: right; white-space: nowrap; }
.cell-actions > * { vertical-align: middle; }

@media (max-width: 719px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .table tbody tr:last-child { border-bottom: 0; }
  .table td { padding: 3px 0; border: 0; }
  .table td[data-label]::before {
    content: attr(data-label); display: block; font-size: .72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .03em; color: var(--muted);
  }
  .table td[data-label]:first-child::before { display: none; }
  .cell-actions { text-align: left; padding-top: 8px !important; }
}

/* ---------- Badges & alerts -------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; line-height: 1.6; white-space: nowrap;
}
.badge-neutral { background: #eef1f5; color: #475569; }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; margin-bottom: 16px; border-radius: var(--radius);
  border: 1px solid transparent; font-size: .93rem;
}
.alert > .icon { margin-top: 2px; }
.alert p { flex: 1; }
.alert-success { background: var(--success-soft); border-color: #bfe5cc; color: #14532d; }
.alert-error { background: var(--danger-soft); border-color: #f5c2bd; color: #7f1d1d; }
.alert-warning { background: var(--warning-soft); border-color: #f7d7a8; color: #6b3a00; }
.alert-info { background: var(--info-soft); border-color: #c7d7fb; color: #1e3a8a; }
.alert a { color: inherit; font-weight: 600; }
.alert-close {
  display: grid; place-items: center; width: 26px; height: 26px; margin: -3px -4px 0 0;
  border: 0; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; opacity: .7;
}
.alert-close:hover { opacity: 1; background: rgba(0, 0, 0, .06); }
.alert-close .icon { width: 15px; height: 15px; }
.pin-code { font-family: var(--mono); font-size: 1.3rem; letter-spacing: .18em; }

/* ---------- Forms ------------------------------------------------------- */

.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > label, .field > legend, .fieldset > legend { font-weight: 600; font-size: .9rem; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.fieldset { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.fieldset > legend { padding: 0 6px; margin-left: -6px; display: flex; align-items: center; gap: 12px; }
.legend-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; font-size: .84rem; }
.legend-link .icon { width: 15px; height: 15px; }
.req { color: var(--danger); }
.optional { font-weight: 400; color: var(--muted); font-size: .85rem; }
.hint { font-size: .84rem; color: var(--muted); }
.field-narrow { max-width: 260px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"],
input[type="tel"], input[type="search"], input[type="date"], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  font: inherit; font-size: .95rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
textarea.mono { font-size: .85rem; }
select {
  appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%235b6b7f' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
input:hover, select:hover, textarea:hover { border-color: #94a3b8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
input[readonly] { background: var(--surface-alt); }
input[type="color"] {
  width: 100%; height: 42px; padding: 4px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); cursor: pointer;
}
input[type="range"] { width: 100%; accent-color: var(--brand); }
input[type="date"] { height: 42px; }
input[type="file"] { font: inherit; font-size: .9rem; color: var(--muted); max-width: 100%; }
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 7px 14px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--surface-alt); }
input:disabled, select:disabled { opacity: .6; cursor: not-allowed; }

.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.field-error { display: flex; align-items: center; gap: 6px; color: var(--danger); font-size: .86rem; font-weight: 500; }
.field-error .icon { width: 15px; height: 15px; }

.field-search { position: relative; }
.field-search .input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.field-search input { padding-left: 40px; }

.checks { display: grid; gap: 12px; }
.check { display: flex; align-items: flex-start; gap: 10px; }
.check input[type="checkbox"] { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); flex-shrink: 0; cursor: pointer; }
.check label { display: grid; gap: 2px; cursor: pointer; }
.check-label { font-weight: 500; }

.segmented { display: inline-flex; flex-wrap: wrap; padding: 3px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 9px; gap: 2px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { padding: 6px 14px; border-radius: 7px; font-size: .9rem; font-weight: 500; cursor: pointer; color: var(--muted); }
.segmented input:checked + label { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented input:focus-visible + label { box-shadow: var(--focus); }

.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; }
.form-actions-reverse { flex-direction: row-reverse; justify-content: flex-start; }
.form-card { max-width: 820px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 0; }
.inline-form .hint { align-self: center; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; align-items: center; }
.filters .field-search { flex: 1 1 280px; }
.filters .field:not(.field-search) { flex: 0 1 220px; }

.copy-field { display: flex; flex-wrap: wrap; gap: 8px; }
.copy-field input { flex: 1 1 260px; font-family: var(--mono); font-size: .88rem; }

/* ---------- Customer autocomplete -------------------------------------- */

.autocomplete-box { position: relative; }
.autocomplete-list {
  position: absolute; z-index: 15; top: calc(100% + 4px); left: 0; right: 0;
  margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow-lg);
  max-height: 280px; overflow-y: auto;
}
.autocomplete-list li { padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.autocomplete-list li[aria-selected="true"], .autocomplete-list li:hover { background: var(--brand-soft); }
.autocomplete-list .cell-sub { margin: 0; }
.selected-note { display: flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--success); font-weight: 500; }
.selected-note .icon { width: 15px; height: 15px; }

/* ---------- Dropzone & file lists -------------------------------------- */

.dropzone { position: relative; border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-alt); transition: border-color .15s, background-color .15s; }
.dropzone:hover, .dropzone.is-dragover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone.has-error { border-color: var(--danger); }
.dropzone-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone-input:focus-visible + .dropzone-label { box-shadow: var(--focus); border-radius: var(--radius); }
.dropzone-label { display: grid; justify-items: center; gap: 6px; padding: 28px 16px; text-align: center; pointer-events: none; }
.dropzone-icon { width: 30px; height: 30px; color: var(--brand); }
.dropzone .link { color: var(--brand); text-decoration: underline; }
.dropzone-compact .dropzone-label { display: flex; justify-content: center; padding: 12px; font-weight: 600; color: var(--brand); }

.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.file-list:empty { display: none; }
.file-list li {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
}
.file-list .file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.file-list .file-size { font-size: .84rem; color: var(--muted); white-space: nowrap; }
.file-list li.is-invalid { border-color: var(--danger); background: var(--danger-soft); }

.file-rows { list-style: none; margin: 0; padding: 0; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.file-row:last-child { border-bottom: 0; }
.file-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-row .file-name { display: block; font-weight: 600; overflow-wrap: anywhere; }
.file-actions { display: flex; align-items: center; gap: 2px; }
.file-actions form { margin: 0; }
.add-files { display: grid; gap: 10px; }

/* ---------- Detail page ------------------------------------------------- */

.details { margin: 0; padding: 6px 18px 12px; }
.details > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.details > div:last-child { border-bottom: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 500; text-align: right; }
.link-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: .9rem; }
.card-body > p + p { margin-top: 4px; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.timeline li { display: flex; gap: 12px; align-items: flex-start; }
.timeline-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-alt); border: 1px solid var(--border); color: var(--muted); flex-shrink: 0; }
.timeline-icon .icon { width: 15px; height: 15px; }

.danger-zone {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  max-width: 820px; padding: 16px 18px; border: 1px solid #f5c2bd; border-radius: var(--radius); background: var(--surface);
}
.danger-zone h2 { color: var(--danger); margin-bottom: 4px; }

/* ---------- Empty states & pagination ---------------------------------- */

.empty-state { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 40px 20px; }
.empty-state p { color: var(--muted); max-width: 440px; }
.empty-state .btn { margin-top: 8px; }
.empty-icon { width: 40px; height: 40px; color: var(--border-strong); }

.pagination { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); }
.pagination-info, .pagination-current { font-size: .88rem; color: var(--muted); }
.pagination-links { display: flex; align-items: center; gap: 10px; }

/* ---------- Settings ---------------------------------------------------- */

.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: thin; }
.tab {
  padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }

.settings-split { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1200px) { .settings-split { grid-template-columns: minmax(0, 1fr) 420px; } }
.preview-panel { display: grid; gap: 10px; }
@media (min-width: 1200px) { .preview-panel { position: sticky; top: 24px; } }
.preview-head { display: flex; justify-content: space-between; align-items: center; }
.preview-frame { width: 100%; height: 640px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.image-preview { padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: repeating-conic-gradient(#f1f5f9 0% 25%, #fff 0% 50%) 50% / 16px 16px; max-width: 280px; }
.image-preview img { display: block; max-height: 80px; margin: 0 auto; }
.image-preview-wide { max-width: 360px; padding: 0; overflow: hidden; }
.image-preview-wide img { max-height: 140px; width: 100%; object-fit: cover; }

.help-card summary { cursor: pointer; list-style: none; }
.help-card summary::-webkit-details-marker { display: none; }
.help-card:not([open]) summary { border-bottom: 0; }
.placeholder-list { display: grid; gap: 6px 20px; margin: 12px 0 0; }
@media (min-width: 720px) { .placeholder-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.placeholder-list > div { display: flex; gap: 10px; align-items: baseline; font-size: .9rem; }
.placeholder-list dd { margin: 0; color: var(--muted); }
.placeholder-list code { background: var(--surface-alt); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; }

/* ---------- Toast (copy confirmation) ---------------------------------- */

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%);
  padding: 10px 18px; border-radius: 8px; background: #1e293b; color: #fff; font-weight: 500; font-size: .92rem;
  box-shadow: var(--shadow-lg);
}

/* ---------- Signed-out pages ------------------------------------------- */

.guest-wrap { min-height: 100vh; display: grid; place-content: center; gap: 16px; padding: 24px 16px; }
.guest-card {
  width: min(420px, 100%); padding: 32px 28px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
}
.guest-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.guest-title { font-size: 1.35rem; margin-bottom: 6px; }
.guest-text { color: var(--muted); margin-bottom: 22px; }
.guest-link { margin-top: 18px; text-align: center; font-size: .92rem; }
.guest-footer { text-align: center; font-size: .82rem; color: var(--muted); }

/* ---------- Installer --------------------------------------------------- */

.install-card { width: min(640px, 100%); }
.install-steps { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; margin: 0 0 24px; padding: 0; font-size: .84rem; color: var(--muted); }
.install-steps li { display: flex; align-items: center; gap: 6px; }
.install-steps .num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border-strong); font-weight: 600; font-size: .75rem; }
.install-steps .is-current { color: var(--text); font-weight: 600; }
.install-steps .is-current .num { background: var(--brand); border-color: var(--brand); color: #fff; }
.install-steps .is-done .num { background: var(--success-soft); border-color: #bfe5cc; color: var(--success); }
.req-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); }
.req-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: .92rem; }
.req-list li:last-child { border-bottom: 0; }
.req-ok { color: var(--success); font-weight: 600; }
.req-warn { color: var(--warning); font-weight: 600; }
.req-fail { color: var(--danger); font-weight: 600; }
.radio-cards { display: grid; gap: 10px; }
.radio-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.radio-card input { margin-top: 3px; accent-color: var(--brand); }
.radio-card strong { display: block; }
.summary-list { margin: 0; }
.summary-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.summary-list dt { color: var(--muted); }
.summary-list dd { margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
pre.code-block { margin: 0; padding: 12px; overflow-x: auto; background: #0f172a; color: #e2e8f0; border-radius: 8px; font-size: .82rem; }

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