        body {
            background: linear-gradient(180deg, #f8fafc 0%, #f3f6fb 100%);
            color: #0f172a;
            font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
        }

        .table-scroll {
            width: 100%;
            max-width: 100%;
            overflow-x: auto;
            overflow-y: hidden;
            -webkit-overflow-scrolling: touch;
        }

        .tree-account { color: #0f172a; font-weight: 600; }
        .tree-name { color: #475569; font-weight: 500; }
        .tree-meta { color: var(--muted); }

        .yoy-pos { color: #15803d; font-weight: 700; }
        .yoy-neg { color: #b91c1c; font-weight: 700; }
        .yoy-zero { color: #64748b; font-weight: 700; }

        .multiselect-wrap {
            position: relative;
            min-width: 340px;
        }

        .multiselect-btn {
            width: 100%;
            text-align: left;
            border: 1px solid #dbe3ee;
            background: rgba(255,255,255,0.9);
            color: #0f172a;
            border-radius: 12px;
            padding: 10px 14px;
            font-size: 14px;
            font-weight: 500;
        }

        .multiselect-panel {
            position: absolute;
            top: calc(100% + 8px);
            left: 0;
            right: 0;
            max-height: 320px;
            overflow: auto;
            background: #fff;
            border: 1px solid #dbe3ee;
            border-radius: 14px;
            box-shadow: 0 10px 30px rgba(15, 23, 42, 0.10);
            z-index: 20;
            display: none;
        }

        .multiselect-panel.open { display: block; }

        .multiselect-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            border-bottom: 1px solid #f1f5f9;
        }

        .multiselect-item:last-child { border-bottom: none; }




        .zlecenia-col-header {
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            gap: 2px;
            line-height: 1.1;
            white-space: normal;
            text-align: left;
            overflow: visible;
        }

        .zlecenia-col-header-main {
            font-weight: 800;
            font-size: 13px;
            color: #0f172a;
        }

        .zlecenia-col-header-sub {
            font-size: 11px;
            color: #64748b;
        }

        .zlecenia-timeline {
            width: 100%;
            max-height: 620px;
            overflow-x: scroll;
            overflow-y: auto;
            scrollbar-gutter: stable;
            border: 1px solid #e2e8f0;
            border-radius: 14px;
            background: #fff;
        }

        .zlecenia-timeline-filters {
            display: grid;
            grid-template-columns: repeat(4, minmax(170px, 1fr)) auto;
            gap: 10px;
            align-items: center;
            margin-bottom: 14px;
        }

        .zlecenia-timeline-filters .multiselect-btn { min-width: 0; }

        @media (max-width: 1100px) {
            .zlecenia-timeline-filters { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
        }

        .zlecenia-timeline-canvas { position: relative; min-width: 100%; }

        .zlecenia-timeline-row {
            display: flex;
            min-height: 58px;
            border-bottom: 1px solid #edf2f7;
        }

        .zlecenia-timeline-label,
        .zlecenia-timeline-axis-label {
            position: sticky;
            left: 0;
            z-index: 3;
            width: 310px;
            min-width: 310px;
            box-sizing: border-box;
            background: #fff;
            border-right: 1px solid #e2e8f0;
        }

        .zlecenia-timeline-label {
            display: grid;
            grid-template-columns: 68px 1fr;
            gap: 2px 10px;
            align-content: center;
            padding: 8px 12px;
            font-size: 12px;
        }

        .zlecenia-timeline-label strong { grid-row: 1 / 3; align-self: center; font-size: 13px; }
        .zlecenia-timeline-label span,
        .zlecenia-timeline-label small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
        .zlecenia-timeline-label small { color: #64748b; }

        .zlecenia-timeline-track {
            position: relative;
            flex: none;
            background-image: repeating-linear-gradient(to right, transparent 0, transparent 29px, #f1f5f9 30px);
        }

        .zlecenia-timeline-bar {
            position: absolute;
            top: 18px;
            height: 22px;
            min-width: 6px;
            border-radius: 6px;
            background: linear-gradient(90deg, #2563eb, #38bdf8);
            box-shadow: 0 2px 7px rgba(37, 99, 235, 0.25);
        }

        .zlecenia-timeline-bar:hover { filter: brightness(0.92); }

        .zlecenia-timeline-axis {
            position: sticky;
            bottom: 0;
            z-index: 4;
            height: 42px;
            border-top: 1px solid #cbd5e1;
            background: #f8fafc;
        }

        .zlecenia-timeline-axis-label {
            height: 42px;
            padding: 12px;
            color: #64748b;
            font-size: 12px;
            font-weight: 700;
            background: #f8fafc;
        }

        .zlecenia-timeline-tick {
            position: absolute;
            top: 0;
            height: 42px;
            padding: 12px 0 0 7px;
            border-left: 1px solid #94a3b8;
            color: #475569;
            font-size: 12px;
            font-weight: 700;
        }

        .zlecenia-timeline-empty { padding: 28px; color: #64748b; text-align: center; }

        .dialog {
            width: min(620px, calc(100vw - 32px));
            padding: 0;
            border: 0;
            border-radius: 18px;
            box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
        }

        .dialog::backdrop { background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(3px); }
        .dialog__surface { padding: 24px; }
        .dialog-header { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
        .dialog-header h2 { margin: 0; font-size: 21px; font-weight: 750; }
        .dialog-header p { margin: 6px 0 0; color: #64748b; font-size: 14px; }
        .dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.dialog-content { display: grid; gap: var(--space-4); }
.dialog-close { padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 28px; line-height: 1; cursor: pointer; }
.dialog-close:hover { color: var(--text); }
.dialog-close:focus-visible { border-radius: var(--radius-sm); outline: 0; box-shadow: var(--focus-ring); }
.control--file { height: auto; padding-block: var(--space-3); }
        .hyd-cell-clickable { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
        .hyd-cell-clickable:hover, .hyd-cell-clickable:focus { background: #eef6ff; outline: none; }
        .hyd-row-clickable { cursor: pointer; }
        .hyd-row-clickable:hover td, .hyd-row-clickable:focus-visible td { background: #eef6ff; }
        .hyd-row-clickable:focus-visible { outline: 3px solid rgba(29, 78, 216, .22); outline-offset: -3px; }
        .forecast-order-status { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 9px; border-radius: 999px; font-weight: 700; color: #475569; background: #f1f5f9; }
        .forecast-order-status[data-status="Produkcja"] { color: #1d4ed8; background: #eff6ff; }
        .forecast-order-status[data-status="Testy"] { color: #a16207; background: #fefce8; }
        .forecast-order-status[data-status="Do wysyłki"] { color: #7c3aed; background: #f5f3ff; }
        .forecast-order-status[data-status="Wysłane"] { color: #047857; background: #ecfdf5; }
        .forecast-order-status[data-status="Zamknięte"] { color: #166534; background: #dcfce7; }
        .forecast-order-status[data-status="Zawieszone"] { color: #9f1239; background: #fff1f2; }
        .hyd-table-deep-dive-dialog { width: min(1200px, calc(100vw - 32px)); max-width: none; }
        .hyd-table-deep-dive-dialog .dialog__surface { padding: 20px; }
        .hyd-table-deep-dive-table-wrap {
            max-height: min(68vh, 720px);
            overflow-x: hidden;
            overflow-y: auto;
        }
        .hyd-table-deep-dive-table-wrap .hyd-table-host {
            min-width: 1050px;
            overflow: visible;
        }
        .hyd-table-deep-dive-scroll {
            width: 100%;
            height: 16px;
            margin-top: 8px;
            overflow-x: auto;
            overflow-y: hidden;
        }
        .hyd-table-deep-dive-scroll[hidden] { display: none; }
        .hyd-table-deep-dive-scroll > div { height: 1px; }
        .import-result { padding: 14px; border-radius: 12px; background: #f8fafc; color: var(--muted); font-size: 14px; line-height: 1.6; }
        .import-result-warning { background: #fff7ed; color: #9a3412; }
        .import-result-error { background: #fef2f2; color: #b91c1c; }
        .import-result-success { background: #f0fdf4; color: #166534; }

        .doc-card {
            border: 1px solid #e2e8f0;
            border-radius: 18px;
            background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
            padding: 20px;
        }

.doc-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.doc-card__title { margin-top: var(--space-1); color: var(--text); font-size: 24px; font-weight: 800; }

        .doc-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 16px;
        }

        .doc-label {
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: #64748b;
            font-weight: 700;
        }

        .doc-value {
            margin-top: 6px;
            font-size: 28px;
            font-weight: 800;
            color: #0f172a;
            line-height: 1.1;
        }

        .doc-subtle {
            color: #475569;
            font-size: 14px;
        }

.doc-subtle--spaced { margin-top: var(--space-3); }

        .doc-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 14px;
            font-size: 14px;
        }

        .doc-table th,
        .doc-table td {
            border-top: 1px solid #e2e8f0;
            padding: 10px 12px;
            text-align: left;
            vertical-align: top;
        }

        .doc-table th {
            color: #334155;
            font-weight: 700;
            background: #f8fafc;
        }

        .doc-pill {
            display: inline-flex;
            align-items: center;
            border-radius: 999px;
            padding: 4px 10px;
            font-size: 12px;
            font-weight: 700;
            background: #e2e8f0;
            color: #334155;
        }

/* Hydron app shell: aligned with the BL fin navigation model. */
:root {
    --bg: #f8f9fd;
    --bg-accent: #eef3ff;
    --panel: #ffffff;
    --panel-soft: #f8f9fc;
    --line: #e8ecf4;
    --line-strong: #d9dfeb;
    --text: #101318;
    --muted: #6b7280;
    --muted-strong: #465365;
    --accent: #1f5f8f;
    --accent-soft: #eaf4f7;
    --accent-strong: #13445f;
    --shadow-sm: 0 8px 22px rgba(16, 19, 24, 0.045);
    --shadow-md: 0 18px 42px rgba(16, 19, 24, 0.06);
    --sidebar-width: 214px;
    --color-info: #1d4ed8;
    --color-success: #047857;
    --color-warning: #a16207;
    --color-danger: #b91c1c;
    --focus-ring: 0 0 0 3px rgba(31, 95, 143, 0.18);
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --radius-sm: 8px;
    --radius-control: 10px;
    --radius-panel: 18px;
    --control-height: 38px;
    --page-padding-top: 22px;
    --page-padding-inline: 32px;
    --page-padding-bottom: 48px;
    --panel-padding: 20px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--text);
    font-family: "Manrope", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(203, 231, 238, 0.62), transparent 31%),
        linear-gradient(180deg, #fbfcfd 0%, var(--bg) 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea { font: inherit; }

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
    column-gap: 2px;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 6px 10px;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    align-items: stretch;
}

.brand-block {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    padding: 4px 2px 10px;
    width: 100%;
}

.brand-logo {
    width: 128px;
    height: auto;
    display: block;
}

.nav {
    display: grid;
    gap: 4px;
    align-content: start;
    width: 100%;
    min-height: 0;
    overflow: visible;
}

.nav-area { display: grid; gap: 2px; }
.nav-area__toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: var(--radius-control);
    background: transparent;
    color: var(--muted-strong);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
}
.nav-area__toggle:hover { background: rgba(255, 255, 255, .7); color: var(--accent-strong); }
.nav-area__toggle:focus-visible,
.nav-item:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.nav-area__pages { display: grid; gap: 2px; margin: 0; padding: 0 0 4px var(--space-3); list-style: none; }
.nav-area__pages[hidden] { display: none; }

@media (scripting: none) {
    .nav-area__pages[hidden] { display: grid !important; }
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    min-height: 42px;
    padding: 7px 10px;
    border: 0;
    border-radius: var(--radius-control);
    background: transparent;
    color: var(--text);
    text-decoration: none;
    transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease, color 150ms ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.78);
    transform: translateY(-1px);
}

.nav-item.active {
    background: linear-gradient(180deg, #f6fbfc 0%, var(--accent-soft) 100%);
    box-shadow: 0 10px 24px rgba(31, 95, 143, 0.08);
    color: var(--accent-strong);
}

.nav-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-strong);
}

.nav-item.active .nav-icon { color: var(--accent-strong); }

.nav-icon svg,
.logout-icon svg {
    width: 26px;
    height: 26px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-title {
    min-width: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 8px;
    justify-items: stretch;
    width: 100%;
    padding-top: 16px;
}

.nav-icon svg.nav-icon-filled {
    fill: currentColor;
    stroke: none;
}

.nav-icon[data-icon="list-register"] svg {
    fill: currentColor;
    stroke: none;
}

.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.84);
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.ghost-button:hover {
    background: #fff;
    color: var(--accent-strong);
    transform: translateY(-1px);
}

.logout-icon svg {
    width: 17px;
    height: 17px;
}

.content { min-width: 0; width: 100%; }

.page {
    width: 100%;
    max-width: none;
    padding: var(--page-padding-top) var(--page-padding-inline) var(--page-padding-bottom) 6px;
}

/* Canonical page architecture. */
.ui-page {
    display: grid;
    gap: var(--space-5);
    min-width: 0;
}

.ui-page[hidden] { display: none; }
.ui-page > .page-header { margin-bottom: 0; }
.ui-page > .panel { margin-top: 0; }

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-6);
}

.page-header__main { min-width: 0; }
.page-header__title { margin: 0; }

.page-header__subtitle,
.panel-subtitle {
    margin: var(--space-2) 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.page-controls,
.panel-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.page-content,
.page-grid {
    display: grid;
    gap: var(--space-6);
    min-width: 0;
}

.page-grid--single { grid-template-columns: minmax(0, 1fr); }
.page-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.page-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.report-verification-notice {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    gap: 8px 14px;
    padding: 11px 14px;
    border: 1px solid #bfd8e1;
    border-radius: var(--radius-control);
    background: #f3f9fb;
    color: #385b68;
    font-size: 12px;
    line-height: 1.45;
}

.report-verification-notice strong { color: #254b59; font-size: 12px; }

@media (max-width: 700px) {
    .report-verification-notice { grid-template-columns: 1fr; }
}

.page-tabs {
    display: flex;
    gap: var(--space-1);
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
}

.page-tab {
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    padding: 10px 12px;
    color: var(--muted-strong);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.page-tab:hover { color: var(--accent-strong); }
.page-tab.active { border-bottom-color: var(--accent); color: var(--accent-strong); }
.page-tab:focus-visible { border-radius: var(--radius-sm); outline: 0; box-shadow: var(--focus-ring); }

.panel {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
    min-width: 0;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--panel-padding) var(--panel-padding) 0;
}

.panel-header__main { min-width: 0; }
.panel-title {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.25;
}

.panel-content { padding: var(--panel-padding); }
.panel-content--flush { padding-inline: 0; padding-bottom: 0; }
.panel-footer { padding: 0 var(--panel-padding) var(--panel-padding); }

.revenue-builder-header { align-items: flex-start; gap: var(--space-5); }
.revenue-grouping-control { display: grid; gap: 6px; }
.revenue-grouping-control__label { color: var(--muted); font-size: 12px; font-weight: 700; }
.revenue-dimensions { display: flex; justify-content: flex-end; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.revenue-dimension { position: relative; display: inline-flex; align-items: center; min-height: 38px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--panel); color: var(--text); font-size: 13px; font-weight: 700; cursor: grab; user-select: none; transition: opacity .15s ease, border-color .15s ease, box-shadow .15s ease; }
.revenue-dimension:active { cursor: grabbing; }
.revenue-dimension.is-dragging { opacity: .35; }
.revenue-dimension.is-drop-before::before,
.revenue-dimension.is-drop-after::after { position: absolute; top: -4px; bottom: -4px; width: 3px; border-radius: 2px; background: var(--accent); content: ''; }
.revenue-dimension.is-drop-before::before { left: -6px; }
.revenue-dimension.is-drop-after::after { right: -6px; }
.revenue-dimension__position { display: grid; place-items: center; align-self: stretch; min-width: 30px; background: var(--accent-soft); color: var(--accent-strong); }
.revenue-dimension > span:not(.revenue-dimension__position) { padding-inline: 10px; }

#przychody-elastyczne-table .hyd-table th,
#przychody-elastyczne-table .hyd-table td,
#koszty-kontrahenci-table .hyd-table th,
#koszty-kontrahenci-table .hyd-table td { padding-inline: 8px; }

.app-state {
    min-height: 72px;
    padding: var(--panel-padding);
    color: var(--muted);
    font-size: 14px;
}

.app-state--error { color: var(--color-danger); }
.app-state--success { color: var(--color-success); }
.app-state--empty {
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-panel);
    background: var(--panel-soft);
}

.content-stack { display: grid; gap: var(--space-6); min-width: 0; }
.content-stack-section { min-width: 0; }
.forecast-controls { display: grid; grid-template-columns: minmax(180px, 220px) minmax(150px, 180px) minmax(260px, 1fr); align-items: end; gap: var(--space-3); }
.summary-box { margin-top: var(--space-4); padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--panel-soft); color: var(--muted-strong); font-size: 14px; }
.forecast-summary-items { display: flex; align-items: center; column-gap: var(--space-6); row-gap: var(--space-2); flex-wrap: wrap; }
.multiselect-wrap--compact { min-width: 220px; }
.multiselect-wrap--wide { min-width: min(420px, 45vw); }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--control-height);
    padding: 0 var(--space-4);
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.button:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button--primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.button--primary:hover { border-color: var(--accent-strong); background: var(--accent-strong); }
.button--secondary { border-color: var(--line-strong); background: var(--panel); color: var(--text); }
.button--secondary:hover { border-color: var(--accent); color: var(--accent-strong); }

.field { display: grid; gap: var(--space-2); }
.field__label { color: var(--text); font-size: 14px; font-weight: 700; }
.field__help { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.control {
    width: 100%;
    min-height: var(--control-height);
    padding: 0 var(--space-3);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-control);
    background: var(--panel);
    color: var(--text);
    font: inherit;
}
.control:focus { border-color: var(--accent); outline: 0; box-shadow: var(--focus-ring); }
.choice-group { display: grid; gap: var(--space-3); margin: 0; padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-control); }
.choice-group legend { padding: 0 var(--space-2); font-weight: 700; }
.choice-group label { display: flex; align-items: center; gap: var(--space-2); min-height: 32px; }
.form-actions { display: flex; justify-content: flex-end; gap: var(--space-3); flex-wrap: wrap; }

.button--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 900px) {
    .page-header { display: grid; gap: var(--space-4); }
    .page-controls { justify-content: flex-start; }
    .forecast-controls { grid-template-columns: 1fr; align-items: stretch; }
    .revenue-builder-header { display: grid; }
    .revenue-grouping-control { justify-items: start; }
    .revenue-dimensions { justify-content: flex-start; }
    .page-grid--two,
    .page-grid--three { grid-template-columns: minmax(0, 1fr); }
}

.multiselect-btn {
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 800;
    transition: 0.15s ease;
}

.multiselect-btn:hover {
    background: #ffffff;
    border-color: #c4ccd9;
}

@media (max-width: 560px) {
    .button:not(.button--icon) { width: 100%; }
    .form-actions { display: grid; }
    .panel-header,
    .panel-content { padding-inline: var(--space-4); }
    .dialog-actions { display: grid; }
    .multiselect-wrap--compact,
    .multiselect-wrap--wide { width: 100%; min-width: 0; }
}

.sidebar-settings-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    min-height: 42px;
    padding: 7px 10px;
    border-radius: var(--radius-control);
    color: var(--muted-strong);
    text-decoration: none;
}
.sidebar-settings-link:hover,
.sidebar-settings-link.active { background: var(--accent-soft); color: var(--accent-strong); }
.sidebar-settings-link:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.sidebar-settings-link svg { width: 26px; height: 26px; }
.sidebar-user {
    width: 100%;
    display: grid;
    justify-items: stretch;
    gap: 4px;
    min-width: 0;
}

.sidebar-user form { width: 100%; margin: 0; }

.sidebar-user__logout {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    min-height: 42px;
    padding: 7px 10px;
    border: 0;
    border-radius: var(--radius-control);
    background: transparent;
    color: var(--muted-strong);
    text-align: left;
    cursor: pointer;
}

.sidebar-user__logout .logout-icon svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
    stroke: none;
}

.sidebar-user__logout:hover { background: rgba(255, 255, 255, 0.78); color: var(--accent-strong); }

.sidebar-user__logout-label {
    display: grid;
    gap: 1px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.sidebar-menu-toggle,
.sidebar-backdrop { display: none; }

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(100%, 430px);
    display: grid;
    gap: 22px;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-md);
}

.login-logo { width: 168px; height: auto; }

.login-copy h1 {
    font-size: 36px !important;
    letter-spacing: -0.055em !important;
}

.login-copy p {
    margin: 8px 0 0;
    color: var(--muted);
    font-weight: 600;
}

.login-form {
    display: grid;
    gap: 12px;
}

.login-form label {
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.login-form input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: #fff;
    color: var(--text);
}

.login-form button {
    margin-top: 4px;
    border: 0;
    border-radius: 14px;
    padding: 13px 16px;
    background: var(--accent-strong);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.login-error {
    color: #b91c1c;
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        z-index: 60;
        inset: 0 auto 0 0;
        width: min(86vw, 280px);
        height: 100dvh;
        padding: 18px 10px 12px;
        background: var(--bg);
        box-shadow: var(--shadow-md);
        transform: translateX(-105%);
        transition: transform 180ms ease;
        overflow-y: auto;
    }

    .sidebar.is-open { transform: translateX(0); }

    .sidebar-menu-toggle {
        position: fixed;
        z-index: 55;
        top: 10px;
        left: 10px;
        display: inline-flex;
        align-items: center;
        gap: 7px;
        min-height: 40px;
        padding: 8px 12px;
        border: 1px solid var(--line);
        border-radius: var(--radius-control);
        background: rgba(255, 255, 255, .96);
        color: var(--text);
        box-shadow: var(--shadow-sm);
        font-weight: 800;
        cursor: pointer;
    }

    .sidebar-backdrop:not([hidden]) {
        position: fixed;
        z-index: 50;
        inset: 0;
        display: block;
        background: rgba(15, 23, 42, .34);
    }

    body.sidebar-menu-open { overflow: hidden; }

    .sidebar-inner {
        align-items: stretch;
    }

    .brand-block,
    .sidebar-footer {
        justify-items: start;
        justify-content: flex-start;
    }

    .nav {
        display: grid;
        gap: 4px;
        overflow: visible;
    }

    .nav-item {
        width: 100%;
    }

    .page {
        padding: 64px 12px 36px;
    }
}

body {
    font-family: "Manrope", "Aptos", "Segoe UI", sans-serif;
}

.brand-wordmark {
    color: var(--text);
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -0.075em;
    line-height: 1;
}

.brand-logo {
    width: 154px;
    max-height: 58px;
    object-fit: contain;
}

h1 {
    margin: 0 0 10px;
    font-size: clamp(28px, 3.15vw, 42px) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.052em !important;
    font-weight: 800 !important;
}

h2 {
    margin: 0 0 4px;
    line-height: 1.2;
}

.nav-icon svg,
.logout-icon svg {
    fill: none;
    stroke: currentColor;
}

@media (max-width: 900px) {
    .md\:grid-cols-\[220px_180px_1fr\] {
        grid-template-columns: 1fr;
    }

    .md\:items-end {
        align-items: stretch;
    }

}

.hyd-table-host {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.hyd-table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
    background: #fff;
    color: var(--text);
    font-size: 13px;
}

.hyd-table th,
.hyd-table td {
    border-right: 1px solid #eef2f6;
    border-bottom: 1px solid #f1f5f9;
    padding: 10px 12px;
    vertical-align: middle;
    white-space: nowrap;
}

.hyd-table th:last-child,
.hyd-table td:last-child {
    border-right: 0;
}

.hyd-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(180deg, #fbfcfe 0%, #f5f7fb 100%);
    color: #334155;
    font-weight: 800;
    text-align: left;
}

.hyd-table th.is-resizable { position: sticky; }
.hyd-column-resizer { position: absolute; top: 0; right: -4px; z-index: 2; width: 9px; height: 100%; cursor: col-resize; touch-action: none; }
.hyd-table th:last-child .hyd-column-resizer { right: 0; width: 5px; }
.hyd-column-resizer::after { position: absolute; top: 25%; bottom: 25%; left: 4px; width: 1px; background: transparent; content: ''; }
.hyd-column-resizer:hover::after { background: var(--accent); }
body.is-resizing-column { cursor: col-resize; user-select: none; }
body.is-resizing-column * { cursor: col-resize !important; }

.hyd-table .hyd-sort-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: inherit;
    cursor: pointer;
}

.hyd-table th.is-right .hyd-sort-button { justify-content: flex-end; }
.hyd-table .hyd-sort-button span { color: #64748b; }
.hyd-table .hyd-sort-button:hover span,
.hyd-table .hyd-sort-button:focus-visible span { color: #2563eb; }

.hyd-table tbody tr:nth-child(even) {
    background: #fcfdff;
}

.hyd-table tbody tr:hover {
    background: #f8fbff;
}

.hyd-table tfoot td {
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    font-weight: 800;
}

.hyd-table .is-right {
    text-align: right;
}

.hyd-table .hyd-toggle {
    width: 22px;
    height: 22px;
    margin-right: 8px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: #fff;
    color: var(--muted-strong);
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.hyd-table .tree-account,
.hyd-table .tree-name {
    font-weight: 800;
}

.hyd-table .tree-name {
    color: var(--text);
}

.hyd-table .yoy-pos { color: #15803d; font-weight: 800; }
.hyd-table .yoy-neg { color: #b91c1c; font-weight: 800; }
.hyd-table .yoy-zero { color: #64748b; font-weight: 800; }


.portal-login-shell {
    width: min(100%, 360px);
    display: grid;
    justify-items: center;
    gap: 20px;
}

.portal-login-shell .login-logo { width: min(100%, 240px); }
.portal-login-form { width: 100%; display: grid; gap: 12px; }
.portal-login-form h1 { margin: 4px 0 8px; text-align: center; font-size: 20px; color: #172033; }
.login-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 var(--space-4); border-radius: var(--radius-control); background: var(--accent); color: #fff; font-weight: 800; text-decoration: none; }
.login-button:hover { background: var(--accent-strong); }
.login-button:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.login-error { padding: 12px 14px; border-radius: 12px; background: #fff1f2; color: #be123c; font-size: 14px; }
.multiselect-btn {
    font-weight: 600;
}

.hyd-table {
    font-size: 13px;
    font-weight: 500;
}

.hyd-table th {
    font-weight: 700;
}

.hyd-table td {
    font-weight: 500;
    color: #162033;
}

.hyd-table .tree-account,
.hyd-table .tree-name {
    font-weight: 650;
}

.hyd-table .zlecenia-section-label {
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hyd-table tfoot td {
    font-weight: 700;
}

.hyd-table .hyd-toggle {
    font-weight: 700;
}

.hyd-table .yoy-pos,
.hyd-table .yoy-neg,
.hyd-table .yoy-zero {
    font-weight: 700;
}

.registry-count {
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
}

.registry-filters {
    display: grid;
    grid-template-columns: 180px minmax(220px, 1.5fr) minmax(100px, .6fr) repeat(2, minmax(150px, 1fr)) auto;
    align-items: end;
    gap: 12px;
    padding: 18px;
    border-bottom: 1px solid #e5e7eb;
}

.registry-filters label {
    display: grid;
    gap: 6px;
}

.registry-filters > label > span,
.registry-status-filter > span {
    color: #6b7280;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.registry-status-filter {
    position: relative;
    display: grid;
    gap: 6px;
}

.registry-status-filter details {
    position: relative;
}

.registry-status-filter summary {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 40px;
    padding: 0 30px 0 11px;
    overflow: hidden;
    border: 1px solid #d9e0ea;
    border-radius: 9px;
    background: #fff;
    color: #172033;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    list-style: none;
}

.registry-status-filter summary::-webkit-details-marker { display: none; }
.registry-status-filter summary::after {
    content: "⌄";
    position: absolute;
    top: 20px;
    right: 11px;
    transform: translateY(-50%);
    color: #64748b;
}

.registry-status-options {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    left: 0;
    width: 190px;
    padding: 6px;
    border: 1px solid #d9e0ea;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .14);
}

.registry-filters .status-filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.registry-filters .status-filter-option input {
    width: 15px;
    height: 15px;
    margin: 0;
    padding: 0;
}

.status-filter-dots {
    display: inline-flex;
    gap: 3px;
}

.status-filter-dots i,
.registry-status-filter summary[data-status]::before {
    content: "";
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #94a3b8;
}

.status-filter-option[data-status="Produkcja"],
.registry-status-filter summary[data-status="Produkcja"] { color: #1d4ed8; background: #eff6ff; }
.status-filter-option[data-status="Testy"],
.registry-status-filter summary[data-status="Testy"] { color: #a16207; background: #fefce8; }
.status-filter-option[data-status="Do wysyłki"],
.registry-status-filter summary[data-status="Do wysyłki"] { color: #7c3aed; background: #f5f3ff; }
.status-filter-option[data-status="Wysłane"],
.registry-status-filter summary[data-status="Wysłane"] { color: #047857; background: #ecfdf5; }
.status-filter-option[data-status="Zamknięte"],
.registry-status-filter summary[data-status="Zamknięte"] { color: #166534; background: #dcfce7; }
.status-filter-option[data-status="Zawieszone"],
.registry-status-filter summary[data-status="Zawieszone"] { color: #9f1239; background: #fff1f2; }

.status-filter-dots i[data-status="Produkcja"],
.registry-status-filter summary[data-status="Produkcja"]::before { background: #1d4ed8; }
.status-filter-dots i[data-status="Testy"],
.registry-status-filter summary[data-status="Testy"]::before { background: #ca8a04; }
.status-filter-dots i[data-status="Do wysyłki"],
.registry-status-filter summary[data-status="Do wysyłki"]::before { background: #7c3aed; }
.status-filter-dots i[data-status="Wysłane"],
.registry-status-filter summary[data-status="Wysłane"]::before { background: #059669; }
.status-filter-dots i[data-status="Zamknięte"],
.registry-status-filter summary[data-status="Zamknięte"]::before { background: #16a34a; }
.status-filter-dots i[data-status="Zawieszone"],
.registry-status-filter summary[data-status="Zawieszone"]::before { background: #be123c; }

.registry-filters input,
.registry-filters select {
    width: 100%;
    height: 40px;
    border: 1px solid #d9e0ea;
    border-radius: 9px;
    padding: 0 11px;
    color: #172033;
    background: #fff;
    font: inherit;
}

.registry-filters input:focus,
.registry-filters select:focus {
    border-color: #64748b;
    outline: 3px solid rgba(100, 116, 139, .12);
}

.registry-status {
    padding: 0 18px;
    color: #b91c1c;
    font-size: 13px;
}

.registry-status:not(:empty) {
    padding-top: 14px;
}

.registry-table-wrap {
    overflow: auto;
}

.current-orders-table-wrap { border-right: 0; border-left: 0; border-radius: 0; }
.current-orders-filters { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: flex-end; padding: 0; border: 0; }
.current-orders-filters > label, .current-orders-filters > .registry-status-filter { width: min(190px, 22vw); }
.current-orders-table { min-width: 1300px; table-layout: fixed; }
.current-orders-table .col-number { width: 92px; }
.current-orders-table .col-status { width: 108px; }
.current-orders-table .col-name { width: 150px; }
.current-orders-table .col-client { width: 160px; }
.current-orders-table .col-family { width: 145px; }
.current-orders-table .col-issued { width: 95px; }
.current-orders-table .col-completion { width: 105px; }
.current-orders-table .col-shipping { width: 105px; }
.current-orders-table .col-distribution { width: 445px; }
.current-orders-table th, .current-orders-table td { padding: 10px 12px; }
.current-orders-table th:nth-child(6), .current-orders-table td:nth-child(6),
.current-orders-table th:nth-child(7), .current-orders-table td:nth-child(7),
.current-orders-table th:nth-child(9), .current-orders-table td:nth-child(9) { text-align: right; }
.current-orders-table td.current-shipping-overdue { color: #dc2626; font-weight: 800; }
.current-orders-table td:nth-child(3), .current-orders-table td:nth-child(4), .current-orders-table td:nth-child(5) { overflow: hidden; text-overflow: ellipsis; }
.current-parts-stack { display: flex; width: 100%; height: 24px; overflow: hidden; border-radius: 999px; background: #e5e7eb; }
.current-parts-segment { min-width: 0; height: 100%; overflow: hidden; padding: 0 4px; border: 0; color: #fff; font-size: 10px; font-weight: 800; line-height: 24px; text-align: center; text-overflow: clip; white-space: nowrap; cursor: pointer; transition: filter .15s ease, transform .15s ease; }
.current-parts-segment:hover, .current-parts-segment:focus-visible { z-index: 1; filter: brightness(.88); transform: scaleY(1.18); outline: none; }
.current-parts-segment.is-open, .current-parts-legend .is-open i { background: #f59e0b; }
.current-parts-segment.is-closed, .current-parts-legend .is-closed i { background: #16a34a; }
.current-parts-segment.is-conventional, .current-parts-legend .is-conventional i { background: #7c3aed; }
.current-parts-segment.is-progress, .current-parts-legend .is-progress i { background: #2563eb; }
.current-parts-empty { width: 100%; color: #64748b; font-size: 11px; line-height: 22px; text-align: center; }
.current-parts-legend { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 7px; color: #64748b; font-size: 10px; font-weight: 700; }
.current-distribution-heading { display: flex; align-items: center; gap: 14px; }
.current-parts-legend--header { flex-wrap: nowrap; margin: 0; font-size: inherit; font-weight: inherit; white-space: nowrap; }
.current-parts-legend span { display: inline-flex; align-items: center; gap: 4px; }
.current-parts-legend i { width: 7px; height: 7px; border-radius: 2px; }
.current-parts-dialog { width: min(1500px, calc(100vw - 32px)); max-width: none; }
.current-parts-dialog .dialog__surface { width: 100%; box-sizing: border-box; }
.current-parts-card-host { max-height: calc(100vh - 150px); overflow: auto; }
.current-parts-card-host .details-jira-section { margin: 0; box-shadow: none; }

.registry-table {
    width: 100%;
    border-collapse: collapse;
}

.registry-table th,
.registry-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    white-space: nowrap;
}

.registry-table th:first-child,
.registry-table td:first-child {
    width: 76px;
    max-width: 76px;
    padding-right: 8px;
    padding-left: 10px;
}

.registry-table th:nth-child(2),
.registry-table td:nth-child(2) {
    width: 112px;
    max-width: 112px;
    padding-right: 8px;
    padding-left: 8px;
}

.registry-table th:nth-child(n+6),
.registry-table td:nth-child(n+6) {
    text-align: right;
}

.registry-table th:nth-child(n+6) button {
    text-align: right;
}

.registry-table th:nth-child(9),
.registry-table td:nth-child(9),
.registry-table th:nth-child(9) button {
    text-align: left;
}

.registry-table th:nth-child(9),
.registry-table td:nth-child(9) {
    width: 142px;
    max-width: 142px;
    padding-right: 8px;
    padding-left: 8px;
}

.registry-table th:nth-child(6),
.registry-table td:nth-child(6) {
    width: 116px;
    max-width: 116px;
}

.registry-table th:nth-child(7),
.registry-table td:nth-child(7) {
    width: 106px;
    max-width: 106px;
}

.registry-table th:nth-child(8),
.registry-table td:nth-child(8) {
    width: 88px;
    max-width: 88px;
}

.registry-table th:nth-child(n+10),
.registry-table td:nth-child(n+10) {
    width: 68px;
    max-width: 68px;
    padding-right: 8px;
    padding-left: 8px;
}

.registry-table th:nth-child(n+10) button {
    padding-right: 13px;
}

.registry-table th:last-child,
.registry-table td:last-child {
    padding-right: 18px;
}

.registry-status-select {
    width: 100%;
    height: 30px;
    border: 1px solid #d9e0ea;
    border-radius: 7px;
    padding: 0 7px;
    color: #334155;
    background: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.registry-status-select[data-status="Produkcja"] { color: #1d4ed8; background: #eff6ff; }
.registry-status-select[data-status="Testy"] { color: #a16207; background: #fefce8; }
.registry-status-select[data-status="Do wysyłki"] { color: #7c3aed; background: #f5f3ff; }
.registry-status-select[data-status="Wysłane"] { color: #047857; background: #ecfdf5; }
.registry-status-select[data-status="Zamknięte"] { color: #166534; background: #dcfce7; }
.registry-status-select[data-status="Zawieszone"] { color: #9f1239; background: #fff1f2; }

.registry-table th {
    height: 52px;
    vertical-align: middle;
    white-space: normal;
    background: #f8fafc;
}

.registry-table th button {
    position: relative;
    border: 0;
    padding: 0 18px 0 0;
    color: #6b7280;
    background: transparent;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1.2;
    text-align: left;
    text-transform: uppercase;
    white-space: normal;
    cursor: pointer;
}

.registry-table th button[data-direction="asc"]::after {
    content: "↑";
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}

.registry-table th button[data-direction="desc"]::after {
    content: "↓";
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}

.registry-table td {
    font-size: 13px;
}

.registry-table td.registry-margin-negative {
    color: #991b1b;
    font-weight: 700;
}

.registry-table tbody tr:hover {
    background: #f8fafc;
}

.registry-order-row {
    cursor: pointer;
}

.registry-order-row:focus-visible {
    outline: 3px solid rgba(29, 78, 216, .22);
    outline-offset: -3px;
}

.registry-table tbody tr:last-child td {
    border-bottom: 0;
}

.empty-row {
    height: 150px;
    color: #6b7280;
    text-align: center !important;
}

.order-details-selector {
    width: 100%;
    min-width: 0;
}

.order-details-selector label {
    display: flex;
    align-items: center;
    gap: 9px;
}

.order-details-selector svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: #64748b;
    stroke-width: 1.8;
    stroke-linejoin: round;
}

.order-details-selector select {
    width: auto;
    min-width: 0;
    flex: 1;
    height: 33px;
    border: 1px solid #d9e0ea;
    border-radius: 9px;
    padding: 0 12px;
    color: #172033;
    background: #fff;
    font: inherit;
}

.order-details-selector .selector-attention select {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .14);
}

.details-empty-state {
    min-height: 430px;
    margin-top: 18px;
    display: grid;
    place-content: center;
    justify-items: center;
    padding: 40px 24px;
    border: 1px dashed #bfdbfe;
    border-radius: 16px;
    color: #64748b;
    text-align: center;
    background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}

.details-empty-state[hidden] { display: none; }
.details-empty-state h2 { margin: 0; color: #172033; font-size: clamp(32px, 5vw, 52px); line-height: 1.05; }
.details-empty-state p { margin: 12px 0 0; font-size: 17px; }
.details-empty-arrow { margin: 0 0 12px auto; color: #2563eb; font-size: 64px; font-weight: 300; line-height: 1; transform: translateX(70px); }

.order-details-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 320px);
    align-items: center;
    gap: 12px;
}

.order-status-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-status-control span {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.order-status-control select {
    height: 33px;
    border: 1px solid #d9e0ea;
    border-radius: 9px;
    padding: 0 10px;
    background: #fff;
    font: inherit;
    font-weight: 700;
}

.order-status-control select[data-status="Produkcja"] { color: #1d4ed8; background: #eff6ff; }
.order-status-control select[data-status="Testy"] { color: #a16207; background: #fefce8; }
.order-status-control select[data-status="Do wysyłki"] { color: #7c3aed; background: #f5f3ff; }
.order-status-control select[data-status="Wysłane"] { color: #047857; background: #ecfdf5; }
.order-status-control select[data-status="Zamknięte"] { color: #166534; background: #dcfce7; }
.order-status-control select[data-status="Zawieszone"] { color: #9f1239; background: #fff1f2; }

.order-details-heading h1 {
    min-width: 0;
    font-size: 24px;
    line-height: 1.15;
    white-space: normal;
}

.order-details-heading .details-title-wrap {
    justify-content: flex-start;
}

.details-title-wrap {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.detail-edit-button {
    display: inline-grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border: 1px solid #d9e0ea;
    border-radius: 8px;
    color: #64748b;
    background: #fff;
    font-size: 18px;
    cursor: pointer;
}

.detail-edit-button:hover {
    border-color: #94a3b8;
    color: #1d4ed8;
    background: #f8fafc;
}

.order-details-content {
    display: grid;
    gap: 18px;
}

.order-details-content[hidden] {
    display: none;
}

.order-summary-cards {
    display: grid;
    grid-template-columns: repeat(6, minmax(150px, 1fr));
    gap: 12px;
}

.order-summary-card {
    display: grid;
    gap: 8px;
    min-height: 92px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

.order-summary-card span {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.order-summary-card strong {
    color: #0f172a;
    font-size: 19px;
}

.order-details-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 18px;
}

.order-detail-section {
    overflow: hidden;
}

.order-detail-section dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 22px;
    margin: 0;
}

.order-detail-section .detail-list-single {
    grid-template-columns: 1fr;
}

.order-detail-section .finance-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(54px, auto));
    column-gap: 28px;
}

.finance-col-left { grid-column: 1; }
.finance-col-right { grid-column: 2; }
.finance-row-1 { grid-row: 1; }
.finance-row-2 { grid-row: 2; }
.finance-row-3 { grid-row: 3; }
.finance-row-4 { grid-row: 4; }
.finance-row-5 { grid-row: 5; }

.finance-margin,
.finance-margin-percent {
    border-bottom-color: #cbd5e1 !important;
}

.finance-margin-percent {
    display: flex;
    align-items: flex-end;
}

.finance-margin-percent dt {
    display: none;
}

.finance-margin-percent dd {
    padding-bottom: 1px;
    font-size: 14px;
}

.finance-valuation dd {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 12px;
}

.finance-valuation-meta {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.finance-valuation-meta::before {
    content: "·";
    margin-right: 8px;
    color: #cbd5e1;
}

.details-edit-dialog {
    width: min(760px, calc(100vw - 32px));
}

.order-detail-section dl > div {
    padding: 11px 0;
    border-bottom: 1px solid #eef2f7;
}

.order-detail-section dt {
    margin-bottom: 4px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.order-detail-section dd {
    margin: 0;
    color: #172033;
    font-size: 14px;
    font-weight: 600;
    white-space: pre-wrap;
}

.schedule-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(170px, .7fr) minmax(170px, .7fr);
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #eef2f7;
}

#details-schedule-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

#details-schedule-form .schedule-grid-header {
    display: grid;
}

#details-schedule-form .schedule-grid {
    grid-template-columns: minmax(150px, .7fr) repeat(2, minmax(170px, 1fr));
}

#details-schedule-form .schedule-cost-period,
#details-schedule-form .schedule-locations,
#details-schedule-form .schedule-actions {
    grid-column: 1 / -1;
}

#schedule-dialog { width: min(500px, calc(100vw - 32px)); }

.schedule-mode-plan [data-schedule-actual],
.schedule-mode-plan [data-schedule-order-row],
.schedule-mode-actual [data-schedule-plan] {
    display: none !important;
}

#details-schedule-form.schedule-mode-plan .schedule-grid,
#details-schedule-form.schedule-mode-actual .schedule-grid {
    grid-template-columns: minmax(145px, .85fr) minmax(170px, 1fr);
}

#details-schedule-form.schedule-mode-actual .schedule-grid-single input {
    grid-column: 2;
}

.schedule-grid-header {
    padding-top: 0;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.schedule-grid input[type="date"] {
    width: 100%;
    height: 34px;
    border: 1px solid #d9e0ea;
    border-radius: 9px;
    padding: 0 10px;
    color: #172033;
    background: #fff;
    font: inherit;
}

.schedule-grid-single input { grid-column: 3; }

.schedule-cost-period span {
    grid-column: 2 / -1;
    color: #475569;
    font-weight: 700;
}

.schedule-locations {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 10px;
}

.schedule-locations fieldset {
    display: flex;
    gap: 22px;
    margin: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 9px 12px;
}

.schedule-locations legend {
    padding: 0 5px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.schedule-locations label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
}

.schedule-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 10px;
}

.schedule-actions span {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.schedule-status-heading {
    align-items: end;
}

.schedule-status-heading h2 {
    margin-bottom: 4px;
}

.schedule-status-heading .order-status-control {
    width: auto;
}

.order-gantt {
    display: grid;
    gap: 22px;
    margin-top: 28px;
    padding: 4px 8px 8px;
}

.schedule-assignments {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.schedule-assignments fieldset {
    min-width: 0;
    margin: 0;
    border: 1px solid #d9e0ea;
    border-radius: 10px;
    padding: 9px 12px;
}

.schedule-assignments fieldset {
    display: flex;
    align-items: center;
    gap: 16px;
}

.schedule-assignments legend {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.schedule-assignments fieldset label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
}

.schedule-assignments .schedule-assignment-person {
    align-items: center;
}

.schedule-assignments select {
    width: 100%;
    border: 0;
    padding: 0;
    color: #172033;
    background: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
}

.schedule-assignments-status {
    grid-column: 1 / -1;
    min-height: 18px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.gantt-row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
}

button.gantt-row {
    width: 100%;
    border: 0;
    padding: 0;
    text-align: left;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.gantt-row.editable:hover .gantt-track,
.gantt-row.editable:focus-visible .gantt-track {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.gantt-row > strong {
    color: #334155;
    font-size: 13px;
}

.gantt-track {
    position: relative;
    height: 34px;
    border-radius: 8px;
    background: #eef2f7;
}

.gantt-track.empty {
    display: grid;
    place-items: center start;
    padding-left: 12px;
    color: #94a3b8;
    font-size: 12px;
}

.gantt-timeline {
    position: absolute;
    inset: 0 32px;
}

.gantt-bar {
    position: absolute;
    top: 12px;
    height: 10px;
    border-radius: 999px;
    background: #64748b;
}

.gantt-track.plan .gantt-bar { background: #2563eb; }
.gantt-track.actual .gantt-bar { background: #16a34a; }
.gantt-track.costs .gantt-bar { background: #f59e0b; }

.gantt-marker {
    position: absolute;
    top: 4px;
    z-index: 1;
    display: grid;
    justify-items: center;
    transform: translateX(-50%);
}

.gantt-marker i {
    width: 12px;
    height: 12px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #334155;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .16);
}

.gantt-track.plan .gantt-marker i { background: #2563eb; }
.gantt-track.actual .gantt-marker i { background: #16a34a; }
.gantt-track.costs .gantt-marker i { background: #f59e0b; }

.gantt-marker b,
.gantt-marker small {
    position: absolute;
    white-space: nowrap;
    font-size: 10px;
}

.gantt-marker b { top: -18px; color: #334155; font-size: 12px; }
.gantt-marker small { top: 20px; color: #64748b; }

.gantt-scale {
    display: flex;
    justify-content: space-between;
    margin: -10px 0 0 106px;
    color: #94a3b8;
    font-size: 10px;
}

.gantt-empty {
    margin: 0;
    color: #64748b;
}

.order-detail-comment p {
    margin: 0;
    color: #475569;
    line-height: 1.6;
    white-space: pre-wrap;
}

.details-jira-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.details-jira-sync-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: -5px;
}

.details-jira-sync-wrap span {
    max-width: 280px;
    color: #64748b;
    font-size: 12px;
    font-weight: 650;
    text-align: right;
}

.details-jira-sync-wrap span[data-state="success"] { color: #047857; }
.details-jira-sync-wrap span[data-state="error"] { color: #b91c1c; }

#details-jira-sync:disabled {
    cursor: wait;
    opacity: .65;
}

.order-detail-section .hyd-table-host {
    margin: 0 -20px -20px;
    border-top: 1px solid #e5e7eb;
}

.hours-analysis-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
    margin: 0 -20px -20px;
    border-top: 1px solid #e5e7eb;
}

.cost-analysis-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
    margin: 0 -20px -20px;
    border-top: 1px solid #e5e7eb;
}

.cost-analysis-layout .hyd-table-host {
    margin: 0;
    border-top: 0;
    border-right: 1px solid #e5e7eb;
}

.cost-chart-wrap {
    min-width: 0;
    padding: 18px 20px 16px 0;
}

#details-cost-table .hyd-table,
#details-hours-table .hyd-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

#details-cost-table .hyd-table th:first-child,
#details-cost-table .hyd-table td:first-child,
#details-hours-table .hyd-table th:first-child,
#details-hours-table .hyd-table td:first-child {
    width: 75% !important;
}

#details-cost-table .hyd-table th:last-child,
#details-cost-table .hyd-table td:last-child,
#details-hours-table .hyd-table th:last-child,
#details-hours-table .hyd-table td:last-child {
    width: 25% !important;
}

.hours-analysis-layout .hyd-table-host {
    margin: 0;
    border-top: 0;
    border-right: 1px solid #e5e7eb;
}

.hours-analysis-layout .hyd-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.hours-analysis-layout .hyd-table th,
.hours-analysis-layout .hyd-table td {
    overflow: hidden;
    text-overflow: ellipsis;
}

.hours-chart-wrap {
    min-width: 0;
    padding: 18px 20px 16px 0;
}

.hours-chart {
    min-height: 262px;
    overflow-x: auto;
}

.hours-chart-bars {
    display: flex;
    align-items: flex-end;
    min-width: max-content;
    height: 247px;
    gap: 14px;
    padding: 16px 8px 0;
    border-bottom: 1px solid #cbd5e1;
}

.hours-chart-column {
    display: grid;
    grid-template-rows: 24px 190px 28px;
    justify-items: center;
    width: 48px;
}

.hours-chart-total {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.hours-chart-stack {
    display: flex;
    width: 28px;
    flex-direction: column-reverse;
    justify-content: flex-start;
    align-self: end;
    overflow: hidden;
    border-radius: 4px 4px 0 0;
}

.hours-chart-segment {
    display: block;
    width: 100%;
    min-height: 1px;
}

.hours-chart-label {
    padding-top: 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.hours-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 14px;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
}

.hours-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hours-chart-legend i {
    width: 9px;
    height: 9px;
    border-radius: 2px;
}

.hours-chart-empty {
    display: grid;
    min-height: 230px;
    place-items: center;
    color: #64748b;
    font-size: 13px;
}

.jira-status-chart {
    overflow-x: auto;
    padding: 18px 4px 8px;
}

.detail-parts-summary {
    display: flex;
    gap: 32px;
    margin: 16px 0;
}

.detail-parts-summary > div {
    display: flex;
    flex-direction: column;
}

.detail-parts-summary strong {
    color: var(--foreground, #0f172a);
    font-size: 28px;
    line-height: 1.1;
}

.detail-parts-summary span {
    margin-top: 5px;
    color: var(--muted, #64748b);
    font-size: 13px;
    font-weight: 700;
}

.detail-parts-table th:last-child,
.detail-parts-table td:last-child {
    text-align: right;
}

.detail-part-toggle {
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-align: left;
}

.detail-part-toggle span {
    display: inline-block;
    width: 16px;
}

.detail-part-person td {
    color: var(--muted, #64748b);
}

.detail-parts-table .detail-part-person-name {
    padding-left: 24px;
}

.detail-part-person[hidden] {
    display: none;
}

.jira-resolution-summary {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    margin: 0 -20px;
    padding: 18px 20px;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.jira-detail-count {
    display: flex;
    flex-direction: column;
}

.jira-detail-count strong {
    color: var(--foreground, #0f172a);
    font-size: 32px;
    line-height: 1;
}

.jira-detail-count span {
    margin-top: 6px;
    color: var(--muted, #64748b);
    font-size: 13px;
    font-weight: 700;
}

.jira-resolution-chart-wrap {
    min-width: 0;
}

.jira-resolution-chart {
    min-height: 38px;
}

.jira-resolution-stack {
    display: flex;
    width: 100%;
    height: 38px;
    overflow: hidden;
    border-radius: 6px;
    background: #eef2f7;
}

.jira-resolution-stack .jira-category-segment {
    display: grid;
    min-width: 2px;
    padding: 0;
    border: 0;
    place-items: center;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
}

.jira-category-segment:hover,
.jira-category-segment:focus-visible,
.jira-category-segment.active {
    position: relative;
    z-index: 1;
    outline: 3px solid #0f172a;
    outline-offset: -3px;
}

.jira-resolution-chart-wrap .hours-chart-legend {
    margin-top: 10px;
}

.details-jira-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 24px;
    align-items: stretch;
    margin: 0 -20px -20px;
}

.jira-details-table {
    min-width: 0;
}

.jira-table-wrap {
    min-width: 0;
    border-left: 1px solid #e5e7eb;
}

.jira-table-filter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-bottom: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 12px;
}

.jira-table-filter[hidden] {
    display: none;
}

.jira-table-filter button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #2563eb;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.jira-details-table .hyd-table-host {
    max-height: 430px;
    margin: 0;
    overflow: auto;
    border-top: 0;
}

.jira-table {
    min-width: 0;
    table-layout: fixed;
    font-size: 12px;
}

.jira-table th,
.jira-table td {
    padding: 8px 6px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.jira-table th:nth-child(1), .jira-table td:nth-child(1) { width: 13%; }
.jira-table th:nth-child(2), .jira-table td:nth-child(2) { width: 30%; }
.jira-table th:nth-child(3), .jira-table td:nth-child(3) { width: 21%; }
.jira-table th:nth-child(4), .jira-table td:nth-child(4) { width: 8%; }
.jira-table th:nth-child(5), .jira-table td:nth-child(5) { width: 15%; }
.jira-table th:nth-child(6), .jira-table td:nth-child(6) { width: 13%; }

.jira-table th:nth-last-child(-n + 2),
.jira-table td:nth-last-child(-n + 2) {
    text-align: right;
}

.jira-table tr[data-jira-index] {
    cursor: pointer;
}

.jira-table tr[data-jira-index]:hover,
.jira-table tr[data-jira-index]:focus {
    background: #eff6ff;
    outline: none;
}

.jira-table th:last-child,
.jira-table td:last-child {
    text-align: right;
}

.jira-table th button {
    display: flex;
    align-items: flex-start;
    gap: 3px;
    width: 100%;
    border: 0;
    padding: 0;
    color: inherit;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-align: left;
}

.jira-table th:nth-last-child(-n + 2) button {
    justify-content: flex-end;
}

.jira-table th button span {
    color: #94a3b8;
    font-size: 11px;
}

.jira-table th button.active span {
    color: #2563eb;
}

.jira-path-chart-wrap {
    min-width: 0;
    padding: 0 20px 16px;
}

.jira-path-chart-wrap .hours-chart-legend {
    justify-content: center;
    margin-top: 14px;
}

.jira-status-bars {
    display: grid;
    gap: 14px;
}

.jira-status-row {
    display: grid;
    grid-template-columns: minmax(86px, 34%) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.jira-status-track {
    display: flex;
    height: 30px;
    overflow: hidden;
    border-radius: 4px;
    background: var(--surface-subtle, #eef2f7);
}

.jira-status-columns {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    min-width: max-content;
}

.jira-status-column {
    display: grid;
    grid-template-rows: 24px 220px minmax(42px, auto);
    justify-items: center;
    width: 92px;
}

.jira-status-total {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.jira-status-stack {
    display: flex;
    flex-direction: column-reverse;
    width: 54px;
    height: 220px;
    overflow: hidden;
    border-radius: 6px 6px 2px 2px;
    background: var(--surface-subtle, #eef2f7);
}

.jira-detail-dialog {
    width: min(1240px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    max-width: none;
    overflow: hidden;
}

.jira-detail-dialog .dialog__surface {
    box-sizing: border-box;
    max-height: calc(100vh - 24px);
    padding: 20px;
    overflow-y: auto;
}

.jira-detail-heading {
    align-items: center;
}

.jira-detail-heading h2 {
    margin-bottom: 5px;
}

.jira-detail-heading a {
    color: #2563eb;
    font-size: 13px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.jira-detail-heading a:hover {
    text-decoration: underline;
}

.jira-detail-heading-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.jira-detail-status {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    border-radius: 999px;
    padding: 7px 16px;
    color: #1d4ed8;
    background: #eff6ff;
    font-size: 14px;
    font-weight: 800;
}

.jira-detail-status::before {
    width: 9px;
    height: 9px;
    margin-right: 9px;
    border-radius: 50%;
    background: currentColor;
    content: '';
}

.jira-detail-status[data-tone="done"] { color: #047857; background: #ecfdf5; }
.jira-detail-status[data-tone="warning"] { color: #a16207; background: #fefce8; }
.jira-detail-status[data-tone="danger"] { color: #9f1239; background: #fff1f2; }

.jira-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr);
    gap: 16px;
    align-items: start;
}

.jira-detail-left {
    min-width: 0;
}

.jira-detail-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.jira-detail-fields > div {
    min-width: 0;
    padding: 12px;
    border-radius: 8px;
    background: #f8fafc;
}

.jira-detail-fields dt {
    margin-bottom: 5px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.jira-detail-fields dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: #0f172a;
    font-size: 13px;
    white-space: pre-wrap;
}

.jira-detail-fields a {
    color: #2563eb;
    font-weight: 700;
}

.jira-detail-links dd {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.jira-link-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border-radius: 6px;
    padding: 5px 10px;
    background: #eff6ff;
    font-size: 12px;
    text-decoration: none;
}

.jira-link-chip.disabled {
    color: #94a3b8;
    background: #e2e8f0;
}

.jira-drawing-section {
    min-width: 0;
    margin: 0;
    text-align: center;
}

.jira-drawing-section h3 {
    margin: 0;
    padding-bottom: 10px;
    font-size: 15px;
}

.jira-drawing-preview {
    display: grid;
    width: min(100%, calc((100vh - 190px) * .7071));
    aspect-ratio: 210 / 297;
    max-height: calc(100vh - 190px);
    min-height: 0;
    margin: 0 auto;
    overflow: hidden;
    place-items: center;
    border: 0;
    border-radius: 4px;
    background: #fff;
    color: #64748b;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .16);
}

.jira-drawing-preview iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.jira-detail-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.jira-detail-metrics > div {
    display: grid;
    gap: 3px;
    min-width: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 9px;
    background: #f8fafc;
}

.jira-detail-metrics span {
    color: #64748b;
    font-size: 10px;
    font-weight: 750;
}

.jira-detail-metrics strong {
    color: #0f172a;
    font-size: 14px;
}

.jira-metric-values {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.jira-metric-values i {
    color: #94a3b8;
    font-style: normal;
}

.jira-detail-metrics em {
    color: #b91c1c;
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
}

.jira-detail-metrics > div.late {
    border-color: #dc2626;
    background: #fee2e2;
}

.jira-detail-metrics > div.overdue {
    border-color: #fca5a5;
    background: #fef2f2;
}

.jira-detail-hours,
.jira-detail-plan {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.jira-detail-hours h3,
.jira-detail-plan h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.jira-detail-hours-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.jira-detail-hours-grid > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-radius: 8px;
    padding: 10px;
    background: #f8fafc;
}

.jira-detail-hours-grid > .is-plan {
    border: 1px solid #dbeafe;
    background: #eff6ff;
}

.jira-detail-hours-grid > .is-actual {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
}

.jira-detail-hours-grid > .is-plan span { color: #1d4ed8; }
.jira-detail-hours-grid > .is-actual span { color: #15803d; }

.jira-detail-hours-grid span {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
}

.jira-detail-hours-grid strong {
    margin-top: 5px;
    color: #0f172a;
    font-size: 18px;
}

.jira-detail-hours .hyd-table-host {
    margin-top: 12px;
}

#jira-detail-clockify-table .hours-chart-empty {
    display: block;
    min-height: 0;
    margin-top: 10px;
    padding: 4px 0;
}

.jira-clockify-table {
    min-width: 0;
    table-layout: fixed;
}

.jira-clockify-table th:first-child,
.jira-clockify-table td:first-child {
    width: 32%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.jira-clockify-table th:nth-child(2),
.jira-clockify-table td:nth-child(2) {
    width: 38%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.jira-clockify-table th:last-child,
.jira-clockify-table td:last-child {
    width: 30%;
}

.jira-clockify-table th:last-child,
.jira-clockify-table td:last-child {
    text-align: right;
    white-space: nowrap;
}

.jira-detail-plan .jira-detail-gantt {
    margin-top: 0;
    padding-top: 8px;
    border-top: 0;
}

.jira-detail-gantt {
    display: grid;
    gap: 24px;
    margin-top: 30px;
    padding: 22px 0 4px;
    border-top: 1px solid #e2e8f0;
}

.jira-gantt-row {
    --milestone-color: #2563eb;
    --milestone-soft: #eff6ff;
    min-width: 0;
}

.jira-gantt-row.actual {
    --milestone-color: #059669;
    --milestone-soft: #ecfdf5;
}

.jira-detail-gantt .gantt-row {
    display: block;
}

.jira-gantt-title {
    display: block;
    margin-bottom: 8px;
    color: var(--milestone-color);
    font-size: 12px;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.jira-detail-gantt .gantt-track {
    display: block;
    width: 100%;
    height: 24px;
    background: #f1f5f9;
}

.jira-detail-gantt .gantt-timeline {
    inset: 0 18px;
}

.jira-detail-gantt .gantt-bar {
    top: 10px;
    height: 4px;
    background: var(--milestone-color);
    opacity: .45;
}

.jira-detail-gantt .gantt-marker b,
.jira-detail-gantt .gantt-marker small {
    display: none;
}

.jira-detail-gantt .gantt-marker i {
    width: 11px;
    height: 11px;
    border: 2px solid #fff;
    background: var(--milestone-color);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--milestone-color) 22%, transparent);
}

.jira-detail-gantt .gantt-marker.jira-milestone-square i {
    border-radius: 3px;
}

.jira-detail-gantt .gantt-marker.jira-milestone-triangle i {
    width: 0;
    height: 0;
    border: 0;
    border-right: 6px solid transparent;
    border-bottom: 11px solid var(--milestone-color);
    border-left: 6px solid transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.jira-gantt-milestones {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0 0;
}

.jira-gantt-milestones span {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    gap: 7px;
    align-items: center;
    min-width: 0;
    min-height: 38px;
    border: 1px solid color-mix(in srgb, var(--milestone-color) 14%, #e2e8f0);
    border-radius: 8px;
    padding: 6px 9px;
    color: #334155;
    background: var(--milestone-soft);
    font-size: 11px;
}

.jira-milestone-icon {
    width: 10px;
    height: 10px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--milestone-color);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--milestone-color) 28%, transparent);
}

.jira-milestone-icon.jira-milestone-square {
    border-radius: 1px;
}

.jira-milestone-icon.jira-milestone-triangle {
    width: 0;
    height: 0;
    border: 0;
    border-right: 5px solid transparent;
    border-bottom: 9px solid var(--milestone-color);
    border-left: 5px solid transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.jira-gantt-milestones span.missing {
    color: #94a3b8;
    border-color: #e2e8f0;
    background: #f8fafc;
}

.jira-gantt-row.actual .jira-gantt-milestones span.late {
    border-color: #dc2626;
    color: #7f1d1d;
    background: #fecaca;
}

.jira-gantt-row.actual .jira-gantt-milestones span.overdue {
    border-color: #fca5a5;
    color: #991b1b;
    background: #fef2f2;
}

.jira-gantt-row.actual .jira-gantt-milestones span.late small,
.jira-gantt-row.actual .jira-gantt-milestones span.overdue small {
    color: #b91c1c;
}

.jira-gantt-milestones span.missing .jira-milestone-icon {
    background: #94a3b8;
}

.jira-gantt-milestones span.missing .jira-milestone-icon.jira-milestone-triangle {
    border-bottom-color: #94a3b8;
}

.jira-gantt-milestones span.missing small {
    color: #94a3b8;
}

.jira-gantt-milestones b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jira-gantt-milestones small {
    color: var(--milestone-color);
    font-size: inherit;
    font-weight: 800;
}

@media (max-width: 900px) {
    .details-jira-layout,
    .jira-resolution-summary {
        grid-template-columns: 1fr;
    }

    .jira-table-wrap {
        border-top: 1px solid #e5e7eb;
        border-left: 0;
    }

    .jira-path-chart-wrap {
        padding-left: 20px;
    }

    .jira-detail-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .jira-detail-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .jira-detail-fields {
        grid-template-columns: 1fr;
    }

    .jira-detail-hours-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .jira-detail-metrics {
        grid-template-columns: 1fr;
    }
}

.jira-status-segment {
    display: grid;
    padding: 0;
    border: 0;
    place-items: center;
    min-height: 2px;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    overflow: hidden;
}

.jira-status-segment:hover,
.jira-status-segment:focus-visible,
.jira-status-segment.active {
    position: relative;
    z-index: 1;
    outline: 3px solid #0f172a;
    outline-offset: -3px;
}

.jira-status-label {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 5px 6px;
    border: 0;
    border-radius: 4px;
    overflow-wrap: anywhere;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    line-height: 1.25;
    text-align: left;
}

.jira-status-label:hover,
.jira-status-label:focus-visible,
.jira-status-label.active {
    background: #dbeafe;
    color: #1d4ed8;
    outline: none;
}

.jira-status-label b {
    flex: 0 0 auto;
}

.order-dialog {
    width: min(920px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
}

.order-dialog .dialog__surface {
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.order-form-status {
    color: #b91c1c;
    font-size: 13px;
}

.order-form-status:not(:empty) {
    margin-bottom: 16px;
    padding: 11px 13px;
    border-radius: 10px;
    background: #fef2f2;
}

.order-form-section + .order-form-section {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid #e5e7eb;
}

.order-form-section h3 {
    margin: 0 0 14px;
    font-size: 15px;
}

.order-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.order-form-grid label {
    display: grid;
    gap: 6px;
}

.order-form-grid label > span {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.chamber-diameter-field {
    display: grid;
    grid-column: span 2;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    gap: 6px 12px;
    margin: 0;
    padding: 0;
    border: 0;
}

.schedule-location-field {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 42px;
    margin: 0;
    padding: 8px 11px;
    border: 1px solid #d9e0ea;
    border-radius: 9px;
}

.schedule-location-field legend {
    padding: 0 4px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.order-form-grid .schedule-location-field label {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.order-form-grid .schedule-location-field input {
    width: 16px;
    height: 16px;
    padding: 0;
}

.chamber-diameter-field[hidden] {
    display: none;
}

.chamber-diameter-field legend {
    grid-column: 1 / -1;
    padding: 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.diameter-unit-options {
    display: flex;
    align-items: end;
    gap: 10px;
    padding-bottom: 10px;
}

.order-form-grid .diameter-unit-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.order-form-grid .diameter-unit-options input[type="radio"] {
    width: 16px;
    height: 16px;
    padding: 0;
}

.order-form-grid input,
.order-form-grid select,
.order-form-grid textarea {
    width: 100%;
    border: 1px solid #d9e0ea;
    border-radius: 9px;
    padding: 10px 11px;
    color: #172033;
    background: #fff;
    font: inherit;
}

.order-form-grid input,
.order-form-grid select {
    height: 42px;
}

.order-form-grid textarea {
    min-height: 96px;
    resize: vertical;
}

.order-form-grid input:focus,
.order-form-grid select:focus,
.order-form-grid textarea:focus {
    border-color: #64748b;
    outline: 3px solid rgba(100, 116, 139, .12);
}

.order-form-wide {
    grid-column: 1 / -1;
}

@media (max-width: 1100px) {
    .registry-filters {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .order-summary-cards {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }

    .order-details-heading {
        grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    }

    .schedule-assignments {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .registry-filters {
        grid-template-columns: 1fr;
    }

    .order-details-selector {
        width: 100%;
    }

    .order-details-heading {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .schedule-status-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .schedule-status-heading .order-status-control {
        width: 100%;
    }


    .order-form-grid {
        grid-template-columns: 1fr;
    }

    .chamber-diameter-field {
        grid-column: 1;
        grid-template-columns: 1fr;
    }

    .diameter-unit-options {
        align-items: center;
        padding-bottom: 0;
    }

    .order-summary-cards,
    .order-details-grid,
    .order-detail-section dl {
        grid-template-columns: 1fr;
    }

    .schedule-grid {
        grid-template-columns: 1fr;
    }

    #details-schedule-form { grid-template-columns: 1fr; }

    #details-schedule-form .schedule-grid { grid-template-columns: 1fr; }

    .schedule-grid-header {
        display: none;
    }

    .schedule-cost-period span {
        grid-column: auto;
    }

    .schedule-grid-single input { grid-column: auto; }

    .gantt-row { grid-template-columns: 65px minmax(0, 1fr); gap: 8px; }
    .gantt-timeline { inset-inline: 40px; }
    .gantt-marker b { display: none; }
    .gantt-scale { margin-left: 73px; }

    .schedule-locations {
        grid-template-columns: 1fr;
    }

    .hours-analysis-layout {
        grid-template-columns: 1fr;
    }

    .cost-analysis-layout {
        grid-template-columns: 1fr;
    }

    .hours-analysis-layout .hyd-table-host {
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
    }

    .cost-analysis-layout .hyd-table-host {
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
    }

    .hours-chart-wrap {
        padding-left: 20px;
    }

    .cost-chart-wrap {
        padding-left: 20px;
    }
}
/* Operations analytics */
.operations-controls { display: flex; align-items: center; gap: 1rem; flex: 0 1 auto; min-width: 0; margin-left: auto; flex-wrap: nowrap; white-space: nowrap; overflow-x: auto; padding: .1rem 0 .35rem; }
.operations-controls label { display: inline-flex; align-items: center; gap: .5rem; flex: 0 0 auto; color: #475569; font-size: .875rem; font-weight: 500; }
.operations-controls select { min-width: 11rem; padding: .5rem .7rem; border: 1px solid #cbd5e1; border-radius: .6rem; background: white; color: #0f172a; font: inherit; font-size: .875rem; }
.operations-panel-header { align-items: center; }
.operations-period { display: flex; align-items: center; gap: 1rem; margin: 0; padding: 0; border: 0; color: #475569; font-size: .875rem; font-weight: 500; }
.operations-period label { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; white-space: nowrap; }
.operations-period input { margin: 0; accent-color: var(--accent); }
.operations-note { color: var(--muted); font-size: .875rem; }
.operations-table-wrap { overflow: auto; max-height: min(72vh, 850px); border-top: 1px solid var(--line); background: var(--panel); }
.operations-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: .875rem; }
.operations-table th, .operations-table td { padding: .7rem 1rem; border-bottom: 1px solid #e8edf3; white-space: nowrap; }
.operations-table thead th { position: sticky; top: 0; z-index: 2; background: #f4f7fb; color: #334155; font-weight: 650; text-align: right; border-bottom-color: #d5deea; }
.operations-table thead th:not(:first-child), .operations-table tbody td { min-width: 6.8rem; }
.operations-table thead th:first-child, .operations-table tbody th { position: sticky; left: 0; min-width: 22rem; text-align: left; background: white; }
.operations-table thead th:first-child { z-index: 3; background: #f4f7fb; }
.operations-table tbody th { z-index: 1; font-weight: 500; }
.operations-table tbody td { text-align: right; font-variant-numeric: tabular-nums; }
.operations-cell-link { color: #1d4ed8; font-weight: 600; text-decoration: underline; text-decoration-color: #bfdbfe; text-underline-offset: .2em; }
.operations-cell-link:hover, .operations-cell-link:focus-visible { color: #1e40af; text-decoration-color: currentColor; }
.operations-table tbody tr:not(.operations-section):hover th, .operations-table tbody tr:not(.operations-section):hover td { background: #f8fbff; }
.operations-table .operations-section th, .operations-table .operations-section td { background: #eaf1f8; color: #213f60; border-bottom-color: #d5e1ee; border-top: 7px solid white; padding-top: .55rem; padding-bottom: .55rem; }
.operations-table .operations-section th { font-weight: 700; }
.operations-table .operations-child th { padding-left: 2rem; color: #64748b; font-weight: 400; }
.operations-toggle { display: inline-flex; align-items: center; gap: .4rem; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; appearance: none; color: inherit; font: inherit; font-weight: inherit; text-align: left; cursor: pointer; }
.operations-toggle:hover, .operations-toggle:focus-visible { color: #1d4ed8; }
.operations-toggle::before { content: '›'; display: inline-block; width: .65rem; color: #94a3b8; font-size: 1rem; font-weight: 400; line-height: 1; transition: transform .15s ease; }
.operations-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.operations-note { margin-top: .8rem; }
.panel-footer.operations-note { margin-top: 0; }
@media (max-width: 640px) { .operations-table thead th:first-child, .operations-table tbody th { min-width: 15rem; } }

/* Clockify hours analytics */
.clockify-filters { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; flex-wrap: wrap; }
.clockify-filters label { display: inline-flex; align-items: center; gap: .45rem; color: #475569; font-size: .875rem; font-weight: 500; }
.clockify-filters select, .clockify-filters input, #clockify-groups-button { min-height: var(--control-height); padding: .45rem .7rem; border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--panel); color: var(--text); font: inherit; font-size: .875rem; }
.clockify-groups-filter { position: relative; }
#clockify-groups-button { min-width: 10rem; text-align: left; }
#clockify-groups-button::after { content: '⌄'; float: right; margin-left: .75rem; color: #64748b; }
.clockify-groups-menu { position: absolute; z-index: 20; top: calc(100% + .35rem); right: 0; width: 18rem; max-height: 20rem; overflow: auto; padding: .35rem; border: 1px solid #cbd5e1; border-radius: .65rem; background: white; box-shadow: 0 12px 30px rgba(15, 23, 42, .16); }
.clockify-groups-menu label { display: flex; align-items: center; gap: .65rem; padding: .5rem .55rem; border-radius: .4rem; cursor: pointer; }
.clockify-groups-menu label:hover { background: #f1f5f9; }
.clockify-groups-menu label span { display: grid; }
.clockify-groups-menu small { color: #64748b; font-weight: 400; }
.clockify-custom-dates { display: inline-flex; gap: .5rem; }
.clockify-custom-dates[hidden] { display: none; }
.clockify-custom-dates input { width: 17rem; cursor: pointer; }
.flatpickr-calendar { border: 1px solid #dbe3ed; border-radius: .7rem; box-shadow: 0 14px 35px rgba(15, 23, 42, .18); font-family: inherit; }
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange, .flatpickr-day.selected.inRange, .flatpickr-day.startRange.inRange, .flatpickr-day.endRange.inRange { border-color: #1d4ed8; background: #1d4ed8; }
.flatpickr-day.inRange { border-color: #dbeafe; background: #dbeafe; box-shadow: -5px 0 0 #dbeafe, 5px 0 0 #dbeafe; }
.clockify-date-presets { display: flex; gap: .35rem; width: 100%; padding: .65rem; border-top: 1px solid #e2e8f0; background: #f8fafc; }
.clockify-date-presets button { flex: 1 1 auto; padding: .4rem .5rem; border: 1px solid #cbd5e1; border-radius: .4rem; background: white; color: #334155; font-size: .72rem; white-space: nowrap; cursor: pointer; }
.clockify-date-presets button:hover, .clockify-date-presets button:focus-visible { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; }
.clockify-table-wrap { max-height: 46vh; overflow: auto; border-top: 1px solid var(--line); background: var(--panel); }
.clockify-table { width: 100%; min-width: 520px; font-size: .875rem; }
.clockify-table th, .clockify-table td { padding: .68rem .85rem; border-bottom: 1px solid #e8edf3; text-align: left; }
.clockify-table thead th { position: sticky; z-index: 2; top: 0; background: #f4f7fb; color: #334155; font-weight: 650; }
.clockify-table th:last-child, .clockify-table td:last-child { width: 7rem; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.clockify-table tfoot td { position: sticky; z-index: 2; bottom: 0; background: #f4f7fb; font-weight: 700; }
.clockify-table tbody tr:hover td { background: #f8fbff; }
.clockify-level-0 td:first-child { font-weight: 700; }
.clockify-level-1 td:first-child { padding-left: 2rem; font-weight: 600; }
.clockify-level-2 td:first-child { padding-left: 3.15rem; }
.clockify-level-3 td:first-child { padding-left: 4.3rem; }
.clockify-level-4 td:first-child { padding-left: 5.45rem; color: #475569; }
.clockify-tree-toggle { display: inline-flex; align-items: center; gap: .4rem; margin: 0; padding: 0; border: 0; border-radius: 0; appearance: none; background: transparent; box-shadow: none; color: inherit; font: inherit; font-weight: inherit; line-height: inherit; text-align: left; cursor: pointer; }
.clockify-tree-toggle:hover, .clockify-tree-toggle:focus, .clockify-tree-toggle:active { border: 0; background: transparent; box-shadow: none; color: #1d4ed8; outline: none; }
.clockify-tree-toggle:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.clockify-tree-toggle::before { content: '›'; width: .55rem; color: #94a3b8; font-size: 1rem; transition: transform .15s ease; }
.clockify-tree-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.clockify-tree-toggle--icon { margin-right: .4rem; }
.clockify-jira-detail-link, .clockify-entry-table-link { margin: 0; padding: 0; border: 0; background: transparent; color: #1d4ed8; font: inherit; text-align: left; text-decoration: underline; text-decoration-color: #bfdbfe; text-underline-offset: .2em; cursor: pointer; }
.clockify-jira-detail-link:hover, .clockify-jira-detail-link:focus-visible, .clockify-entry-table-link:hover, .clockify-entry-table-link:focus-visible { color: #1e40af; text-decoration-color: currentColor; }
.clockify-hours-chart { position: relative; height: 330px; margin-top: 1.5rem; padding: 0 0 3.2rem 3.5rem; overflow-x: auto; }
.clockify-chart-y { position: absolute; top: 0; bottom: 3.2rem; left: 0; width: 3rem; color: #64748b; font-size: .72rem; }
.clockify-chart-y span { position: absolute; right: 0; transform: translateY(50%); }
.clockify-chart-grid { position: absolute; z-index: 0; top: 0; right: 0; bottom: 3.2rem; left: 3.5rem; min-width: calc(100% - 3.5rem); }
.clockify-chart-grid i { position: absolute; right: 0; left: 0; border-top: 1px solid #e2e8f0; }
.clockify-chart-columns { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 1rem; width: max-content; min-width: 100%; height: 100%; }
.clockify-chart-column { position: relative; display: grid; grid-template-rows: 1.15rem 1fr 2.8rem; width: max(54px, calc((100vw - 360px) / 12)); max-width: 110px; height: 100%; text-align: center; }
.clockify-chart-value { color: #475569; font-size: .7rem; font-weight: 650; }
.clockify-chart-stack { display: flex; flex-direction: column-reverse; justify-content: flex-start; align-self: stretch; overflow: hidden; border-radius: .35rem .35rem 0 0; }
.clockify-chart-segment { display: block; min-height: 2px; cursor: help; }
.clockify-chart-segment:hover { filter: brightness(.88); }
.clockify-chart-person { overflow: hidden; padding-top: .45rem; color: #334155; font-size: .72rem; line-height: 1.1; text-overflow: ellipsis; }
.clockify-gantt { overflow: auto; max-height: 58vh; border-top: 1px solid var(--line); }
.clockify-gantt-header, .clockify-gantt-row, .clockify-gantt-group { display: grid; grid-template-columns: 12rem minmax(900px, 1fr); min-width: 1080px; }
.clockify-gantt-header { position: sticky; z-index: 5; top: 0; height: 2.5rem; border-bottom: 1px solid #cbd5e1; background: #f8fafc; }
.clockify-gantt-header > div:first-child { position: sticky; z-index: 6; left: 0; background: #f8fafc; }
.clockify-gantt-axis { position: relative; }
.clockify-gantt-axis span { position: absolute; bottom: .55rem; transform: translateX(-50%); color: #64748b; font-size: .72rem; white-space: nowrap; }
.clockify-gantt-axis span.is-day { font-weight: 700; }
.clockify-gantt-row { min-height: 2.65rem; border-bottom: 1px solid #e8edf3; }
.clockify-gantt-row > strong { position: sticky; z-index: 3; left: 0; display: flex; align-items: center; overflow: hidden; padding: 0 .75rem; border-right: 1px solid #dbe3ed; background: white; color: #334155; font-size: .8rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.clockify-gantt-row:nth-child(even) > strong, .clockify-gantt-row:nth-child(even) .clockify-gantt-track { background-color: #fbfdff; }
.clockify-gantt-group { position: sticky; z-index: 4; left: 0; min-height: 2rem; border-bottom: 1px solid #d5e1ee; background: #eaf1f8; }
.clockify-gantt-group strong { position: sticky; left: 0; display: flex; align-items: center; padding: 0 .75rem; background: #eaf1f8; color: #213f60; font-size: .8rem; font-weight: 700; }
.clockify-gantt-group span { background: #eaf1f8; }
.clockify-gantt-track { position: relative; min-height: 2.65rem; background: white; }
.clockify-gantt-track i { position: absolute; top: 0; bottom: 0; border-left: 1px solid #edf1f5; }
.clockify-gantt-track i.is-day { border-left-width: 2px; border-left-color: #cbd5e1; }
.clockify-gantt-bar { position: absolute; z-index: 2; top: .55rem; height: 1.55rem; min-width: 3px; border-radius: .2rem; cursor: help; opacity: .9; }
.clockify-gantt-bar:hover { z-index: 4; filter: brightness(.85); opacity: 1; }
.clockify-gantt-bar:focus-visible { z-index: 5; outline: 2px solid #0f172a; outline-offset: 2px; opacity: 1; }
.clockify-entry-dialog { width: min(620px, calc(100vw - 32px)); }
.clockify-entry-details { display: grid; gap: 0; border: 1px solid #e2e8f0; border-radius: .65rem; overflow: hidden; }
.clockify-entry-details > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1rem; padding: .7rem .85rem; border-bottom: 1px solid #e8edf3; }
.clockify-entry-details > div:last-child { border-bottom: 0; }
.clockify-entry-details dt { color: #64748b; font-size: .8rem; font-weight: 600; }
.clockify-entry-details dd { min-width: 0; color: #1e293b; font-size: .875rem; overflow-wrap: anywhere; }
@media (max-width: 900px) { .clockify-filters { justify-content: flex-start; } }

/* Operations monitoring */
#monitoring-refresh:disabled { opacity: .6; cursor: wait; }
.monitoring-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.monitoring-total, .monitoring-section-heading span { color: #475569; font-size: .875rem; }
.monitoring-section-heading { margin: 0; }
.monitoring-section-heading h2 { font-size: 1.35rem; font-weight: 650; }
.monitoring-section-heading a { color: #1d4ed8; text-decoration: underline; text-decoration-color: #bfdbfe; text-underline-offset: .2em; }
.monitoring-cnc-grid { gap: var(--space-4); }
.monitoring-cnc-right { display: grid; align-content: start; gap: 1rem; min-width: 0; }
.monitoring-bars { margin-top: .9rem; overflow-x: auto; }
.monitoring-bar-row { display: grid; grid-template-columns: minmax(9rem, 1.2fr) 3.5rem minmax(7rem, 3fr) 3.2rem; align-items: center; gap: .65rem; min-height: 2.25rem; font-size: .875rem; }
.monitoring-bar-row--hours, .monitoring-bar-header, .monitoring-bar-total { grid-template-columns: minmax(9rem, 1.2fr) 3.5rem minmax(7rem, 3fr) 3.2rem 3.5rem 3.5rem 3.2rem 3.2rem; }
.monitoring-bar-row--hours, .monitoring-bar-header, .monitoring-bar-total { min-width: 780px; }
#monitoring-current .monitoring-bar-row--hours,
#monitoring-current .monitoring-bar-header,
#monitoring-current .monitoring-bar-total {
    grid-template-columns: minmax(7rem, 1.1fr) 2.8rem minmax(5rem, 2.4fr) 2.7rem 3rem 3rem 2.75rem 2.75rem;
    min-width: 0;
    gap: .45rem;
}
#monitoring-current .monitoring-hours-heading,
#monitoring-current .monitoring-missing-heading { gap: .45rem; }
.monitoring-bar-header, .monitoring-bar-total { display: grid; align-items: end; gap: .65rem; }
.monitoring-bar-header { min-height: 2.8rem; color: #64748b; font-size: .72rem; font-weight: 650; text-align: right; }
.monitoring-hours-heading, .monitoring-missing-heading { display: grid; grid-template-columns: repeat(2, 1fr); gap: .65rem; text-align: center; }
.monitoring-hours-heading { grid-column: 5 / span 2; }
.monitoring-missing-heading { grid-column: 7 / span 2; }
.monitoring-hours-heading strong, .monitoring-missing-heading strong { grid-column: 1 / -1; font-size: .72rem; }
.monitoring-hours-heading small, .monitoring-missing-heading small { padding-top: .2rem; border-top: 1px solid #dbe3ed; font-size: .68rem; font-weight: 650; }
.monitoring-hours-total-tooltip { position: relative; cursor: help; }
.monitoring-hours-total-tooltip::after { position: absolute; z-index: 10; right: 0; bottom: calc(100% + 7px); width: 280px; padding: .55rem .65rem; border-radius: .45rem; background: #1e293b; box-shadow: 0 8px 20px rgba(15, 23, 42, .2); color: #fff; content: attr(data-tooltip); font-size: .7rem; font-weight: 500; line-height: 1.35; opacity: 0; pointer-events: none; text-align: left; transform: translateY(4px); transition: opacity .15s ease, transform .15s ease; }
.monitoring-hours-total-tooltip:hover::after, .monitoring-hours-total-tooltip:focus-visible::after { opacity: 1; transform: translateY(0); }
.monitoring-hours-total-tooltip:focus-visible { border-radius: 2px; outline: 2px solid #93c5fd; outline-offset: 2px; }
.monitoring-row-hours, .monitoring-row-data { color: #475569; font-variant-numeric: tabular-nums; text-align: right; }
.monitoring-row-hours--excluded { color: #a8b0bc; }
.monitoring-row-data { color: #1d4ed8; text-decoration: underline; text-decoration-color: #bfdbfe; text-underline-offset: .2em; }
.monitoring-row-data:hover { color: #1e40af; text-decoration-color: currentColor; }
.monitoring-bar-total { min-height: 2.5rem; border-top: 1px solid #cbd5e1; color: #334155; font-size: .8rem; font-variant-numeric: tabular-nums; text-align: right; }
.monitoring-bar-total strong:first-child { text-align: left; }
.monitoring-bar-row + .monitoring-bar-row { border-top: 1px solid #f1f5f9; }
.monitoring-row-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monitoring-row-name, .monitoring-row-count { color: #1d4ed8; text-decoration: none; }
.monitoring-row-name:hover, .monitoring-row-count:hover, .monitoring-legend-item:hover { text-decoration: underline; }
.monitoring-row-count, .monitoring-row-percent { font-variant-numeric: tabular-nums; }
.monitoring-row-percent { color: #475569; text-align: right; }
.monitoring-bar-track { height: .35rem; border-radius: 1rem; background: #e8f0fc; overflow: hidden; }
.monitoring-bar-fill { height: 100%; border-radius: inherit; background: #2563eb; }
.monitoring-stack { display: flex; height: 2.8rem; overflow: hidden; border-radius: .3rem; background: #e2e8f0; }
.monitoring-segment { display: flex; align-items: center; justify-content: center; min-width: 0; color: white; font-weight: 650; font-size: .9rem; text-decoration: none; font-variant-numeric: tabular-nums; }
.monitoring-segment:hover { filter: brightness(.93); }
.monitoring-legend { display: flex; flex-wrap: wrap; gap: .45rem 1rem; margin-top: .9rem; }
.monitoring-legend-item { display: inline-flex; align-items: center; gap: .35rem; color: #334155; font-size: .8rem; text-decoration: none; }
.monitoring-legend-item strong { font-variant-numeric: tabular-nums; font-weight: 600; }
.monitoring-swatch { display: inline-block; width: .55rem; height: .55rem; flex: 0 0 auto; border-radius: .1rem; }
.monitoring-path-0 { background: #2563eb; }
.monitoring-path-1 { background: #0f9f6e; }
.monitoring-path-2 { background: #7c3aed; }
.monitoring-path-3 { background: #0891b2; }
.monitoring-path-4 { background: #e75a24; }
.monitoring-path-5 { background: #64748b; }
.monitoring-due-overdue { background: #ef553f; }
.monitoring-due-this_week { background: #fb923c; }
.monitoring-due-next_week { background: #fbbf24; color: #422006; }
.monitoring-due-later { background: #0f9f6e; }
.monitoring-empty { margin-top: .75rem; color: #64748b; font-size: .875rem; }
.monitoring-table-scroll { max-height: 38rem; overflow: auto; border-top: 1px solid var(--line); }
.monitoring-material-table { width: 100%; min-width: 850px; border-collapse: separate; border-spacing: 0; font-size: .825rem; }
.monitoring-material-table th, .monitoring-material-table td { padding: .65rem .75rem; border-bottom: 1px solid #e8edf3; text-align: left; vertical-align: top; }
.monitoring-material-table thead th { position: sticky; top: 0; z-index: 1; background: #f4f7fb; color: #334155; font-weight: 650; white-space: nowrap; }
.monitoring-material-table th button { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.monitoring-material-table th button:hover { color: #1d4ed8; }
.monitoring-material-table th[aria-sort="ascending"] button::after { content: " ↑"; }
.monitoring-material-table th[aria-sort="descending"] button::after { content: " ↓"; }
.monitoring-material-table tbody tr:last-child td { border-bottom: 0; }
.monitoring-material-table tbody tr:hover { background: #f8fafc; }
.monitoring-material-table a { color: #1d4ed8; text-decoration: underline; text-decoration-color: #bfdbfe; text-underline-offset: .2em; }
.monitoring-material-table .monitoring-description { min-width: 12rem; max-width: 27rem; overflow-wrap: anywhere; }
.monitoring-material-table .monitoring-number, .monitoring-material-table .monitoring-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.monitoring-material-table tr.is-overdue td, .monitoring-material-table tr.is-overdue a { color: #7f1d1d; }
.monitoring-material-table tr.is-overdue a { text-decoration-color: #f3c5c5; }
.monitoring-drawing-preview { position: fixed; z-index: 1000; overflow: hidden; border: 1px solid #cbd5e1; border-radius: .6rem; background: white; box-shadow: 0 18px 50px rgba(15, 23, 42, .24); pointer-events: none; }
.monitoring-drawing-preview[hidden] { display: none; }
.monitoring-drawing-preview iframe { display: block; width: 100%; height: 100%; border: 0; }
@media (max-width: 900px) { .monitoring-cnc-grid { grid-template-columns: 1fr; } }
@media (max-width: 540px) { .monitoring-bar-row { grid-template-columns: minmax(6rem, 1fr) 2.5rem minmax(3rem, 1fr) 2.7rem; gap: .4rem; font-size: .75rem; } }
