/* ==========================================================================
   Skybooks — SkyUI-inspired interface
   A locally hosted, accessible dark theme modelled on the SkyUI inventory
   menus: charcoal ground, parchment text, a single warm gold selection accent,
   condensed uppercase display type, and a list + item-detail reading layout.
   ========================================================================== */

@font-face {
    font-family: "Oswald";
    src: url("/assets/vendor/fonts/Oswald-Variable.ttf") format("truetype");
    font-weight: 200 700;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: dark;

    /* Ground and surfaces */
    --ground-top: #0c0e10;
    --ground-bottom: #15181b;
    --iron: #14171a;
    --panel: rgba(26, 29, 33, 0.82);
    --panel-solid: #1a1d21;
    --raised: rgba(255, 255, 255, 0.035);

    /* Ink */
    --parchment: #e9dcbf;
    --ivory: #f4ecd8;
    --muted: rgba(233, 220, 191, 0.62);
    --faint: rgba(233, 220, 191, 0.40);

    /* Accents */
    --gold: #c9a24e;
    --gold-bright: #e2c079;
    --gold-deep-1: #9c7f40;
    --gold-deep-2: #6d582c;
    --frost: #7fa6bd;
    --crimson: #8f3a34;
    --crimson-bright: #c98a84;
    --moss: #5c7551;
    --moss-bright: #a8c39a;

    /* Lines */
    --hairline: rgba(201, 162, 78, 0.16);
    --hairline-soft: rgba(233, 220, 191, 0.10);

    --font-display: "Oswald", "Arial Narrow", "Helvetica Neue", system-ui, sans-serif;
    --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    --radius: 4px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background:
        radial-gradient(120% 80% at 50% -10%, rgba(201, 162, 78, 0.05), transparent 60%),
        linear-gradient(180deg, var(--ground-top) 0%, var(--ground-bottom) 100%);
    background-attachment: fixed;
    color: var(--parchment);
    -webkit-font-smoothing: antialiased;
    letter-spacing: 0.01em;
}

a { color: var(--gold-bright); text-decoration: none; }
a:hover { color: var(--gold); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; }

/* Shared display / heading treatment */
.page-title,
.topbar-title,
.brand,
.auth-title {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ivory);
    margin-top: 0;
}

.skyui-icon {
    width: 18px;
    height: 18px;
    display: block;
    flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }
.app-frame { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.sidebar {
    width: 250px;
    flex: 0 0 250px;
    background:
        linear-gradient(180deg, #14171a 0%, #0f1215 100%);
    border-right: 1px solid var(--hairline);
    padding: 1.4rem 1rem;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1.1rem;
    margin-bottom: 1.1rem;
    border-bottom: 1px solid var(--hairline-soft);
}
.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    color: var(--gold-bright);
    background: linear-gradient(180deg, rgba(201, 162, 78, 0.14), rgba(201, 162, 78, 0.03));
    border: 1px solid var(--hairline);
    flex: 0 0 auto;
}
.brand-icon svg { width: 22px; height: 22px; }
.brand-icon img { width: 22px; height: 22px; display: block; }
.brand {
    font-size: 0.98rem;
    line-height: 1.15;
    margin: 0;
    color: var(--ivory);
}
.sidebar-context {
    color: var(--gold);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 0.2rem;
}

.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list li { margin: 0.15rem 0; }
.nav-list a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--parchment);
    padding: 0.6rem 0.7rem;
    border-radius: var(--radius);
    border-left: 2px solid transparent;
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.92rem;
}
.nav-list a svg { width: 18px; height: 18px; opacity: 0.75; flex: 0 0 auto; }
.nav-list a:hover, .nav-list a:focus {
    background: var(--raised);
    border-left-color: var(--gold-deep-1);
    color: var(--ivory);
    outline: none;
}
.nav-list a.is-active {
    background: linear-gradient(90deg, rgba(201, 162, 78, 0.16), rgba(201, 162, 78, 0.02));
    border-left-color: var(--gold);
    color: var(--ivory);
}
.nav-list a.is-active svg { opacity: 1; color: var(--gold-bright); }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.05rem 1.75rem;
    border-bottom: 1px solid var(--hairline);
    background: linear-gradient(180deg, rgba(18, 21, 24, 0.9), rgba(15, 18, 21, 0.6));
}
.topbar-context {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}
.topbar-back-link {
    flex: 0 0 auto;
}
.topbar-kicker {
    text-transform: uppercase;
    letter-spacing: 0.28em;
    font-size: 0.66rem;
    color: var(--gold);
    font-family: var(--font-display);
}
.topbar-title { margin-top: 0.1rem; font-size: 1.25rem; letter-spacing: 0.14em; }

