/* PPM design system. Colours, type and spacing live in the tokens below; components use only the tokens. */

:root {
    --navy-950: #041526;
    --navy-900: #0a2540;
    --navy-800: #12304f;
    --navy-700: #1d3d61;

    --brand: #f97316;
    --brand-strong: #ea580c;
    --brand-gradient: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);

    --primary: #2563eb;
    --primary-strong: #1d4ed8;
    --primary-soft: #eff6ff;
    --primary-ring: rgba(37, 99, 235, 0.18);

    --success: #059669;
    --success-soft: #ecfdf5;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --danger: #e11d48;
    --danger-soft: #fff1f2;
    --info: #7c3aed;
    --info-soft: #f5f3ff;

    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --text: #0f172a;
    --text-2: #334155;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 32px -8px rgba(15, 23, 42, 0.18);

    --sidebar-width: 264px;
    --topbar-height: 64px;

    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, p { margin: 0; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1rem; font-weight: 700; }
h1:focus { outline: none; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.icon { flex: none; display: inline-block; vertical-align: middle; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.muted { color: var(--text-muted); }
.small { font-size: 0.8125rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------- App shell ---------- */

.shell { min-height: 100vh; }

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background: var(--navy-900);
    color: #94a3b8;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.nav-toggle:checked ~ .sidebar { transform: none; }
.nav-toggle:checked ~ .sidebar-backdrop { opacity: 1; pointer-events: auto; }

.main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

@media (min-width: 1024px) {
    .sidebar { transform: none; }
    .sidebar-backdrop { display: none; }
    .main { padding-left: var(--sidebar-width); }
    .topbar .menu-button { display: none; }
}

.brand {
    height: var(--topbar-height);
    flex: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    color: #fff;
}

.brand:hover { text-decoration: none; }

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: 0 6px 16px -6px rgba(234, 88, 12, 0.6);
}

.brand-name { font-size: 1.25rem; font-weight: 800; letter-spacing: 0.04em; line-height: 1.1; }
.brand-tagline { font-size: 0.625rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #94a3b8; }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--navy-700) transparent;
}

.nav-section + .nav-section { margin-top: 14px; }

.nav-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: color 0.15s;
}

.nav-section-title::-webkit-details-marker { display: none; }
.nav-section-title:hover { color: #a8b6c8; }

/* The arrow points down while the group is open and turns sideways when it is collapsed. */
.nav-section-title .chevron { transition: transform 0.15s; }
.nav-section:not([open]) > .nav-section-title .chevron { transform: rotate(-90deg); }

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: #a8b6c8;
    font-weight: 500;
    transition: background-color 0.15s, color 0.15s;
}

.nav-link:hover { background: var(--navy-800); color: #e2e8f0; text-decoration: none; }

.nav-link.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 6px 16px -8px rgba(37, 99, 235, 0.8);
}

.nav-link.is-disabled { cursor: default; color: #5f7088; }
.nav-link.is-disabled:hover { background: transparent; color: #5f7088; }

.nav-link .nav-badge {
    margin-left: auto;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(148, 163, 184, 0.12);
    color: #7c8ba1;
}

.sidebar-footer {
    flex: none;
    padding: 14px 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    font-size: 0.75rem;
    color: #64748b;
}

/* ---------- Top bar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
}

@media (min-width: 1024px) { .topbar { padding: 0 28px; } }

.topbar-spacer { flex: 1; }

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
}

.icon-button:hover { background: var(--surface-muted); }

.workplace-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 320px;
    min-width: 0;
    padding: 6px 12px 6px 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-2);
}

.workplace-pill .workplace-logo {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: contain;
    background: var(--surface-muted);
}

.workplace-pill .workplace-icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff7ed;
    color: var(--brand-strong);
}

@media (max-width: 639px) { .workplace-pill { display: none; } }

/* Pump and company switchers: the workplace pill as a <details> menu, for users who work at more than one. */
.workplace-menu { position: relative; min-width: 0; }
.workplace-menu > summary { list-style: none; cursor: pointer; }
.workplace-menu > summary::-webkit-details-marker { display: none; }
.workplace-menu > summary:hover { background: var(--surface-muted); }
.workplace-menu .chevron { flex-shrink: 0; color: var(--text-subtle); transition: transform 0.15s; }
.workplace-menu[open] > summary .chevron { transform: rotate(180deg); }
.workplace-menu .menu-panel { left: 0; right: auto; }
.workplace-menu .menu-item:disabled { cursor: default; background: transparent; }
.workplace-option { display: grid; flex: 1; min-width: 0; }

/* Unlike the plain pill, the switcher stays on small screens: it is the only way to change pump. */
@media (max-width: 639px) { .workplace-menu .workplace-pill { display: inline-flex; max-width: 170px; } }

/* User menu: a <details> element so it works without script; ppm.js closes it on outside clicks. */
.user-menu { position: relative; }

.user-menu > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 4px 4px;
    border-radius: 999px;
    cursor: pointer;
    list-style: none;
}

.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover { background: var(--surface-muted); }

.user-menu-text { display: none; text-align: left; line-height: 1.2; }
.user-menu-name { font-weight: 600; font-size: 0.875rem; }
.user-menu-role { font-size: 0.75rem; color: var(--text-muted); }

@media (min-width: 768px) { .user-menu-text { display: block; } }

.user-menu[open] > summary .chevron { transform: rotate(180deg); }
.user-menu .chevron { color: var(--text-subtle); transition: transform 0.15s; }

.menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 260px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.menu-panel-header { padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-2);
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.menu-item:hover { background: var(--surface-muted); text-decoration: none; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-soft); }

.avatar {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-initials {
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
}

.avatar-lg { width: 56px; height: 56px; font-size: 1.125rem; }

/* ---------- Page content ---------- */

.content {
    flex: 1;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

@media (min-width: 1024px) { .content { padding: 28px 28px 48px; } }

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 28px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.75rem;
    color: var(--text-subtle);
}

@media (max-width: 639px) {
    .app-footer { padding: 14px 16px; }
    .app-footer > :last-child { display: none; }
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.page-subtitle { margin-top: 4px; color: var(--text-muted); }

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 0.75rem;
    color: var(--text-subtle);
}

.breadcrumbs [aria-current] { color: var(--text-muted); font-weight: 500; }

.page-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.stack { display: flex; flex-direction: column; gap: 24px; }

.grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }

@media (min-width: 768px) {
    .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
    .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Cards ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 0;
}

.card-body { padding: 20px; }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.card-header h2 { font-size: 0.9375rem; }

/* Section title inside a form card, with the blue accent bar from the design. */
.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-left: 10px;
    border-left: 3px solid var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-2);
}

