/* ═══════════════════════════════════════════════════════════════════
   SailorShop Admin — "Chart Room" design system (#322)
   The reference is the SailorShop design system artifact; this file is
   its tokens + kit. Tokens first; components below. Tools use these
   classes and tokens and keep only layout of their own.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* brand — from sailorshop.co.uk */
  --ss-navy:         #274472;   /* action colour; white on it 9.7:1 */
  --ss-navy-dark:    #1a2e4a;   /* hover/pressed on navy fills */
  --ss-navy-light:   #4c6791;   /* the storefront's button hover; minor ticks */
  --ss-navy-lighter: #4c6791;   /* legacy alias */
  --ss-rust:         #C03221;   /* identity only (navbar stripe, logo) — never a state */
  --ss-rust-light:   #d44a3a;
  --ss-gold:         #D5A021;   /* fills only; text on it is gold-ink */
  --ss-gold-light:   #e0b63e;
  --ss-gold-ink:     #3a2c00;
  --ss-gold-wash:    #fbf3dc;   /* inputs owned by automation */

  /* neutrals */
  --ss-bg:             #F8F8F8;
  --ss-surface:        #FFFFFF;
  --ss-white:          #FFFFFF;
  --ss-on-fill:        #FFFFFF;  /* text on navy / danger / success fills */
  --ss-tint:           #f0f4f9;  /* THE hover / subtle-selected fill */
  --ss-border:         #dde3ea;  /* container hairlines (decorative) */
  --ss-border-control: #8592a3;  /* edges of controls: 3.2:1 on white */
  --ss-text:           #1e2a38;
  --ss-text-muted:     #5a6c7d;

  /* semantic triads (text / bg / border) */
  --ss-success:        #2C7E3F;
  --ss-success-bg:     #edf6ef;  /* success text 4.6:1 on it */
  --ss-success-border: #b9dcc3;
  --ss-success-dark:   #246834;
  --ss-danger:         #B40C1C;
  --ss-danger-dark:    #8f0a17;
  --ss-danger-bg:      #fbecee;
  --ss-danger-border:  #ecc0c5;
  --ss-warning:        #8a5d10;  /* AA amber text; gold stays for fills */
  --ss-warning-bg:     #fdf5e3;
  --ss-warning-border: #ecd9a8;
  --ss-info:           #2b5688;
  --ss-info-bg:        #eaf1f9;
  --ss-info-border:    #c3d5ea;

  /* identity accent — NP131 chart-limit magenta; use rarely */
  --ss-chart-magenta: #cc0088;

  /* toast marks (on --ss-text) and the modal scrim */
  --ss-toast-ok:    #5fc07a;
  --ss-toast-error: #f08c96;
  --ss-toast-info:  #8fb0e0;
  --ss-scrim:       rgba(26, 46, 74, 0.45);

  /* geometry — 4 / 6 / 8, nothing larger */
  --ss-radius-sm:   4px;
  --ss-radius:      6px;
  --ss-radius-lg:   8px;
  --ss-radius-xl:   8px;    /* legacy alias: 8px is the largest corner */
  --ss-radius-pill: 999px;  /* count pills and dots only */
  --ss-shadow:      none;   /* legacy alias: things on the page cast no shadow */
  --ss-shadow-pop:  0 8px 32px rgba(39, 68, 114, 0.18);  /* modals, menus, toasts */
  --ss-focus-ring:  0 0 0 2px #fff, 0 0 0 4px #274472;   /* solid navy, 9.7:1 */

  /* spacing (4px scale) */
  --ss-space-1: 4px;  --ss-space-2: 8px;  --ss-space-3: 12px; --ss-space-4: 16px;
  --ss-space-5: 20px; --ss-space-6: 24px; --ss-space-8: 32px; --ss-space-12: 48px;

  /* graticule pitches */
  --ss-grat-minor: 4px;   /* tenths */
  --ss-grat-major: 20px;  /* minutes */
  --ss-grat-block: 24px;  /* latitude band block */

  --ss-font-head: 'Barlow', 'Segoe UI', sans-serif;
  --ss-font-body: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  --ss-font-mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
}

