/* ============================================================================
   Bloom Shop Dashboard — 1950s florist theme
   Palette: cream paper ground, espresso ink, teal/cherry/gold accents.
   Chart series colors are validated for CVD separation and contrast
   (see BloomTheme.cs — keep the two in sync).
   ========================================================================== */

:root {
    /* surfaces */
    --paper: #FAF3E4;          /* cream wall            */
    --card: #FFFDF6;           /* framed card           */
    --card-edge: #E4D7BC;      /* card frame line       */
    --panel: #2E3D38;          /* walnut/teal nav board */
    --panel-edge: #24312D;
    --awning-a: #0B8A73;       /* awning stripe teal    */
    --awning-b: #F6EEDC;       /* awning stripe cream   */

    /* ink */
    --ink: #33261C;            /* espresso              */
    --ink-soft: #6B5B4C;
    --ink-faint: #98866F;
    --ink-on-panel: #E8DFC8;
    --gold: #B3720A;

    /* accents */
    --teal: #0B8A73;
    --cherry: #D0342C;

    /* chart series (fixed order, never cycled) */
    --s1: #0B8A73;
    --s2: #D0342C;
    --s3: #3E6FB0;
    --s4: #B3720A;
    --s5: #9C4177;
    --s6: #6B7F2E;

    /* type */
    --font-script: 'Yellowtail', cursive;
    --font-head: 'Oswald', 'Arial Narrow', sans-serif;
    --font-body: 'Jost', 'Segoe UI', sans-serif;
    --font-mono: 'Courier Prime', 'Courier New', monospace;

    /* spacing scale */
    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
    --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
}

/* ---------------------------------------------------------------- layout -- */

.shop {
    display: grid;
    grid-template-columns: 236px 1fr;
    min-height: 100vh;
}

/* -------------------------------------------------- directory-board nav -- */

.board {
    background: var(--panel);
    border-right: 4px solid var(--panel-edge);
    padding: var(--sp-5) var(--sp-4);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.board-sign {
    text-align: center;
    margin-bottom: var(--sp-3);
}

.board-sign .script {
    font-family: var(--font-script);
    font-size: 40px;
    line-height: 1.1;
    color: #F2C879;
    text-shadow: 0 2px 0 rgba(0,0,0,.35);
    display: block;
}

.board-sign .est {
    font-family: var(--font-head);
    font-size: 10px;
    letter-spacing: .32em;
    text-transform: uppercase;
    color: var(--ink-on-panel);
    opacity: .7;
}

.board-rule {
    border: 0;
    border-top: 1px solid rgba(232,223,200,.25);
    border-bottom: 1px solid rgba(0,0,0,.35);
    margin: var(--sp-4) 0;
}

.board nav { display: flex; flex-direction: column; gap: 2px; }

.board a {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 9px var(--sp-3);
    border-radius: 3px;
    color: var(--ink-on-panel);
    text-decoration: none;
    font-family: var(--font-head);
    font-size: 13px;
    letter-spacing: .12em;
    text-transform: uppercase;
    border-left: 3px solid transparent;
}

.board a .nav-ico {
    width: 22px;
    text-align: center;
    font-size: 15px;
    filter: grayscale(35%) sepia(15%);
}

.board a:hover { background: rgba(0,0,0,.22); color: #fff; }

.board a.active {
    background: rgba(0,0,0,.3);
    border-left-color: var(--gold);
    color: #F2C879;
}

.board a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* ------------------------------------------------------- awning + header -- */

.wall { min-width: 0; display: flex; flex-direction: column; }

.awning {
    height: 26px;
    background: repeating-linear-gradient(90deg,
        var(--awning-a) 0 44px,
        var(--awning-b) 44px 88px);
    position: relative;
    flex: none;
}
.awning::after {
    /* scalloped hem — one semicircle per stripe, in the stripe's own color */
    content: "";
    position: absolute;
    left: 0; right: 0; top: 100%;
    height: 14px;
    background:
        radial-gradient(circle 14px at 22px 0, var(--awning-a) 13px, transparent 14px) 0 0 / 88px 14px repeat-x,
        radial-gradient(circle 14px at 66px 0, var(--awning-b) 13px, transparent 14px) 0 0 / 88px 14px repeat-x;
    filter: drop-shadow(0 2px 2px rgba(51, 38, 28, .2));
}

.topbar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sp-4);
    padding: var(--sp-6) var(--sp-6) var(--sp-4);
    flex-wrap: wrap;
}

/* FocusOnNavigate moves programmatic focus here on route change — the
   default outline reads as a stray box, and keyboard tab order never
   lands on a heading, so suppressing it costs nothing. */
.page-title:focus { outline: none; }

