/* Minimal styling for Phase 1. Tailwind CSS is introduced in a later phase. */
:root {
    color-scheme: light dark;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --accent: #2563eb;
    --dark: #0f172a;
    --sidebar-width: 15.5rem;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    line-height: 1.5;
    color: #111827;
    background: #f8fafc;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header / nav */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 1rem;
    background: var(--dark);
    color: #f8fafc;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid #334155;
}
.site-header__start {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}
.site-header a { color: #f8fafc; }
.brand a { font-weight: 700; white-space: nowrap; }
.sidebar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0.35rem;
    border: 1px solid #475569;
    border-radius: 6px;
    background: #1e293b;
    cursor: pointer;
}
.sidebar-toggle span {
    display: block;
    height: 2px;
    background: #f8fafc;
    border-radius: 1px;
}
.header-tools {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-left: auto;
}
.header-tools .user { opacity: 0.85; font-size: 0.9rem; }
.inline-form { display: inline; margin: 0; }
.linklike {
    background: none; border: none; color: #f8fafc; cursor: pointer;
    text-decoration: underline; font: inherit; padding: 0;
}
select { padding: 0.25rem; border-radius: 4px; }

/* App shell — left sidebar + full-width content */
.app-layout {
    display: flex;
    align-items: stretch;
    min-height: calc(100vh - 3.1rem);
}
.app-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: #1e293b;
    color: #e2e8f0;
    border-right: 1px solid #334155;
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem 0.5rem 1.25rem;
}
.sidebar-section {
    border-radius: 6px;
    margin-bottom: 0.15rem;
}
.sidebar-section__title {
    list-style: none;
    cursor: pointer;
    padding: 0.55rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    user-select: none;
}
.sidebar-section__title::-webkit-details-marker { display: none; }
.sidebar-section__title::before {
    content: "▸";
    display: inline-block;
    margin-right: 0.35rem;
    font-size: 0.7rem;
    transition: transform 0.15s ease;
}
.sidebar-section[open] > .sidebar-section__title::before { transform: rotate(90deg); }
.sidebar-section[open] > .sidebar-section__title {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px 6px 0 0;
}
.sidebar-section__links {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.15rem 0 0.35rem 0.35rem;
}
.sidebar-link {
    display: block;
    padding: 0.45rem 0.65rem 0.45rem 1.15rem;
    border-radius: 5px;
    color: #e2e8f0;
    font-size: 0.92rem;
    text-decoration: none;
    border-left: 3px solid transparent;
}
.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
    color: #fff;
}
.sidebar-link.is-active {
    background: rgba(37, 99, 235, 0.22);
    border-left-color: #60a5fa;
    color: #fff;
    font-weight: 600;
}
.sidebar-link--admin {
    margin-top: 0.35rem;
    padding-left: 0.65rem;
    color: #fcd34d;
}

/* Main / footer — full width, left-aligned (no centered column) */
.site-main {
    flex: 1;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1.25rem 1.5rem 2rem;
}
.site-footer {
    padding: 0.75rem 1.5rem;
    color: #6b7280;
    text-align: left;
    border-top: 1px solid #e5e7eb;
    margin-top: auto;
}

/* Legacy horizontal nav — removed from header; keep sep for in-page use */
.nav-sep {
    width: 1px;
    height: 1.1rem;
    background: #cbd5e1;
    margin: 0 0.15rem;
}
.report-group { margin-top: 1.5rem; }
.report-group h2 { margin-bottom: 0.5rem; font-size: 1.1rem; }
.blk-row--4 { display: grid; grid-template-columns: repeat(4, 1fr); }

@media (max-width: 960px) {
    .sidebar-toggle { display: flex; }
    .sidebar {
        position: fixed;
        top: 3.1rem;
        left: 0;
        bottom: 0;
        z-index: 30;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: 4px 0 24px rgba(15, 23, 42, 0.25);
    }
    .app-layout.sidebar-open .sidebar { transform: translateX(0); }
    .brand a { font-size: 0.92rem; }
}

@media (min-width: 961px) {
    .has-sidebar .site-header { padding-left: 0.75rem; }
}

/* Buttons */
.btn {
    display: inline-block; background: var(--accent); color: #fff;
    padding: 0.4rem 0.9rem; border: none; border-radius: 6px; cursor: pointer;
    font: inherit;
}
.btn:hover { text-decoration: none; opacity: 0.92; }
.btn-secondary {
    background: #475569;
    color: #fff;
    border: none;
    cursor: pointer;
}
.btn-reconcile-link {
    background: #059669;
    color: #fff;
    border: 1px solid #047857;
    font-weight: 600;
}
.btn-reconcile-link:hover {
    background: #047857;
    text-decoration: none;
    opacity: 1;
}
.btn-reconcile-confirm {
    background: #7c3aed;
    color: #fff;
    border: 1px solid #6d28d9;
    font-weight: 600;
}
.btn-reconcile-confirm:hover {
    background: #6d28d9;
    text-decoration: none;
    opacity: 1;
}
.reconcile-classify {
    margin-top: 0.65rem;
    border: 2px solid #94a3b8;
    border-radius: 8px;
    background: #f8fafc;
    overflow: hidden;
}
.reconcile-classify__summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: #1e293b;
    background: #e2e8f0;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.reconcile-classify__summary::-webkit-details-marker { display: none; }