/* ── Focus — one solid ring everywhere ───────────────────────────── */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--ss-focus-ring);
}

/* ── Utilities ───────────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.mono   { font-family: var(--ss-font-mono); font-size: 0.92em; font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.muted  { color: var(--ss-text-muted); }
.eyebrow {
  font-family: var(--ss-font-body); font-size: 11px; line-height: 16px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ss-text-muted);
}
.ref { font: 600 13px/18px var(--ss-font-mono); color: var(--ss-navy); font-variant-numeric: tabular-nums; }

/* ═══ The chart-border motif ═════════════════════════════════════════
   Quietest first. At most ONE strong form (band, neatline, graticule)
   per view; never a background texture. */

/* Graticule rule: minute ticks with tenths between */
.rule-grat {
  height: 6px; flex: 1; align-self: center;
  background:
    repeating-linear-gradient(90deg, var(--ss-border-control) 0 1px, transparent 1px var(--ss-grat-major)) 0 0 / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, var(--ss-border) 0 1px, transparent 1px var(--ss-grat-minor)) 0 3px / 100% 3px no-repeat;
}
.rule-grat.navy {
  background:
    repeating-linear-gradient(90deg, var(--ss-navy) 0 1px, transparent 1px var(--ss-grat-major)) 0 0 / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, var(--ss-navy-light) 0 1px, transparent 1px var(--ss-grat-minor)) 0 3px / 100% 3px no-repeat;
}

/* Latitude band: alternating blocks over a tick row (modal tops, printed heads) */
.grat-band, .modal .modal-rule {
  --band-ink: var(--ss-navy);
  height: 8px;
  border-bottom: 1px solid var(--band-ink);
  background:
    repeating-linear-gradient(90deg, var(--band-ink) 0 var(--ss-grat-block), transparent var(--ss-grat-block) calc(var(--ss-grat-block) * 2)) 0 0 / 100% 50% no-repeat,
    repeating-linear-gradient(90deg, var(--band-ink) 0 1px, transparent 1px var(--ss-grat-minor)) 0 100% / 100% 50% no-repeat;
}
.modal.danger .grat-band, .modal.danger .modal-rule { --band-ink: var(--ss-danger); }

/* Neatline: thick outer line, hairline inside */
.neatline {
  border: 2px solid var(--ss-navy);
  outline: 1px solid var(--ss-navy);
  outline-offset: -6px;
  background: var(--ss-surface);
}

/* container width modifiers (base .container is 900px) */
.container.container-wide  { max-width: 1240px; }
.container.container-full  {
  max-width: none; background: transparent; border: none;
  box-shadow: none; padding: 0; border-radius: 0;
}

