/* EightSkys Sky, design system v1 (20 Nov 2026).
   One shared layer on top of control-theme.css: brand colours, one typeface, spacing, and the look of every shared
   piece (top bar, page heading, tabs, buttons, fields, cards, tables, notices). It changes no behaviour, no text and no
   element; screens keep their own layout rules. Business documents and print keep their own colours. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/inter-regular.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/inter-medium.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/inter-semibold.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/inter-bold.woff") format("woff"); }

/* ---------- 1. Tokens ---------- */
html[data-appearance="light"], html:not([data-appearance]) {
  color-scheme: light;
  --control-canvas: #f3f5f8;
  --control-paper: #ffffff;
  --control-raised: #f8fafc;
  --control-ink: #0f1b2d;
  --control-muted: #556479;
  --control-faint: #5f6e82;
  --control-line: #e2e7ee;
  --control-soft: #eef2f7;
  --control-accent: #0a6cb4;
  --control-accent-hover: #075896;
  --control-accent-ink: #ffffff;
  --control-success: #12704a;
  --control-success-bg: #e9f7ef;
  --control-success-line: #bfe3cf;
  --control-warning: #8a5300;
  --control-warning-bg: #fff6e5;
  --control-warning-line: #f3d9a6;
  --control-danger: #b42318;
  --control-danger-bg: #fef1ef;
  --control-danger-line: #f6c9c3;
  --control-shadow: 0 12px 32px rgba(15, 27, 45, .12), 0 2px 6px rgba(15, 27, 45, .06);
  --sky-line-strong: #cdd5e0;
  --sky-accent-soft: #e8f2fb;
  --sky-accent-line: #b9d6ef;
  --sky-brand: #2aa4dd;
  --sky-card-shadow: 0 1px 2px rgba(15, 27, 45, .05);
  --sky-header: #ffffff;
}
html[data-appearance="dark"] {
  color-scheme: dark;
  --control-canvas: #0b1220;
  --control-paper: #121b2c;
  --control-raised: #172235;
  --control-ink: #e8eef7;
  --control-muted: #a3b1c6;
  --control-faint: #93a3b9;
  --control-line: #24324a;
  --control-soft: #1c2940;
  --control-accent: #5ab8f0;
  --control-accent-hover: #86cbf5;
  --control-accent-ink: #062238;
  --control-success: #6fd3a1;
  --control-success-bg: #10301f;
  --control-success-line: #1f5a3c;
  --control-warning: #f4c26b;
  --control-warning-bg: #352710;
  --control-warning-line: #6a4d1d;
  --control-danger: #ff9b8f;
  --control-danger-bg: #3a1a17;
  --control-danger-line: #6e3029;
  --control-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  --sky-line-strong: #33445f;
  --sky-accent-soft: #12304a;
  --sky-accent-line: #1f4f75;
  --sky-brand: #5ab8f0;
  --sky-card-shadow: none;
  --sky-header: #0f1828;
}
/* DS-50: :root, not just html, so the old style.css :root background (#f7f8fa) cannot win: in dark mode it left a light
   strip below short pages and behind overscroll. */
