/* ============================================================
   VisiSuite design system — shared tokens for every screen.
   Tweak here and the whole product restyles. Premium, not boxy:
   rounded, layered shadows, gradients, glow, smooth motion.
   ============================================================ */
:root {
    /* Brand palette (leanlogic cyan + Watermill navy, bottle tones) */
    --cyan: #29abe2;
    --cyan-bright: #4fc3f0;
    --cyan-deep: #1a86c7;
    --ink-900: #060d16;
    --ink-800: #08131f;
    --ink-700: #0b1a2b;
    --ink-600: #0f2337;
    --ink-500: #123153;
    --line: #1c3a55;
    --line-soft: #142c44;
    --text: #dce8f3;
    --text-dim: #7ea6c6;
    --text-faint: #5f7f98;

    /* Pace / status */
    --ok: #37d67a;
    --warn: #ffb020;
    --bad: #ff5f5f;

    /* Radii — generous, never boxy */
    --r-sm: 10px;
    --r-md: 16px;
    --r-lg: 22px;
    --r-xl: 28px;
    --r-pill: 999px;

    /* Layered soft shadows for real depth */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.45);
    --glow-cyan: 0 0 24px rgba(41, 171, 226, 0.45);

    /* Glass surface */
    --glass: linear-gradient(160deg, rgba(23, 52, 80, 0.75) 0%, rgba(10, 24, 38, 0.85) 100%);
    --glass-hi: linear-gradient(160deg, rgba(34, 68, 100, 0.85) 0%, rgba(12, 28, 44, 0.9) 100%);

    /* Motion */
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --t-fast: 0.16s var(--ease);
    --t-med: 0.3s var(--ease);
}

html, body {
    font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, 'Inter', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background: var(--ink-900);
}

/* ---- Scale-to-fit stage: the dashboard is authored at a fixed design width
   and uniformly scaled by js/fit.js to fill any screen without scrolling. ---- */
html, body { margin: 0; height: 100%; overflow: hidden; }

.vc-stage {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: var(--ink-900);
    display: flex;
    justify-content: center;
    align-items: center;
}

.vc-canvas {
    width: 2200px;            /* landscape design width; JS scales the whole thing */
    flex: 0 0 auto;           /* never let flex shrink it below the design width */
    transform-origin: center center;
    will-change: transform;
}

/* Reusable premium surfaces (available to any screen) */
.surface {
    background: var(--glass);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(6px);
}

.lift { transition: transform var(--t-med), box-shadow var(--t-med); }
.lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.pill-btn {
    background: linear-gradient(180deg, var(--cyan) 0%, var(--cyan-deep) 100%);
    color: #04121e;
    font-weight: 700;
    border: none;
    border-radius: var(--r-pill);
    padding: 9px 18px;
    cursor: pointer;
    transition: transform var(--t-fast), box-shadow var(--t-med), filter var(--t-fast);
    box-shadow: 0 6px 18px rgba(41, 171, 226, 0.4);
}
.pill-btn:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 10px 26px rgba(41, 171, 226, 0.6); }
.pill-btn:active { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0d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iA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ============================================================
   VisiCentral charts (rate + pipeline). Bars are rendered as
   markup, so these are global (not scoped) styles.
   ============================================================ */
.chart-card {
    background: var(--glass, linear-gradient(160deg, #12263b, #0b1a2b));
    border: 1px solid var(--line, #1c3a55);
    border-radius: var(--r-lg, 22px);
    padding: 16px 18px 12px;
    box-shadow: var(--shadow-md, 0 10px 30px rgba(0,0,0,0.35));
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    transition: transform var(--t-med, 0.3s ease), box-shadow var(--t-med, 0.3s ease);
}
.chart-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg, 0 20px 50px rgba(0,0,0,0.45)); }

.chart-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 8px;
}
.chart-title { font-size: 0.95rem; font-weight: 800; letter-spacing: 1px; color: #eaf6ff; }
.chart-sub { font-size: 0.78rem; color: #7ea6c6; }

.chart-legend { font-size: 0.74rem; color: #9ec6e3; display: flex; align-items: center; gap: 6px; }
.chart-legend .lg { width: 11px; height: 11px; border-radius: 3px; display: inline-block; margin-left: 10px; }
.lg-actual { background: linear-gradient(180deg, #5ccbf2, #1483c4); }
.lg-target { background: linear-gradient(180deg, #5f7488, #3a4b5c); }

/* Fill the card so both charts are the same size and as large/legible as possible. */
.chart-svg { width: 100%; height: 100%; flex: 1 1 auto; min-height: 0; display: block; overflow: visible; }

/* Bars grow up on render; soft shadow gives a little depth. */
.chart-svg .bar-grow {
    transform-box: fill-box;
    transform-origin: bottom;
    animation: barGrow 0.85s cubic-bezier(0.22, 0.61, 0.36, 1) both;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35));
}

/* ---------- Tile tools + pop-out (shared: floor, inventory, pipeline) ---------- */
.tile-tools { display: flex; align-items: center; gap: 10px; }
.chart-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.tile-expand {
    background: #10314e; border: 1px solid #24557f; color: #cfe6f7;
    border-radius: 7px; width: 30px; height: 28px; cursor: pointer;
    font-size: 15px; line-height: 1; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s ease;
}
.tile-expand:hover { background: #1b4667; }

.pop-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(4, 12, 22, 0.72); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    animation: pop-fade .15s ease;
}
.pop-card {
    width: 94vw; height: 92vh;
    background: #0b1f33; border: 1px solid #1d456b; border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
    padding: 18px 24px 22px; display: flex; flex-direction: column;
    animation: pop-pop .18s ease;
}
.pop-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px; flex: 0 0 auto;
}
.pop-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.pop-body .chart-svg { width: 100%; height: 100%; }
.pop-body .bottle-grid { width: 100%; gap: 22px; }
.pop-body .kanban { width: 100%; }

@keyframes pop-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Rolling-window dropdown. Lives here (global) not in the component's scoped CSS
   because the <select> is built via RenderTreeBuilder and so never receives the
   scoped-style marker — the scoped rule wouldn't apply and the browser would fall
   back to a white default. color-scheme:dark makes the native arrow/list dark too. */
.rate-window {
    background: #0e2740;
    color: #cfe6f7;
    border: 1px solid #24557f;
    border-radius: 7px;
    padding: 3px 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color-scheme: dark;
}
.rate-window option { background: #0e2740; color: #cfe6f7; }

/* Chart picker sits just right of the chart title, inside the header. */
.chart-picker { display: inline-flex; align-items: center; margin-left: 12px; }
@keyframes barGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }