/* ============================================================================
   Cultiva ERP — OFFICE surface
   Desktop-first, data-dense. Selectors unscoped (office pages load only this).
   Values come from tokens.css (--c-*). Works in light + dark.
   ============================================================================ */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: var(--weight-bold); line-height: var(--leading-tight); color: var(--c-text-plain); }

a { color: var(--c-link); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.muted  { color: var(--c-muted); }
.small  { font-size: var(--text-sm); }
.mono   { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.eyebrow {
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--c-primary-bright);
}

/* ---------------------------------------------------------------- App shell
   Left sidebar + light appbar, matching the Cultiva CRM design language.
   ---------------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 248px; flex: none; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; z-index: 40;
  background: var(--c-surface); border-right: 1px solid var(--c-border-subtle);
}
.sidebar .brand {
  display: flex; align-items: center; gap: 8px;
  padding: 18px 20px 14px; font-size: 1.3rem; font-weight: var(--weight-bold);
  letter-spacing: 0.01em; color: var(--c-text-strong); text-decoration: none;
}
.sidebar .brand:hover { text-decoration: none; }
.sidebar .brand img.brand-logo { height: 30px; width: auto; display: block; }
.sidebar .brand .version { font-size: var(--text-2xs); font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide); color: var(--c-muted); align-self: center; }
.sidebar .brand .brand-erp {
  font-size: var(--text-2xs); font-weight: var(--weight-bold); letter-spacing: var(--tracking-wide);
  text-transform: uppercase; color: var(--c-primary-bright);
  border: 1px solid currentColor; border-radius: var(--radius-sm); padding: 2px 6px; align-self: center;
}
.sidenav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.sidenav a {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px;
  border-radius: var(--radius-md); color: var(--c-text); font-size: var(--text-sm);
  font-weight: var(--weight-medium); margin-bottom: 2px;
}
.sidenav a:hover { background: var(--c-surface-2); text-decoration: none; }
.sidenav a.active { background: var(--c-wash); color: var(--c-text-strong); font-weight: var(--weight-semibold); }
.sidenav a .nav-ico { width: 20px; height: 20px; flex: none; color: var(--c-muted); display: inline-flex; }
.sidenav a.active .nav-ico { color: var(--c-primary-bright); }
.sidenav a .nav-ico svg { width: 20px; height: 20px; display: block; }
.sidenav a .nav-badge { margin-left: auto; }
.nav-group { padding: 18px 12px 6px; font-size: var(--text-2xs); text-transform: uppercase;
  letter-spacing: var(--tracking-wide); color: var(--c-faint); font-weight: var(--weight-bold); }
.side-sep { height: 1px; background: var(--c-border-subtle); border: none; margin: 12px 8px; }
.side-foot { border-top: 1px solid var(--c-border-subtle); padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.side-foot .sf-meta { line-height: 1.2; min-width: 0; }
.side-foot .sf-name { font-weight: var(--weight-semibold); color: var(--c-text-plain); font-size: var(--text-sm); }
.side-foot .sf-role { font-size: var(--text-2xs); color: var(--c-muted); text-transform: uppercase; letter-spacing: var(--tracking-wide); }

.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }

/* Avatar */
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--c-primary);
  color: var(--c-on-primary); display: inline-flex; align-items: center; justify-content: center;
  font-weight: var(--weight-bold); font-size: var(--text-sm); text-transform: uppercase; }