:root, html { background: var(--control-canvas, #f3f5f8); }
body.control-shell {
  --sky-font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --sky-r-sm: 6px;
  --sky-r: 8px;
  --sky-r-lg: 12px;
  --control-gutter: 28px;
  font-family: var(--sky-font);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
.control-shell :is(h1, .metric-card strong, .management-summary-value, .control-sidebar-brand) { font-family: var(--sky-font); }
.control-shell :is(h1, h2, h3, h4):not(.business-document *) { letter-spacing: -.011em; }

/* ---------- 2. Buttons ---------- */
.control-shell :is(button, .button-link) {
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid var(--sky-line-strong);
  border-radius: var(--sky-r);
  background: var(--control-paper);
  color: var(--control-ink);
  box-shadow: var(--sky-card-shadow);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.35;
  letter-spacing: 0;
}
.control-shell :is(button, .button-link):hover { background: var(--control-raised); border-color: var(--control-faint); }
.control-shell :is(button, .button-link):active { transform: translateY(.5px); }
.control-shell button:is(.primary, .selected) {
  background: var(--control-accent);
  border-color: var(--control-accent);
  color: var(--control-accent-ink);
  box-shadow: 0 1px 2px rgba(10, 108, 180, .25);
}
.control-shell button:is(.primary, .selected):hover { background: var(--control-accent-hover); border-color: var(--control-accent-hover); }
.control-shell button:is(.danger, .destructive) { color: var(--control-danger); border-color: var(--control-danger-line); }
.control-shell :is(button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--control-accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--sky-accent-soft);
}

/* ---------- 3. Fields ---------- */
.control-shell :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"]), select, textarea) {
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--sky-line-strong);
  border-radius: var(--sky-r);
  background-color: var(--control-paper);
  color: var(--control-ink);
  font-size: 14px;
  box-shadow: inset 0 1px 1px rgba(15, 27, 45, .03);
  transition: border-color .15s, box-shadow .15s;
}
.control-shell :is(input, select, textarea):hover:not(:disabled, :focus) { border-color: var(--control-faint); }
.control-shell :is(input, select, textarea):focus { border-color: var(--control-accent); box-shadow: 0 0 0 3px var(--sky-accent-soft); outline: none; }
.control-shell :is(input, select, textarea):focus-visible { outline: none; }
.control-shell select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667589' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 12px;
}
.control-shell select[multiple] { background-image: none; padding-right: 11px; }
.control-shell input[readonly] { background: var(--control-raised); }
.control-shell :is(input[type="checkbox"], input[type="radio"]) { width: 16px; height: 16px; margin: 0; accent-color: var(--control-accent); flex: 0 0 auto; }
.control-shell label { font-size: 13px; font-weight: 500; color: var(--control-ink); }
.control-shell label:has(> input[type="checkbox"], > input[type="radio"]) { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.control-shell :is(input, textarea)::placeholder { color: #8794a7; }
html[data-appearance="dark"] .control-shell :is(input, textarea)::placeholder { color: #6f7f96; }

/* ---------- 4. Top bars ---------- */
@media (min-width: 901px) {
  .control-shell .control-sidebar {
    background: var(--sky-header);
    border-bottom: 1px solid var(--control-line);
    box-shadow: 0 1px 0 rgba(15, 27, 45, .02);
    gap: 18px;
  }
  .control-shell .control-module {
    padding: 0 10px;
    border: 0;
    border-top: 2px solid transparent;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: none;
    color: var(--control-muted);
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: none;
    min-height: 0;
  }
  .control-shell .control-module:hover { background: none; border-color: transparent; }
  .control-shell .control-sidebar-company { flex: 0 0 auto; max-width: 200px; }
  .control-shell .control-module:hover { color: var(--control-ink); }
  .control-shell .control-module:is(.selected, .active, [aria-current="page"], [aria-pressed="true"]) {
    color: var(--control-ink);
    font-weight: 600;
    border-bottom-color: var(--control-accent);
    border-bottom-width: 2px;
  }
  .control-shell .control-sidebar-company strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    padding: 5px 10px;
    border: 1px solid var(--control-line);
    border-radius: 999px;
    background: var(--control-raised);
    color: var(--control-ink);
    font-size: 12px;
    font-weight: 600;
  }
  /* One slim bar under the modules: breadcrumb, search, Waiting for me, who is signed in, help, appearance, sign-in time, sign out. */
  .control-shell .control-topbar {
    min-height: 52px;
    padding: 8px var(--control-gutter);
    gap: 10px;
    background: color-mix(in srgb, var(--control-canvas) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(8px);
    -webkit-backdrop-filter: saturate(1.4) blur(8px);
  }
  .control-shell .control-breadcrumb { flex: 0 1 auto; min-width: 120px; }
  .control-shell .control-topbar-tools { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; justify-content: flex-end; }
  .control-shell .control-topbar-tools .header-search { flex: 0 1 300px; max-width: 300px; margin-right: auto; margin-left: 12px; }
}
.control-shell .control-topbar-tools .header-tools { display: flex; align-items: center; gap: 10px; min-width: 0; }
.control-shell .control-topbar-tools .header-tools[hidden] { display: none; }
.control-shell .control-topbar-tools .workspace-chip { display: none; }
.control-shell.signed-in .app-header { display: none; }
.control-shell .control-sidebar-brand { gap: 10px; font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.control-shell :is(.control-brand-mark, .control-sidebar-brand > svg) {
  flex-basis: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #39b3ea 0%, #0a6cb4 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12);
}
.control-shell .control-breadcrumb { font-size: 13px; color: var(--control-muted); gap: 6px; }
.control-shell .control-breadcrumb :is(strong, b) { font-size: 13px; font-weight: 600; }
.control-shell .header-search { position: relative; }
.control-shell .header-search input { min-height: 34px; padding: 6px 12px 6px 34px; border-radius: 999px; font-size: 13px; background: var(--control-paper); }
.control-shell .header-search::before { left: 13px; top: 50%; transform: translateY(-50%); line-height: 1; font-size: 14px; }
.control-shell .control-topbar :is(.header-work, .header-signout, .howdoi-open) {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--control-line);
  border-radius: var(--sky-r);
  background: var(--control-paper);
  color: var(--control-ink);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.control-shell .control-topbar :is(.header-work, .header-signout, .howdoi-open):hover { background: var(--control-raised); border-color: var(--sky-line-strong); }
/* Help, sign-in time and sign out are quiet text buttons; "Waiting for me" keeps its outline because it carries a count. */
.control-shell .control-topbar :is(.header-signout, .howdoi-open) { border-color: transparent; background: transparent; color: var(--control-muted); }
.control-shell .control-topbar :is(.header-signout, .howdoi-open):hover { color: var(--control-ink); background: var(--control-soft); border-color: transparent; }
.control-shell .header-work .header-work-count { min-width: 20px; padding: 0 6px; border-radius: 999px; font-size: 11.5px; line-height: 18px; background: var(--control-soft); color: var(--control-ink); }
.control-shell .header-work.has-work .header-work-count { background: var(--control-accent); color: var(--control-accent-ink); }
.control-shell .header-work.has-late .header-work-count { background: var(--control-danger); color: #fff; }
.control-shell .control-topbar #identity { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--control-muted); font-size: 12.5px; font-weight: 500; }
.control-shell .control-theme-toggle { margin-left: 0; padding: 2px; border-radius: var(--sky-r); background: var(--control-raised); border-color: var(--control-line); }
.control-shell .control-theme-toggle > button { min-height: 28px; padding: 3px 10px; border-radius: 6px; font-size: 12px; box-shadow: none; }
.control-shell .control-theme-toggle > button[aria-pressed="true"] { background: var(--control-paper); color: var(--control-ink); box-shadow: 0 1px 2px rgba(15, 27, 45, .12); }
.control-shell .work-inbox-panel { top: 116px; background: var(--control-paper); color: var(--control-ink); border-color: var(--control-line); box-shadow: var(--control-shadow); }

/* ---------- 5. Page heading ---------- */
.control-shell #viewEyebrow { display: none; }
.control-shell .heading { margin: 22px 0 18px; gap: 16px; }
.control-shell .heading h1 { margin: 0; font-size: 24px; font-weight: 650; line-height: 1.25; letter-spacing: -.02em; }
.control-shell .heading > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.control-shell .info-note-button {
  min-height: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  border-color: var(--control-line);
  background: transparent;
  color: var(--control-faint);
  font: italic 600 11px/1 Georgia, serif;
  box-shadow: none;
}
.control-shell .info-note-button:hover { color: var(--control-accent); border-color: var(--sky-accent-line); background: var(--sky-accent-soft); }
.control-shell .heading .refresh-button { gap: 6px; }

/* ---------- 6. Tabs: module sections underline; inner tabs are a quiet segmented row ---------- */
.control-shell .control-section-tabs {
  gap: 2px;
  margin: 0 0 22px;
  padding: 0;
  border-bottom: 1px solid var(--control-line);
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.control-shell .control-section-tabs::-webkit-scrollbar { display: none; }
.control-shell .control-section-tabs button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 12px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--control-muted);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
}
.control-shell .control-section-tabs button:hover { background: transparent; color: var(--control-ink); border-bottom-color: var(--sky-line-strong); }
.control-shell .control-section-tabs button:is(.selected, .active, [aria-current="page"], [aria-pressed="true"]) {
  background: transparent;
  border-bottom-color: var(--control-accent);
  color: var(--control-ink);
  font-weight: 600;
}
.control-shell .management-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--control-line);
  border-radius: 10px;
  background: var(--control-raised);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.control-shell .management-tabs > button {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  color: var(--control-muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.control-shell .management-tabs > button:hover { color: var(--control-ink); background: var(--control-soft); }
.control-shell .management-tabs > button:is([aria-current="page"], [aria-selected="true"], [aria-pressed="true"], .selected) {
  background: var(--control-paper);
  border-color: var(--control-line);
  color: var(--control-ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 27, 45, .08);
}
.control-shell .management-tabs > button::after { display: none; }

/* ---------- 7. Cards and panels ---------- */
.control-shell :is(.panel, .menu-workspace, .metric-card, .company-card, .managed-item, .customer-register,
  .sales-balance-tile, .management-summary-card, .management-table-wrap, .management-detail-card,
  .location-report-breakdown, .location-report-documents, .location-report-detail, .counterparty-filters,
  .sales-draft-register, .purchasing-register-card, .purchasing-draft-card) {
  border: 1px solid var(--control-line);
  border-radius: var(--sky-r-lg);
  background: var(--control-paper);
  box-shadow: var(--sky-card-shadow);
}
.control-shell .panel { padding: 22px 24px; }
.control-shell .panel h2 { margin-top: 0; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.control-shell .panel h3 { font-size: 14px; font-weight: 650; }
.control-shell .panel > p:first-of-type { color: var(--control-muted); }
.control-shell details:not(.business-document *) > summary { cursor: pointer; font-weight: 600; }
.control-shell :is(.management-empty, .workspace-readiness-card, .purchasing-register-record, .purchasing-preflight,
  .purchase-invoice-action, .money-report-filters, .purchase-document-options, .sales-vat-controls, .sales-vat-totals,
  .sales-stock-tools, .sales-payment-form, .sales-fix-panel) { border-radius: 10px; }

/* Key figures */
.control-shell :is(.metrics-grid, .management-summary-grid) { gap: 12px; }
.control-shell .metric-card { padding: 16px 18px; }
.control-shell .metric-card small { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--control-muted); }
.control-shell .metric-card strong { margin-top: 6px; font-size: 26px; font-weight: 650; letter-spacing: -.02em; }
.control-shell .metric-card .secondary { font-size: 12px; }
.control-shell .management-summary-card { min-height: 0; padding: 14px 16px; }
.control-shell .management-summary-label { font-size: 12px; font-weight: 500; }
.control-shell .management-summary-value { font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.control-shell .management-summary-meta { font-size: 12px; }

/* ---------- 8. Tables ---------- */
.control-shell table:not(.business-document *) { border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.control-shell th:not(.business-document *) {
  padding: 10px 14px;
  background: var(--control-raised);
  color: var(--control-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  border-bottom: 1px solid var(--control-line);
  white-space: nowrap;
}
.control-shell td:not(.business-document *) { padding: 11px 14px; border-bottom: 1px solid var(--control-line); vertical-align: middle; }
.control-shell tbody tr:last-child > td:not(.business-document *) { border-bottom: 0; }
.control-shell tbody tr:not(.business-document *):hover > td { background: color-mix(in srgb, var(--control-raised) 70%, transparent); }
.control-shell :is(td, th):is(.num, .amount, .money, .numeric, .number, [data-type="number"]) { text-align: right; font-variant-numeric: tabular-nums; }
.control-shell :is(.table-scroll, .management-table-wrap) { border-radius: var(--sky-r-lg); }
.control-shell :is(.table-scroll, .management-table-wrap) > table { width: 100%; }
.control-shell tfoot :is(td, th):not(.business-document *) { font-weight: 650; color: var(--control-ink); border-top: 1px solid var(--sky-line-strong); background: var(--control-raised); }

/* Row action buttons inside tables stay small and quiet */
.control-shell td :is(button, .button-link):not(.primary) { min-height: 30px; padding: 4px 10px; font-size: 12.5px; }

/* ---------- 9. Messages, notices, chips ---------- */
.control-shell .notice {
  border: 1px solid var(--sky-accent-line);
  border-radius: 10px;
  background: var(--sky-accent-soft);
  color: var(--control-ink);
}
.control-shell :is(.badge, .sync-badge, .category-chip, .workspace-chip, .status-chip) {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 550;
}
.control-shell .message[data-tone="ok"] { color: var(--control-success); }
/* DS-05: guidance and "not available yet" lines read as information (normal ink, blue edge), not as an error. */
.control-shell :is(.message, p, div, output)[data-tone="info"] { color: var(--control-ink); border-left: 3px solid var(--control-accent); padding-left: 10px; }
.control-shell :is(.message, p, div, output)[data-tone="info"]:empty { border-left: 0; padding-left: 0; }

/* ---------- 10. Dialogs and floating sheets ---------- */
.control-shell dialog { border: 1px solid var(--control-line); border-radius: 14px; background: var(--control-paper); color: var(--control-ink); box-shadow: var(--control-shadow); padding: 22px 24px; }
.control-shell dialog::backdrop { background: rgba(15, 27, 45, .45); backdrop-filter: blur(2px); }
.control-shell dialog h2 { font-size: 18px; font-weight: 650; }
.control-shell .floating-sheet { border-radius: 14px; box-shadow: var(--control-shadow); }

/* ---------- 11. Screen fixes ---------- */
/* Dashboard: the period explanation reads as a quiet note, not a coloured block. */
.control-shell #dashboardGreeting { font-size: 15px; font-weight: 650; letter-spacing: -.01em; text-transform: none; color: var(--control-ink); }
.control-shell #dashboardScope { font-size: 12.5px; }
.control-shell #dashboard .location-report-scope { padding: 0; border: 0; background: transparent; }
.control-shell .location-report-workspace.is-dashboard .location-report-scope p { font-size: 12.5px; color: var(--control-muted); max-width: 120ch; }
.control-shell .location-dashboard-filters { border-radius: 10px; }
/* Point of sale: the order queue line is information, not a warning, and stays on one quiet line. */
.control-shell .menu-card { border-radius: var(--sky-r-lg); }
.control-shell .menu-card:hover { border-color: var(--sky-accent-line); box-shadow: 0 4px 14px rgba(15, 27, 45, .08); }
.control-shell .menu-price { color: var(--control-ink); font-weight: 650; }
.control-shell .category-chip { min-height: 32px; padding: 4px 12px; }
.control-shell .category-chip.selected { background: var(--control-ink); border-color: var(--control-ink); color: var(--control-paper); }
.control-shell .cart-panel { border-radius: var(--sky-r-lg); box-shadow: var(--sky-card-shadow); }

/* Sign-in page: white brand bar, a sky-blue welcome panel beside the sign-in card. */
body:not(.signed-in) { min-height: 100vh; background: #f3f5f8; font-family: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: #0f1b2d; -webkit-font-smoothing: antialiased; }
body:not(.signed-in) .app-header { min-height: 72px; border-bottom: 1px solid #e2e7ee; background: #fff; box-shadow: 0 0 0 100vmax #fff; clip-path: inset(0 -100vmax); }
body:not(.signed-in) .app-header .brand-lockup img { width: 200px; height: 56px; object-fit: cover; }
body:not(.signed-in) .app-header .brand-lockup #companyLabel { display: none; }
body:not(.signed-in) .login-grid {
  grid-template-columns: 1.05fr 1fr;
  gap: 0;
  max-width: 1080px;
  margin: 56px auto;
  border: 1px solid #e2e7ee;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 27, 45, .10);
  align-items: stretch;
}
body:not(.signed-in) .login-grid > .intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 52px;
  color: #fff;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .18) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(150deg, #39b3ea 0%, #0a6cb4 55%, #074a80 100%);
}
body:not(.signed-in) .login-grid > .intro .eyebrow { color: rgba(255, 255, 255, .85); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
body:not(.signed-in) .login-grid > .intro h1 { color: #fff; font-size: clamp(30px, 3.4vw, 42px); font-weight: 700; letter-spacing: -.03em; line-height: 1.12; }
body:not(.signed-in) .login-grid > .intro p { color: rgba(255, 255, 255, .92); font-size: 15px; }
body:not(.signed-in) .login-grid > .intro p.secondary { color: rgba(255, 255, 255, .78); font-size: 14px; }
body:not(.signed-in) .login-grid > .panel { margin: 0; padding: 48px 44px; border: 0; border-radius: 0; box-shadow: none; background: #fff; }
body:not(.signed-in) .login-grid > .panel h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
body:not(.signed-in) .login-grid input { min-height: 44px; border: 1px solid #cdd5e0; border-radius: 10px; font-size: 15px; }
body:not(.signed-in) .login-grid input:focus { border-color: #0a6cb4; outline: none; box-shadow: 0 0 0 3px #e8f2fb; }
body:not(.signed-in) .login-grid button.primary { min-height: 46px; border-radius: 10px; background: #0a6cb4; border-color: #0a6cb4; font-size: 15px; font-weight: 600; }
body:not(.signed-in) .login-grid button.primary:hover { background: #075896; }
@media (max-width: 820px) {
  body:not(.signed-in) .login-grid { grid-template-columns: 1fr; margin: 20px 0; border-radius: 16px; }
  body:not(.signed-in) .login-grid > .intro { padding: 28px 24px; }
  body:not(.signed-in) .login-grid > .intro h1 { font-size: 28px; margin: 10px 0 12px; }
  body:not(.signed-in) .login-grid > .panel { padding: 28px 24px; }
}

/* ---------- 12. Phones ---------- */
@media (max-width: 900px) {
  body.control-shell { --control-gutter: 16px; }
  .control-shell .control-topbar { flex-wrap: wrap; row-gap: 8px; padding-top: 10px; padding-bottom: 10px; background: var(--sky-header); }
  .control-shell .control-topbar-tools { order: 10; flex: 1 1 100%; display: flex; align-items: center; gap: 8px; min-width: 0; }
  .control-shell .control-topbar-tools .header-tools { display: none; }
  .control-shell .control-topbar-tools #identity { margin-left: auto; max-width: 55%; }
  .control-shell .control-breadcrumb { display: none; }
  .control-shell .heading { margin: 16px 0 14px; }
  .control-shell .heading h1 { font-size: 21px; }
  .control-shell .panel { padding: 16px; }
  .control-shell .control-section-tabs { margin-bottom: 16px; }
  .control-shell :is(input:not([type="checkbox"], [type="radio"]), select, textarea) { font-size: 16px; }
}
@media (max-width: 480px) {
  /* Everything on one row on a 360-390 px phone: menu, help, appearance, sign-in time, sign out. */
  .control-shell .control-theme-toggle > button { padding: 3px 7px; font-size: 11.5px; }
  .control-shell .control-topbar { gap: 4px; justify-content: flex-start; }
  .control-shell .control-topbar .header-signout { padding: 0 8px; }
  .control-shell .control-topbar .control-mobile-toggle { min-height: 34px; padding: 0 10px; gap: 6px; margin-right: auto; }
  .control-shell .control-topbar .sign-in-time-button { width: 32px; padding: 0; justify-content: center; }
}
@media (max-width: 700px) {
  /* "How do I…?" becomes a round "?" so nothing overlaps; its accessible name stays. */
  .control-shell .control-topbar .howdoi-open { width: 34px; padding: 0; justify-content: center; font-size: 0; }
  .control-shell .control-topbar .howdoi-open::before { content: "?"; font-size: 15px; font-weight: 700; }
}

/* ---------- 13. Shared page patterns ---------- */
/* Section headers: the label sits left, actions sit right; a lone Refresh joins the actions instead of floating mid-row. */
.control-shell header.management-header { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; }
.control-shell header.management-header > button { order: 2; margin-left: auto; }
.control-shell header.management-header > button ~ .actions { margin-left: 0; }
.control-shell header.management-header > .actions { order: 3; margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.control-shell header.management-header > button + .actions, .control-shell header.management-header > .actions:has(~ button) { margin-left: 0; }
.control-shell header.management-header .eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--control-muted); }
@media (min-width: 901px) {
  .control-shell :is(header.management-header, .toolbar, .actions, .dashboard-intro) button { white-space: nowrap; }
}

/* On/off setting rows (guided entry, one-step correction…): text left, its switch button right, in one quiet card. */
.control-shell .guide-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin: 0 0 10px;
  padding: 12px 16px;
  border: 1px solid var(--control-line);
  border-radius: 10px;
  background: var(--control-paper);
}
.control-shell .guide-setting > p { margin: 0; max-width: 110ch; font-size: 13px; }
.control-shell .guide-setting > button { flex: 0 0 auto; width: auto; }
@media (max-width: 680px) { .control-shell .guide-setting { flex-direction: column; align-items: stretch; } }

/* Report finders (Stock, Money, Branch & staff reports): each report is a card with its name and what it shows. */
.control-shell .report-hub-search input { max-width: 420px; }
.control-shell .report-hub-groups { display: grid; gap: 22px; }
.control-shell .report-hub-group h3 { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--control-muted); }
.control-shell .report-hub-group ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.control-shell .report-hub-group li { margin: 0; padding: 0; }
.control-shell .report-hub-open {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  height: 100%;
  min-height: 84px;
  padding: 14px 16px 14px 16px;
  border: 1px solid var(--control-line);
  border-radius: var(--sky-r-lg);
  background: var(--control-paper);
  text-align: left;
  white-space: normal;
  position: relative;
}
.control-shell .report-hub-open strong { font-size: 14px; font-weight: 650; color: var(--control-ink); padding-right: 22px; }
.control-shell .report-hub-open .secondary { font-size: 12.5px; font-weight: 400; line-height: 1.45; color: var(--control-muted); }
.control-shell .report-hub-open::after { content: "→"; position: absolute; top: 13px; right: 14px; color: var(--control-faint); font-size: 15px; transition: transform .15s, color .15s; }
.control-shell .report-hub-open:hover { border-color: var(--sky-accent-line); background: var(--control-paper); box-shadow: 0 4px 14px rgba(15, 27, 45, .07); }
.control-shell .report-hub-open:hover::after { color: var(--control-accent); transform: translateX(2px); }

/* Customers: the main action leads; the shown totals sit in one row of figures under the list. */
.control-shell #customers > .toolbar { justify-content: flex-end; margin: 0 0 14px; }
.control-shell #customers > .toolbar #newCustomer { order: 2; background: var(--control-accent); border-color: var(--control-accent); color: var(--control-accent-ink); }
.control-shell #customers > .toolbar #newCustomer:hover { background: var(--control-accent-hover); }
.control-shell #customers .sales-balance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 14px 0; }
.control-shell .sales-balance-tile { display: grid; gap: 4px; padding: 14px 16px; }
.control-shell .sales-balance-tile small { font-size: 12px; font-weight: 500; }
.control-shell .sales-balance-tile strong { font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.control-shell .customer-register { overflow: hidden; }
.control-shell .customer-register-labels { font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.control-shell .customer-register-row:hover { background: var(--control-raised); }

/* Action rows: buttons size to their words (a lone "Open…" no longer stretches across the page); dialogs end-align them. */
@media (min-width: 681px) {
  .control-shell .actions > button { flex: 0 0 auto; }
  .control-shell .actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .control-shell dialog .actions, .control-shell .floating-sheet .actions { justify-content: flex-end; }
}

/* Sortable column headings: the heading is the button, so it reads as a heading, not a box in the header row. */
.control-shell th:not(.business-document *) > button {
  min-height: 24px;
  min-width: 24px;
  padding: 2px 0;
  border: 0;
  border-radius: 4px;
  background: none;
  box-shadow: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
}
.control-shell th:not(.business-document *) > button:hover { background: none; color: var(--control-ink); }
.control-shell th:not(.business-document *) > button[aria-sort], .control-shell th[aria-sort]:not([aria-sort="none"]) > button { color: var(--control-ink); }

/* Phones: the Modules button reads as a menu. */
@media (max-width: 900px) {
  .control-shell .control-mobile-toggle { display: inline-flex; align-items: center; gap: 8px; }
  .control-shell .control-mobile-toggle::before { content: ""; width: 14px; height: 10px; background: linear-gradient(currentColor 0 0) top / 100% 2px no-repeat, linear-gradient(currentColor 0 0) center / 100% 2px no-repeat, linear-gradient(currentColor 0 0) bottom / 100% 2px no-repeat; }
}

/* ---------- 14. Point of sale ---------- */
/* Sale type is one compact row: the choice, its one-line meaning, and Receipts & refunds at the right. */
.control-shell #posModeHost { padding: 12px 16px; margin-bottom: 10px; }
.control-shell #posModeHost > .toolbar { margin: 0; flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.control-shell #posModeHost > .toolbar label { min-width: 200px; }
.control-shell #posModeHost #posModeHelp { margin: 6px 0 0; font-size: 12.5px; }
.control-shell #newOrderOwner { margin: 0 0 10px; font-size: 12px; }
.control-shell .pos-toolbar { margin: 0 0 8px; min-height: 0; }
.control-shell #refreshMenu { min-height: 30px; padding: 4px 10px; font-size: 12px; }
.control-shell .menu-workspace { padding: 14px; }
.control-shell .scan-entry { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--control-line); }
.control-shell .menu-grid { gap: 12px; }
.control-shell .cart-panel .cart-heading h2 { font-size: 16px; }
.control-shell .cart-total strong, .control-shell .cart-footer strong { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* Purchasing home: the two view buttons sit apart from the figures under them. */
.control-shell .management-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.control-shell .management-detail-card > .management-toolbar-actions { margin: 4px 0 16px; }
.control-shell .management-detail-card > p.secondary { margin: 4px 0 14px; }

/* Customer register (DS-07): headings and rows share the same last column, so every heading sits over its values;
   amounts are right-aligned figures. */
@media (min-width: 901px) {
  .control-shell .customer-register:not(.customer-register-branches) :is(.customer-register-labels, .customer-register-row) {
    grid-template-columns: minmax(180px, 1.6fr) minmax(130px, 1fr) minmax(120px, 1fr) minmax(130px, 1fr) 9rem;
  }
  .control-shell .customer-register:not(.customer-register-branches) :is(.customer-register-labels, .customer-register-row) > :is(span:nth-child(3), span:nth-child(4)) { text-align: right; }
  .control-shell .customer-register-row > button { justify-self: end; }
}

/* DS-06: the accounting queue line when nothing is waiting: quiet information, not an amber warning. */
.control-shell #connectionNotice.all-clear { border-color: var(--control-line); background: var(--control-paper); color: var(--control-muted); }
.control-shell #connectionNotice.all-clear::before { content: "●"; margin-right: 8px; color: var(--control-success); }

/* Search fields with a magnifier keep room for it. */
.control-shell .menu-search input { padding-left: 36px; }
.control-shell .menu-search::before { top: 50%; transform: translateY(-50%); line-height: 1; font-size: 18px; }

/* ---------- 15. Dashboard, v3 (design vision board 21 Nov) ---------- */
.control-shell #dashboard .dashboard-intro { align-items: flex-end; margin: 4px 0 20px; }
.control-shell .dashboard-hello { margin: 0 0 4px; font-size: 26px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; color: var(--control-ink); }
.control-shell .dashboard-hello:empty { display: none; }
.control-shell #dashboard .dashboard-intro #dashboardGreeting { font-size: 13px; font-weight: 600; color: var(--control-muted); letter-spacing: 0; }
.control-shell #dashboardNewOrder { min-height: 40px; padding: 0 18px; border-radius: 10px; box-shadow: 0 1px 2px rgba(10, 108, 180, .3), 0 6px 16px rgba(10, 108, 180, .2); }

/* Headline figures carry a small coloured icon tile. */
.control-shell #dashboardMetrics .metric-card { position: relative; padding: 18px 18px 16px 70px; min-height: 0; }
.control-shell #dashboardMetrics .metric-card::before {
  content: ""; display: block; position: absolute; left: 18px; top: 18px; width: 38px; height: 38px; border-radius: 10px;
  background: var(--sky-tile, var(--sky-accent-soft));
}
.control-shell #dashboardMetrics .metric-card::after {
  content: ""; position: absolute; left: 27px; top: 27px; width: 20px; height: 20px; background: var(--sky-tile-ink, var(--control-accent));
  -webkit-mask: var(--sky-icon) center / contain no-repeat; mask: var(--sky-icon) center / contain no-repeat;
}
.control-shell #dashboardMetrics .metric-card.amber { --sky-tile: var(--control-warning-bg); --sky-tile-ink: var(--control-warning); --sky-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='6' width='20' height='14' rx='2'/%3E%3Cpath d='M2 10h20M6 15h4'/%3E%3C/svg%3E"); }
.control-shell #dashboardMetrics .metric-card.blue { --sky-tile: var(--sky-accent-soft); --sky-tile-ink: var(--control-accent); --sky-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11h18M5 11V7a7 7 0 0 1 14 0v4M4 15h16l-1 5H5z'/%3E%3C/svg%3E"); }

/* Confirmed activity: the figures sit in a tidy grid. */
.control-shell #dashboard .location-report-overview .management-summary-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.control-shell #dashboard .management-summary-card { padding: 16px 16px 14px; }
.control-shell .management-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }

/* Quick actions: icon tiles. */
.control-shell .dashboard-quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.control-shell .dashboard-quick-action { position: relative; }
.control-shell .dashboard-quick-action {
  display: flex; align-items: center; gap: 12px; padding: 14px; min-height: 76px;
  border: 1px solid var(--control-line); border-radius: 12px; background: var(--control-raised); text-align: left; white-space: normal;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.control-shell .dashboard-quick-action::before {
  content: ""; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; background: var(--sky-accent-soft);
  box-shadow: inset 0 0 0 1px var(--sky-accent-line);
}
.control-shell .dashboard-quick-action:nth-child(4n+2)::before { background: var(--control-success-bg); box-shadow: inset 0 0 0 1px var(--control-success-line); }
.control-shell .dashboard-quick-action:nth-child(4n+3)::before { background: var(--control-warning-bg); box-shadow: inset 0 0 0 1px var(--control-warning-line); }
.control-shell .dashboard-quick-action:nth-child(4n)::before { background: #f3eefe; box-shadow: inset 0 0 0 1px #ddd0fb; }
html[data-appearance="dark"] .control-shell .dashboard-quick-action:nth-child(4n)::before { background: #2a2145; box-shadow: inset 0 0 0 1px #45367a; }
.control-shell .dashboard-quick-action:hover { border-color: var(--sky-accent-line); background: var(--control-paper); box-shadow: 0 6px 18px rgba(15, 27, 45, .08); transform: translateY(-1px); }
.control-shell .dashboard-action-copy strong { font-size: 13.5px; font-weight: 650; }
.control-shell .dashboard-action-copy small { font-size: 12px; line-height: 1.4; }
.control-shell .dashboard-action-arrow { margin-left: auto; color: var(--control-faint); }


/* Each quick action shows its module's icon in its tile. */
.control-shell .dashboard-quick-action::after { content: ""; position: absolute; left: 22px; top: 50%; width: 20px; height: 20px; margin-top: -10px; background: var(--sky-qa-ink, var(--control-accent)); -webkit-mask: var(--sky-qa-icon) center / contain no-repeat; mask: var(--sky-qa-icon) center / contain no-repeat; }
.control-shell .dashboard-quick-action:nth-child(4n+1) { --sky-qa-ink: var(--control-accent); --sky-qa-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4zM3 6h18M16 10a4 4 0 0 1-8 0'/%3E%3C/svg%3E"); }
.control-shell .dashboard-quick-action:nth-child(4n+2) { --sky-qa-ink: var(--control-success); --sky-qa-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3h2l2.4 12.2a2 2 0 0 0 2 1.6h8.8a2 2 0 0 0 2-1.6L21 7H6'/%3E%3Ccircle cx='9' cy='20' r='1'/%3E%3Ccircle cx='18' cy='20' r='1'/%3E%3C/svg%3E"); }
.control-shell .dashboard-quick-action:nth-child(4n+3) { --sky-qa-ink: var(--control-warning); --sky-qa-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21 8-9-5-9 5 9 5 9-5zM3 8v8l9 5 9-5V8M12 13v8'/%3E%3C/svg%3E"); }
.control-shell .dashboard-quick-action:nth-child(4n) { --sky-qa-ink: #6b3fd1; --sky-qa-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='4'/%3E%3Cpath d='M2 21a7 7 0 0 1 14 0M17 4a4 4 0 0 1 0 8M22 21a7 7 0 0 0-4-6.3'/%3E%3C/svg%3E"); }
html[data-appearance="dark"] .control-shell .dashboard-quick-action:nth-child(4n) { --sky-qa-ink: #b9a3f5; }
/* The dashboard greets by name; its page title stays for screen readers and keyboard focus. */
.control-shell:has(#dashboard.view:not([hidden])) #viewTitle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Order progress: a clean stage list with figure pills. */
.control-shell #dashboard .dashboard-stage { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 0 12px; border: 0; border-bottom: 1px solid var(--control-line); border-radius: 0; background: transparent; box-shadow: none; }
.control-shell #dashboard .dashboard-stage:last-child { border-bottom: 0; }
.control-shell #dashboard .dashboard-stage:hover { background: var(--control-raised); }
.control-shell #dashboard .dashboard-stage strong { min-width: 32px; padding: 2px 10px; border-radius: 999px; background: var(--control-soft); text-align: center; font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .control-shell .dashboard-quick-action { transition: none; } .control-shell .dashboard-quick-action:hover { transform: none; } }

/* Module icons beside the module names on wide screens (they are already drawn by control-shell.js). */
@media (min-width: 1560px) {
  .control-shell .control-module { display: inline-flex; align-items: center; gap: 7px; }
  .control-shell .control-module :is(svg, .control-module-icon) { display: block; width: 16px; height: 16px; opacity: .8; }
  .control-shell .control-module:is(.selected, .active, [aria-current="page"], [aria-pressed="true"]) :is(svg, .control-module-icon) { opacity: 1; color: var(--control-accent); }
}
/* Dashboard header: the greeting takes the title's place; the page help and Refresh stay at the top right. */
@media (min-width: 681px) {
  .control-shell:has(#dashboard.view:not([hidden])) .heading { justify-content: flex-end; margin-bottom: -36px; position: relative; z-index: 2; }
  .control-shell:has(#dashboard.view:not([hidden])) .heading > div { order: 0; }
  .control-shell #dashboard .dashboard-intro { position: relative; z-index: 1; pointer-events: none; margin-top: 0; }
  .control-shell #dashboard .dashboard-intro > * { pointer-events: auto; }
  .control-shell #dashboard .dashboard-intro { align-items: flex-start; }
  .control-shell #dashboardNewOrder { margin-right: 150px; }
}
@media (max-width: 680px) {
  .control-shell #dashboardMetrics .metric-card { padding-left: 16px; }
  .control-shell #dashboardMetrics .metric-card::before, .control-shell #dashboardMetrics .metric-card::after { display: none; }
}
/* The dashboard's period note shows two lines; the rest opens on hover. Screen readers read all of it. */
@media (min-width: 681px) and (hover: hover) {
  .control-shell #dashboard .location-report-scope small.secondary:not(:last-child) { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .control-shell #dashboard .location-report-scope:hover small.secondary { -webkit-line-clamp: unset; display: block; }
}

/* ---------- 16. Registers (list pattern from the vision board) ---------- */
/* A drill-down inside a row reads as a link, not a boxed button. */
.control-shell .management-table .management-row-action,
.control-shell td > button.management-row-action {
  min-height: 24px; padding: 0; border: 0; border-radius: 4px; background: none; box-shadow: none;
  color: var(--control-accent); font-size: 13.5px; font-weight: 600; text-align: left; white-space: normal;
}
.control-shell .management-table .management-row-action:hover { background: none; color: var(--control-accent-hover); text-decoration: underline; text-underline-offset: 3px; }
.control-shell .management-table td.cell-primary { font-weight: 600; }
/* Status pills read as words with a capital. */
.control-shell .management-status { text-transform: none; }
.control-shell td .management-status { text-transform: capitalize; }
.control-shell .management-status.is-muted { background: var(--control-soft); color: var(--control-muted); }
/* The count-and-total line above a register is a quiet summary. */
.control-shell .management-table-wrap { box-shadow: none; }
.control-shell .management-table tbody td.numeric { font-weight: 500; }
.control-shell .management-pagination { gap: 8px; color: var(--control-muted); font-size: 12.5px; }

/* Purchasing: its header holds only Refresh view, which sits at the end of the tab row instead of on its own line. */
@media (min-width: 1400px) {
  #purchasingModern.management-workspace {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px;
  }
  #purchasingModern.management-workspace > * { grid-column: 1 / -1; }
  #purchasingModern.management-workspace > header.management-header { grid-column: 2; grid-row: 1; }
  #purchasingModern.management-workspace > nav.management-tabs { grid-column: 1; grid-row: 1; }
}

/* Sign-in: a floating, wordless product preview in the brand panel (decoration only). */
@media (min-width: 821px) {
  body:not(.signed-in) .login-grid > .intro::after {
    content: ""; display: block; width: 100%; max-width: 440px; aspect-ratio: 440 / 250; margin-top: 30px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='440' height='250' viewBox='0 0 440 250'%3E%3Cdefs%3E%3Cfilter id='s' x='-10%25' y='-10%25' width='130%25' height='140%25'%3E%3CfeDropShadow dx='0' dy='18' stdDeviation='18' flood-color='%23041e38' flood-opacity='.35'/%3E%3C/filter%3E%3C/defs%3E%3Cg filter='url(%23s)'%3E%3Crect x='20' y='14' width='400' height='210' rx='16' fill='%23fff'/%3E%3C/g%3E%3Crect x='40' y='36' width='90' height='10' rx='5' fill='%23cdd5e0'/%3E%3Crect x='364' y='33' width='36' height='16' rx='8' fill='%23e9f7ef'/%3E%3Crect x='40' y='58' width='150' height='18' rx='6' fill='%230f1b2d'/%3E%3Cpath d='M40 160 L80 150 L120 154 L160 132 L200 140 L240 116 L280 122 L320 100 L360 106 L400 86 L400 176 L40 176Z' fill='%230a6cb4' fill-opacity='.10'/%3E%3Cpath d='M40 160 L80 150 L120 154 L160 132 L200 140 L240 116 L280 122 L320 100 L360 106 L400 86' fill='none' stroke='%230a6cb4' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='400' cy='86' r='5' fill='%23fff' stroke='%230a6cb4' stroke-width='3'/%3E%3Crect x='40' y='190' width='108' height='18' rx='6' fill='%23f3f5f8'/%3E%3Crect x='166' y='190' width='108' height='18' rx='6' fill='%23f3f5f8'/%3E%3Crect x='292' y='190' width='108' height='18' rx='6' fill='%23f3f5f8'/%3E%3C/svg%3E") left top / contain no-repeat; transform: rotate(-2deg); transform-origin: left center;
  }
}
@media (min-width: 821px) { body:not(.signed-in) .login-grid > .panel { display: flex; flex-direction: column; justify-content: center; } }

/* ---------- 17. Jump to (Ctrl K) — public/command-bar.js ---------- */
.control-shell .command-bar-open {
  display: inline-flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 8px 0 12px;
  border: 1px solid var(--control-line); border-radius: 999px; background: var(--control-paper); color: var(--control-muted);
  font-size: 13px; font-weight: 500; box-shadow: none; white-space: nowrap;
}
.control-shell .command-bar-open::before {
  content: ""; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.control-shell .command-bar-open:hover { color: var(--control-ink); border-color: var(--sky-line-strong); background: var(--control-paper); }
.control-shell .command-bar-kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--control-line); border-bottom-width: 2px; border-radius: 6px; background: var(--control-raised); color: var(--control-muted); font: 600 11px/1.5 var(--sky-font); }
.control-shell .command-bar-backdrop { position: fixed; inset: 0; z-index: 1100; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(15, 27, 45, .38); backdrop-filter: blur(3px); animation: sky-fade .12s ease-out; }
.control-shell .command-bar-backdrop[hidden] { display: none; }
.control-shell .command-bar { width: min(620px, 100%); max-height: 70vh; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--control-line); border-radius: 16px; background: var(--control-paper); color: var(--control-ink); box-shadow: 0 24px 60px rgba(15, 27, 45, .28); animation: sky-rise .16s cubic-bezier(.2, .8, .2, 1); }
.control-shell .command-bar-field { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--control-line); }
.control-shell .command-bar-field .command-bar-input { flex: 1; min-height: 32px; padding: 0; border: 0; box-shadow: none; background: transparent; font-size: 16px; }
.control-shell .command-bar-field .command-bar-input:focus { box-shadow: none; }
.control-shell .command-bar-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.control-shell .command-bar-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.control-shell .command-bar-item[aria-selected="true"] { background: var(--sky-accent-soft); }
.control-shell .command-bar-item[aria-selected="true"] .command-bar-item-label { color: var(--control-accent); }
.control-shell .command-bar-item-label { font-size: 14px; font-weight: 600; }
.control-shell .command-bar-item-group { font-size: 12px; color: var(--control-muted); }
.control-shell .command-bar-empty { margin: 0; padding: 22px 16px; color: var(--control-muted); text-align: center; }
.control-shell .command-bar-foot { margin: 0; padding: 9px 16px; border-top: 1px solid var(--control-line); background: var(--control-raised); color: var(--control-muted); font-size: 12px; }
@keyframes sky-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sky-rise { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .control-shell :is(.command-bar-backdrop, .command-bar) { animation: none; } }
@media (max-width: 900px) {
  .control-shell .control-topbar-tools { flex-wrap: wrap; }
  .control-shell .command-bar-open .command-bar-kbd { display: none; }
  .control-shell .control-topbar-tools .command-bar-open { order: -1; flex: 1 1 100%; min-width: 0; min-height: 40px; }
}
@media (min-width: 901px) and (max-width: 1279px) { .control-shell .command-bar-open .command-bar-open-label { display: none; } }


/* ---------- 18. Empty states ---------- */
/* "Nothing here yet" panels get a quiet tray illustration above their sentence, so an empty screen looks finished, not broken. */
.control-shell .empty:not(.customer-register .empty, .batch-valuation-report .empty, td, li, span) {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 20px; color: var(--control-muted); font-size: 14px; text-align: center;
}
.control-shell .empty:not(.customer-register .empty, .batch-valuation-report .empty, td, li, span)::before {
  content: ""; width: 72px; height: 72px; flex: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Ccircle cx='36' cy='36' r='35' fill='%23e8f2fb' stroke='%23b9d6ef' stroke-width='1'/%3E%3Cg fill='none' stroke='%230a6cb4' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M50 38h-9l-3 4h-4l-3-4h-9'/%3E%3Cpath d='M26.5 27h19l4.5 11v8a2 2 0 0 1-2 2H24a2 2 0 0 1-2-2v-8z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}
html[data-appearance="dark"] .control-shell .empty:not(.customer-register .empty, .batch-valuation-report .empty, td, li, span)::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Ccircle cx='36' cy='36' r='35' fill='%2312304a' stroke='%231f4f75' stroke-width='1'/%3E%3Cg fill='none' stroke='%235ab8f0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M50 38h-9l-3 4h-4l-3-4h-9'/%3E%3Cpath d='M26.5 27h19l4.5 11v8a2 2 0 0 1-2 2H24a2 2 0 0 1-2-2v-8z'/%3E%3C/g%3E%3C/svg%3E"); }
.control-shell .empty.panel { border-style: dashed; box-shadow: none; }

/* ---------- 19. Motion: panels, pop-ups and sheets arrive softly ---------- */
@media (prefers-reduced-motion: no-preference) {
  .control-shell .view:not([hidden]) { animation: sky-view .18s ease-out; }
  .control-shell dialog[open] { animation: sky-rise .18s cubic-bezier(.2, .8, .2, 1); }
  .control-shell .floating-sheet:not([hidden]) { animation: sky-rise .2s cubic-bezier(.2, .8, .2, 1); }
  .control-shell .work-inbox-panel:not([hidden]), .howdoi-panel:not([hidden]) { animation: sky-rise .16s cubic-bezier(.2, .8, .2, 1); }
  .control-shell :is(button, .button-link, .report-hub-open, .dashboard-quick-action, .menu-card) { transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s; }
}
@keyframes sky-view { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 20. Point of sale: Sale type as one-tap buttons (public/sale-type-switch.js) ---------- */
/* The company's default stays selected; staff tap another type only when a sale needs it. */
.control-shell label.sale-type-select-replaced > select { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.control-shell .sale-type-switch { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--control-line); border-radius: 12px; background: var(--control-raised); }
.control-shell .sale-type-switch[hidden] { display: none; }
.control-shell .sale-type-switch .sale-type-option { min-height: 40px; padding: 6px 16px; border: 1px solid transparent; border-radius: 9px; background: transparent; box-shadow: none; color: var(--control-muted); font-size: 14px; font-weight: 600; }
.control-shell .sale-type-switch .sale-type-option:hover:not(:disabled) { background: var(--control-soft); color: var(--control-ink); }
.control-shell .sale-type-switch .sale-type-option.is-selected { background: var(--control-ink); border-color: var(--control-ink); color: var(--control-paper); box-shadow: 0 1px 3px rgba(15, 27, 45, .2); }
.control-shell .sale-type-switch .sale-type-option:disabled:not(.is-selected) { opacity: .45; }
@media (max-width: 680px) { .control-shell .sale-type-switch { display: flex; } .control-shell .sale-type-switch .sale-type-option { flex: 1 1 0; padding: 6px 8px; font-size: 13px; } }
.control-shell #posModeHost > .toolbar { justify-content: flex-start; align-items: center; }
.control-shell #posModeHost > .toolbar > label.sale-type-select-replaced { min-width: 0; font-weight: 600; color: var(--control-muted); }
.control-shell #posModeHost > .toolbar > #posOpenHistory { margin-left: auto; }


/* ---------- 21. Name badges (public/name-avatars.js sets data-initials; the text itself is unchanged) ---------- */
.control-shell [data-initials]:not(td, th) { display: inline-flex; align-items: center; gap: 10px; }
/* A table cell keeps behaving as a cell (so row lines run the full width); its badge sits inline before the name. */
.control-shell :is(td, th)[data-initials]::before { display: inline-grid; vertical-align: middle; margin-right: 10px; }
.control-shell [data-initials]::before {
  content: attr(data-initials); display: inline-grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border-radius: 8px;
  background: var(--sky-av-bg, var(--sky-accent-soft)); color: var(--sky-av-ink, var(--control-accent));
  font-size: 11px; font-weight: 700; letter-spacing: .02em; text-decoration: none;
}
.control-shell [data-initials][data-tone="0"] { --sky-av-bg: #e8f2fb; --sky-av-ink: #0a6cb4; }
.control-shell [data-initials][data-tone="1"] { --sky-av-bg: #e9f7ef; --sky-av-ink: #12704a; }
.control-shell [data-initials][data-tone="2"] { --sky-av-bg: #fff6e5; --sky-av-ink: #8a5300; }
.control-shell [data-initials][data-tone="3"] { --sky-av-bg: #f3eefe; --sky-av-ink: #6b3fd1; }
.control-shell [data-initials][data-tone="4"] { --sky-av-bg: #fdecef; --sky-av-ink: #b4234f; }
.control-shell [data-initials][data-tone="5"] { --sky-av-bg: #e6f6f6; --sky-av-ink: #0e6e6e; }
html[data-appearance="dark"] .control-shell [data-initials][data-tone="0"] { --sky-av-bg: #12304a; --sky-av-ink: #86cbf5; }
html[data-appearance="dark"] .control-shell [data-initials][data-tone="1"] { --sky-av-bg: #10301f; --sky-av-ink: #6fd3a1; }
html[data-appearance="dark"] .control-shell [data-initials][data-tone="2"] { --sky-av-bg: #352710; --sky-av-ink: #f4c26b; }
html[data-appearance="dark"] .control-shell [data-initials][data-tone="3"] { --sky-av-bg: #2a2145; --sky-av-ink: #b9a3f5; }
html[data-appearance="dark"] .control-shell [data-initials][data-tone="4"] { --sky-av-bg: #3a1622; --sky-av-ink: #ff9ab4; }
html[data-appearance="dark"] .control-shell [data-initials][data-tone="5"] { --sky-av-bg: #0f2f2f; --sky-av-ink: #6fd6d6; }
.control-shell .management-table .management-row-action[data-initials]:hover::before { text-decoration: none; }
/* The breadcrumb stays on one line now the top bar also holds Jump to; the item search gives way first. */
@media (min-width: 901px) {
  .control-shell .control-breadcrumb { flex: 0 0 auto; flex-wrap: nowrap; white-space: nowrap; }
  .control-shell .control-topbar-tools .header-search { flex: 0 1 260px; min-width: 150px; }
}
@media (min-width: 901px) and (max-width: 1365px) { .control-shell .control-topbar-tools .header-tools { display: none; } }

/* ---------- 22. Dashboard figures: change against the period just before (location-reports.js, DS-16) ---------- */
.control-shell .management-summary-delta { display: inline-flex; align-self: flex-start; width: fit-content; margin: 6px 0 2px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* Direction only, not good or bad: more purchases or refunds is not "good", so up is blue and down is grey. */
.control-shell .management-summary-delta.is-up { background: var(--sky-accent-soft); color: var(--control-accent); }
.control-shell .management-summary-delta.is-down { background: var(--control-soft); color: var(--control-ink); }
.control-shell .management-summary-delta.is-flat { background: var(--control-soft); color: var(--control-muted); }
.control-shell .management-summary-card { display: flex; flex-direction: column; }

/* ---------- 23. Point of sale item tiles (DS-17, look only) ---------- */
.control-shell .menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.control-shell .menu-card { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--control-line); border-radius: 14px; background: var(--control-paper); box-shadow: var(--sky-card-shadow); }
.control-shell .menu-card .menu-photo { position: relative; aspect-ratio: 4 / 3; height: auto; min-height: 0; margin: 0; border-radius: 10px; background: linear-gradient(135deg, var(--sky-accent-soft), var(--control-raised)); display: grid; place-items: center; overflow: hidden; }
.control-shell .menu-card .menu-photo.has-photo { background: var(--control-raised); }
.control-shell .menu-card .menu-photo > small { display: none; }
.control-shell .menu-card .placeholder-plate { opacity: .55; transform: scale(.8); }
.control-shell .menu-card .quick-photo { position: absolute; right: 6px; bottom: 6px; min-height: 26px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: color-mix(in srgb, var(--control-paper) 92%, transparent); border-color: var(--control-line); box-shadow: 0 1px 3px rgba(15, 27, 45, .12); }
.control-shell .menu-card .menu-card-info { display: grid; gap: 1px; }
.control-shell .menu-card .menu-card-info h3 { margin: 0; font-size: 14px; font-weight: 650; line-height: 1.3; }
.control-shell .menu-card .menu-unit { font-size: 12px; }
.control-shell .menu-card .menu-price { margin-top: 4px; font-size: 15px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.control-shell .menu-card .menu-balance .stock-available { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: var(--control-success-bg); color: var(--control-success); font-size: 12px; font-weight: 600; }
.control-shell .menu-card .menu-balance .stock-available::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.control-shell .menu-card.low-stock .menu-balance .stock-available { background: var(--control-warning-bg); color: var(--control-warning); }
.control-shell .menu-card .menu-balance .stock-available.stock-empty { background: var(--control-danger-bg); color: var(--control-danger); }
.control-shell .menu-card .add-menu-item { margin-top: auto; min-height: 38px; border: 0; border-radius: 10px; background: var(--control-accent); color: var(--control-accent-ink); font-weight: 600; }
.control-shell .menu-card .add-menu-item:hover:not(:disabled) { background: var(--control-accent-hover); }
.control-shell .menu-card .add-menu-item:disabled { background: var(--control-soft); color: var(--control-muted); }
.control-shell .menu-card:hover { transform: translateY(-1px); }
/* The scan field is the till's front door: larger and easy to hit. */
.control-shell .scan-entry input { min-height: 46px; font-size: 16px; }
.control-shell .scan-entry #scanAdd { min-height: 46px; padding: 0 18px; }
/* The ticket stays in view while the menu scrolls on wide screens. */
@media (min-width: 1100px) { .control-shell .cart-panel { position: sticky; top: 124px; align-self: flex-start; } }
.control-shell .menu-card .quick-photo { width: auto; left: auto; }

/* ---------- 24. Long explanations fold to two lines (public/long-text.js, DS-03) ---------- */
.control-shell .sky-fold:not(.is-open) { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.control-shell .sky-fold-toggle { display: inline-flex; min-height: 24px; margin: 2px 0 10px; padding: 0; border: 0; background: none; box-shadow: none; color: var(--control-accent); font-size: 12.5px; font-weight: 600; }
.control-shell .sky-fold-toggle:hover { background: none; text-decoration: underline; text-underline-offset: 3px; }
.control-shell .sky-fold-toggle[hidden] { display: none; }

/* ---------- 25. Forms ---------- */
/* Grouped fields (fieldset) read as one card with a clear title; field help is small and quiet under its field. */
.control-shell fieldset:not(.business-document *) { margin: 0 0 14px; padding: 14px 18px 16px; border: 1px solid var(--control-line); border-radius: 12px; background: var(--control-paper); min-width: 0; }
.control-shell fieldset:not(.business-document *) > legend { padding: 0 6px; margin-left: -6px; font-size: 14px; font-weight: 650; color: var(--control-ink); }
.control-shell label:not(.business-document *) > small, .control-shell label:not(.business-document *) + small { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; line-height: 1.45; color: var(--control-muted); }
.control-shell label:not(.business-document *) { line-height: 1.35; }
.control-shell :is(input, select, textarea)[aria-invalid="true"] { border-color: var(--control-danger); box-shadow: 0 0 0 3px var(--control-danger-bg); }
.control-shell :is(input, select, textarea):disabled { background: var(--control-raised); color: var(--control-muted); cursor: not-allowed; }
/* Point of sale on phones: two tiles per row, so a cashier sees more items at once. */
@media (max-width: 680px) {
  .control-shell .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .control-shell .menu-card { padding: 8px; gap: 6px; }
  .control-shell .menu-card .menu-photo { aspect-ratio: 1 / 1; }
  .control-shell .menu-card .quick-photo { font-size: 11px; padding: 2px 7px; }
  .control-shell .menu-card .menu-price { font-size: 14px; }
}
/* The ticket's main button only floats over the ticket when it can be pressed; while disabled it stays in its place. */
.control-shell .cart-panel #saveOrder:disabled { position: static; box-shadow: none; }

/* ---------- 26. Staff access ---------- */
/* Branch access: each person and their choice share one row; staff rows show the person's badge. */
@media (min-width: 681px) {
  .control-shell label.branch-access-row { display: grid; grid-template-columns: minmax(160px, 240px) minmax(220px, 320px); align-items: center; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--control-line); font-weight: 600; }
  .control-shell label.branch-access-row:last-of-type { border-bottom: 0; }
}
.control-shell .staff-row > div > strong[data-initials] { margin-bottom: 2px; }
.control-shell .staff-row .staff-detail { margin: 2px 0 0; font-size: 13px; color: var(--control-muted); }
.control-shell .staff-row > div > small { font-size: 12px; }

/* ---------- 27. Company settings ---------- */
/* Settings menu: the open section is marked in brand blue. */
.control-shell #company .settings-menu-item { min-height: 40px; font-size: 13.5px; }
.control-shell #company .settings-menu-item[aria-current="page"] { background: var(--sky-accent-soft); color: var(--control-accent); font-weight: 600; box-shadow: inset 3px 0 0 var(--control-accent); }
/* Point of sale settings: the three sale-type ticks sit in one tidy row with space between them. */
.control-shell #posAllowedModes { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.control-shell #posAllowedModes > label:not(.check-label) { flex: 1 1 100%; }
.control-shell #posAllowedModes > :not(label) { flex: 1 1 100%; }
.control-shell .check-label { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 12px 4px 10px; border: 1px solid var(--control-line); border-radius: 999px; background: var(--control-paper); font-weight: 500; }
.control-shell .check-label:has(input:checked) { border-color: var(--sky-accent-line); background: var(--sky-accent-soft); color: var(--control-ink); }
.control-shell .check-label:has(input:disabled) { opacity: .6; }

/* ---------- 28. Credit rules ---------- */
/* Fields line up in even columns; each on/off choice and the save button take their own row. */
:root .control-shell #creditRulesHost form.settings-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px 20px; align-items: start; }
:root .control-shell #creditRulesHost form.settings-form > .check-label,
:root .control-shell #creditRulesHost form.settings-form > button,
:root .control-shell #creditRulesHost form.settings-form > p { grid-column: 1 / -1; justify-self: start; }
:root .control-shell #creditRulesHost form.settings-form > .check-label:not(:first-child) { margin-top: 8px; }
:root .control-shell #creditRulesHost form.settings-form > label:not(.check-label) { display: flex; flex-direction: column; gap: 6px; }
:root .control-shell #creditRulesHost form.settings-form > label small { font-weight: 400; }
:root .control-shell #creditRulesHost form.settings-form > label:not(.check-label) > :is(input, select) { width: 100%; max-width: none; }
/* ---------- 29. Report table tools (find, sort, hide, columns, export) ---------- */
/* One tidy row of tools above each report table. The Hide choices are small chips, not a separate card. */
.control-shell .report-view-toolbar { align-items: flex-end; gap: 12px 16px; }
.control-shell fieldset.report-arrange-hide:not(.business-document *) { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.control-shell fieldset.report-arrange-hide:not(.business-document *) > legend { float: left; width: 100%; padding: 0; margin: 0 0 -2px; font-size: 12px; font-weight: 500; color: var(--control-muted); }
.control-shell .report-arrange-hide label { min-height: 38px; padding: 4px 12px 4px 10px; border: 1px solid var(--control-line); border-radius: 999px; background: var(--control-paper); font-weight: 500; }
.control-shell .report-arrange-hide label:has(input:checked) { border-color: var(--sky-accent-line); background: var(--sky-accent-soft); }
.control-shell .report-columns > summary { display: inline-flex; align-items: center; min-height: 38px; padding: 0 12px; border: 1px solid var(--control-line); border-radius: 8px; background: var(--control-paper); font-weight: 500; cursor: pointer; }
/* Export and Print sit together on the left. */
.control-shell .report-view-toolbar + .management-toolbar { justify-content: flex-start; gap: 8px; margin-top: 4px; }
.control-shell .report-view-toolbar + .management-toolbar > p { margin-left: auto; }
/* Phones: the tools sit two to a row so the table starts higher up. Find and Hide take the full width. */
@media (max-width: 600px) {
  :root .control-shell .report-view-toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 10px; align-items: end; }
  :root .control-shell .report-view-toolbar > * { min-width: 0; max-width: none; width: auto; }
  :root .control-shell .report-view-toolbar > label:has(input[type=search]),
  :root .control-shell .report-view-toolbar > fieldset { grid-column: 1 / -1; }
  :root .control-shell .report-view-toolbar > label > :is(input, select) { width: 100%; max-width: none; }
  :root .control-shell .report-view-toolbar .report-columns > summary { width: 100%; justify-content: center; white-space: nowrap; font-size: 13px; padding: 0 8px; }
  :root .control-shell .report-arrange-hide label { min-height: 34px; }
}
/* Export and Print sit together on the left wherever the export row appears (some reports put a note between the tools and this row). */
.control-shell .management-toolbar:has(> button.secondary-button:first-child + button.secondary-button + p:last-child) { justify-content: flex-start; gap: 8px; }
.control-shell .management-toolbar:has(> button.secondary-button:first-child + button.secondary-button + p:last-child) > p:last-child { margin-left: auto; }
/* Workspace pages are a grid with its own gap; paragraph margins on top of it left ~40px between short notes. */
.control-shell .management-workspace > p { margin-block: 0; }
.control-shell .management-workspace > p:empty { display: none; }
/* A second workspace block on the same page (e.g. Sales by branch under Item sales) starts with clear space. */
.control-shell .view > .management-workspace + .management-workspace { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--control-line); }

/* ---------- 30. Item profit period totals ---------- */
/* Each label sits above its figure in a tile; the tiles share one row like the dashboard figures. Gross profit stands out. */
@media (min-width: 720px) {
  .control-shell .item-profit-totals dl { grid-template-rows: auto auto; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: none; gap: 0 12px; font-size: 13px; }
  .control-shell .item-profit-totals dt { padding: 12px 14px 2px; border: 1px solid var(--control-line); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--control-paper); color: var(--control-muted); font-size: 12px; }
  .control-shell .item-profit-totals dd { padding: 2px 14px 12px; border: 1px solid var(--control-line); border-top: 0; border-radius: 0 0 10px 10px; background: var(--control-paper); font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--control-ink); }
  .control-shell .item-profit-totals dt:nth-last-of-type(1) { border-color: var(--sky-accent-line); background: var(--sky-accent-soft); color: var(--control-accent); }
  .control-shell .item-profit-totals dd:last-of-type { border-color: var(--sky-accent-line); background: var(--sky-accent-soft); }
}
.control-shell .item-profit-totals > h2 { font-size: 14px; font-weight: 650; margin-bottom: 12px; }

/* ---------- 31. Panel headings ---------- */
/* A heading that opens a card does not add its own top margin on top of the card padding (e.g. Open my shift). */
.control-shell .panel > :is(h2, h3):first-child { margin-top: 0; }
/* A lone button placed straight in a workspace page (e.g. Switch the report on) is button-sized on wider screens, not page-wide. */
@media (min-width: 601px) { .control-shell .management-workspace > button { justify-self: start; } }
/* Phones: order filters sit two per row; search and the action buttons take the full width. */
@media (max-width: 600px) {
  :root .control-shell .order-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  :root .control-shell .order-filters > * { min-width: 0; max-width: none; width: auto; }
  :root .control-shell .order-filters > :is(.order-filter-search, .order-filter-actions) { grid-column: 1 / -1; }
  :root .control-shell .order-filters > label > :is(input, select) { width: 100%; max-width: none; }
  :root .control-shell .order-filter-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  :root .control-shell .order-filter-actions select { min-width: 160px; }
}

/* ---------- 32. Report filter forms ---------- */
/* Filters read left to right and the Apply button follows the last field, instead of fields drifting to the far edge. */
.control-shell form.management-toolbar { justify-content: flex-start; align-items: flex-end; column-gap: 16px; }
.control-shell form.management-toolbar > label { max-width: 22rem; }
@media (min-width: 900px) { .control-shell .management-toolbar-filters > .report-period { grid-column: span 2; } }

/* ---------- 33. Tick boxes inside filter rows ---------- */
/* A tick-box filter (e.g. My recent entries) reads as a chip on the same line as the other filter boxes: box first, then words. */
:root .control-shell .sales-register-controls > label:has(> input[type=checkbox]) { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; align-self: end; gap: 8px; min-height: 38px; padding: 4px 12px 4px 10px; border: 1px solid var(--control-line); border-radius: 999px; background: var(--control-paper); font-size: 13px; font-weight: 500; color: var(--control-ink); }
:root .control-shell .sales-register-controls > label:has(> input[type=checkbox]:checked) { border-color: var(--sky-accent-line); background: var(--sky-accent-soft); }
:root .control-shell .sales-register-controls > label > input[type=checkbox] { width: auto; margin: 0; }
/* ---------- 34. Report sub-tabs and phone summaries ---------- */
/* Sub-tab strips (Activity, Customers, Suppliers, Branch result) keep clear space above the section they open. */
.control-shell .management-tabs { margin-bottom: 16px; }
@media (max-width: 600px) {
  /* Summary figures sit two per row on phones so the table is reached sooner. */
  :root .control-shell .management-summary-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  :root .control-shell .management-summary-grid > .management-summary-card { min-width: 0; padding: 12px; }
  :root .control-shell .management-summary-grid > .management-summary-card strong { font-size: 18px; overflow-wrap: anywhere; }
  /* Counterparty filters: the two dates share a row; names and choices keep the full width so long names are not cut. */
  :root .control-shell form.counterparty-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  :root .control-shell form.counterparty-filters > * { min-width: 0; max-width: none; width: auto; }
  :root .control-shell form.counterparty-filters > .report-period { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  :root .control-shell form.counterparty-filters > .report-period > label:first-child { grid-column: 1 / -1; }
  :root .control-shell form.counterparty-filters > :is(label, button) { grid-column: 1 / -1; }
  :root .control-shell form.counterparty-filters > button { justify-self: start; }
  :root .control-shell form.counterparty-filters :is(input, select) { width: 100%; max-width: none; min-width: 0; }
}

/* A toolbar that has a heading and its own fields (e.g. Staff commission: From, To, Show) keeps the fields beside the heading instead of spreading them to the far edge. */
.control-shell .toolbar:has(> h2:first-child + label) { justify-content: flex-start; align-items: flex-end; gap: 12px 16px; flex-wrap: wrap; }
.control-shell .toolbar:has(> h2:first-child + label) > h2 { flex: 1 0 100%; margin: 0; }

/* ---------- 35. Pinned phone buttons stay solid ---------- */
/* Production plan, Batch costs and Stock transfers pin their main button to the bottom on phones. While the form is not ready the
   button was drawn at 60% opacity, so the fields scrolling under it showed through. It now stays solid and shows "not ready" with a grey fill. */
@media (max-width: 900px) {
  .control-shell :is(.production-form, .inventory-use-target-form, #stockTransferForm) > button[type="submit"]:is(.guide-not-ready, :disabled) {
    opacity: 1;
    background: var(--control-soft, #eef1f5);
    border: 1px solid var(--control-line);
    /* DS-62: ink, not muted, so the label keeps text contrast (muted on the soft grey was about 3.1:1); the grey fill still says "not ready". */
    color: var(--control-ink);
  }
}

/* ---------- 36. Small controls keep their size inside stacked boxes ---------- */
/* The round "i" button inside a box that stacks its content on phones (e.g. Production > guided entry note) was stretched into a wide oval. */
.control-shell .info-note-button { align-self: flex-start; flex: 0 0 auto; }
/* "Show more" sits on its own line, so it never crowds the button that follows it. */
.control-shell .sky-fold-toggle { display: flex; width: fit-content; }

/* ---------- 37. Point of sale item tiles without a photo ---------- */
/* name-avatars.js puts the item's initials on the photo area of a tile that has no photo. Instead of a large grey
   placeholder, the tile shows a compact coloured block with the initials, so items are told apart at a glance.
   Tiles with a real photo are unchanged; "+ Add photo" stays where it was. */
.control-shell .menu-card > .menu-photo[data-initials]:not(.has-photo) {
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 0;
  min-height: 0; height: 84px; aspect-ratio: auto;
  background: var(--sky-av-bg, #e8f2fb); border-radius: 10px;
}
.control-shell .menu-card > .menu-photo[data-initials]:not(.has-photo)::before {
  content: attr(data-initials); display: block; width: auto; height: auto; flex: none; border-radius: 0; background: none; box-shadow: none;
  font-size: 26px; font-weight: 700; letter-spacing: .02em; line-height: 1; color: var(--sky-av-ink, #0a6cb4);
}
.control-shell .menu-card > .menu-photo[data-initials]:not(.has-photo) > :is(.placeholder-plate, small) { display: none; }
/* When the manager's "+ Add photo" button is on the tile, the initials move to the left so the two never overlap. */
.control-shell .menu-card > .menu-photo[data-initials]:not(.has-photo):has(.quick-photo) { justify-content: flex-start; padding-left: 16px; }
/* When the order accounting queue is clear, its notice is a slim status line with a small button, so the till starts higher up. */
.control-shell #connectionNotice.all-clear { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 0; padding: 5px 8px 5px 12px; font-size: 12px; }
.control-shell #connectionNotice.all-clear button { min-height: 28px; width: auto; padding: 2px 10px; font-size: 12px; margin-left: 12px; }
@media (max-width: 600px) {
  .control-shell #connectionNotice.all-clear { grid-template-columns: auto minmax(0, 1fr); padding: 8px 10px 8px 12px; }
  .control-shell #connectionNotice.all-clear button { grid-column: 1 / -1; justify-self: start; margin: 4px 0 0; }
}
.control-shell .menu-card > .menu-photo[data-initials]:not(.has-photo) > .quick-photo { background: var(--control-paper); color: var(--control-ink); }

/* ---------- 38. Point of sale ticket quantity ---------- */
/* Bigger, joined − / quantity / + controls so a cashier can tap them reliably on a till touchscreen. */
.control-shell #cartLines .cart-controls { gap: 0; }
.control-shell #cartLines .cart-controls > button:not(.remove-cart) {
  width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 0; border: 1px solid var(--control-line);
  background: var(--control-raised, var(--control-paper)); color: var(--control-ink); font-size: 17px; font-weight: 600; border-radius: 0;
}
.control-shell #cartLines .cart-controls > button:not(.remove-cart):first-of-type { border-radius: 9px 0 0 9px; }
.control-shell #cartLines .cart-controls > button:not(.remove-cart):nth-of-type(2) { border-radius: 0 9px 9px 0; color: var(--control-accent); }
.control-shell #cartLines .cart-controls > button:not(.remove-cart):hover { background: var(--sky-accent-soft); }
.control-shell #cartLines .cart-controls > input {
  width: 46px; height: 34px; min-height: 34px; padding: 0 2px; border: 1px solid var(--control-line); border-left: 0; border-right: 0; border-radius: 0;
  background: var(--control-paper); color: var(--control-ink); font-size: 14px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums;
}
.control-shell #cartLines .cart-controls > .remove-cart { width: 30px; min-width: 30px; height: 30px; min-height: 30px; margin-left: 8px; border-radius: 8px; }

/* ---------- 39. Empty status notice ---------- */
/* Some screens (e.g. Quotations) leave the accounting-queue notice empty; it showed as a bare green dot in an empty box. */
.control-shell #connectionNotice:empty { display: none; }

/* ---------- 40. Customer account summary ---------- */
/* The three balance figures, a note and two write-off forms shared one row of six equal columns, so the figure tiles
   stretched to the forms' height. Now: figures in one row, the note across the width, the two write-off forms side by side. */
.control-shell #customerBalanceSummary { grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: start; gap: 12px; }
.control-shell #customerBalanceSummary > .sales-balance-tile { grid-column: span 2; }
.control-shell #customerBalanceSummary > p { grid-column: 1 / -1; margin: 0; }
.control-shell #customerBalanceSummary > :is(.customer-writeoff, .customer-bad-debt) { grid-column: span 3; padding: 14px 16px; border: 1px solid var(--control-line); border-radius: 12px; background: var(--control-paper); }
@media (max-width: 700px) {
  .control-shell #customerBalanceSummary { grid-template-columns: minmax(0, 1fr); }
  .control-shell #customerBalanceSummary > * { grid-column: 1 / -1; }
}
/* Customers: the Refresh customers / New customer buttons sat flush against the card above them. */
.control-shell #customers > .panel + .toolbar { margin-top: 12px; }
.control-shell #customerBalanceSummary > :is(.customer-writeoff, .customer-bad-debt) > :is(h2, h3, h4):first-child { margin-top: 0; }
/* DS-44: the new "Check the balance difference" box (KS-FRANK, Administrators) fell into one sixth of the summary grid.
   It takes the full row as a quiet card: text, then the reason field and buttons in one wrapping row. */
.control-shell #customerBalanceSummary > .customer-credit-review { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 16px; border: 1px dashed var(--control-line); border-radius: 12px; background: var(--control-paper); }
.control-shell #customerBalanceSummary > .customer-credit-review > p { flex: 1 1 100%; margin: 0; }
.control-shell #customerBalanceSummary > .customer-credit-review > p:empty { display: none; }
.control-shell #customerBalanceSummary > .customer-credit-review > input { flex: 1 1 260px; min-width: 0; }

/* ---------- 41. Empty section toolbars ---------- */
/* A section toolbar that holds only the page note (hidden while notes are folded) and a Refresh button that the page-level
   Refresh replaces (e.g. Accounting sync > review card) was an empty strip with margins at the top of its card. */
body.control-shell.info-notes-on:not(.page-info-open) .toolbar:has(> div > .page-info:only-child):not(:has(> :not(div, #posRefreshHistory, #inventory-costs-refresh, #refreshReconciliation, #creditExceptions-refresh, #payment-correction-refresh, #accountingOutbox-refresh))) { display: none; }

/* ---------- 42. Dashboard figures on phones ---------- */
/* The dashboard's own grid (cards at least 210px) left one card per row on a phone, so nine figures made a very long page. Two per row now. */
@media (max-width: 600px) {
  .control-shell #dashboard .location-report-overview .management-summary-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .control-shell #dashboard .location-report-overview .management-summary-card { min-width: 0; padding: 12px; }
  .control-shell #dashboard .location-report-overview .management-summary-card strong { font-size: 18px; overflow-wrap: anywhere; }
}

/* ---------- 43. "Who is taking this order?" name picker ---------- */
/* The names grid asked for columns of at least 200px; in a narrow card two columns plus the gap did not fit, so the
   card scrolled sideways. Columns now shrink to the space there is, long names wrap, and the card never scrolls sideways. */
.control-shell .shared-till-card { overflow-x: hidden; }
.control-shell .shared-till-people { grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); }
.control-shell .shared-till-person { min-width: 0; }
.control-shell .shared-till-person > span:not(.shared-till-avatar) { min-width: 0; overflow-wrap: anywhere; }

/* ---------- 44. Point of sale: items start higher on tills and tablets ---------- */
/* At 1024×768 (a common till) the first item tile started at about 800px, below the screen. The blocks above the
   tiles are now compact on screens 701px and wider; nothing is removed or renamed. */
@media (min-width: 701px) {
  /* Sale type: the label sits beside its choice, in a slimmer card. */
  .control-shell #neworder #posModeHost { margin-top: 10px; padding: 10px 16px; }
  .control-shell #neworder #posModeHost > .toolbar { align-items: center; margin: 0; }
  .control-shell #neworder #posModeHost > .toolbar > label { display: flex; flex-direction: row; align-items: center; gap: 12px; margin: 0; font-weight: 600; }
  .control-shell #neworder #posModeHost > .toolbar > label > select { width: auto; min-width: 220px; margin: 0; }
  .control-shell #neworder #posModeHelp { margin: 4px 0 0; font-size: 12.5px; }
  .control-shell #neworder #newOrderOwner { margin: 6px 0 8px; font-size: 12.5px; }
  /* Barcode box: the placeholder already says "Scan barcode or enter PLU"; the label stays for screen readers only. */
  .control-shell #neworder #scanEntryForm > label > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .control-shell #neworder #scanEntryForm { align-items: center; padding-bottom: 10px; }
  /* Search, category and sort share one row. */
  .control-shell #neworder .menu-filters { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding-top: 10px; }
  .control-shell #neworder .menu-filters > label { grid-column: auto; min-width: 0; }
}

/* ---------- 45. Point of sale: no second Refresh ---------- */
/* DS-04: "↻ Refresh items" repeated the page Refresh, which already presses it (app.js MERGED_REFRESH). It is hidden like the
   other merged section buttons, and its row (which then only holds the screen-reader heading) takes no space. */
.control-shell #refreshMenu { display: none; }
.control-shell #neworder > .pos-toolbar { min-height: 0; height: 0; margin: 0; padding: 0; border: 0; overflow: visible; }

/* ---------- 46. Receivables ageing on phones ---------- */
/* The ageing table (seven money columns) is about 920px wide and had no scrolling wrapper, so on a phone the whole page
   scrolled sideways. The table now scrolls inside its own box; the page stays still. */
@media (max-width: 1000px) { .control-shell table.ra-table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; } }
/* "Show each unpaid invoice": the tick box sat above its words; it now reads as a chip in line with the other filters. */
.control-shell #receivablesageing label:has(> input[type=checkbox]) { display: inline-flex; flex-direction: row; justify-content: flex-end; align-items: center; align-self: end; gap: 8px; min-height: 38px; padding: 4px 12px 4px 10px; border: 1px solid var(--control-line); border-radius: 999px; background: var(--control-paper); font-size: 13px; font-weight: 500; }
.control-shell #receivablesageing label:has(> input[type=checkbox]:checked) { border-color: var(--sky-accent-line); background: var(--sky-accent-soft); }
.control-shell #receivablesageing label > input[type=checkbox] { width: auto; margin: 0; }

/* ---------- 47. Active filter chips (filter-chips.js) ---------- */
/* Under a register's filters: one chip per active filter, with × to remove it, and "Clear all" (vision board, Sales documents). */
.control-shell .sky-filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 4px; }
.control-shell .sky-filter-chips[hidden] { display: none; }
.control-shell .sky-filter-chip { display: inline-flex; align-items: center; gap: 2px; min-height: 30px; padding: 2px 4px 2px 12px; border: 1px solid var(--sky-accent-line); border-radius: 999px; background: var(--sky-accent-soft); color: var(--control-accent); font-size: 13px; font-weight: 600; }
.control-shell .sky-filter-chip-remove { display: inline-grid; place-items: center; width: 26px; min-width: 26px; height: 26px; min-height: 26px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 16px; line-height: 1; }
.control-shell .sky-filter-chip-remove:hover { background: color-mix(in srgb, var(--control-accent) 14%, transparent); }
.control-shell .sky-filter-clear { min-height: 30px; padding: 2px 8px; border: 0; background: none; color: var(--control-accent); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
/* The same for every accounting-style report table (gl-table): new reports (Discounts, KPI scorecard, Payables ageing)
   had wide tables without a scrolling wrapper, so phones scrolled the whole page sideways. Desktop is unchanged. */
@media (max-width: 1000px) { .control-shell table.gl-table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; } }

/* ---------- 48. Report frames (accounting-style reports) ---------- */
/* Export Excel is added after the Export CSV / Print row, so it fell onto a line of its own. It now sits in the same row. */
.control-shell .management-toolbar:has(+ button[id$="-excel"]) { display: inline-flex; flex-wrap: wrap; gap: 8px; vertical-align: middle; margin-right: 4px; }
.control-shell .management-toolbar + button[id$="-excel"] { display: inline-flex; vertical-align: middle; }
/* The export row keeps a little space below the table. */
.control-shell .gl-wrap + .management-toolbar { margin-top: 12px; }
/* Tick-box filters in a report's period row ("Show each unpaid invoice", "Show zero lines") read as chips, box first. */
.control-shell .fs-period label:has(> input[type=checkbox]) { display: inline-flex; flex-direction: row; align-items: center; align-self: end; gap: 8px; min-height: 38px; padding: 4px 12px 4px 10px; border: 1px solid var(--control-line); border-radius: 999px; background: var(--control-paper); font-size: 13px; font-weight: 500; }
.control-shell .fs-period label:has(> input[type=checkbox]:checked) { border-color: var(--sky-accent-line); background: var(--sky-accent-soft); }
.control-shell .fs-period label > input[type=checkbox] { width: auto; margin: 0; order: -1; }
.control-shell .gl-wrap + .management-toolbar + button[id$="-excel"] { margin-top: 12px; }
.control-shell .management-toolbar:has(+ button[id$="-excel"]), .control-shell .management-toolbar + button[id$="-excel"] { vertical-align: top; }

/* ---------- 51. Waiting for me panel (WFM-19..28) ---------- */
/* Seen on KIWANGO PRACTICE (23 Nov): on phones the panel opened over its own "Waiting for me" button; the search box cut
   its placeholder; the "Reason:" a sender writes showed in error red; "All categories" / "Show everything" were bordered
   and underlined at once. Layout and colour only; the panel's text and behaviour are unchanged. */
.control-shell .work-inbox-panel .work-filters input[type=search] { flex: 1 1 100%; }
.control-shell .work-inbox-panel .work-filters select { flex: 1 1 0; max-width: none; min-width: 0; width: auto; }
.control-shell .work-inbox-panel .work-filters .work-filter-late { flex: 0 0 auto; }
.control-shell .work-inbox-panel .work-item-open .work-item-note { justify-self: start; padding: 3px 8px; border-radius: 6px; background: var(--control-soft); color: var(--control-ink); font-weight: 500; overflow-wrap: anywhere; }
.control-shell .work-inbox-panel .work-item-top > strong { overflow-wrap: anywhere; }
.control-shell .work-inbox-panel .work-item-age:empty { display: none; }
.control-shell .work-inbox-panel .work-categories + button, .control-shell .work-inbox-panel #workInboxBody > button.link-button, .control-shell .work-inbox-panel button.link-button { text-decoration: none; }
@media (max-width: 700px) {
  /* A sheet from the bottom of the screen: the header and the button that opened it stay in view. */
  .control-shell .work-inbox-panel { top: auto; bottom: 0; left: 0; right: 0; width: auto; max-height: calc(100dvh - 190px); border-radius: 16px 16px 0 0; border-bottom: 0; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}

/* ---------- 49. Usual items for this customer (SI-02, sales form) ---------- */
/* The suggestion box arrived as a bare bulleted list with the Add button glued to the end of each line. It is now a
   quiet accent card: one row per item, the reason on the left, Add on the right (44px tall on phones, Add all full width),
   rows divided by a hairline. Text and behaviour are unchanged. */
.control-shell .sales-usual { margin: 14px 0; padding: 14px 16px; border: 1px solid var(--sky-accent-line); border-radius: var(--sky-r-lg, 12px); background: var(--sky-accent-soft); }
.control-shell .sales-usual[hidden] { display: none; }
.control-shell .sales-usual > h3 { margin: 0 0 4px; font-size: 15px; }
.control-shell .sales-usual > p { margin: 0 0 10px; }
.control-shell .sales-usual-items { margin: 0 0 10px; padding: 0; list-style: none; }
.control-shell .sales-usual-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--sky-accent-line); }
.control-shell .sales-usual-item:first-child { border-top: 0; }
.control-shell .sales-usual-item > span { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.control-shell .sales-usual-item > button { flex: 0 0 auto; min-width: 72px; background: var(--control-paper); }
@media (max-width: 700px) {
  .control-shell .sales-usual { padding: 12px; }
  .control-shell .sales-usual-item > button { min-width: 64px; min-height: 44px; }
  .control-shell .sales-usual > button { width: 100%; min-height: 44px; }
}

/* ---------- 50. Receive into: one tap per account (DS-17, public/pay-buttons.js) ---------- */
/* Restaurant "Receive full payment" and the Point of sale cash checkout. The select stays (visually hidden, still
   required and read on confirm); the buttons mirror its accounts. More than 12 accounts (DS-45; was 6): the select shows as before. */
.control-shell label.sky-pay-select-replaced > select { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.control-shell label.sky-pay-select-replaced { margin-bottom: 6px; font-weight: 600; }
.control-shell .sky-pay-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr)); gap: 8px; margin: 0 0 14px; }
.control-shell .sky-pay-buttons[hidden] { display: none; }
.control-shell .sky-pay-option { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 56px; padding: 8px 14px; border: 1.5px solid var(--control-line); border-radius: var(--sky-r-lg, 12px); background: var(--control-paper); color: var(--control-ink); text-align: left; box-shadow: none; }
.control-shell .sky-pay-option:hover:not(:disabled) { border-color: var(--sky-accent-line); background: var(--sky-accent-soft); }
.control-shell .sky-pay-option .sky-pay-name { font-size: 15px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.control-shell .sky-pay-option .sky-pay-note { font-size: 12px; font-weight: 500; color: var(--control-muted); line-height: 1.25; overflow-wrap: anywhere; }
.control-shell .sky-pay-option.is-selected { border-color: var(--control-accent); background: var(--sky-accent-soft); box-shadow: inset 0 0 0 1px var(--control-accent); }
.control-shell .sky-pay-option.is-selected .sky-pay-name::before { content: "✓ "; color: var(--control-accent); }
.control-shell .sky-pay-option:disabled:not(.is-selected) { opacity: .5; }
/* DS-44: guided entry marks the label (Next field / problem); the buttons right after it get the same outline. */
/* DS-45: one outline, not two: the label keeps its "Next field" / problem text but drops its box; the buttons carry it. */
.control-shell label.sky-pay-select-replaced:is(.guide-next, .guide-invalid) { outline: none; }
.control-shell label.sky-pay-select-replaced.guide-next + .sky-pay-buttons { outline: 3px solid var(--control-accent); outline-offset: 3px; border-radius: 12px; }
.control-shell label.sky-pay-select-replaced.guide-invalid + .sky-pay-buttons { outline: 2px solid var(--control-danger, #b42318); outline-offset: 3px; border-radius: 12px; }

/* DS-46 (U-419): on narrow screens the staff editor's Save sits full width on top and Cancel well below it,
   so a thumb aimed at Save cannot land on Cancel. Wide screens keep Cancel and Save side by side. */
/* DS-48: only the editor's own Save/Cancel row (not the permission list's "Select all reports | Clear"), and a
   "Discard changes" button that guided-auto.js wraps with its warning note (.harm-pair) stays full width. */
@media (max-width: 600px) {
  #staffEditForm > .actions { flex-direction: column-reverse; align-items: stretch; gap: 20px; }
  #staffEditForm > .actions > button, #staffEditForm > .actions > .harm-pair,
  #staffEditForm > .actions > .harm-pair > button { width: 100%; min-height: 44px; }
  #staffEditForm > .actions > .harm-pair { display: flex; align-items: stretch; }
}
#staffEditForm > .actions button.sky-discard { color: #a4262c; border-color: currentColor; }

/* DS-47: long workspace references show in short form (public/short-refs.js); the full one is the tooltip. */
.sky-ref { white-space: nowrap; font-variant-numeric: tabular-nums; cursor: help; }

/* DS-49: the "Clean this file" plan table (ED-11b, public/clean-file.js) scrolls inside its own box on narrow
   screens instead of pushing the whole Audit trail page sideways (it was 2px too wide at 360px; long
   "Cannot delete" reasons would make it wider). */
.clean-file-plan { max-width: 100%; overflow-x: auto; }
.clean-file-plan > table { min-width: 0; }
.clean-file-plan td { overflow-wrap: anywhere; }

/* ---------- Phase 2 · Wave 1 · DS-51: tables read the same way everywhere (public/table-polish.js) ---------- */
/* Figures right-aligned on one line; dates on one line; slightly shorter rows. */
html:not([data-sky-classic]) .control-shell :is(td, th).sky-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
html:not([data-sky-classic]) .control-shell :is(td, th).sky-nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }
html:not([data-sky-classic]) .control-shell td:not(.business-document *) { padding-top: 9px; padding-bottom: 9px; }
/* Status badges: the words always show; colour only adds meaning. */
html:not([data-sky-classic]) .control-shell .sky-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
html:not([data-sky-classic]) .control-shell .sky-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
html:not([data-sky-classic]) .control-shell .sky-badge--good { background: #e6f4ec; color: #12704a; }
html:not([data-sky-classic]) .control-shell .sky-badge--warn { background: #fdf1dc; color: #8a5300; }
html:not([data-sky-classic]) .control-shell .sky-badge--bad { background: #fdecea; color: #b42318; }
html:not([data-sky-classic]) .control-shell .sky-badge--info { background: #e8f2fb; color: #0a5a96; }
html:not([data-sky-classic]) .control-shell .sky-badge--neutral { background: #eef1f5; color: #3b4a5e; }
html[data-appearance="dark"]:not([data-sky-classic]) .control-shell .sky-badge--good { background: #12352a; color: #6fd3a1; }
html[data-appearance="dark"]:not([data-sky-classic]) .control-shell .sky-badge--warn { background: #3a2a0c; color: #f4c26b; }
html[data-appearance="dark"]:not([data-sky-classic]) .control-shell .sky-badge--bad { background: #3d1814; color: #ff9b8f; }
html[data-appearance="dark"]:not([data-sky-classic]) .control-shell .sky-badge--info { background: #12304a; color: #8cc8f2; }
html[data-appearance="dark"]:not([data-sky-classic]) .control-shell .sky-badge--neutral { background: #1c2940; color: #c3cedd; }
/* Overview figures stay on one line and shrink to fit their card (KIWANGO STORE: "TZS 14,840,368.00" broke in two). */
html:not([data-sky-classic]) .control-shell .management-summary-card { container-type: inline-size; }
html:not([data-sky-classic]) .control-shell .management-summary-value.sky-figure { white-space: nowrap; font-size: clamp(15px, 10.5cqi, 24px); }
/* DS-52: on phones a list table (one with a status or Actions column) shows each row as a card: each value under its
   column name, figures and badges on the right, actions at the bottom. Nothing to scroll sideways. */
@media (max-width: 600px) {
  html:not([data-sky-classic]) .control-shell :is(.table-scroll, .management-table-wrap):has(> table.sky-list) { overflow: visible; border: 0; background: transparent; }
  html:not([data-sky-classic]) .control-shell table.sky-list, html:not([data-sky-classic]) .control-shell table.sky-list > tbody { display: block; width: 100%; }
  html:not([data-sky-classic]) .control-shell table.sky-list > thead { display: none; }
  html:not([data-sky-classic]) .control-shell table.sky-list > tbody > tr { display: block; margin: 0 0 10px; padding: 10px 14px; background: var(--control-paper); border: 1px solid var(--control-line); border-radius: 14px; }
  html:not([data-sky-classic]) .control-shell table.sky-list > tbody > tr > td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; text-align: right; min-height: 0; }
  html:not([data-sky-classic]) .control-shell table.sky-list > tbody > tr > td::before { content: attr(data-label); color: var(--control-muted); font-size: 12.5px; font-weight: 500; text-align: left; flex-shrink: 0; max-width: 45%; }
  html:not([data-sky-classic]) .control-shell table.sky-list > tbody > tr > td[data-label=""]::before { content: none; }
  html:not([data-sky-classic]) .control-shell table.sky-list > tbody > tr > td:empty { display: none; }
  html:not([data-sky-classic]) .control-shell table.sky-list > tbody > tr > td.sky-actions { justify-content: flex-start; flex-wrap: wrap; border-top: 1px solid var(--control-line); margin-top: 6px; padding-top: 10px; }
  html:not([data-sky-classic]) .control-shell table.sky-list > tbody > tr > td.sky-actions::before { content: none; }
  html:not([data-sky-classic]) .control-shell table.sky-list > tbody > tr:hover > td { background: none; }
  html:not([data-sky-classic]) .control-shell table.sky-list > tbody > tr > td:is([data-label^="Document"], [data-label="Customer"], [data-label="Supplier"]) { font-weight: 600; }
}

/* ---------- Phase 2 · Wave 1 · DS-53: the phone shell (public/phone-shell.js) ---------- */
/* Outside phones (or in Classic), the phone-only parts never show. */
html:not(.sky-phone) :is(.sky-tabbar, .sky-company) { display: none !important; }
/* Two slim rows (was three, 141 px): Modules, company, search, Waiting for me; then help, Light/Dark, sign-in time,
   the signed-in name and Sign out. Every control stays one tap away. */
html.sky-phone:not([data-sky-classic]) .control-shell .control-topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; height: auto; min-height: 0; padding: 4px 10px; }
html.sky-phone:not([data-sky-classic]) .control-shell .control-topbar::after { content: ''; order: 5; flex-basis: 100%; height: 0; }
html.sky-phone:not([data-sky-classic]) .control-shell .control-topbar-tools { display: contents; }
html.sky-phone:not([data-sky-classic]) .control-shell .control-mobile-toggle { order: 0; flex: 0 0 40px; width: 40px; height: 40px; padding: 0; font-size: 0; display: inline-flex; align-items: center; justify-content: center; }
html.sky-phone:not([data-sky-classic]) .control-shell .control-mobile-toggle::before { content: '\2630'; font-size: 20px; line-height: 1; }
html.sky-phone:not([data-sky-classic]) .control-shell .sky-company { order: 1; flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; font-weight: 650; color: var(--control-ink); }
html.sky-phone:not([data-sky-classic]) .control-shell .control-topbar-tools .command-bar-open { order: 2; flex: 0 0 40px; width: 40px; min-height: 40px; height: 40px; padding: 0; justify-content: center; }
html.sky-phone:not([data-sky-classic]) .control-shell .command-bar-open :is(.command-bar-open-label, .command-bar-kbd) { display: none; }
html.sky-phone:not([data-sky-classic]) .control-shell #workInboxButton { order: 3; flex: 0 0 auto; min-height: 40px; padding: 0 10px; font-size: 13px; white-space: nowrap; }
html.sky-phone:not([data-sky-classic]) .control-shell #howDoIOpen { order: 6; margin: 0; min-height: 36px; }
html.sky-phone:not([data-sky-classic]) .control-shell .control-theme-toggle { order: 7; min-height: 36px; }
html.sky-phone:not([data-sky-classic]) .control-shell #signInTimeButton { order: 8; min-height: 36px; }
html.sky-phone:not([data-sky-classic]) .control-shell #identity { order: 9; flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
html.sky-phone:not([data-sky-classic]) .control-shell #logout { order: 10; min-height: 36px; padding: 0 10px; }
/* Bottom tab bar: Home, Sales, Customers, Stock, More. */
html.sky-phone:not([data-sky-classic]) .sky-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: calc(64px + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--control-paper); border-top: 1px solid var(--control-line); }
html.sky-phone:not([data-sky-classic]) .sky-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 56px; color: var(--control-muted); font-family: inherit; font-size: 11.5px; font-weight: 500; line-height: 1.2; padding: 0; }
html.sky-phone:not([data-sky-classic]) .sky-tabbar > .sky-tab { border: 0 !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; margin: 0; width: auto; }
html.sky-phone:not([data-sky-classic]) .sky-tab svg { width: 22px; height: 22px; }
html.sky-phone:not([data-sky-classic]) .sky-tab[aria-current="page"] { color: var(--control-accent); font-weight: 650; }
html.sky-phone:not([data-sky-classic]) body { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
/* On a screen with a pinned Save, the tab bar steps aside so Save keeps the bottom edge; the open Modules menu covers it too. */
html.sky-phone:not([data-sky-classic]).sky-formbar .sky-tabbar, html.sky-phone:not([data-sky-classic]) body.control-menu-open .sky-tabbar { display: none; }
html.sky-phone:not([data-sky-classic]).sky-formbar body { padding-bottom: 0; }

/* ---------- Phase 2 · Wave 1 · DS-54: saved views as chips (public/view-chips.js) ---------- */
html:not([data-sky-classic]) .control-shell .sky-view-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
html:not([data-sky-classic]) .control-shell .sky-view-chips > .sky-view-chip { min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--sky-line-strong); background: var(--control-paper); color: var(--control-ink); font-size: 13.5px; font-weight: 500; }
html:not([data-sky-classic]) .control-shell .sky-view-chips > .sky-view-chip[aria-pressed="true"] { background: var(--control-ink); border-color: var(--control-ink); color: var(--control-paper); }
@media (max-width: 600px) {
  html:not([data-sky-classic]) .control-shell .sky-view-chips { flex-wrap: nowrap; overflow-x: auto; margin-left: -2px; padding: 2px; scrollbar-width: none; }
  html:not([data-sky-classic]) .control-shell .sky-view-chips > .sky-view-chip { flex: 0 0 auto; min-height: 40px; }
}

/* ---------- Phase 2 · Wave 1 · DS-55: waiting and held report screens (public/report-states.js) ---------- */
html:not([data-sky-classic]) .control-shell p.coa-meta.sky-reading { display: flex; align-items: center; gap: 8px; color: var(--control-muted); }
html:not([data-sky-classic]) .control-shell p.coa-meta.sky-reading::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--sky-accent-soft); border-top-color: var(--control-accent); animation: sky-spin .9s linear infinite; flex-shrink: 0; }
html:not([data-sky-classic]) .control-shell .sky-skeleton { display: flex; flex-direction: column; gap: 12px; margin: 12px 0 4px; padding: 18px; border: 1px solid var(--control-line); border-radius: 14px; background: var(--control-paper); }
html:not([data-sky-classic]) .control-shell .sky-skeleton-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
html:not([data-sky-classic]) .control-shell :is(.sky-skeleton-tile, .sky-skeleton-chart, .sky-skeleton-line) { display: block; border-radius: 10px; background: linear-gradient(90deg, var(--control-raised) 0%, var(--control-line) 50%, var(--control-raised) 100%); background-size: 200% 100%; animation: sky-shimmer 1.6s ease-in-out infinite; }
html:not([data-sky-classic]) .control-shell .sky-skeleton-tile { height: 64px; }
html:not([data-sky-classic]) .control-shell .sky-skeleton-chart { height: 150px; }
html:not([data-sky-classic]) .control-shell .sky-skeleton-line { height: 12px; border-radius: 6px; }
@keyframes sky-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@keyframes sky-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { html:not([data-sky-classic]) .control-shell :is(.sky-skeleton-tile, .sky-skeleton-chart, .sky-skeleton-line, p.coa-meta.sky-reading::before) { animation: none; } }
html:not([data-sky-classic]) .control-shell .sky-held { max-width: 560px; margin: 12px 0; padding: 22px 24px; border: 1px solid var(--control-line); border-radius: 14px; background: var(--control-paper); display: flex; flex-direction: column; gap: 10px; }
html:not([data-sky-classic]) .control-shell .sky-held-badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; background: var(--sky-accent-soft); color: var(--control-accent); font-size: 12.5px; font-weight: 650; }
html:not([data-sky-classic]) .control-shell .sky-held-badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
html:not([data-sky-classic]) .control-shell .sky-held-title { margin: 0; font-size: 18px; font-weight: 700; color: var(--control-ink); }
html:not([data-sky-classic]) .control-shell .sky-held-text { margin: 0; font-size: 14px; line-height: 1.55; color: var(--control-muted); }
html:not([data-sky-classic]) .control-shell .sky-held-details { font-size: 13px; color: var(--control-muted); }
html:not([data-sky-classic]) .control-shell .sky-held-details > summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
html:not([data-sky-classic]) .control-shell .sky-held-details p.coa-error { margin: 6px 0 0; font-size: 13px; }

/* ---------- Phase 2 · Wave 1 · DS-56: the Classic look (public/classic-look.js) ---------- */
/* Every Wave 1 style above applies only without html[data-sky-classic]; the parts Wave 1 adds are hidden in Classic. */
html[data-sky-classic] :is(.sky-tabbar, .sky-company, .sky-view-chips, .sky-skeleton) { display: none !important; }
.sky-look-banner { margin: 0 0 16px; box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 16px; border: 1px solid var(--control-line, #e2e7ee); border-radius: 14px; background: var(--sky-accent-soft, #e8f2fb); color: var(--control-ink, #0f1b2d); font-size: 14px; }
.sky-look-banner p { margin: 0; flex: 1 1 260px; line-height: 1.45; }
.sky-look-banner button { min-height: 40px; padding: 0 14px; border-radius: 9px; font-weight: 600; }
.control-theme-toggle .sky-look-toggle { white-space: nowrap; }

/* ---------- Phase 2 · Wave 1 · DS-57: empty states (public/empty-states.js) ---------- */
/* An empty list or panel ("No transfers yet.") reads as a calm empty state: centred, muted, a small tray drawing above. */
html:not([data-sky-classic]) .control-shell #workspace .sky-empty { text-align: center; line-height: 1.45; padding: 26px 16px 22px; margin: 8px 0; }
html:not([data-sky-classic]) .control-shell #workspace p.sky-empty { border: 1px dashed var(--control-line); border-radius: 10px; background: var(--control-canvas, #f3f5f8); }
html:not([data-sky-classic]) .control-shell #workspace .sky-empty::before { content: ''; display: block; width: 34px; height: 34px; margin: 0 auto 8px; background: currentColor; opacity: .55;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 13h5l1.5 2.5h5L16 13h5'/%3E%3Cpath d='M5.5 5h13L21 13v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 13h5l1.5 2.5h5L16 13h5'/%3E%3Cpath d='M5.5 5h13L21 13v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5z'/%3E%3C/svg%3E") center / contain no-repeat; }
@media print { .sky-empty::before { display: none !important; } }

/* ---------- Phase 2 · Wave 2 · DS-58: Overview figures (public/overview-figures.js) ---------- */
/* A shortened amount stays on one line; hovering shows the full amount (title), as does a screen reader (aria-label). */
html:not([data-sky-classic]) .control-shell #dashboard :is(.management-summary-value, .metric-card > strong).sky-short { white-space: nowrap; cursor: help; font-variant-numeric: tabular-nums; }
html:not([data-sky-classic]) .control-shell #dashboard .management-summary-delta.is-flat { color: var(--control-muted); }

/* ---------- Phase 2 · Wave 2 · DS-59: Overview layout (location-reports.js, dashboard mode). The counting note already folds (Show more). ---------- */
/* The five trading figures lead; the service figures are a compact second row (every figure still shown). */
html:not([data-sky-classic]) .control-shell #dashboard .management-summary-card.sky-minor { padding-top: 10px; padding-bottom: 10px; box-shadow: none; }
html:not([data-sky-classic]) .control-shell #dashboard .management-summary-card.sky-minor .management-summary-value { font-size: 17px; }
html:not([data-sky-classic]) .control-shell #dashboard .management-summary-card.sky-minor .management-summary-label { font-size: 12px; }
html:not([data-sky-classic]) .control-shell #dashboard .management-summary-card.sky-minor .management-summary-meta { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; }

/* ---------- Phase 2 · Wave 2 · DS-60: report headline figures (financial-statements.js, Profit and loss on screen) ---------- */
.sky-headline { display: none; }
html:not([data-sky-classic]) .control-shell .sky-headline { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 4px 0 14px; container-type: inline-size; }
html:not([data-sky-classic]) .control-shell .sky-headline-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--control-paper); border: 1px solid var(--control-line); border-radius: 12px; min-width: 0; }
html:not([data-sky-classic]) .control-shell .sky-headline-label { font-size: 12.5px; color: var(--control-muted); font-weight: 600; }
html:not([data-sky-classic]) .control-shell .sky-headline-value { font-size: 22px; font-weight: 700; color: var(--control-ink); white-space: nowrap; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
html:not([data-sky-classic]) .control-shell .sky-headline-delta { font-size: 12.5px; font-weight: 600; color: var(--control-muted); }
html:not([data-sky-classic]) .control-shell .sky-headline-delta.is-up { color: #0f7a3d; }
html:not([data-sky-classic]) .control-shell .sky-headline-delta.is-down { color: #b42318; }
html:not([data-sky-classic])[data-appearance="dark"] .control-shell .sky-headline-delta.is-up { color: #6fd39a; }
html:not([data-sky-classic])[data-appearance="dark"] .control-shell .sky-headline-delta.is-down { color: #ff9b91; }
@media print { .sky-headline { display: none !important; } }

/* ---------- Phase 2 · Wave 4 · DS-63: client identity (public/client-identity.js) ---------- */
/* A round mark before the company name: the client's logo (--sky-logo) or its first letter (data-sky-initial). */
html:not([data-sky-classic]) .control-shell :is(.control-sidebar-company, .sky-company)[data-sky-initial] { position: relative; padding-left: 30px; min-height: 24px; }
html:not([data-sky-classic]) .control-shell :is(.control-sidebar-company, .sky-company)[data-sky-initial]::before {
  content: attr(data-sky-initial); position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sky-accent-soft, #e6f0fb); color: var(--control-accent); font-size: 12px; font-weight: 700; line-height: 1; letter-spacing: 0; }
html.sky-has-logo:not([data-sky-classic]) .control-shell :is(.control-sidebar-company, .sky-company)[data-sky-initial]::before {
  content: ''; background: #fff var(--sky-logo) center / 80% no-repeat; border: 1px solid var(--control-line); }
html:not([data-sky-classic]) .control-shell .control-sidebar-company[data-sky-initial] { text-align: left; }

/* ---------- Phase 2 · Wave 4 · DS-64: dark mode 2.0 (as approved on the canvas "Overview in dark mode") ---------- */
/* A softer action blue, and raised panels a step lighter than the page, so cards read as raised without shadows. */
html:not([data-sky-classic])[data-appearance="dark"] {
  --control-accent: #4aa8e8;
  --control-accent-hover: #6fbcf0;
  --control-accent-ink: #04111f;
  --sky-brand: #4aa8e8;
  --control-raised: #1a263a;
  --sky-accent-line: #1f5f8f;
}

/* ---------- Phase 2 · Wave 3 · DS-65: Livestock reports as tiles ---------- */
/* The six farm reports (overview, checks, eggs and milk, feed, health, growth) were full-width panels stacked ~1,900 px
   tall, each a title, one line and a Show button. They now sit as tiles, three to a row (two, then one on smaller screens);
   a report that has been opened takes the full width again. Everything else on the screen keeps its full width. */
html:not([data-sky-classic]) .control-shell #livestock:not([hidden]) { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
html:not([data-sky-classic]) .control-shell #livestock:not([hidden]) > * { flex: 1 1 100%; min-width: 0; margin-top: 0; margin-bottom: 0; }
html:not([data-sky-classic]) .control-shell #livestock:not([hidden]) > :is(label, button) { flex: 0 0 auto; align-self: end; }
html:not([data-sky-classic]) .control-shell #livestock > :is(.livestock-farm-overview, .livestock-control-checks, .livestock-produce-report, .livestock-feed-report, .livestock-health-report, .livestock-growth-report) {
  flex: 1 1 calc(33.333% - 8px); display: flex; flex-direction: column; gap: 6px; }
html:not([data-sky-classic]) .control-shell #livestock > :is(.livestock-farm-overview, .livestock-control-checks, .livestock-produce-report, .livestock-feed-report, .livestock-health-report, .livestock-growth-report) > button:first-of-type { margin-top: auto; align-self: flex-start; }
html:not([data-sky-classic]) .control-shell #livestock > :is(.livestock-farm-overview, .livestock-control-checks, .livestock-produce-report, .livestock-feed-report, .livestock-health-report, .livestock-growth-report):is(:has(table), :has(> :nth-child(5))) { flex-basis: 100%; }
@media (max-width: 1100px) { html:not([data-sky-classic]) .control-shell #livestock > :is(.livestock-farm-overview, .livestock-control-checks, .livestock-produce-report, .livestock-feed-report, .livestock-health-report, .livestock-growth-report) { flex-basis: calc(50% - 6px); } }
@media (max-width: 700px) { html:not([data-sky-classic]) .control-shell #livestock > :is(.livestock-farm-overview, .livestock-control-checks, .livestock-produce-report, .livestock-feed-report, .livestock-health-report, .livestock-growth-report) { flex-basis: 100%; } }
html:not([data-sky-classic]) .control-shell #livestock:not([hidden]) > label { min-width: min(320px, 100%); }
html:not([data-sky-classic]) .control-shell #livestock:not([hidden]) > label select { width: 100%; }

/* ---------- Phase 2 · Wave 3 · DS-66: setup notices on Production and Livestock ---------- */
/* "Production accounting setup" and "Service-cost accounting setup" read as one compact notice: an accent edge, tighter
   lines, the first line in full weight. Every sentence stays visible (they include refusals); only spacing and weight change.
   A neutral edge, because the same box also says "enabled" once a company is set up. */
html:not([data-sky-classic]) .control-shell :is(.production-compatibility, .livestock-compatibility) { border-left: 4px solid var(--sky-accent-line, #9cc7ea); padding-top: 12px; padding-bottom: 12px; }
html:not([data-sky-classic]) .control-shell :is(.production-compatibility, .livestock-compatibility) > p { margin: 3px 0; font-size: 13.5px; line-height: 1.45; }
html:not([data-sky-classic]) .control-shell :is(.production-compatibility, .livestock-compatibility) > h3 + p { font-weight: 600; color: var(--control-ink); }
html:not([data-sky-classic]) .control-shell :is(.production-compatibility, .livestock-compatibility) > :is(button, .toolbar, div) { margin-top: 8px; }

/* ---------- Phase 2 · Wave 3 · DS-67: Production plan summary (public/production-summary.js) ---------- */
/* On wide screens the plan form keeps a 300 px column on the right where a sticky summary restates what is entered.
   Phones, narrower screens and Classic look: no summary, the form as before. */
.sky-plan-summary { display: none; }
@media (min-width: 1100px) {
  html:not([data-sky-classic]) .control-shell form.production-form.sky-has-summary { position: relative; padding-right: 330px; }
  html:not([data-sky-classic]) .control-shell form.production-form > .sky-plan-summary { display: block; position: absolute; top: 16px; bottom: 16px; right: 16px; width: 290px; }
  html:not([data-sky-classic]) .control-shell .sky-plan-summary-card { position: sticky; top: 132px; max-height: calc(100vh - 160px); overflow: auto;
    padding: 14px 16px; border: 1px solid var(--control-line); border-radius: 12px; background: var(--control-canvas); font-size: 13px; line-height: 1.45; }
  html:not([data-sky-classic]) .control-shell .sky-plan-summary h3 { margin: 0 0 8px; font-size: 14px; }
  html:not([data-sky-classic]) .control-shell .sky-plan-summary-block { margin: 0 0 10px; }
  html:not([data-sky-classic]) .control-shell .sky-plan-summary-block strong { display: block; font-size: 12.5px; color: var(--control-muted); font-weight: 650; margin-bottom: 2px; }
  html:not([data-sky-classic]) .control-shell .sky-plan-summary ul { margin: 0; padding-left: 16px; }
  html:not([data-sky-classic]) .control-shell .sky-plan-summary li.is-missing { color: var(--control-muted); font-style: italic; }
  html:not([data-sky-classic]) .control-shell .sky-plan-summary p { margin: 0 0 8px; }
  html:not([data-sky-classic]) .control-shell .sky-plan-summary-share { font-weight: 600; }
  html:not([data-sky-classic]) .control-shell .sky-plan-summary-next { padding: 8px 10px; border-radius: 8px; background: var(--sky-accent-soft, #e6f0fb); color: var(--control-ink); }
}
@media print { .sky-plan-summary { display: none !important; } }

/* ---------- Phase 2 · Wave 2 · DS-59b: "Needs your attention" on the Overview (public/overview-attention.js) ---------- */
.sky-attention { display: none; }
html:not([data-sky-classic]) .control-shell #dashboard .sky-attention:not([hidden]) { display: block; margin: 0 0 14px; padding: 14px 16px; border: 1px solid var(--control-line); border-left: 4px solid var(--control-warning, #c98a16); border-radius: 12px; background: var(--control-paper); }
html:not([data-sky-classic]) .control-shell .sky-attention h2 { margin: 0 0 8px; font-size: 15px; }
html:not([data-sky-classic]) .control-shell .sky-attention ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
html:not([data-sky-classic]) .control-shell .sky-attention li { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 0; border-top: 1px solid var(--control-line); }
html:not([data-sky-classic]) .control-shell .sky-attention li:first-child { border-top: 0; }
html:not([data-sky-classic]) .control-shell .sky-attention-count { min-width: 32px; padding: 2px 8px; border-radius: 999px; background: var(--control-warning-bg, #fdf1dc); color: var(--control-ink); text-align: center; font-variant-numeric: tabular-nums; }
html:not([data-sky-classic]) .control-shell .sky-attention-label { flex: 1 1 auto; min-width: 0; }
html:not([data-sky-classic]) .control-shell .sky-attention li > button { flex: 0 0 auto; min-height: 36px; }
@media (max-width: 600px) { html:not([data-sky-classic]) .control-shell .sky-attention li > button { min-height: 44px; } }

/* ---------- Phase 2 · Wave 2 · DS-61: 30-day sales line on the Overview (location-reports.js, dashboard mode) ---------- */
.sky-trend { display: none; }
html:not([data-sky-classic]) .control-shell #dashboard .sky-trend { display: block; margin: 0 0 12px; padding: 12px 16px 8px; border: 1px solid var(--control-line); border-radius: 12px; background: var(--control-paper); }
html:not([data-sky-classic]) .control-shell .sky-trend-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
html:not([data-sky-classic]) .control-shell .sky-trend-label { font-size: 12.5px; font-weight: 600; color: var(--control-muted); }
html:not([data-sky-classic]) .control-shell .sky-trend-total { font-size: 18px; font-variant-numeric: tabular-nums; color: var(--control-ink); }
html:not([data-sky-classic]) .control-shell .sky-trend-line { display: block; width: 100%; height: 64px; margin-top: 6px; }
html:not([data-sky-classic]) .control-shell .sky-trend-stroke { fill: none; stroke: var(--control-accent); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
html:not([data-sky-classic]) .control-shell .sky-trend-area { fill: var(--sky-accent-soft, #e6f0fb); stroke: none; }
html:not([data-sky-classic]) .control-shell .sky-trend-foot { display: flex; justify-content: space-between; color: var(--control-muted); font-size: 11.5px; }
@media print { .sky-trend { display: none !important; } }

/* ---------- 52. DS-04: the last lone section Refresh buttons (27 Nov) ---------- */
/* The page Refresh at the top already reloads the same data: Customers through loadCustomers (the same call as 'Refresh customers');
   Items, Purchasing and Money by pressing their own button (app.js MERGED_REFRESH / MERGED_REFRESH_PLACES), so these duplicates go. */
.control-shell :is(#refreshCustomers, #refreshMenuSettings, #purchasingModern > header.management-header > button.secondary-button, #moneyHost > .toolbar > button) { display: none; }
/* DS-65 follow-up (1 Dec): the flock row gained Record feed (PL-114); on screens up to 1100 px the picker narrows to 260 px so the picker and its four buttons still share one row. */
@media (max-width: 1100px) { html:not([data-sky-classic]) .control-shell #livestock:not([hidden]) > label { min-width: min(260px, 100%); } }