.reconcile-classify__summary::before {
    content: "▸";
    font-size: 0.85rem;
    color: #475569;
    transition: transform 0.15s ease;
}
.reconcile-classify[open] > .reconcile-classify__summary::before {
    transform: rotate(90deg);
}
.reconcile-classify[open] > .reconcile-classify__summary {
    border-bottom: 2px solid #cbd5e1;
}
.reconcile-classify__body {
    padding: 0.65rem 0.75rem 0.75rem;
}
.reconcile-match-hint {
    margin: 0 0 0.35rem;
    padding: 0.45rem 0.6rem;
    background: #f5f3ff;
    border: 1px solid #c4b5fd;
    border-radius: 6px;
    font-size: 0.88rem;
}
.reconcile-link-hint {
    margin: 0 0 0.35rem;
    padding: 0.45rem 0.6rem;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: 6px;
    font-size: 0.88rem;
}
.shipping-vat-readonly {
    display: inline-block;
    min-width: 3rem;
    font-weight: 600;
}
.shipping-line { border-color: #94a3b8; }

/* Messages */
.messages { list-style: none; padding: 0; margin: 1rem 0 0; width: 100%; }
.msg { padding: 0.6rem 1rem; border-radius: 6px; margin: 0.4rem 1.5rem 0; }
.msg-success { background: #dcfce7; color: #166534; }
.msg-error { background: #fee2e2; color: #991b1b; }
.msg-info, .msg-warning { background: #fef9c3; color: #854d0e; }

/* Cards */
.cards { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.card {
    display: flex; flex-direction: column; gap: 0.25rem;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    padding: 1rem 1.25rem; min-width: 12rem;
}
.card:hover { text-decoration: none; border-color: var(--accent); }
.card-value { font-size: 2rem; font-weight: 700; color: var(--dark); }
.card-label { color: #6b7280; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; margin-top: 1rem; background: #fff; }
.data-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table th, .data-table td {
    text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid #e5e7eb;
}
.data-table thead th { background: #f1f5f9; }

/* Forms */
.search-form { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; align-items: flex-end; }
.search-form input[type="text"],
.search-form input[type="search"],
.search-form input[type="date"],
.search-form select {
    padding: 0.45rem 0.65rem; border: 1px solid #94a3b8; border-radius: 4px; min-width: 12rem;
    /* Explicit text color: color-scheme:light dark + white bg otherwise yields
       invisible caret/text in OS dark mode (search looks "inactive"). */
    background: #fff; color: #0f172a; caret-color: #0f172a;
    font-size: 0.95rem; cursor: text; pointer-events: auto;
}
.search-form select { cursor: pointer; }
.search-form input[type="text"]:focus,
.search-form input[type="search"]:focus,
.search-form input[type="date"]:focus,
.search-form select:focus {
    outline: 2px solid #93c5fd; outline-offset: 1px; border-color: #2563eb;
}
.search-form label {
    display: flex; flex-direction: column; gap: 0.25rem;
    font-size: 0.82rem; font-weight: 600; color: #475569;
}
.auth {
    max-width: 28rem;
    margin: 2rem auto;
}
.auth form p { display: flex; flex-direction: column; max-width: 22rem; gap: 0.25rem; }
.auth input { padding: 0.4rem 0.6rem; border: 1px solid #cbd5e1; border-radius: 6px; }

/* Official form layout — structured, document-like */
.official-form {
    max-width: 56rem;
    background: #fff;
    border: 2px solid #334155;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.official-form__header {
    padding: 1rem 1.25rem;
    background: #f1f5f9;
    border-bottom: 2px solid #cbd5e1;
}
.official-form__header h1 { margin: 0; font-size: 1.25rem; color: #0f172a; }
.official-form__header .hint { margin: 0.35rem 0 0; }
.official-form__body { padding: 1rem 1.25rem 1.25rem; }
.official-form__section {
    margin-bottom: 1.25rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    overflow: hidden;
}
.official-form__section-title {
    margin: 0;
    padding: 0.55rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #334155;
    background: #e2e8f0;
    border-bottom: 1px solid #cbd5e1;
}
.official-form__section-body { padding: 0.85rem 1rem; }
.official-form__actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #e2e8f0;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 0.85rem 1.25rem;
    align-items: start;
}
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-field--full { grid-column: 1 / -1; }
.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin: 0;
}
.form-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    letter-spacing: 0.01em;
}
.form-field--required > label::after { content: " *"; color: #b91c1c; }
.form-field__help { font-size: 0.8rem; color: #64748b; }
.form-field__error { font-size: 0.82rem; color: #b91c1c; font-weight: 500; }
.form-field--error input,
.form-field--error select,
.form-field--error textarea { border-color: #f87171; background: #fef2f2; }
.official-form input[type="text"],
.official-form input[type="number"],
.official-form input[type="email"],
.official-form input[type="date"],
.official-form input[type="file"],
.official-form select,
.official-form textarea,
.form-grid input[type="text"],
.form-grid input[type="number"],
.form-grid input[type="email"],
.form-grid input[type="text"].app-date-input,
.form-grid input[type="date"],
.form-grid input[type="file"],
.form-grid select,
.form-grid textarea,
.filter-panel input,
.filter-panel select,
.filter-panel textarea {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid #94a3b8;
    border-radius: 4px;
    background: #fff;
    font-size: 0.95rem;
    color: #0f172a;
    box-sizing: border-box;
}
.official-form textarea,
.form-grid textarea { min-height: 4.5rem; resize: vertical; }
.official-form input:focus,
.official-form select:focus,
.official-form textarea:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 1px;
    border-color: #3b82f6;
}
.official-form input[disabled],
.official-form select[disabled],
.official-form textarea[disabled] {
    background: #f8fafc;
    color: #64748b;
    cursor: not-allowed;
}
.official-form .errorlist,
.form-grid .errorlist {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.82rem;
    color: #b91c1c;
}
.official-form > p,
.form-grid > p {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin: 0;
}
.official-form > p > label,
.form-grid > p > label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
}
.form-grid .flatpickr-input[readonly] {
    background: #fff;
    cursor: pointer;
}
.form-grid .flatpickr-wrapper,
.official-form .flatpickr-wrapper {
    width: 100%;
}
.form-grid .flatpickr-wrapper input,
.official-form .flatpickr-wrapper input {
    width: 100%;
    box-sizing: border-box;
}
.balance-hint {
    margin: 0.5rem 0 0;
    padding: 0.55rem 0.75rem;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #1e40af;
}
.balance-hint--low {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}
.form-table-section { margin-top: 0.5rem; overflow-x: auto; }
.form-table-section .data-table { margin-top: 0; }
.form-table-section .data-table input,
.form-table-section .data-table select {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 1px solid #94a3b8;
    border-radius: 4px;
    font-size: 0.9rem;
}

.pagination { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; }

/* Phase 2 additions */
.notif { position: relative; }
.badge {
    background: #ef4444; color: #fff; border-radius: 999px;
    padding: 0 0.4rem; font-size: 0.75rem; margin-left: 0.15rem;
}
.badge-ok {
    background: #dcfce7; color: #166534; padding: 0.25rem 0.6rem; border-radius: 6px;
}
.hint { color: #6b7280; font-size: 0.9rem; }
.filter-banner {
    margin: 0.75rem 0 0;
    padding: 0.6rem 0.85rem;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #991b1b;
    font-size: 0.9rem;
}
.filter-banner a { margin-left: 0.5rem; font-weight: 600; }
.data-table tr.row-overdue { background: #fff1f2; }
.data-table tr.row-overdue td { border-color: #fecdd3; }
.data-table tr.row-completed { background: #f0fdf4; }
.data-table tr.row-completed td { border-color: #bbf7d0; }
.data-table tr.row-fully-complete { background: #ecfdf5; }
.data-table tr.row-fully-complete td { border-color: #6ee7b7; }
.status-badge {
    display: inline-block;
    margin-right: 0.35rem;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    vertical-align: middle;
}
.status-badge--overdue { background: #fee2e2; color: #b91c1c; }
.status-badge--completed { background: #dcfce7; color: #166534; }
.status-badge--locked { background: #d1fae5; color: #047857; }
.overdue-date { color: #b91c1c; }
.order-complete-banner {
    margin: 0.75rem 0;
    padding: 0.65rem 0.9rem;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    color: #166534;
    font-size: 0.9rem;
}
.order-lock-banner {
    margin: 0.75rem 0;
    padding: 0.65rem 0.9rem;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: 8px;
    color: #047857;
    font-size: 0.9rem;
}
.finance-steps { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.finance-step {
    border: 1px solid #e2e8f0; border-radius: 10px; padding: 1rem 1.25rem; background: #fff;
}
.finance-step--done { border-color: #86efac; background: #f0fdf4; }
.finance-step--blocked { border-color: #fca5a5; background: #fef2f2; }
.finance-step h2 { margin: 0 0 0.5rem; font-size: 1rem; color: #334155; }
.form-grid p { margin: 0; }
.line-form {
    border: 1px solid #cbd5e1; border-radius: 4px; padding: 0.75rem 1rem;
    margin-bottom: 0.85rem; background: #fafafa;
}
.line-form legend {
    font-size: 0.82rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; color: #475569; padding: 0 0.35rem;
}
.line-form p { margin: 0; }
tr.unread { font-weight: 600; }
.data-table tfoot th { background: #f8fafc; }

/* Accessibility */
.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;
}

/* Dashboard — block layout */
.blk { display: flex; flex-direction: column; gap: 1rem; }

.blk-bar {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 1rem;
    background: #0f172a; color: #f8fafc;
    padding: 1rem 1.25rem; border: 2px solid #0f172a;
}
.blk-bar a { color: #f8fafc; }
.blk-bar__info { display: flex; gap: 1rem; align-items: center; }
.blk-bar__code {
    display: block; min-width: 3.5rem; padding: .5rem .6rem;
    background: #1e293b; border: 2px solid #334155;
    font-weight: 800; font-size: 1rem; text-align: center;
}
.blk-bar__title { margin: 0; font-size: 1.35rem; font-weight: 700; }
.blk-bar__date { margin: .2rem 0 0; font-size: .85rem; opacity: .75; }
.blk-bar__actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.blk-block {
    background: #fff; border: 2px solid #cbd5e1; padding: 0;
}
.blk-block__title {
    margin: 0; padding: .6rem 1rem;
    font-size: .8rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: #334155;
    background: #e2e8f0; border-bottom: 2px solid #cbd5e1;
}

.blk-row { display: flex; gap: 0; }
.blk-row--3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.blk-row--pipe { display: grid; grid-template-columns: repeat(6, 1fr); }
.blk-row--metrics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.75rem;
}
.blk-row--panels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

/* Stat blocks (top row) */
.blk-stat {
    display: flex; flex-direction: column; justify-content: center;
    min-height: 5.5rem; padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    text-decoration: none; color: inherit;
}
.blk-stat:hover { background: #f8fafc; text-decoration: none; }
.blk-stat--urgent { background: #fef2f2; border-color: #fecaca; }
.blk-stat--warn { background: #fffbeb; border-color: #fde68a; }
.blk-stat--calm { background: #f0fdf4; border-color: #bbf7d0; }
.blk-stat__num { font-size: 2.25rem; font-weight: 800; line-height: 1; color: #0f172a; }
.blk-stat__lbl { margin-top: .35rem; font-size: .85rem; font-weight: 600; color: #475569; }

/* Pipeline blocks */
.blk-pipe {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 4.5rem; padding: .75rem .5rem;
    background: #f8fafc; border-right: 1px solid #e2e8f0;
    text-decoration: none; color: #64748b;
}
.blk-pipe:last-child { border-right: none; }
.blk-pipe:hover { background: #e2e8f0; text-decoration: none; color: #0f172a; }
.blk-pipe--on { background: #dbeafe; color: #1e40af; font-weight: 700; }
.blk-pipe--on:hover { background: #bfdbfe; }
.blk-pipe--done { background: #dcfce7; color: #166534; }
.blk-pipe--done:hover { background: #bbf7d0; }
.blk-pipe__num { font-size: 1.75rem; font-weight: 800; line-height: 1; }
.blk-pipe__lbl { margin-top: .3rem; font-size: .72rem; font-weight: 600; text-transform: uppercase; }

/* Metric blocks — individual cards (no shared border grid lines) */
.blk-metric {
    display: flex; flex-direction: column; justify-content: center;
    min-height: 4.5rem; padding: 0.9rem 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    text-decoration: none; color: inherit;
}
.blk-metric:hover { background: #f8fafc; border-color: #cbd5e1; text-decoration: none; }
.blk-metric--urgent { background: #fef2f2; border-color: #fecaca; }
.blk-metric--warn { background: #fffbeb; border-color: #fde68a; }
.blk-metric--calm { background: #f0fdf4; border-color: #bbf7d0; }
.blk-metric--neutral { background: #fff; }
.blk-metric--zero { opacity: .55; }
.blk-panel--complete { border-color: #86efac; background: #fafffe; }

/* Notifications / alerts inbox */
.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.notif-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0 0 1rem;
}
.notif-filter {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
}
.notif-filter:hover { background: #f8fafc; text-decoration: none; }
.notif-filter--active {
    background: #1e40af;
    border-color: #1e40af;
    color: #fff;
}
.notif-row--unread { font-weight: 600; }
.notif-row--alert { background: #fef2f2; }
.notif-row--warning { background: #fffbeb; }
.notif-level {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}
.notif-level--alert { background: #fee2e2; color: #b91c1c; }
.notif-level--warning { background: #fef3c7; color: #b45309; }
.filter-panel { margin: 1rem 0; padding: 1rem; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; }
.filter-panel .form-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.blk-metric__num { font-size: 1.75rem; font-weight: 800; line-height: 1; }
.blk-metric__lbl { margin-top: .25rem; font-size: .78rem; color: #64748b; line-height: 1.3; }

/* Panel blocks */
.blk-panel {
    background: #fff; border: 2px solid #cbd5e1;
    display: flex; flex-direction: column; min-height: 12rem;
}
.blk-panel__head {
    display: flex; align-items: center; gap: .5rem;
    padding: .6rem 1rem; background: #e2e8f0;
    border-bottom: 2px solid #cbd5e1;
}
.blk-panel__head h2 { margin: 0; font-size: .85rem; font-weight: 700; flex: 1; }
.blk-panel__count {
    background: #0f172a; color: #fff; font-weight: 700;
    padding: .15rem .5rem; font-size: .85rem; min-width: 1.5rem; text-align: center;
}
.blk-panel__head a { font-size: .78rem; font-weight: 600; }
.blk-panel__empty {
    margin: 0; padding: 1.5rem 1rem; color: #94a3b8; text-align: center;
}
.blk-table {
    width: 100%; border-collapse: collapse; font-size: .85rem;
}
.blk-table th, .blk-table td {
    text-align: left; padding: .45rem .75rem;
    border-bottom: 1px solid #e2e8f0;
}
.blk-table thead th {
    background: #f8fafc; font-size: .75rem; text-transform: uppercase;
    color: #64748b; font-weight: 700;
}
.blk-table tbody tr:last-child td { border-bottom: none; }

@media (max-width: 900px) {
    .blk-row--3, .blk-row--4, .blk-row--pipe, .blk-row--panels { grid-template-columns: 1fr; }
    .blk-stat + .blk-stat { border-left: 2px solid #cbd5e1; border-top: none; }
    .blk-stat { border-top: none; }
    .blk-stat:first-child { border-top: 2px solid #cbd5e1; }
    .blk-pipe { border-right: none; border-bottom: 2px solid #cbd5e1; }
    .blk-pipe:last-child { border-bottom: none; }
}

/* Dashboard — operations control room (Option B) */
.ctrl {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    --ctrl-primary: #2563eb;
    --ctrl-primary-dark: #1e40af;
    --ctrl-accent: #60a5fa;
    --ctrl-hero-from: #0f172a;
    --ctrl-hero-to: #1e293b;
    --ctrl-glow: rgba(37, 99, 235, 0.25);
}

.ctrl-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    color: #f8fafc;
    background: linear-gradient(135deg, var(--ctrl-hero-from), var(--ctrl-hero-to));
    border: 2px solid var(--ctrl-primary-dark);
    box-shadow: 0 8px 24px var(--ctrl-glow);
}
.ctrl-hero__main { display: flex; gap: 1rem; align-items: center; }
.ctrl-hero__code {
    display: block;
    min-width: 3.5rem;
    padding: 0.55rem 0.65rem;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid var(--ctrl-accent);
    font-weight: 800;
    font-size: 1rem;
    text-align: center;
    color: var(--ctrl-accent);
}
.ctrl-hero__title { margin: 0; font-size: 1.4rem; font-weight: 700; }
.ctrl-hero__meta { margin: 0.2rem 0 0; font-size: 0.85rem; opacity: 0.8; }
.ctrl-hero__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-hero {
    background: var(--ctrl-primary);
    border-color: var(--ctrl-primary);
    color: #fff;
}
.btn-hero:hover { background: var(--ctrl-primary-dark); text-decoration: none; }
.btn-hero-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: #f8fafc;
}
.btn-hero-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
    color: #fff;
}

.ctrl-attention {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.ctrl-attention__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.75rem;
    border: 2px solid #cbd5e1;
    background: #fff;
    text-decoration: none;
    color: inherit;
    font-size: 0.85rem;
    font-weight: 600;
}
.ctrl-attention__chip:hover { background: #f8fafc; text-decoration: none; }
.ctrl-attention__chip--urgent { border-color: #fca5a5; background: #fef2f2; }
.ctrl-attention__chip--warn { border-color: #fcd34d; background: #fffbeb; }
.ctrl-attention__chip--calm { border-color: #86efac; background: #f0fdf4; }
.ctrl-attention__chip--neutral { border-color: #93c5fd; background: #eff6ff; }
.ctrl-attention__value {
    background: #0f172a;
    color: #fff;
    padding: 0.1rem 0.45rem;
    font-size: 0.78rem;
    font-weight: 800;
}
.ctrl-attention__chip .dash-icon svg { width: 1rem; height: 1rem; }

.ctrl-spotlights {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    border: none;
}
.ctrl-spot {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    min-height: 5.5rem;
    padding: 1rem 1.15rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    text-decoration: none;
    color: inherit;
}
.ctrl-spot:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    text-decoration: none;
}
.ctrl-spot--urgent { background: #fef2f2; border-color: #fecaca; }
.ctrl-spot--warn { background: #fffbeb; border-color: #fde68a; }
.ctrl-spot--calm { background: #f0fdf4; border-color: #bbf7d0; }
.ctrl-spot .dash-icon svg { width: 1.25rem; height: 1.25rem; color: var(--ctrl-primary); }
.ctrl-spot__num { font-size: 2rem; font-weight: 800; line-height: 1; }
.ctrl-spot__lbl { font-size: 0.82rem; font-weight: 600; color: #475569; }

.ctrl-charts {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 1rem;
}
.ctrl-card {
    background: #fff;
    border: 2px solid #cbd5e1;
    padding: 0.85rem 1rem 1rem;
}
.ctrl-card__title {
    margin: 0 0 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #334155;
}
.ctrl-card__hint {
    margin: -0.35rem 0 0.75rem;
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.35;
}
.ctrl-card__empty { margin: 1rem 0; color: #94a3b8; text-align: center; }

.ctrl-donut-wrap {
    position: relative;
    width: 9rem;
    height: 9rem;
    margin: 0 auto 0.75rem;
}
.ctrl-donut { width: 100%; height: 100%; }
.ctrl-donut__track { stroke: #e2e8f0; }
.ctrl-donut__seg { stroke-linecap: butt; }
.ctrl-donut__center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.ctrl-donut__total { font-size: 1.75rem; font-weight: 800; line-height: 1; }
.ctrl-donut__hint { font-size: 0.72rem; color: #64748b; text-transform: uppercase; }

.ctrl-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.78rem;
    color: #475569;
}
.ctrl-legend li { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.25rem; }
.ctrl-legend__swatch {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 2px;
    flex-shrink: 0;
}

.ctrl-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 0.5rem;
    min-height: 9rem;
    padding-top: 0.5rem;
}
.ctrl-bars__col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
}
.ctrl-bars__track {
    width: 100%;
    max-width: 2.5rem;
    height: 6.5rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: flex-end;
}
.ctrl-bars__fill {
    width: 100%;
    min-height: 2px;
    transition: height 0.2s ease;
}
.ctrl-bars__val { margin-top: 0.35rem; font-size: 0.95rem; font-weight: 800; }
.ctrl-bars__lbl {
    font-size: 0.68rem;
    color: #64748b;
    text-align: center;
    line-height: 1.2;
    margin-top: 0.15rem;
}

.ctrl-pipe {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    border: 2px solid #e2e8f0;
}
.ctrl-pipe__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 4rem;
    padding: 0.5rem 0.35rem;
    background: #f8fafc;
    border-right: 2px solid #e2e8f0;
    text-decoration: none;
    color: #64748b;
}
.ctrl-pipe__step:last-child { border-right: none; }
.ctrl-pipe__step:hover { background: #e2e8f0; text-decoration: none; color: #0f172a; }
.ctrl-pipe__step--on { background: color-mix(in srgb, var(--ctrl-primary) 15%, #fff); color: var(--ctrl-primary-dark); font-weight: 700; }
.ctrl-pipe__step--done { background: #dcfce7; color: #166534; }
.ctrl-pipe__num { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.ctrl-pipe__lbl { margin-top: 0.25rem; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; text-align: center; }

.ctrl-queues {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.ctrl-panel {
    background: #fff;
    border: 2px solid #cbd5e1;
    display: flex;
    flex-direction: column;
    min-height: 12rem;
}
.ctrl-panel--complete { border-color: #86efac; background: #fafffe; }
.ctrl-panel__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: #e2e8f0;
    border-bottom: 2px solid #cbd5e1;
}
.ctrl-panel__head h2 { margin: 0; font-size: 0.85rem; font-weight: 700; flex: 1; }
.ctrl-panel__count {
    background: var(--ctrl-primary-dark);
    color: #fff;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    font-size: 0.85rem;
    min-width: 1.5rem;
    text-align: center;
}
.ctrl-panel__head a { font-size: 0.78rem; font-weight: 600; }
.ctrl-panel__empty { margin: 0; padding: 1.5rem 1rem; color: #94a3b8; text-align: center; }

.ctrl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.ctrl-table th, .ctrl-table td {
    text-align: left;
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}
.ctrl-table thead th {
    background: #f8fafc;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
}
.ctrl-table tbody tr:last-child td { border-bottom: none; }

.ctrl-transit-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.65rem;
    padding: 0.75rem;
}
.ctrl-transit-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.65rem 0.75rem;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    text-decoration: none;
    color: inherit;
    font-size: 0.82rem;
}
.ctrl-transit-card:hover {
    border-color: var(--ctrl-accent);
    background: #eff6ff;
    text-decoration: none;
}
.ctrl-transit-card__num { font-weight: 800; color: var(--ctrl-primary-dark); }
.ctrl-transit-card__supplier { color: #475569; }
.ctrl-transit-card__track, .ctrl-transit-card__eta { font-size: 0.75rem; color: #64748b; }

.ctrl-acc {
    border: 2px solid #cbd5e1;
    background: #fff;
}
.ctrl-acc__summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #334155;
    background: #e2e8f0;
    cursor: pointer;
    list-style: none;
}
.ctrl-acc__summary::-webkit-details-marker { display: none; }
.ctrl-acc__chev::after { content: "▸"; display: inline-block; transition: transform 0.15s; }
.ctrl-acc[open] .ctrl-acc__chev::after { transform: rotate(90deg); }
.ctrl-acc__body { padding: 0; }
.ctrl-acc--violet .ctrl-acc__summary { border-left: 4px solid #8b5cf6; }
.ctrl-acc--sky .ctrl-acc__summary { border-left: 4px solid var(--ctrl-accent); }
.ctrl-acc--emerald .ctrl-acc__summary { border-left: 4px solid #10b981; }
.ctrl-acc--amber .ctrl-acc__summary { border-left: 4px solid #f59e0b; }
.ctrl-acc--slate .ctrl-acc__summary { border-left: 4px solid #64748b; }

.ctrl-mtd-chart { padding: 0.75rem 1rem 0; border-bottom: 2px solid #e2e8f0; }
.ctrl-bars--mtd { min-height: 7rem; }

.ctrl-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.75rem;
    padding: 0.85rem 1rem 1rem;
}
.ctrl-metric {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-height: 4.5rem;
    padding: 0.9rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    text-decoration: none;
    color: inherit;
}
.ctrl-metric:hover { background: #f8fafc; border-color: #cbd5e1; text-decoration: none; }
.ctrl-metric--urgent { background: #fef2f2; border-color: #fecaca; }
.ctrl-metric--warn { background: #fffbeb; border-color: #fde68a; }
.ctrl-metric--calm { background: #f0fdf4; border-color: #bbf7d0; }
.ctrl-metric--zero { opacity: 0.55; }
.ctrl-metric .dash-icon svg { width: 1.1rem; height: 1.1rem; color: #64748b; }
.ctrl-metric__num { font-size: 1.65rem; font-weight: 800; line-height: 1; }
.ctrl-metric__lbl { font-size: 0.76rem; color: #64748b; line-height: 1.3; }

.dash-icon { display: inline-flex; line-height: 0; }
.dash-icon svg { width: 1.25rem; height: 1.25rem; }

.hr-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin: 0.75rem 0 0;
}
.hr-toolbar .btn { margin: 0; }

@media (max-width: 1100px) {
    .ctrl-charts { grid-template-columns: 1fr; }
    .ctrl-spotlights { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    .ctrl-queues { grid-template-columns: 1fr; }
    .ctrl-spotlights { grid-template-columns: 1fr; }
    .ctrl-pipe { grid-template-columns: repeat(2, 1fr); }
    .ctrl-pipe__step { border-bottom: 1px solid #e2e8f0; }
}

/* Legacy dash classes — unused */
.dash { display: flex; flex-direction: column; gap: 1rem; }
.dashboard { display: flex; flex-direction: column; gap: 1.75rem; }

/* Danger / delete */
.btn-danger {
    background: #dc2626; color: #fff;
}
.btn-danger:hover { background: #b91c1c; }
.btn-danger-outline {
    background: #fff; color: #dc2626; border: 1px solid #fca5a5;
}
.btn-danger-outline:hover { background: #fef2f2; text-decoration: none; }
.danger-zone { max-width: 40rem; }
.danger-lead { font-size: 1.05rem; color: #7f1d1d; }
.danger-panel {
    background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px;
    padding: 1rem 1.25rem; margin: 1rem 0;
}
.danger-panel h2 { margin: 0.5rem 0 0.35rem; font-size: 1rem; }
.danger-panel ul { margin: 0.25rem 0 0.75rem 1.1rem; }
.danger-form .confirm-hint { color: #92400e; }
.danger-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }
.panel {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 1rem 1.25rem;
}

.tab-nav {
    display: flex; flex-wrap: wrap; gap: 0.35rem;
    margin: 1.25rem 0; padding: 0.35rem;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
}
.tab-nav__item {
    flex: 1 1 auto; text-align: center; padding: 0.65rem 1rem;
    border-radius: 8px; font-size: 0.9rem; font-weight: 600;
    color: #475569; text-decoration: none;
}
.tab-nav__item:hover { background: #f8fafc; text-decoration: none; }
.tab-nav__item--active { background: #1d4ed8; color: #fff; }

.blk-metric--positive { border-color: #86efac; background: #ecfdf5; }
.blk-metric--positive .blk-metric__lbl { color: #047857; }
.blk-metric--negative { border-color: #fca5a5; background: #fff1f2; }
.blk-metric--negative .blk-metric__lbl { color: #be123c; }

.meta-list {
    display: grid; grid-template-columns: 8rem 1fr; gap: 0.35rem 1rem;
    margin-top: 1rem; font-size: 0.9rem;
}
.meta-list dt { color: #64748b; font-weight: 600; }
.meta-list dd { margin: 0; }

/* Order inventory queues & put-away UX */
.order-queue-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0 1rem;
}
.order-queue-filters__label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.order-queue-filters__chip {
    padding: 0.35rem 0.75rem;
    border: 2px solid #cbd5e1;
    background: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
}
.order-queue-filters__chip:hover { background: #f8fafc; text-decoration: none; }
.order-queue-filters__chip--active {
    background: #1e40af;
    border-color: #1e40af;
    color: #fff;
}
.order-list-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}
.order-list-filters label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
}

.inventory-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.35;
    max-width: 16rem;
}
.inventory-badge--urgent { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }
.inventory-badge--warn { background: #fffbeb; color: #b45309; border: 1px solid #fcd34d; }
.inventory-badge--calm { background: #ecfdf5; color: #047857; border: 1px solid #86efac; }
.inventory-badge--neutral { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.inventory-action { font-size: 0.78rem; font-weight: 600; }
.row-awaiting-inventory { background: #fffbeb; }
.row-reconcile-focus {
    background: #fef3c7 !important;
    outline: 2px solid #d97706;
    outline-offset: -2px;
}
[id^="txn-"],
[id^="payment-"] {
    scroll-margin-top: 5.5rem;
}

.inventory-callout {
    margin: 0.75rem 0 1rem;
    padding: 0.85rem 1rem;
    border: 2px solid #cbd5e1;
    background: #f8fafc;
    font-size: 0.9rem;
    line-height: 1.45;
}
.inventory-callout p { margin: 0.35rem 0 0; }
.inventory-callout--urgent { border-color: #fca5a5; background: #fef2f2; }
.inventory-callout--warn { border-color: #fcd34d; background: #fffbeb; }
.inventory-callout--calm { border-color: #86efac; background: #f0fdf4; }

.form-field--highlight {
    grid-column: 1 / -1;
    padding: 0.75rem;
    border: 2px solid #93c5fd;
    background: #eff6ff;
    border-radius: 4px;
}
.storage-location-grid .form-field--highlight label { font-weight: 700; color: #1e40af; }

.qa-approval-panel {
    margin-top: 0.5rem;
    padding: 0.65rem;
    border: 2px solid #fcd34d;
    background: #fffbeb;
}
.qa-approval-panel .form-grid { margin-bottom: 0.5rem; }


/* ---- Cashflow monitoring ---- */
.cf-monitor__header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.cf-monitor__exports { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; }
.cf-monitor__filters { margin-bottom: 1.25rem; }
.cf-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.cf-kpi {
    background: #fff;
    border: 2px solid #cbd5e1;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.cf-kpi__label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}
.cf-kpi__value { font-size: 1.35rem; font-weight: 800; color: #0f172a; }
.cf-kpi--in { border-color: #86efac; background: #f0fdf4; }
.cf-kpi--out { border-color: #fca5a5; background: #fef2f2; }
.cf-kpi--cash { border-color: #5eead4; background: #f0fdfa; }
.cf-charts { margin-bottom: 1.5rem; }
.ctrl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem;
}
.ctrl-card--wide { grid-column: 1 / -1; }
.cf-compare {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem;
}
.cf-compare__company {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    padding: 0.75rem;
}
.cf-compare__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}
.cf-compare__bars { min-height: 8rem; }
@media (max-width: 720px) {
    .cf-monitor__header { flex-direction: column; }
}

/* ---- 12-month cashflow trend ---- */
.cf-trend__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-bottom: 0.75rem;
}
.cf-trend {
    display: flex;
    align-items: flex-end;
    gap: 0.35rem;
    min-height: 11rem;
    padding: 0.5rem 0.25rem 0;
    overflow-x: auto;
}
.cf-trend__month {
    flex: 1 1 0;
    min-width: 2.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}
.cf-trend__cluster {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    width: 100%;
    height: 8.5rem;
    justify-content: center;
}
.cf-trend__bar-wrap {
    width: 28%;
    max-width: 0.85rem;
    height: 100%;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: flex-end;
}
.cf-trend__bar {
    width: 100%;
    min-height: 2px;
}
.cf-trend__lbl {
    font-size: 0.72rem;
    font-weight: 700;
    color: #334155;
}
.cf-trend__year {
    font-size: 0.65rem;
    color: #94a3b8;
}
.cf-trend__table-wrap {
    margin-top: 1rem;
    overflow-x: auto;
}
.cf-trend__table { margin: 0; font-size: 0.85rem; }