/* User menu */
.user-menu { position: relative; }
.user-menu summary { list-style: none; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.4rem 0.65rem 0.4rem 0.4rem;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    background: rgba(8, 8, 8, 0.4);
    cursor: pointer;
    color: var(--parchment);
}
.user-menu-trigger:hover { border-color: var(--gold-deep-1); }
.user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, var(--gold-deep-1), var(--gold-deep-2));
    color: var(--ivory);
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 0.04em;
}
.user-menu-name { color: var(--ivory); font-family: var(--font-display); letter-spacing: 0.06em; }
.user-menu-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 190px;
    padding: 0.4rem;
    border-radius: var(--radius);
    border: 1px solid var(--hairline);
    background: var(--panel-solid);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6);
    z-index: 20;
}
.user-menu-panel a,
.user-menu-logout {
    display: block;
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--parchment);
    text-align: left;
    cursor: pointer;
    font-size: 0.95rem;
}
.user-menu-panel a:hover, .user-menu-logout:hover,
.user-menu-panel a:focus, .user-menu-logout:focus {
    background: var(--raised);
    color: var(--ivory);
    outline: none;
}

.content { flex: 1; padding: 1.75rem; }

/* --------------------------------------------------------------------------
   Panels / cards
   -------------------------------------------------------------------------- */
.card,
.widget-panel {
    background: var(--panel);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 1.25rem;
    position: relative;
}
.card + .card { margin-top: 1rem; }

.page-title { letter-spacing: 0.1em; font-size: 1.35rem; }
h2.page-title { font-size: 1.1rem; }
.muted { color: var(--muted); }