/* ── Page head (one per page: title, status line, actions) ─────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 26px; line-height: 32px; color: var(--ss-text); }
.page-head p { margin: 4px 0 0; font-size: 13.5px; color: var(--ss-text-muted); }
.page-head .btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Buttons — one geometry: 34px tall r6, small 26px r4 ────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 34px; padding: 0 16px;
  font-family: var(--ss-font-head); font-weight: 600; font-size: 13.5px;
  letter-spacing: 0.02em; line-height: 1.3;
  border-radius: var(--ss-radius);
  border: 1px solid transparent; cursor: pointer;
  background: transparent; color: var(--ss-navy);
  text-decoration: none; white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
.btn svg { flex: none; }
.btn:disabled:not(.is-loading), .btn.disabled {
  background: var(--ss-tint); border-color: var(--ss-border);
  color: var(--ss-text-muted); cursor: default; pointer-events: none;
}
.btn-primary          { background: var(--ss-navy); border-color: var(--ss-navy); color: var(--ss-on-fill); }
.btn-primary:hover    { background: var(--ss-navy-dark); border-color: var(--ss-navy-dark); color: var(--ss-on-fill); }
.btn-outline          { background: var(--ss-surface); border-color: var(--ss-navy); color: var(--ss-navy); }
.btn-outline:hover    { background: var(--ss-tint); }
.btn-ghost            { background: transparent; color: var(--ss-navy); }
.btn-ghost:hover      { background: var(--ss-tint); }
.btn-danger           { background: var(--ss-danger); border-color: var(--ss-danger); color: var(--ss-on-fill); }
.btn-danger:hover     { background: var(--ss-danger-dark); border-color: var(--ss-danger-dark); color: var(--ss-on-fill); }
.btn-danger-outline        { background: var(--ss-surface); border-color: var(--ss-danger-border); color: var(--ss-danger); }
.btn-danger-outline:hover  { background: var(--ss-danger-bg); }
.btn-success          { background: var(--ss-success); border-color: var(--ss-success); color: var(--ss-on-fill); }
.btn-success:hover    { background: var(--ss-success-dark); border-color: var(--ss-success-dark); color: var(--ss-on-fill); }
.btn-warning          { background: var(--ss-warning-bg); border-color: var(--ss-warning-border); color: var(--ss-warning); }
.btn-warning:hover    { border-color: var(--ss-warning); }
/* gold: the one action per view that sends something to the shop or the books */
.btn-gold             { background: var(--ss-gold); border-color: var(--ss-gold); color: var(--ss-gold-ink); }
.btn-gold:hover       { background: var(--ss-gold-light); border-color: var(--ss-gold-light); color: var(--ss-gold-ink); }
.btn-sm               { min-height: 26px; font-size: 12px; padding: 0 10px; border-radius: var(--ss-radius-sm); }
.btn-block            { display: flex; width: 100%; }
.btn-group            { display: inline-flex; }
.btn-group .btn       { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--ss-radius) 0 0 var(--ss-radius); margin-left: 0; }
.btn-group .btn:last-child  { border-radius: 0 var(--ss-radius) var(--ss-radius) 0; }
.btn-group .btn[aria-pressed="true"], .btn-group .btn.active { background: var(--ss-navy); border-color: var(--ss-navy); color: var(--ss-on-fill); }

/* loading state that never destroys the label */
.btn.is-loading { pointer-events: none; }
.btn.is-loading::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: ss-spin 0.7s linear infinite;
}
@keyframes ss-spin { to { transform: rotate(360deg); } }

.spinner {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--ss-border); border-top-color: var(--ss-navy);
  animation: ss-spin 0.7s linear infinite; vertical-align: middle;
}

/* ── Tabs — underline bar ────────────────────────────────────────── */
.tab-bar {
  display: flex; gap: 24px; border: none;
  border-bottom: 1px solid var(--ss-border);
  border-radius: 0; overflow-x: auto; overflow-y: hidden;
  background: transparent;
}
.tab-bar .tab-btn {
  flex: 0 0 auto; padding: 10px 2px 11px; border: none; background: transparent;
  font-family: var(--ss-font-head); font-weight: 600; font-size: 13.5px; letter-spacing: 0.02em;
  color: var(--ss-text-muted); cursor: pointer;
  margin-bottom: -1px; border-bottom: 2px solid transparent; border-radius: 0;
  transition: color 0.12s, border-color 0.12s;
}
.tab-bar .tab-btn:hover  { background: transparent; color: var(--ss-navy); }
.tab-bar .tab-btn.active { background: transparent; color: var(--ss-navy); border-bottom-color: var(--ss-navy); }
.tab-content          { display: none; }
.tab-content.active   { display: block; }

/* ── Cards & section headers ─────────────────────────────────────── */
.card {
  background: var(--ss-surface); border: 1px solid var(--ss-border);
  border-radius: var(--ss-radius-lg);
}
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--ss-border);
}
.card-head .card-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ss-text-muted);
}
.card-body { padding: 16px; }
.card-foot {
  display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px;
  border-top: 1px solid var(--ss-border); background: var(--ss-bg);
  border-radius: 0 0 var(--ss-radius-lg) var(--ss-radius-lg);
}

.section-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 12px;
}
.section-head h2 { font-size: 20px; line-height: 26px; white-space: nowrap; }
.section-head .actions { display: flex; gap: 8px; }