.eyebrow {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-subtle);
}

/* KPI tile */
.stat {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
}

.stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stat-value { margin-top: 4px; font-size: 1.375rem; font-weight: 700; letter-spacing: -0.01em; }
.stat-note { font-size: 0.75rem; color: var(--text-muted); }

.tile-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex: none;
}

.tone-blue { background: var(--primary-soft); color: var(--primary); }
.tone-green { background: var(--success-soft); color: var(--success); }
.tone-orange { background: #fff7ed; color: var(--brand-strong); }
.tone-purple { background: var(--info-soft); color: var(--info); }
.tone-rose { background: var(--danger-soft); color: var(--danger); }
.tone-slate { background: #f1f5f9; color: var(--text-muted); }

/* Label/value list used on detail cards */
.detail-list { display: grid; gap: 14px; margin: 0; }
.detail-list > div { display: flex; gap: 12px; align-items: flex-start; }
.detail-list dt { font-size: 0.75rem; color: var(--text-muted); }
.detail-list dd { margin: 2px 0 0; font-weight: 500; color: var(--text-2); }
.detail-list .icon { margin-top: 2px; color: var(--text-subtle); }

/* Placeholder for content that has nothing to show yet */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state .tile-icon { width: 48px; height: 48px; border-radius: 14px; }
.empty-state h3 { font-size: 0.9375rem; color: var(--text); }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; }
/* Looks like a button but isn't one, e.g. a date label in the page header. */
.btn.is-static { cursor: default; }
.btn.is-static:hover { background: var(--surface); border-color: var(--border); }

.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px -10px rgba(37, 99, 235, 0.9); }
.btn-primary:hover:not(:disabled) { background: var(--primary-strong); }

.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text-2); box-shadow: var(--shadow-sm); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-muted); border-color: var(--border-strong); }

.btn-outline-primary { background: var(--surface); border-color: #bfdbfe; color: var(--primary); }
.btn-outline-primary:hover:not(:disabled) { background: var(--primary-soft); }

.btn-danger-ghost { background: transparent; color: var(--danger); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--danger-soft); }