.section-kicker {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.68rem;
    color: var(--gold);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn,
.auth-submit-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    padding: 0.6rem 1.05rem;
    border: 1px solid rgba(201, 162, 78, 0.5);
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--gold-deep-1), var(--gold-deep-2));
    color: var(--ivory);
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.86rem;
    line-height: 1.1;
}
.btn:hover, .btn:focus,
.auth-submit-button:hover, .auth-submit-button:focus {
    background: linear-gradient(180deg, #b0904a, #7d6633);
    border-color: var(--gold);
    color: #fff8ea;
    outline: none;
}
.btn:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.btn-secondary {
    background: linear-gradient(180deg, #2b2f33, #202327);
    border-color: var(--hairline);
    color: var(--parchment);
}
.btn-secondary:hover, .btn-secondary:focus { background: linear-gradient(180deg, #343a3f, #262a2e); color: var(--ivory); }
.btn-danger { background: linear-gradient(180deg, #7c352f, #52211d); border-color: rgba(201, 138, 132, 0.4); }
.btn-danger:hover, .btn-danger:focus { background: linear-gradient(180deg, #8f3e37, #5f2723); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost {
    background: transparent;
    border-color: var(--hairline);
    color: var(--parchment);
}
.btn-ghost:hover { background: var(--raised); border-color: var(--gold-deep-1); color: var(--ivory); }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.76rem; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-group { margin-bottom: 1rem; }
label { font-family: var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.78rem; color: var(--gold); }
.form-control {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: rgba(6, 8, 9, 0.7);
    color: var(--ivory);
    font-family: var(--font-body);
    font-size: 0.95rem;
    margin-top: 0.35rem;
}
.form-control:focus {
    border-color: var(--gold);
    outline: none;
    box-shadow: 0 0 0 3px rgba(201, 162, 78, 0.18);
}
select.form-control { appearance: none; }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; color: var(--parchment); }
.table th, .table td { text-align: left; padding: 0.7rem 0.65rem; border-bottom: 1px solid var(--hairline-soft); }
.table th {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.78rem;
    color: var(--gold);
}
.table tbody tr:hover { background: var(--raised); }
.num { font-variant-numeric: tabular-nums; text-align: right; }

/* --------------------------------------------------------------------------
   Alerts / badges
   -------------------------------------------------------------------------- */
.alert { padding: 0.8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid var(--hairline); }
.alert-danger { background: rgba(143, 58, 52, 0.2); border-color: rgba(201, 138, 132, 0.35); color: var(--crimson-bright); }
.alert-success { background: rgba(92, 117, 81, 0.18); border-color: rgba(168, 195, 154, 0.3); color: var(--moss-bright); }

.badge, .widget-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(201, 162, 78, 0.12);
    border: 1px solid var(--hairline);
    color: var(--parchment);
    font-size: 0.78rem;
    font-family: var(--font-display);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.widget-badge.is-warning, .badge.is-warning { background: rgba(143, 58, 52, 0.22); color: var(--crimson-bright); border-color: rgba(201, 138, 132, 0.3); }
.widget-badge.is-success, .badge.is-success { background: rgba(92, 117, 81, 0.22); color: var(--moss-bright); border-color: rgba(168, 195, 154, 0.3); }

/* --------------------------------------------------------------------------
   Stat plates + widget grids (dashboard / reporting)
   -------------------------------------------------------------------------- */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.9rem;
}
.widget-grid--auto { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card-grid.card-grid--auto { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; }
.widget-grid > .card + .card, .card-grid > .card + .card { margin-top: 0; }

.outstanding-orders-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    max-height: min(70vh, 760px);
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0.1rem 0.5rem 0.5rem 0.1rem;
    scrollbar-color: var(--steel) rgba(0, 0, 0, 0.2);
}
.outstanding-order-card {
    min-width: 0;
    width: 100%;
}
.store-admin-sections {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.store-admin-section {
    margin: 0;
}

.stat-plate,
.widget-card--metric {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(0, 0, 0, 0.15));
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 0.95rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 104px;
    justify-content: space-between;
}
.stat-plate .stat-label,
.widget-subtle {
    color: var(--gold);
    font-family: var(--font-display);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.72rem;
}
.stat-plate .stat-value,
.widget-stat {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.85rem;
    line-height: 1;
    color: var(--ivory);
    font-variant-numeric: tabular-nums;
}
.stat-plate .stat-value.is-small { font-size: 1.3rem; }
.stat-plate .stat-icon { color: var(--gold); opacity: 0.5; }
.stat-plate .stat-icon svg { width: 20px; height: 20px; }

.widget-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.widget-title-row .skyui-icon--report-heading {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    color: var(--gold);
    opacity: 0.85;
}
.report-table-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--hairline);
}
.report-filters {
    margin-bottom: 1rem;
}
.report-filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}
.report-filter-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.widget-list { margin: 0; padding: 0; list-style: none; }
.widget-list li + li { margin-top: 0.35rem; }
.widget-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.85rem; }
.widget-link-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    background: var(--raised);
    color: var(--parchment);
    cursor: pointer;
    font-family: var(--font-display);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.8rem;
}
.widget-link-button:hover, .widget-link-button:focus { background: rgba(201, 162, 78, 0.14); border-color: var(--gold-deep-1); color: var(--ivory); outline: none; }
.widget-link-button.is-primary { background: linear-gradient(180deg, var(--gold-deep-1), var(--gold-deep-2)); border-color: var(--gold-deep-1); color: var(--ivory); }

/* Two-column workspace (dashboard / detail pages) */
.workspace-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1rem; align-items: start; }
.workspace-main, .workspace-sidebar { min-width: 0; }
.workspace-sidebar { position: sticky; top: 1rem; }

/* Transaction summary lines */
.transaction-line {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--hairline-soft);
}
.transaction-total {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--hairline);
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 0.06em;
    color: var(--ivory);
}
.money { font-variant-numeric: tabular-nums; color: var(--gold-bright); }