/* ── Form sections ───────────────────────────────────────────────── */
.form-section { padding: 4px 0 16px; }
.form-section + .form-section { border-top: 1px solid var(--ss-border); padding-top: 16px; }
.form-section h3 {
  display: flex; align-items: center; gap: 12px; margin: 0 0 12px;
  font-family: var(--ss-font-body); font-size: 11px; line-height: 16px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ss-navy);
}
.form-section h3::after { content: ""; flex: 1; height: 1px; background: var(--ss-navy); opacity: 0.35; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; }

/* ── Stat cards — joined instrument strip ───────────────────────── */
.stats-row {
  display: flex; gap: 0; flex-wrap: nowrap;
  border: 1px solid var(--ss-border); border-radius: var(--ss-radius-lg);
  overflow: hidden; background: var(--ss-surface);
}
.stats-row .stat-card { flex: 1 1 0; min-width: 0; border: none; border-left: 1px solid var(--ss-border); border-radius: 0; padding: 12px 16px; }
.stats-row .stat-card:first-child { border-left: none; }
.stat-card {
  background: var(--ss-surface); border: 1px solid var(--ss-border);
  border-radius: var(--ss-radius-lg);
  padding: 10px 16px; min-width: 96px; text-align: left;
  font-family: var(--ss-font-body); color: var(--ss-text);
}
.stat-card.accent-gold, .stat-card.accent-warning { --stat-ink: var(--ss-warning); }
.stat-card.accent-info    { --stat-ink: var(--ss-info); }
.stat-card.accent-success { --stat-ink: var(--ss-success); }
.stat-card.accent-danger  { --stat-ink: var(--ss-danger); }
.stat-card.accent-magenta { --stat-ink: var(--ss-chart-magenta); }
.stat-card .stat-value {
  font-family: var(--ss-font-head); font-weight: 800; font-size: 22px;
  line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--stat-ink, var(--ss-text));
}
.stat-card .stat-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ss-text-muted); margin-top: 2px;
}
button.stat-card { cursor: pointer; }
button.stat-card:hover { background: var(--ss-tint); }
button.stat-card[aria-pressed="true"], button.stat-card.active { box-shadow: inset 0 -2px 0 var(--ss-navy); }

/* ── Tables — neatline header, dense rows ────────────────────────── */
.table-wrap {
  overflow-x: auto; background: var(--ss-surface);
  border: 1px solid var(--ss-border); border-radius: var(--ss-radius-lg);
}
table.ss-table { border-collapse: collapse; width: 100%; font-size: 13px; }
table.ss-table th {
  background: var(--ss-surface); color: var(--ss-text-muted); text-align: left;
  padding: 9px 12px 8px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
  border-bottom: 2px solid var(--ss-navy);
}
table.ss-table th.sortable, table.ss-table th[aria-sort] { cursor: pointer; user-select: none; }
table.ss-table th.sortable::after  { content: " \2195"; opacity: 0.5; }
table.ss-table th.sort-asc::after, table.ss-table th[aria-sort="ascending"]::after   { content: " \25B2"; opacity: 1; color: var(--ss-navy); }
table.ss-table th.sort-desc::after, table.ss-table th[aria-sort="descending"]::after { content: " \25BC"; opacity: 1; color: var(--ss-navy); }
table.ss-table td {
  padding: 8px 12px; border-top: 1px solid var(--ss-border);
  vertical-align: middle;
}
table.ss-table thead + tbody tr:first-child td { border-top: 0; }
table.ss-table tbody tr:hover    { background: var(--ss-tint); }
table.ss-table tbody tr.selected { background: var(--ss-info-bg); }
table.ss-table td.num, table.ss-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.ss-table td.mono { font-family: var(--ss-font-mono); font-size: 12.5px; }
table.ss-table tr.ss-filter-row td { background: var(--ss-bg); padding: 6px 8px; border-top: 0; border-bottom: 1px solid var(--ss-border); }
table.ss-table tr.ss-filter-row input, table.ss-table tr.ss-filter-row select {
  width: 100%; box-sizing: border-box; font-size: 12px; padding: 4px 8px;
  border: 1px solid var(--ss-border-control); border-radius: var(--ss-radius-sm);
  background: var(--ss-surface); color: var(--ss-text); font-family: var(--ss-font-body);
}
table.ss-table tr.group-row td { background: var(--ss-bg); font-weight: 600; font-size: 12px; color: var(--ss-navy); }
.table-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; background: var(--ss-bg);
  border-top: 1px solid var(--ss-border);
  font-size: 12px; color: var(--ss-text-muted); font-family: var(--ss-font-mono);
}
.table-scroll-hint { display: none; text-align: center; font-size: 0.78em; color: var(--ss-text-muted); padding: 4px 0; }
@media (max-width: 768px) { .table-scroll-hint { display: block; } }