/* Count badges (sidebar nav) */
.nav-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill);
  background: var(--c-primary); color: var(--c-on-primary); font-size: var(--text-2xs);
  font-weight: var(--weight-bold); display: inline-flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.nav-badge.attention { background: var(--st-progress-fg); color: #fff; }

/* Main + appbar */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.appbar {
  position: sticky; top: 0; z-index: 30; min-height: 64px;
  display: flex; align-items: center; gap: var(--space-4); padding: 0 var(--space-5);
  background: var(--c-surface); border-bottom: 1px solid var(--c-border-subtle);
}
.appbar .ab-title { flex: none; min-width: 0; }
.appbar .ab-title h1 { font-size: var(--text-md); color: var(--c-text-plain); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .ab-title .ab-sub { font-size: var(--text-2xs); color: var(--c-muted); }
.appbar .ab-right { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); }

/* Neutral icon button (appbar) */
.icon-btn {
  height: 40px; min-width: 40px; padding: 0 12px; border-radius: var(--radius-md);
  background: var(--c-surface); color: var(--c-text); border: 1px solid var(--c-border);
  font: inherit; font-size: var(--text-sm); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none;
}
.icon-btn:hover { background: var(--c-surface-2); text-decoration: none; }
.icon-btn svg { width: 18px; height: 18px; display: block; }

/* Narrow: sidebar collapses to a horizontal scroll strip above the content */
@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: sticky; top: 0; width: auto; height: auto; flex-direction: row;
    align-items: center; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--c-border-subtle); }
  .sidebar .brand { padding: 12px 16px; }
  .sidenav { display: flex; flex: 1 1 100%; overflow-x: auto; padding: 4px 8px 8px; scrollbar-width: none; }
  .sidenav::-webkit-scrollbar { display: none; }
  .sidenav a { margin-bottom: 0; white-space: nowrap; }
  .sidenav a .nav-ico { display: none; }
  .nav-group, .side-sep, .side-foot { display: none; }
}

/* ---------------------------------------------------------------- Layout */
.container { max-width: var(--container-max); margin: 0 auto; padding: var(--space-5); }
.page-header {
  display: flex; align-items: flex-start; gap: var(--space-4); flex-wrap: wrap;
  padding-bottom: var(--space-4); margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--c-border);
}
.page-header .ph-main { min-width: 0; }
.page-title { font-size: var(--text-xl); color: var(--c-text-strong); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-sub { color: var(--c-muted); font-size: var(--text-sm); margin-top: 4px; }
.page-header .ph-actions { margin-left: auto; display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }

.grid { display: grid; gap: var(--space-5); }
.cols-2 { grid-template-columns: 2fr 1fr; }
.cols-even { grid-template-columns: 1fr 1fr; }
@media (max-width: 960px) { .cols-2, .cols-even { grid-template-columns: 1fr; } }

.section { margin-bottom: var(--space-6); }
.section-head {
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.section-head h2 { font-size: var(--text-lg); color: var(--c-text-strong); }
.section-head .sh-actions { margin-left: auto; display: flex; gap: var(--space-2); }
.section-head .count { color: var(--c-muted); font-weight: var(--weight-medium); font-size: var(--text-sm); }

/* ---------------------------------------------------------------- Card */
.card {
  background: var(--c-surface); border: 1px solid var(--c-border-subtle);
  border-radius: var(--radius-lg); box-shadow: var(--c-shadow-sm);
}
.card.pad { padding: var(--space-5); }
.card-head {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--c-border-subtle);
}
.card-head h3 { font-size: var(--text-md); color: var(--c-text-plain); }
.card-head .ch-actions { margin-left: auto; display: flex; gap: var(--space-2); }
.card-body { padding: var(--space-5); }
.card.wash { background: var(--c-wash); border-color: var(--c-primary-bright); }
.card.brand { background: var(--c-primary); color: var(--c-on-primary); border: none; }
.card.brand h3, .card.brand .kpi-value { color: var(--c-on-primary); }

/* ---------------------------------------------------------------- Buttons */
.btn, .btn-primary, .btn-secondary, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 var(--space-4); border-radius: var(--radius-md);
  font: inherit; font-size: var(--text-sm); font-weight: var(--weight-semibold);
  cursor: pointer; border: 1px solid transparent; transition: background var(--transition-fast), transform var(--transition-fast);
  text-decoration: none; white-space: nowrap;
}
.btn:active, .btn-primary:active, .btn-secondary:active, .btn-danger:active { transform: scale(0.985); }
.btn-primary { background: var(--c-primary); color: var(--c-on-primary); }
.btn-primary:hover { background: var(--c-primary-bright); text-decoration: none; }
.btn-primary:active { background: var(--c-primary-pressed); }
.btn-secondary { background: var(--c-surface); color: var(--c-text-strong); border-color: var(--c-border); }
.btn-secondary:hover { background: var(--c-surface-2); text-decoration: none; }
.btn-danger { background: transparent; color: var(--st-fail-fg); border-color: var(--st-fail-fg); }
.btn-danger:hover { background: var(--st-fail-bg); text-decoration: none; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: var(--text-xs); }
.btn:disabled, .btn-primary:disabled, .btn-secondary:disabled, .btn-danger:disabled,
[disabled].btn, .btn.is-disabled {
  opacity: 0.5; cursor: not-allowed; pointer-events: none;
}
.btn-group { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* ---------------------------------------------------------------- Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: var(--weight-semibold); line-height: 1.3;
  white-space: nowrap; border: 1px solid transparent;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.plain::before { display: none; }
.badge-neutral  { background: var(--st-neutral-bg);  color: var(--st-neutral-fg); }
.badge-confirmed{ background: var(--st-confirmed-bg); color: var(--st-confirmed-fg); }
.badge-progress { background: var(--st-progress-bg);  color: var(--st-progress-fg); }
.badge-qc       { background: var(--st-qc-bg);        color: var(--st-qc-fg); }
.badge-fail     { background: var(--st-fail-bg);      color: var(--st-fail-fg); }
.badge-ready    { background: var(--st-ready-bg);     color: var(--st-ready-fg); }
.badge-shipped  { background: var(--st-shipped-bg);   color: var(--st-shipped-fg); }
.badge-delivered{ background: var(--st-delivered-bg); color: var(--st-delivered-fg); }
.badge-complete { background: var(--st-complete-bg);  color: var(--st-complete-fg); }

/* ---------------------------------------------------------------- Tables */
.table-wrap { overflow: auto; border: 1px solid var(--c-border-subtle); border-radius: var(--radius-lg); background: var(--c-surface); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
table.data thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--c-surface-2); color: var(--c-muted);
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  text-transform: uppercase; letter-spacing: var(--tracking-wide);
  text-align: left; padding: 10px var(--space-4); border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}