/* Editable draft order lines (POS sidebar) */
.tx-lines { list-style: none; margin: 0; padding: 0; }
.tx-line { padding: 0.6rem 0; border-bottom: 1px solid var(--hairline-soft); }
.tx-line-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.tx-line-name { color: var(--ivory); }
.tx-line.is-restricted { background: rgba(143, 58, 52, 0.16); border-left: 3px solid var(--crimson-bright); padding-left: 0.55rem; }
.restricted-text, .restricted-warning { color: var(--crimson-bright); }
.restricted-warning { display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; }
.restricted-badge { color: var(--crimson-bright); border: 1px solid rgba(201, 138, 132, 0.5); padding: 0.1rem 0.35rem; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; }
.tx-line-controls { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.45rem; flex-wrap: wrap; }
.tx-qty { display: inline-flex; align-items: center; gap: 0.35rem; }
.tx-qty-input.form-control { width: 62px; margin-top: 0; padding: 0.3rem 0.4rem; text-align: center; }
.tx-qty-set { padding: 0.35rem 0.6rem; }
.tx-unit { font-size: 0.8rem; }
.tx-remove-form { margin-left: auto; }
.tx-remove {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: transparent;
    color: var(--crimson-bright);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}
.tx-remove:hover, .tx-remove:focus { background: rgba(143, 58, 52, 0.22); border-color: rgba(201, 138, 132, 0.45); outline: none; }

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    clip: rect(0 0 0 0); clip-path: inset(50%);
    overflow: hidden; white-space: nowrap;
}

/* Timeline list */
.timeline-list { list-style: none; margin: 0; padding: 0; }
.timeline-list li { padding: 0.55rem 0; border-bottom: 1px solid var(--hairline-soft); }

/* Impersonation banner */
.impersonation-banner { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }

/* ==========================================================================
   SkyUI inventory component (POS / catalogue / inventory browsers)
   ========================================================================== */
.skyui { display: flex; flex-direction: column; gap: 0.9rem; }

.skyui-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.skyui-cats { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.skyui-cat {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    background: transparent;
    border: 1px solid transparent;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    cursor: pointer;
    font-family: var(--font-display);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    font-size: 0.82rem;
}
.skyui-cat svg { width: 19px; height: 19px; }
.skyui-cat .skyui-cat-count {
    font-size: 0.7rem;
    color: var(--faint);
    font-variant-numeric: tabular-nums;
}
.skyui-cat:hover { color: var(--parchment); }
.skyui-cat.is-active {
    color: var(--gold-bright);
    border-bottom-color: var(--gold);
}
.skyui-cat.is-active .skyui-cat-count { color: var(--gold); }

.skyui-search {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    background: rgba(6, 8, 9, 0.7);
    min-width: 240px;
}
.skyui-search svg { width: 17px; height: 17px; color: var(--gold); flex: 0 0 auto; }
.skyui-search input {
    border: 0;
    background: transparent;
    color: var(--ivory);
    width: 100%;
    font-size: 0.92rem;
    outline: none;
}

.skyui-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.9fr);
    gap: 0;
    background: var(--panel);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 460px;
}

.skyui-listwrap { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--hairline); }

.skyui-list-head {
    display: grid;
    grid-template-columns: 2.4fr 1.1fr 0.8fr 0.9fr 0.9fr;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--hairline);
    background: rgba(0, 0, 0, 0.22);
    position: sticky;
    top: 0;
    z-index: 1;
}
.skyui-col {
    background: transparent;
    border: 0;
    color: var(--gold);
    text-align: left;
    cursor: pointer;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
}
.skyui-col--num { justify-content: flex-end; text-align: right; }
.skyui-col .skyui-sort-caret { opacity: 0; font-size: 0.7rem; transition: opacity 0.1s; }
.skyui-col[data-sort-active] .skyui-sort-caret { opacity: 1; }
.skyui-col:hover { color: var(--gold-bright); }