.btn-sm { height: 32px; padding: 0 12px; font-size: 0.8125rem; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 0.9375rem; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */

.form-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }

@media (min-width: 640px) { .form-grid-2, .form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.field-label { font-size: 0.8125rem; font-weight: 600; color: var(--text-2); }
.field-label .required { color: var(--danger); }
.field-hint { font-size: 0.75rem; color: var(--text-muted); }

.input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }

select.input {
    appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' 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 12px center;
}

.input::placeholder { color: var(--text-subtle); }
.input:hover { border-color: var(--border-strong); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.input[readonly], .input:disabled { background: var(--surface-muted); color: var(--text-muted); }

/* Input with a leading icon and an optional trailing button */
.input-group { position: relative; }
.input-group > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-subtle); pointer-events: none; }
.input-group > .input { padding-left: 38px; }
.input-group > .input-action {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
}
.input-group:has(.input-action) > .input { padding-right: 42px; }

/* Blazor validation */
.input.invalid, .input.modified.invalid { border-color: var(--danger); }
.input.invalid:focus { box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.15); }
.validation-message { font-size: 0.75rem; color: var(--danger); }
.validation-errors { margin: 0; padding-left: 18px; color: var(--danger); }

/* Segmented choice, e.g. payment mode */
.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; }
.segmented span {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-2);
    cursor: pointer;
}
.segmented input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.segmented input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Alerts and badges ---------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.alert .icon { margin-top: 1px; }
.alert-danger { background: var(--danger-soft); border-color: #fecdd3; color: #9f1239; }
.alert-success { background: var(--success-soft); border-color: #a7f3d0; color: #065f46; }
.alert-warning { background: var(--warning-soft); border-color: #fde68a; color: #92400e; }
.alert-info { background: var(--primary-soft); border-color: #bfdbfe; color: #1e40af; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--primary-soft); color: var(--primary); }
.badge-neutral { background: #f1f5f9; color: var(--text-muted); }

/* ---------- Tables ---------- */

/* A table wider than its card scrolls sideways inside it. Positioned, so that what a wide table holds out of the flow,
   such as a heading only a screen reader hears, scrolls with the table instead of stretching the page. */
.table-wrap { position: relative; overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }

.table th {
    padding: 12px 16px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: left;
    color: var(--text-muted);
    white-space: nowrap;
}

.table td { padding: 14px 16px; border-bottom: 1px solid #f1f5f9; color: var(--text-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfd; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table .sub { display: block; font-size: 0.75rem; color: var(--text-subtle); }

/* Foot of a table that is loaded a page at a time. */
.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
}

.pager-buttons { display: flex; align-items: center; gap: 10px; }

/* A card opened under a list for one of its rows (a tank's maintenance, a product's prices): its own form above
   its own table. */
.panel-header-actions { display: flex; align-items: center; gap: 10px; }
.panel-message { padding-bottom: 0; }
.panel-editor { display: flex; flex-direction: column; gap: 16px; border-bottom: 1px solid var(--border); }
.panel-editor-actions { display: flex; gap: 8px; }

/* ---------- Progress bar (tank levels and similar) ---------- */

.meter { height: 8px; border-radius: 999px; background: #f1f5f9; overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--success); }
.meter.low > span { background: var(--danger); }
.meter.mid > span { background: var(--warning); }

/* ---------- Blazor runtime ---------- */

.blazor-error-boundary {
    padding: 1rem 1rem 1rem 1.25rem;
    border-radius: var(--radius-sm);
    background: var(--danger);
    color: white;
}

.blazor-error-boundary::after { content: "An error has occurred."; }

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    padding: 12px 20px;
    background: #fffbeb;
    border-top: 1px solid #fde68a;
    box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.08);
    color: #92400e;
}

#blazor-error-ui .reload { margin-left: 8px; font-weight: 600; }
#blazor-error-ui .dismiss { position: absolute; right: 16px; top: 10px; cursor: pointer; }

/* ---------- Print ---------- */

/* A printed page is its content alone: no navigation, top bar or footer, and nothing marked no-print. */
@media print {
    .sidebar, .sidebar-backdrop, .topbar, .app-footer, .no-print, #blazor-error-ui { display: none !important; }
    .main { min-height: 0; padding-left: 0; }
    .content { max-width: none; padding: 0; }
    body { background: #fff; }
}