table.data th.num, table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data th.sortable { cursor: pointer; }
table.data th.sortable::after { content: " ↕"; color: var(--c-faint); font-size: 0.9em; }
table.data th.sortable.asc::after  { content: " ↑"; color: var(--c-primary-bright); }
table.data th.sortable.desc::after { content: " ↓"; color: var(--c-primary-bright); }
table.data tbody td { padding: 12px var(--space-4); border-bottom: 1px solid var(--c-border-subtle); color: var(--c-text); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr:hover { background: var(--c-surface-2); }
table.data td .t-strong { font-weight: var(--weight-semibold); color: var(--c-text-plain); }
table.data td .t-sub { color: var(--c-muted); font-size: var(--text-xs); }

/* Collapse to cards on narrow */
@media (max-width: 720px) {
  table.data.collapse thead { display: none; }
  table.data.collapse, table.data.collapse tbody, table.data.collapse tr, table.data.collapse td { display: block; width: 100%; }
  table.data.collapse tr { border: 1px solid var(--c-border-subtle); border-radius: var(--radius-md); margin-bottom: var(--space-3); padding: var(--space-2); }
  table.data.collapse tr:hover { background: transparent; }
  table.data.collapse td { border: none; padding: 6px var(--space-3); display: flex; justify-content: space-between; gap: var(--space-4); text-align: right; }
  table.data.collapse td::before { content: attr(data-label); color: var(--c-muted); font-size: var(--text-xs);
    font-weight: var(--weight-semibold); text-transform: uppercase; letter-spacing: var(--tracking-wide); text-align: left; }
  table.data.collapse td.num { text-align: right; }
  table.data.collapse td:empty { display: none; }
}

/* ---------------------------------------------------------------- KPI */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
@media (max-width: 960px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .kpi-row { grid-template-columns: 1fr; } }
.kpi {
  background: var(--c-surface); border: 1px solid var(--c-border-subtle);
  border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); box-shadow: var(--c-shadow-sm);
}
.kpi-value { font-size: var(--text-2xl); font-weight: var(--weight-bold); color: var(--c-text-strong); line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-label { display: block; margin-top: 8px; font-size: var(--text-xs); color: var(--c-muted);
  text-transform: uppercase; letter-spacing: var(--tracking-wide); font-weight: var(--weight-semibold); }
.kpi-attention { border-color: var(--st-progress-fg); background: var(--st-progress-bg); }
.kpi-attention .kpi-value, .kpi-attention .kpi-label { color: var(--st-progress-fg); }
.kpi .kpi-delta { font-size: var(--text-xs); margin-top: 6px; }
.kpi a { color: inherit; }

/* ---------------------------------------------------------------- Key-value */
dl.kv { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 10px var(--space-5); }
dl.kv dt { color: var(--c-muted); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--tracking-wide); font-weight: var(--weight-semibold); align-self: center; }
dl.kv dd { margin: 0; color: var(--c-text-plain); font-weight: var(--weight-medium); }
dl.kv.stack { grid-template-columns: 1fr; gap: 4px var(--space-4); }
dl.kv.stack dt { margin-top: var(--space-3); }