.skyui-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    max-height: 62vh;
    flex: 1;
}
.skyui-row {
    display: grid;
    grid-template-columns: 2.4fr 1.1fr 0.8fr 0.9fr 0.9fr;
    gap: 0.5rem;
    align-items: center;
    padding: 0.55rem 1rem;
    border-left: 3px solid transparent;
    border-bottom: 1px solid var(--hairline-soft);
    cursor: pointer;
    color: var(--parchment);
}
.skyui-row:hover { background: var(--raised); }
.skyui-row.is-selected {
    background: linear-gradient(90deg, rgba(201, 162, 78, 0.2), rgba(201, 162, 78, 0.05));
    border-left-color: var(--gold);
    color: var(--ivory);
}
.skyui-row[hidden] { display: none; }
.skyui-cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.92rem; }
.skyui-cell--name { display: flex; align-items: center; gap: 0.6rem; font-weight: 500; }
.skyui-cell--name .skyui-row-icon { color: var(--gold); opacity: 0.8; flex: 0 0 auto; }
.skyui-cell--name .skyui-row-icon svg { width: 17px; height: 17px; }
.skyui-cell--type { color: var(--muted); text-transform: capitalize; font-size: 0.85rem; }
.skyui-cell--num { text-align: right; font-variant-numeric: tabular-nums; }
.skyui-cell--value { color: var(--gold-bright); }
.skyui-row.is-selected .skyui-cell--type { color: rgba(244, 236, 216, 0.85); }
.skyui-row.is-low .skyui-cell--num.skyui-stock { color: var(--crimson-bright); }

/* Stock uses six aligned columns rather than the five-column POS browser. */
.stock-list-head,
.stock-row {
    grid-template-columns: minmax(11rem, 2fr) minmax(7rem, 1.15fr) minmax(8rem, 1.25fr) minmax(5rem, 0.75fr) minmax(5rem, 0.75fr) minmax(5.5rem, 0.8fr);
    gap: 0.75rem;
}
.stock-list-head { align-items: center; }
.stock-row { cursor: default; }

.skyui-empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }

/* Item detail card */
.skyui-detail {
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.18));
}
.skyui-detail-empty { margin: auto; text-align: center; color: var(--faint); }
.skyui-detail-empty svg { width: 44px; height: 44px; opacity: 0.4; }
.skyui-detail-head { display: flex; gap: 1rem; align-items: flex-start; }
.skyui-detail-emblem {
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    color: var(--gold-bright);
    background: linear-gradient(180deg, rgba(201, 162, 78, 0.16), rgba(201, 162, 78, 0.03));
    border: 1px solid var(--hairline);
}
.skyui-detail-emblem svg { width: 24px; height: 24px; }
.skyui-detail-title { font-family: var(--font-display); font-size: 1.4rem; letter-spacing: 0.04em; color: var(--ivory); line-height: 1.1; }
.skyui-detail-sub { color: var(--gold); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.72rem; font-family: var(--font-display); margin-top: 0.25rem; }

.skyui-detail-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.skyui-stat {
    border: 1px solid var(--hairline-soft);
    border-radius: var(--radius);
    padding: 0.55rem 0.65rem;
    background: rgba(0, 0, 0, 0.18);
}
.skyui-stat .k { color: var(--gold); font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.66rem; }
.skyui-stat .v { color: var(--ivory); font-variant-numeric: tabular-nums; font-size: 1.05rem; margin-top: 0.15rem; }
.skyui-detail-divider { height: 1px; background: var(--hairline); margin: 0.2rem 0; }
.skyui-detail-note { color: var(--muted); font-size: 0.88rem; }

/* Point of Sale: list panel with an always-visible quick-add footer, and the
   current order pinned in the right workspace sidebar. */
.pos-workspace .skyui-bar { margin-bottom: 0.9rem; }
.pos-workspace { grid-template-columns: minmax(0, 1fr) 540px; }

/* Fixed-height frame: the header and the quick-add footer stay put while only
   the item list scrolls inside, so the selected item is always in view without
   scrolling the page. */
.skyui-listpanel {
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    overflow: hidden;
    max-height: calc(100vh - 290px);
}
.skyui-listpanel .skyui-list-head { flex: 0 0 auto; }
.skyui-listpanel .skyui-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}