/* Bulk bar — sits over a table while rows are selected */
.bulk-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; background: var(--ss-navy); color: var(--ss-on-fill); font-size: 13px;
  border-radius: var(--ss-radius-lg) var(--ss-radius-lg) 0 0;
}

/* ── Badges — chart-label tags, not pills ────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600; line-height: 16px;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 1px 7px; border-radius: var(--ss-radius-sm);
  border: 1px solid var(--ss-border); background: var(--ss-tint);
  color: var(--ss-text-muted); white-space: nowrap; vertical-align: 1px;
}
.badge-success { background: var(--ss-success-bg); color: var(--ss-success); border-color: var(--ss-success-border); }
.badge-danger  { background: var(--ss-danger-bg);  color: var(--ss-danger);  border-color: var(--ss-danger-border); }
.badge-warning { background: var(--ss-warning-bg); color: var(--ss-warning); border-color: var(--ss-warning-border); }
.badge-info    { background: var(--ss-info-bg);    color: var(--ss-info);    border-color: var(--ss-info-border); }
.badge-neutral { background: var(--ss-tint);       color: var(--ss-text-muted); border-color: var(--ss-border); }
.badge-magenta { background: var(--ss-surface);    color: var(--ss-chart-magenta); border-color: var(--ss-chart-magenta); }
.badge-navy    { background: var(--ss-navy);       color: var(--ss-on-fill); border-color: var(--ss-navy); }

/* raw Shopify tag or code */
.tag {
  display: inline-flex; align-items: center; padding: 1px 7px;
  font: 500 11.5px/16px var(--ss-font-mono); color: var(--ss-text);
  border: 1px dashed var(--ss-border-control); border-radius: var(--ss-radius-sm);
  background: var(--ss-surface); white-space: nowrap;
}

.count-pill {
  display: inline-block; min-width: 20px; text-align: center;
  font-family: var(--ss-font-mono); font-size: 11.5px; line-height: 16px;
  border-radius: var(--ss-radius-pill); padding: 1px 7px;
  background: var(--ss-navy); color: var(--ss-on-fill);
}
.count-pill.quiet { background: var(--ss-tint); color: var(--ss-navy); }

/* chart-symbol status dots: filled = in state, open = idle. Always beside a word. */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: 1px; box-sizing: border-box; flex: none; }
.dot-ok   { background: var(--ss-success); }
.dot-bad  { background: var(--ss-danger); }
.dot-warn { background: var(--ss-gold); }
.dot-info { background: var(--ss-info); }
.dot-open { background: var(--ss-surface); border: 2px solid var(--ss-text-muted); }

/* ── Alerts / flash messages — full hairline frame + leading symbol ── */
.alert {
  --alert-ink: var(--ss-text-muted);
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; border-radius: var(--ss-radius);
  border: 1px solid var(--ss-border);
  background: var(--ss-surface); color: var(--ss-text);
  font-size: 13.5px; line-height: 20px;
}
.alert::before {
  content: ""; flex: none; width: 16px; height: 16px; margin-top: 2px;
  background: var(--alert-ink);
  -webkit-mask: var(--alert-icon) center / contain no-repeat;
          mask: var(--alert-icon) center / contain no-repeat;
}
.alert:has(> svg:first-child)::before { display: none; }
.alert > svg:first-child { flex: none; margin-top: 2px; color: var(--alert-ink); }
.alert b, .alert strong { font-weight: 600; }
.alert {
  --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6M12 7.5v.5'/%3E%3C/svg%3E");
}
.alert-success {
  --alert-ink: var(--ss-success);
  --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 12.5 5 5L20 6.5'/%3E%3C/svg%3E");
  background: var(--ss-success-bg); border-color: var(--ss-success-border);
}
.alert-error, .alert-danger {
  --alert-ink: var(--ss-danger);
  --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 6 12 12M18 6 6 18'/%3E%3C/svg%3E");
  background: var(--ss-danger-bg); border-color: var(--ss-danger-border);
}
.alert-warning {
  --alert-ink: var(--ss-warning);
  --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 2.5 20h19z'/%3E%3Cpath d='M12 9.5V14M12 16.8v.2'/%3E%3C/svg%3E");
  background: var(--ss-warning-bg); border-color: var(--ss-warning-border);
}
.alert-info {
  --alert-ink: var(--ss-info);
  background: var(--ss-info-bg); border-color: var(--ss-info-border);
}

