/* The Sapera App's look (PointOfSale/OfflinePos DESIGN.md and the tokens at the top of its pos.css): Sapera's blue on
   the app's lighter greys, 6 px corners, a grey strip on a card's heading, Sapera's tables with bold column names on
   the grey band, the chosen row light blue with a mark at its left edge, small buttons with a mouse and large ones on a
   touch screen. The app has no dark theme, so neither has this skin. */

:root[data-skin="app"] {
    color-scheme: light;
    --st-font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    --st-font-size: 14px;
    --st-control-font-size: 14px;
    --st-input-pad: 6px 10px;
    --st-button-pad: 5px 12px;
    --st-tab-pad: 8px 12px;
    --st-tab-font-size: 14px;
    --st-tab-mark: 3px;
    --st-cell-pad: 6px 8px;
    --st-grid-head-weight: 700;
    --st-mono: "Cascadia Mono", Consolas, Menlo, "DejaVu Sans Mono", "Courier New", monospace;
    --st-radius: 6px;
    --st-control-radius: 4px;
    --st-login-radius: 14px;

    --st-bg: #eef2f6;
    --st-surface: #ffffff;
    --st-panel: #f3f6f9;
    --st-text: #1d2733;
    --st-label: #627080;
    --st-muted: #627080;
    --st-text-disabled: #9aa7b2;
    --st-border: #d9e1e8;
    --st-border-strong: #c3ced8;
    --st-card-border: #d9e1e8;
    --st-divider: #e8edf2;
    --st-input-bg: #ffffff;
    --st-input-border: #c3ced8;
    --st-input-disabled-bg: #f3f6f9;
    --st-input-inset: none;
    --st-focus: #2f6da4;
    --st-focus-ring: 0 0 0 3px rgba(51, 122, 183, .2);
    --st-button-bg: #ffffff;
    --st-button-hover: #ffffff;
    --st-button-hover-border: #337ab7;

    --st-accent: #337ab7;
    --st-accent-border: #a9c4dc;
    --st-accent-fill: #337ab7;
    --st-accent-fill-border: #337ab7;
    --st-accent-fill-hover: #2a5580;
    --st-on-accent: #ffffff;
    --st-link: #2f6da4;
    --st-link-hover: #2a5580;
    --st-selected: #d5e2ed;
    --st-hover: #e8f0f7;
    --st-zebra: #ffffff;

    --st-header-bg: #2f6da4;
    --st-header-text: #ffffff;
    --st-header-muted: rgba(255, 255, 255, .8);
    --st-header-border: transparent;
    --st-header-shadow: none;
    --st-header-sep: rgba(255, 255, 255, .35);
    --st-header-chip: rgba(255, 255, 255, .15);
    --st-header-chip-border: transparent;
    --st-header-button: rgba(255, 255, 255, .15);
    --st-header-button-border: transparent;
    --st-header-button-text: #ffffff;
    --st-header-button-hover: rgba(255, 255, 255, .25);
    --st-header-primary: #ffffff;
    --st-header-primary-text: #2f6da4;
    --st-header-primary-hover: #e8f0f7;

    --st-card-head-bg: #f3f6f9;
    --st-card-head-text: #1d2733;
    --st-card-head-border: #d9e1e8;
    --st-card-head-size: 15px;
    --st-card-head-weight: 600;
    --st-dialog-head-bg: transparent;
    --st-dialog-head-text: #1d2733;

    --st-grid-head-bg: #f3f6f9;
    --st-grid-head-line: #d9e1e8;
    --st-grid-line: #d9e1e8;

    --st-good: #2a9d8f;
    --st-good-bg: #e3f4f1;
    --st-good-border: #b5e0d9;
    --st-good-fill: #2a9d8f;
    --st-bad: #b42318;
    --st-bad-bg: #fdecea;
    --st-bad-border: #f1c0bb;
    --st-bad-fill: #b42318;
    --st-bad-fill-hover: #93190f;
    --st-warn: #c77d00;
    --st-warn-bg: #fff4dc;
    --st-warn-border: #f0d58a;
    --st-changed-bg: #fff4dc;

    --st-row-new: #20b2aa;
    --st-row-changed: #fafad2;
    --st-row-unchanged: #808080;
    --st-row-failed: #f08080;
    --st-inactive: #e1e6eb;

    --st-shadow: none;
    --st-shadow-raised: 0 8px 24px rgba(24, 37, 45, .12), 0 1px 2px rgba(24, 37, 45, .06);
    --st-popup-shadow: 0 6px 20px rgba(0, 0, 0, .18);
    --st-backdrop: rgba(15, 23, 28, .45);
    --st-tooltip-bg: #1d2733;
    --st-tooltip-text: #ffffff;
    --st-code-bg: #eef2f6;
    --st-band-blend: multiply;

    --st-login-bg: linear-gradient(160deg, #f5f8fb 0%, #e7edf3 60%, #dde6ee 100%);
    --st-login-card-bg: #ffffff;
    --st-login-shadow: 0 18px 45px rgba(31, 45, 57, .10), 0 2px 8px rgba(31, 45, 57, .06);
    --st-login-accent: #54a0e0;
    --st-login-accent-hover: #3f8ed3;
    --st-login-accent-ring: rgba(84, 160, 224, .18);
    --st-login-accent-glow: rgba(84, 160, 224, .35);
}

/* Rule 3: tables as Sapera's - bold column names on the grey band, rows divided by a line; no zebra. */
:root[data-skin="app"] .grid th { border-bottom-width: 2px; }

:root[data-skin="app"] .grid tr.selected td:first-child, :root[data-skin="app"] .list li.selected { box-shadow: inset 3px 0 0 var(--st-accent); }

/* The app's tabs are the shared underlined tabs (app.css) with its own sizes (the tokens above). */

/* Dialogs: the app's rounder dialog, its heading plain on the dialog. */
:root[data-skin="app"] .modal { border-radius: 14px; padding: 20px; gap: 14px; }
:root[data-skin="app"] .modal h3 { margin: 0; padding: 0; border: 0; }

/* Rule 4: buttons by device - small with a mouse, large to hit with a finger. */
@media (pointer: coarse) {
    :root[data-skin="app"] button, :root[data-skin="app"] .file-button, :root[data-skin="app"] a.button { min-height: 44px; padding: 8px 16px; border-radius: var(--st-radius); }
    :root[data-skin="app"] button.small, :root[data-skin="app"] .file-button.small { min-height: 32px; }
    :root[data-skin="app"] input:not([type=checkbox]):not([type=radio]), :root[data-skin="app"] select { min-height: 44px; }
}

/* Inside the app (?embed=app): the app's blue top bar and menu stand around the frame, so the toolbar is the page's own
   head - light, on the page's background (rule 6), with the app's plain buttons. */
:root[data-skin="app"][data-embed] .toolbar {
    --st-header-bg: transparent;
    --st-header-text: var(--st-text);
    --st-header-muted: var(--st-muted);
    --st-header-sep: var(--st-border);
    --st-header-chip: var(--st-surface);
    --st-header-chip-border: var(--st-border);
    --st-header-button: var(--st-surface);
    --st-header-button-border: var(--st-border);
    --st-header-button-text: var(--st-text);
    --st-header-button-hover: var(--st-surface);
    --st-header-primary: var(--st-accent-fill);
    --st-header-primary-text: var(--st-on-accent);
    --st-header-primary-hover: var(--st-accent-fill-hover);
    border-bottom: 1px solid var(--st-border);
}
:root[data-skin="app"][data-embed] .toolbar button:not(.primary):hover, :root[data-skin="app"][data-embed] .toolbar a.button:hover { border-color: var(--st-accent); color: var(--st-accent); }

/* No dark theme in the app: the switch is not offered. */
:root[data-skin="app"] .theme-switch { display: none; }