.skyui-quickadd {
    flex: 0 0 auto;
    border-top: 1px solid var(--gold-deep-1);
    background: linear-gradient(180deg, #201c15, #17140e);
    box-shadow: 0 -12px 24px rgba(0, 0, 0, 0.35);
    padding: 0.75rem 1rem;
}
.skyui-quickadd-empty {
    color: var(--faint);
    font-family: var(--font-display);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.78rem;
}
.skyui-quickadd-form { display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap; }
.skyui-quickadd-emblem {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--gold-bright);
    background: linear-gradient(180deg, rgba(201, 162, 78, 0.16), rgba(201, 162, 78, 0.03));
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
}
.skyui-quickadd-emblem svg { width: 20px; height: 20px; }
.skyui-quickadd-identity { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.skyui-quickadd-name { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.03em; color: var(--ivory); line-height: 1.15; }
.skyui-quickadd-meta { font-size: 0.85rem; display: inline-flex; gap: 0.4rem; align-items: baseline; }
.skyui-quickadd-price { font-variant-numeric: tabular-nums; }
.skyui-quickadd .qa-field { display: flex; flex-direction: column; gap: 0.15rem; }
.skyui-quickadd .qa-field label { font-size: 0.6rem; margin: 0; }
.skyui-quickadd .qa-field input.form-control { margin-top: 0; padding: 0.4rem 0.5rem; width: 78px; }
.skyui-quickadd .qa-price input.form-control { width: 108px; }
.skyui-quickadd .qa-tax input.form-control { width: 74px; }
.skyui-quickadd-form .btn { margin-left: auto; }

@media (max-width: 960px) {
    .skyui-quickadd-form .btn { margin-left: 0; }
}

/* --------------------------------------------------------------------------
   Mode toggle (Sell / Buy) and small toolbars
   -------------------------------------------------------------------------- */
.pos-toolbar, .profile-toolbar, .report-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.1rem;
}
.pos-mode-toggle {
    display: inline-flex;
    padding: 0.2rem;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    background: rgba(6, 8, 9, 0.6);
    gap: 0.15rem;
}
.pos-mode-toggle a {
    padding: 0.45rem 1rem;
    border-radius: 999px;
    color: var(--parchment);
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.82rem;
}
.pos-mode-toggle a.is-active { background: linear-gradient(180deg, var(--gold-deep-1), var(--gold-deep-2)); color: var(--ivory); }

/* --------------------------------------------------------------------------
   Dialog / tabs
   -------------------------------------------------------------------------- */
.dialog {
    width: min(760px, calc(100vw - 2rem));
    padding: 0;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: var(--panel-solid);
    color: var(--parchment);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7);
}
.dialog::backdrop { background: rgba(0, 0, 0, 0.66); }
.dialog-header, .dialog-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1rem 1.15rem;
}
.dialog-header { border-bottom: 1px solid var(--hairline); }
.dialog-footer { border-top: 1px solid var(--hairline); }
.dialog-body { padding: 1.15rem; }

.tab-strip {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--hairline);
    background: rgba(0, 0, 0, 0.12);
}
.tab-strip button {
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted);
    padding: 0.85rem 1rem;
    border-radius: 0;
    cursor: pointer;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
}
.tab-strip button:hover,
.tab-strip button:focus {
    color: var(--ivory);
    background: rgba(255, 255, 255, 0.04);
    outline: none;
}
.tab-strip button.is-active {
    background: rgba(201, 162, 78, 0.12);
    border-bottom-color: var(--gold);
    color: var(--gold-bright);
}
.tab-panels {
    padding-top: 1rem;
}
.tab-panel[hidden] { display: none; }

.datatable-toolbar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: end;
    margin-bottom: 0.75rem;
}
.datatable-search,
.datatable-length {
    min-width: 220px;
}
.datatable-info {
    margin-left: auto;
    padding-bottom: 0.25rem;
}
.datatable-pagination {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 0.75rem;
}
.datatable-page-label {
    min-width: 7rem;
    text-align: center;
}
.datatable-shell .table {
    margin-bottom: 0;
}
.outstanding-order-card > .datatable-toolbar {
    justify-content: flex-end;
    margin-bottom: 0.35rem;
}
.outstanding-order-card > .datatable-toolbar .datatable-info {
    margin-left: 0;
    margin-right: auto;
}
.datatable-shell .datatable-empty-row td {
    text-align: center;
    padding: 1.2rem 0.75rem;
}