/* ── Forms ───────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ss-text-muted);
}
.field input, .field select, .field textarea, .input {
  font-family: var(--ss-font-body); font-size: 13.5px;
  padding: 7px 10px; border: 1px solid var(--ss-border-control);
  border-radius: var(--ss-radius); background: var(--ss-surface);
  color: var(--ss-text); box-sizing: border-box; width: 100%;
}
.field input.mono, .input.mono { font-family: var(--ss-font-mono); font-size: 13px; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  outline: none; border-color: var(--ss-navy); box-shadow: var(--ss-focus-ring);
}
.field textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
.field .hint  { font-size: 12px; color: var(--ss-text-muted); }
.field .error { font-size: 12px; color: var(--ss-danger); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--ss-danger); }
/* a value owned by a job (SailorPi, cron) — say which in a .hint */
.field input.automated, .input.automated, .field select.automated {
  background: var(--ss-gold-wash); border-color: var(--ss-warning-border);
}

/* Key/value list */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 13px; }
.kv dt { color: var(--ss-text-muted); }
.kv dd { margin: 0; }

/* ── Toast ───────────────────────────────────────────────────────── */
#ss-toast-host {
  position: fixed; bottom: 24px; right: 24px; z-index: 9000;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 420px;
  background: var(--ss-text); color: var(--ss-on-fill); border-radius: var(--ss-radius);
  padding: 10px 14px; font-size: 13px; line-height: 18px; font-family: var(--ss-font-body);
  box-shadow: var(--ss-shadow-pop);
  animation: ss-toast-in 0.18s ease-out; pointer-events: auto;
}
.toast::before { content: ""; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--ss-toast-ok); }
.toast.error::before   { background: var(--ss-toast-error); }
.toast.warning::before { background: var(--ss-gold); }
.toast.info::before    { background: var(--ss-toast-info); }
@keyframes ss-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Modal / confirm ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: var(--ss-scrim);
  display: none; align-items: center; justify-content: center;
  z-index: 8000; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--ss-surface); border: 1px solid var(--ss-border);
  border-radius: var(--ss-radius-lg); box-shadow: var(--ss-shadow-pop);
  width: 440px; max-width: 100%; max-height: 85vh; overflow: auto;
}
.modal-head { padding: 18px 20px 4px; }
.modal-head h3 { font-family: var(--ss-font-head); font-weight: 700; font-size: 16px; margin: 0; }
.modal-body { padding: 6px 20px 18px; font-size: 13.5px; color: var(--ss-text-muted); }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 20px; background: var(--ss-bg);
  border-top: 1px solid var(--ss-border);
}

/* ── Empty states ────────────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 32px 20px; text-align: center; color: var(--ss-text-muted);
}
.empty-state svg { color: var(--ss-border-control); }
.empty-state .empty-title {
  font-family: var(--ss-font-head); font-weight: 700; font-size: 15px;
  color: var(--ss-text);
}
.empty-state .empty-copy { font-size: 13px; max-width: 360px; }

/* ── Drop zone ───────────────────────────────────────────────────── */
.drop-zone {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 28px 20px; border: 1.5px dashed var(--ss-border-control);
  border-radius: var(--ss-radius-lg); background: var(--ss-surface);
  color: var(--ss-text-muted); cursor: pointer; text-align: center;
  transition: border-color 0.12s, background 0.12s;
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--ss-navy); background: var(--ss-tint); }

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