.page-title {
    margin: 0;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 30px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.page-title .flourish {
    font-family: var(--font-script);
    font-size: 26px;
    text-transform: none;
    letter-spacing: 0;
    color: var(--teal);
    margin-right: var(--sp-2);
}

.page-sub {
    margin: 2px 0 0;
    color: var(--ink-soft);
    font-size: 14px;
}

/* -------------------------------------------------------- open/live sign -- */

.live-sign {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    background: #201914;
    color: #7CE8C9;
    border-radius: 6px;
    padding: 6px 14px;
    font-family: var(--font-head);
    letter-spacing: .22em;
    font-size: 12px;
    text-transform: uppercase;
    box-shadow: inset 0 0 12px rgba(124,232,201,.25);
    border: 2px solid #3a2f26;
}

.live-sign .bulb {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #7CE8C9;
    box-shadow: 0 0 8px 2px rgba(124,232,201,.8);
}

.live-sign.closed { color: #E88A7C; box-shadow: inset 0 0 12px rgba(232,138,124,.25); }
.live-sign.closed .bulb { background: #E88A7C; box-shadow: 0 0 8px 2px rgba(232,138,124,.8); }

@media (prefers-reduced-motion: no-preference) {
    .live-sign .bulb { animation: bulb 2.4s ease-in-out infinite; }
    @keyframes bulb { 50% { opacity: .55; } }
}

.refresh-note {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-faint);
}

/* ---------------------------------------------------------------- cards -- */

.content { padding: 0 var(--sp-6) var(--sp-7); }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: var(--sp-5);
    align-items: start;
}

.card {
    background: var(--card);
    border: 1px solid var(--card-edge);
    border-radius: 4px;
    box-shadow: 0 1px 0 rgba(51,38,28,.08), 0 6px 14px -10px rgba(51,38,28,.35);
    padding: var(--sp-4) var(--sp-5) var(--sp-5);
}

.card.wide { grid-column: 1 / -1; }

.card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sp-3);
    border-bottom: 1px dashed var(--card-edge);
    padding-bottom: var(--sp-2);
    margin-bottom: var(--sp-4);
}

.card-title {
    margin: 0;
    font-family: var(--font-head);
    font-weight: 500;
    font-size: 15px;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.card-note { font-size: 12px; color: var(--ink-faint); }

.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 320px; }

/* -------------------------------------------------------------- KPI tiles -- */

.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--sp-4);
    margin-bottom: var(--sp-5);
}

.kpi {
    background: var(--card);
    border: 1px solid var(--card-edge);
    border-radius: 4px;
    padding: var(--sp-4) var(--sp-4) var(--sp-3);
    position: relative;
    overflow: hidden;
}

.kpi::before {
    /* price-tag hole */
    content: "";
    position: absolute;
    top: 10px; right: 10px;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--paper);
    border: 1px solid var(--card-edge);
}

.kpi-label {
    font-family: var(--font-head);
    font-size: 11px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.kpi-value {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 700;
    line-height: 1.15;
    margin-top: 2px;
}

.kpi-unit { font-size: 14px; color: var(--ink-faint); font-family: var(--font-mono); }

/* ------------------------------------------------------- loading / empty -- */

.state-note {
    padding: var(--sp-6);
    text-align: center;
    color: var(--ink-faint);
    font-size: 14px;
}

.state-note .script {
    display: block;
    font-family: var(--font-script);
    font-size: 24px;
    color: var(--ink-soft);
    margin-bottom: var(--sp-1);
}

/* ---------------------------------------------------- receipt notifications */

.receipt-spool {
    position: fixed;
    top: 0;
    right: var(--sp-6);
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--sp-2);
    max-height: 100vh;
    overflow: hidden;
    pointer-events: none;
    padding-bottom: var(--sp-4);
}

.receipt {
    pointer-events: auto;
    width: 280px;
    background: #FFFEF8;
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.45;
    border: 1px solid var(--card-edge);
    border-top: none;
    box-shadow: 0 8px 18px -8px rgba(51,38,28,.5);
    padding: var(--sp-3) var(--sp-4) var(--sp-4);
    position: relative;
}

.receipt::after {
    /* perforated bottom edge */
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -6px;
    height: 6px;
    background: radial-gradient(circle at 6px -1px, #FFFEF8 5px, transparent 6px) 0 0 / 16px 6px repeat-x;
    filter: drop-shadow(0 3px 3px rgba(51,38,28,.25));
}

@media (prefers-reduced-motion: no-preference) {
    .receipt { animation: print .45s cubic-bezier(.2,.9,.3,1); }
    @keyframes print {
        from { transform: translateY(-104%); }
        to   { transform: translateY(0); }
    }
}

.receipt-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px dashed var(--card-edge);
    padding-bottom: 4px;
    margin-bottom: 6px;
}

.receipt-node {
    font-family: var(--font-head);
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: 12px;
}

.receipt-op { font-weight: 700; }
.receipt-op.create { color: var(--teal); }
.receipt-op.update { color: var(--gold); }
.receipt-op.delete { color: var(--cherry); }

.receipt-line { display: flex; justify-content: space-between; gap: var(--sp-2); }
.receipt-line .k { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt-line .v { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }

.receipt-foot {
    margin-top: 6px;
    padding-top: 4px;
    border-top: 1px dashed var(--card-edge);
    display: flex;
    justify-content: space-between;
    color: var(--ink-faint);
    font-size: 11px;
}

/* ------------------------------------------------------------ data table -- */

.tag-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tag-table th {
    font-family: var(--font-head);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 11px;
    color: var(--ink-soft);
    text-align: left;
    padding: 6px 8px;
    border-bottom: 2px solid var(--card-edge);
}
.tag-table td { padding: 6px 8px; border-bottom: 1px solid #F0E7D2; }
.tag-table td.num { font-family: var(--font-mono); text-align: right; }

/* ------------------------------------------------------------- responsive -- */

@media (max-width: 900px) {
    .shop { grid-template-columns: 1fr; }
    .board { position: static; height: auto; }
    .receipt-spool { right: var(--sp-3); }
}

/* Blazor error UI (kept minimal, restyled) */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--cherry);
    color: #fff;
    padding: var(--sp-3) var(--sp-5);
    font-family: var(--font-body);
    z-index: 100;
}
#blazor-error-ui .dismiss { cursor: pointer; float: right; }