/* ---------------------------------------------------------------- Flash */
.flash {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: 12px var(--space-4); border-radius: var(--radius-md);
  border: 1px solid transparent; margin-bottom: var(--space-4); font-size: var(--text-sm);
}
.flash .flash-icon { font-weight: var(--weight-bold); flex: none; }
.flash .flash-close { margin-left: auto; background: none; border: none; color: inherit; font-size: 1.1rem; cursor: pointer; line-height: 1; padding: 2px 4px; opacity: 0.7; }
.flash .flash-close:hover { opacity: 1; }
.flash-success { background: var(--flash-success-bg); color: var(--flash-success-fg); border-color: var(--flash-success-bd); }
.flash-danger, .flash-error { background: var(--flash-error-bg); color: var(--flash-error-fg); border-color: var(--flash-error-bd); }
.flash-warning { background: var(--flash-warning-bg); color: var(--flash-warning-fg); border-color: var(--flash-warning-bd); }
.flash-info    { background: var(--flash-info-bg);    color: var(--flash-info-fg);    border-color: var(--flash-info-bd); }

/* ---------------------------------------------------------------- Forms */
.field { margin-bottom: var(--space-4); }
.field > label { display: block; font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--c-text-plain); margin-bottom: 6px; }
.field .req { color: var(--st-fail-fg); margin-left: 2px; }
.field .opt { color: var(--c-muted); font-weight: var(--weight-regular); font-size: var(--text-xs); margin-left: 6px; }
input[type="text"], input[type="password"], input[type="number"], input[type="email"], input[type="date"], input[type="search"], input[type="tel"], select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px;
  font: inherit; font-size: var(--text-sm); color: var(--c-text-plain);
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
textarea { min-height: 96px; resize: vertical; line-height: var(--leading-normal); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--c-focus); box-shadow: 0 0 0 3px var(--c-focus-ring); }
input::placeholder, textarea::placeholder { color: var(--c-faint); }
input[readonly], .is-readonly {
  background: var(--c-surface-2); color: var(--c-muted); border-style: dashed; cursor: default;
}
.field .hint { font-size: var(--text-xs); color: var(--c-muted); margin-top: 6px; }
.field.error input, .field.error select, .field.error textarea { border-color: var(--st-fail-fg); box-shadow: 0 0 0 3px rgba(163,41,34,0.14); }
.field .field-error { display: flex; gap: 6px; font-size: var(--text-xs); color: var(--st-fail-fg); margin-top: 6px; font-weight: var(--weight-medium); }

/* File upload */
.file-upload {
  border: 1.5px dashed var(--c-border); border-radius: var(--radius-md);
  padding: var(--space-5); text-align: center; background: var(--c-surface-2); cursor: pointer;
}
.file-upload:hover { border-color: var(--c-primary-bright); background: var(--c-wash); }
.file-upload .fu-title { font-weight: var(--weight-semibold); color: var(--c-text-plain); }
.file-upload .fu-meta { font-size: var(--text-xs); color: var(--c-muted); margin-top: 4px; }

/* Radio / checkbox groups */
.radio-group { display: flex; flex-direction: column; gap: var(--space-2); }
.radio-opt {
  display: flex; align-items: center; gap: 10px; min-height: var(--tap);
  padding: 0 var(--space-4); border: 1px solid var(--c-border); border-radius: var(--radius-md);
  cursor: pointer; font-weight: var(--weight-medium); background: var(--c-surface);
}
.radio-opt:hover { border-color: var(--c-primary-bright); }
.radio-opt input { width: auto; min-height: auto; }
.radio-opt.selected { border-color: var(--c-primary); background: var(--c-wash); }