.docs-callout {
    padding: 0.9rem 1rem;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: rgba(201, 162, 78, 0.08);
    color: var(--parchment);
}

/* --------------------------------------------------------------------------
   Authentication
   -------------------------------------------------------------------------- */
.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(120% 60% at 50% 0%, rgba(201, 162, 78, 0.08), transparent 55%),
        linear-gradient(180deg, var(--ground-top) 0%, var(--ground-bottom) 100%);
    color: var(--parchment);
}
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.auth-card {
    width: min(100%, 430px);
    padding: 2.2rem 2rem;
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid var(--hairline);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    position: relative;
}
.auth-card::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px solid var(--hairline-soft);
    border-radius: var(--radius);
    pointer-events: none;
}
.auth-logo {
    display: grid; place-items: center;
    width: 66px; height: 66px; margin: 0 auto 1rem;
    border-radius: var(--radius);
    color: var(--gold-bright);
    background: linear-gradient(180deg, rgba(201, 162, 78, 0.16), rgba(201, 162, 78, 0.03));
    border: 1px solid var(--hairline);
}
.auth-logo svg { width: 34px; height: 34px; }
.auth-logo img { width: 34px; height: 34px; }
.auth-title { text-align: center; font-size: 1.9rem; margin-bottom: 0.3rem; }
.auth-copy { text-align: center; color: var(--muted); margin-bottom: 1.6rem; }
.auth-form { position: relative; z-index: 1; }
.auth-submit-button { width: 100%; margin-top: 0.5rem; padding: 0.8rem; font-size: 0.95rem; }

/* --------------------------------------------------------------------------
   Horizontal bar chart (self-contained, no charting library)
   -------------------------------------------------------------------------- */
.chart-bars { display: flex; flex-direction: column; gap: 0.7rem; }
.chart-bar-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 110px; gap: 0.75rem; align-items: center; }
.chart-bar-label { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--parchment); text-transform: capitalize; font-family: var(--font-display); letter-spacing: 0.04em; font-size: 0.9rem; }
.chart-bar-label svg { width: 17px; height: 17px; color: var(--gold); opacity: 0.85; flex: 0 0 auto; }
.chart-bar-track { height: 14px; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--hairline-soft); border-radius: 999px; overflow: hidden; }
.chart-bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold-deep-2), var(--gold)); border-radius: 999px; }
.chart-bar-value { text-align: right; font-size: 0.9rem; }

/* Crafting recipe list in the item detail pane */
.craft-recipe { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.4rem; }
.craft-line {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.6rem;
    align-items: baseline;
    padding: 0.4rem 0.55rem;
    border: 1px solid var(--hairline-soft);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.18);
    font-size: 0.88rem;
}
.craft-line-name { color: var(--parchment); }
.craft-line-need { color: var(--gold); font-variant-numeric: tabular-nums; }
.craft-line-have { color: var(--muted); font-variant-numeric: tabular-nums; }
.craft-line.is-short { border-color: rgba(201, 138, 132, 0.4); }
.craft-line.is-short .craft-line-have { color: var(--crimson-bright); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
    .widget-grid--auto { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card-grid.card-grid--auto { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: auto; flex-basis: auto; }
    .workspace-layout { grid-template-columns: 1fr; }
    .workspace-sidebar { position: static; }
    .store-admin-section .widget-grid { grid-template-columns: 1fr !important; }
    .skyui-layout { grid-template-columns: 1fr; }
    .skyui-listwrap { border-right: 0; border-bottom: 1px solid var(--hairline); }
    .widget-grid--auto { grid-template-columns: 1fr; }
    .report-table-header { flex-direction: column; }
    .report-filter-grid { grid-template-columns: 1fr; }
}