/* ---------------------------------------------------------------- Filter / pagination */
.filterbar {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  padding: var(--space-3) var(--space-4); background: var(--c-surface); border: 1px solid var(--c-border-subtle);
  border-radius: var(--radius-lg); margin-bottom: var(--space-4);
}
.filterbar .grow { flex: 1; min-width: 180px; }
.filterbar .field { margin: 0; }
.filterbar input, .filterbar select { min-height: 38px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; min-height: 32px;
  border-radius: var(--radius-pill); border: 1px solid var(--c-border); background: var(--c-surface);
  font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--c-text); cursor: pointer;
}
.chip:hover { text-decoration: none; background: var(--c-surface-2); }
.chip.active { background: var(--c-primary); color: var(--c-on-primary); border-color: var(--c-primary); }
.pagination { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: var(--space-4); }
.pagination a, .pagination span {
  min-width: 36px; height: 36px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-border); border-radius: var(--radius-md); font-size: var(--text-sm); color: var(--c-text); background: var(--c-surface);
}
.pagination a:hover { background: var(--c-surface-2); text-decoration: none; }
.pagination .current { background: var(--c-primary); color: var(--c-on-primary); border-color: var(--c-primary); }
.pagination .disabled { opacity: 0.45; pointer-events: none; }

/* ---------------------------------------------------------------- Empty state */
.empty {
  text-align: center; padding: var(--space-7) var(--space-5);
  border: 1px dashed var(--c-border); border-radius: var(--radius-lg); background: var(--c-surface-2); color: var(--c-muted);
}
.empty .empty-mark { width: 44px; height: 44px; border-radius: 50%; margin: 0 auto var(--space-3);
  background: var(--c-wash); color: var(--c-primary-bright); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.empty .empty-title { color: var(--c-text-plain); font-weight: var(--weight-semibold); font-size: var(--text-md); }
.empty p { margin: 6px 0 var(--space-4); }

/* ---------------------------------------------------------------- Step progress (lot / DO lifecycle) */
.steps { display: flex; align-items: flex-start; gap: 0; list-style: none; margin: 0; padding: 0; }
.steps li { flex: 1; position: relative; text-align: center; padding-top: 30px; font-size: var(--text-xs); color: var(--c-muted); min-width: 0; }
.steps li::before {
  content: ""; position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 18px; height: 18px; border-radius: 50%; background: var(--c-surface); border: 2px solid var(--c-border); z-index: 2;
}
.steps li::after { content: ""; position: absolute; top: 14px; left: -50%; width: 100%; height: 2px; background: var(--c-border); z-index: 1; }
.steps li:first-child::after { display: none; }
.steps li .step-label { font-weight: var(--weight-semibold); color: var(--c-text-plain); display: block; }
.steps li .step-meta { color: var(--c-muted); }
.steps li.done::before { background: var(--c-primary); border-color: var(--c-primary); }
.steps li.done::after, .steps li.current::after { background: var(--c-primary); }
.steps li.current::before { background: var(--c-surface); border-color: var(--c-primary); box-shadow: 0 0 0 4px var(--c-focus-ring); }
.steps li.current .step-label { color: var(--c-text-strong); }
.steps li.rejected::before { background: var(--st-fail-fg); border-color: var(--st-fail-fg); }

/* Utility */
.stack-sm > * + * { margin-top: var(--space-3); }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: var(--space-3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.divider { height: 1px; background: var(--c-border-subtle); border: none; margin: var(--space-4) 0; }
.notes-item { padding: var(--space-3) 0; border-bottom: 1px solid var(--c-border-subtle); }
.notes-item:last-child { border-bottom: none; }
.notes-item .n-meta { font-size: var(--text-xs); color: var(--c-muted); margin-bottom: 2px; }

/* ============================================================================
   App integration — shell glue not in the static mockups
   ============================================================================ */
/* inline forms (logout, small POST actions) sit inline with buttons */
form.inline, .inline { display: inline; }
.appbar form.inline { display: inline-flex; }

/* Login page (unauthenticated) — centred card */
body.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--c-bg); padding: 24px; }
.login-card { width: 100%; max-width: 400px; }
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand img.brand-logo { height: 46px; width: auto; }
.login-brand p { color: var(--c-muted); font-size: var(--text-sm); margin: 10px 0 0; }

/* Footer (app chrome) */
footer.foot { text-align: center; padding: var(--space-5); color: var(--c-faint); font-size: var(--text-xs); }
.app-main footer.foot { border-top: 1px solid var(--c-border-subtle); margin-top: auto; }

/* labelled cards helper already covered by table.data.collapse */
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
