/* Dashboard Wujka — Warm Slate Theme */
/* Not too dark, not too light — "wujkowy" theme */

/* ─── Base ─── */
body {
    background-color: #1c2633;
    color: #cfd8e3;
}

/* ─── Production unlock screen ─── */
.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top, rgba(93, 173, 226, 0.12), transparent 42%),
        #1c2633;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.login-card {
    width: min(100%, 30rem);
    padding: 2rem;
    text-align: center;
    background: linear-gradient(135deg, #243040 0%, #1f2a3a 100%);
    border: 1px solid #2d3e52;
    border-radius: 0.75rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.3);
}

.login-icon {
    display: grid;
    place-items: center;
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    color: #5dade2;
    font-size: 2rem;
    background: rgba(93, 173, 226, 0.12);
    border: 1px solid rgba(93, 173, 226, 0.28);
    border-radius: 50%;
}

.login-security-note {
    margin-top: 1.5rem;
    color: rgb(170, 190, 210);
    font-size: 0.82rem;
}

.locked-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
    text-align: center;
    background: #1c2633;
}

/* ─── Navbar ─── */
.navbar {
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    background: #1f2a3a !important;
    border-bottom: 1px solid #2a3a4e !important;
}

.navbar .navbar-brand,
.navbar .nav-link {
    color: #cfd8e3;
}

.navbar .nav-link.active {
    color: #5dade2 !important;
}

/* ─── Cards ─── */
.card {
    background-color: #243040;
    border: 1px solid #2d3e52;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    border-radius: 0.5rem;
}

.card-header {
    background-color: #1f2a3a;
    border-bottom: 1px solid #2d3e52;
    font-weight: 600;
    color: #d4dce4;
}

/* ─── Tables ─── */
.table {
    color: #cfd8e3;
    margin-bottom: 0;
    /* ⚠️ CRITICAL: Neutralize Bootstrap's solid dark cell background.
       Bootstrap paints --bs-table-bg (solid #212529 in dark mode) on
       EVERY <td>/<th>. Cells sit ABOVE rows in the paint stack, so
       any background set on <tr> is invisible. We must:
       1. Zero out --bs-table-bg so cells become transparent
       2. Target <td>/<th> directly for glass backgrounds
    */
    --bs-table-bg: transparent;
    --bs-table-accent-bg: transparent;
}

.table thead th {
    border-bottom-color: rgba(45, 62, 82, 0.5);
    background: rgba(31, 42, 58, 0.75);
    color: #8a9db5;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 2;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(45, 62, 82, 0.5);
}

/* Dark rows — jak tło card-header (#1f2a3a), ciemne i spokojne.
   ⚠️ Target <td>/<th> directly, NOT <tr>.
   Bootstrap's `> :not(caption) > * > *` paints bg on cells,
   which sit ABOVE rows. <tr> background is invisible behind cells. */
.table td, .table th {
    background-color: #1f2a3a;
    transition: background-color 0.2s ease;
    border: none;
    vertical-align: middle;
    padding: 0.75rem 0.85rem;
}

/* Even rows — minimalnie jaśniejsze żeby było widać podział */
.table tbody tr:nth-child(even) > td,
.table tbody tr:nth-child(even) > th {
    background-color: #233141;
}

/* Hover — Boostrap uses box-shadow:inset with --bs-table-bg-state.
   We must zero it AND set our own bg-color. Also clear background-image
   so the first-column gradient doesn't stack on top of hover color. */
.table-hover tbody tr:hover > td,
.table-hover tbody tr:hover > th,
.table-hover tbody tr:hover {
    box-shadow: none !important;
    background-color: rgba(93, 173, 226, 0.24);
    background-image: none !important;
}

/* Clickable row hover — same logic, target cells not row */
.clickable-row {
    cursor: pointer;
}
.clickable-row:hover > td,
.clickable-row:hover > th {
    box-shadow: none !important;
    background-color: rgba(93, 173, 226, 0.24);
    background-image: none !important;
}

/* ─── First column gradient — kolor dopasowany do statusu ─── */
/* Domyślnie bardzo subtelny niebieski dla wierszy bez statusu */
.table td:first-child {
    background-image: linear-gradient(
        to right,
        rgba(93, 173, 226, 0.06) 0%,
        transparent 50%
    );
}

/* ─── Closed — zielony gradient + lewy pasek ─── */
tr.row-closed > td:first-child {
    background-image: linear-gradient(
        to right,
        rgba(76, 217, 100, 0.30) 0%,
        rgba(76, 217, 100, 0.08) 45%,
        transparent 100%
    );
    box-shadow: inset 4px 0 0 rgba(76, 217, 100, 0.45);
}
tr.row-closed:nth-child(even) > td:first-child {
    background-image: linear-gradient(
        to right,
        rgba(76, 217, 100, 0.35) 0%,
        rgba(76, 217, 100, 0.12) 45%,
        transparent 100%
    );
}

/* ─── Open — niebieski gradient + lewy pasek ─── */
tr.row-open > td:first-child {
    background-image: linear-gradient(
        to right,
        rgba(93, 173, 226, 0.30) 0%,
        rgba(93, 173, 226, 0.08) 45%,
        transparent 100%
    );
    box-shadow: inset 4px 0 0 rgba(93, 173, 226, 0.45);
}
tr.row-open:nth-child(even) > td:first-child {
    background-image: linear-gradient(
        to right,
        rgba(93, 173, 226, 0.35) 0%,
        rgba(93, 173, 226, 0.12) 45%,
        transparent 100%
    );
}

/* ─── Overdue — czerwony gradient + lewy pasek ─── */
tr.row-overdue > td:first-child {
    background-image: linear-gradient(
        to right,
        rgba(255, 107, 107, 0.30) 0%,
        rgba(255, 107, 107, 0.08) 45%,
        transparent 100%
    );
    box-shadow: inset 4px 0 0 rgba(255, 107, 107, 0.55);
}
tr.row-overdue:nth-child(even) > td:first-child {
    background-image: linear-gradient(
        to right,
        rgba(255, 107, 107, 0.35) 0%,
        rgba(255, 107, 107, 0.12) 45%,
        transparent 100%
    );
}

/* Brighter secondary text — wujek ma słaby wzrok, a te szarości są ledwo widoczne */
.table, .card, .container-fluid {
    --bs-secondary-rgb: 170, 190, 210;
}

/* ─── Stat Cards ─── */
.stat-card {
    text-align: center;
    padding: 1.15rem 0.75rem;
    border-radius: 0.5rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border-left: 4px solid #2d3e52;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}

.stat-card .stat-value {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: #8a9db5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.2rem;
}

.stat-card-success .stat-value { color: #4cd964; }
.stat-card-warning .stat-value { color: #f5a623; }
.stat-card-danger .stat-value { color: #ff6b6b; }
.stat-card-info .stat-value { color: #5dade2; }

.stat-card-success { border-left-color: #4cd964; }
.stat-card-warning { border-left-color: #f5a623; }
.stat-card-danger { border-left-color: #ff6b6b; }
.stat-card-info { border-left-color: #5dade2; }
.stat-card-primary { border-left-color: #5dade2; }
.stat-card-secondary { border-left-color: #5a6d85; }

.stat-card-primary .stat-value { color: #5dade2; }
.stat-card-secondary .stat-value { color: #5a6d85; }

/* ─── Efficiency ─── */
.badge-efficiency {
    font-size: 0.85rem;
    padding: 0.35em 0.65em;
    font-weight: 600;
}

.efficiency-good { color: #4cd964 !important; }
.efficiency-bad { color: #ff6b6b !important; }
.efficiency-neutral { color: #f5a623 !important; }

/* ─── Buttons ─── */
.btn-outline-secondary {
    border-color: #2d3e52;
    color: #8a9db5;
}

.btn-outline-secondary:hover {
    background-color: #2d3e52;
    color: #e0e8f0;
}

/* ─── Forms ─── */
.form-control, .form-select {
    background-color: #1f2a3a;
    border-color: #2d3e52;
    color: #cfd8e3;
}

.form-control:focus, .form-select:focus {
    background-color: #243040;
    border-color: #5dade2;
    color: #e0e8f0;
    box-shadow: 0 0 0 0.2rem rgba(93, 173, 226, 0.2);
}

/* ─── Misc ─── */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

.search-box {
    max-width: 300px;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background-color: #2a3a4e !important;
}

/* ─── Profile Header ─── */
.profile-header {
    background: linear-gradient(135deg, #243040 0%, #1f2a3a 100%);
    border: 1px solid #2d3e52;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.profile-header .profile-name {
    font-size: 1.5rem;
    font-weight: 700;
}

.profile-header .profile-detail {
    color: #8a9db5;
    font-size: 0.9rem;
}

.profile-header .profile-detail i {
    width: 1.2rem;
    margin-right: 0.3rem;
    color: #6a7d95;
}

/* ─── Order Header ─── */
.order-header {
    background: linear-gradient(135deg, #243040 0%, #1f2a3a 100%);
    border: 1px solid #2d3e52;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.order-header .order-number {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: monospace;
}

.order-header .profile-detail {
    color: #8a9db5;
    font-size: 0.9rem;
}

.order-header .profile-detail i {
    width: 1.2rem;
    margin-right: 0.3rem;
    color: #6a7d95;
}

/* ─── Timeline ─── */
.timeline {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    padding: 0.75rem 0;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 110px;
    position: relative;
    text-align: center;
}

.timeline-item .timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4cd964;
    margin-bottom: 0.4rem;
}

.timeline-item .timeline-label {
    font-size: 0.78rem;
    color: #8a9db5;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.timeline-item .timeline-date {
    font-size: 0.9rem;
    font-weight: 600;
}

.timeline-connector {
    flex: 1;
    height: 2px;
    background: #2d3e52;
    min-width: 25px;
}

/* ─── Pagination ─── */
.pagination-info {
    color: #8a9db5;
    font-size: 0.85rem;
}

/* ─── Hala ─── */
.hala-employee-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: default;
}

.hala-employee-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}

.hala-employee-card.border-success {
    border-left: 4px solid #4cd964 !important;
}

.hala-employee-card.border-secondary {
    border-left: 4px solid #5a6d85 !important;
}

/* ─── Animations ─── */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.pulse-dot {
    animation: pulse-dot 2s ease-in-out infinite;
    display: inline-block;
}

/* ─── Progress ─── */
.progress {
    background-color: #1a2332;
    border-radius: 0.25rem;
}

.progress-bar {
    font-size: 0.78rem;
    font-weight: 600;
}

/* ─── Footer ─── */
footer {
    color: #5a6d85 !important;
    border-top-color: #2d3e52 !important;
}

/* ─── Help Modal ─── */
.modal-content {
    border: 1px solid #2d3e52;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.3);
}

.modal-header {
    background-color: #1f2a3a;
    border-bottom-color: #2d3e52;
}

.modal-footer {
    background-color: #1f2a3a;
    border-top-color: #2d3e52;
}

/* ─── Section Title ─── */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: #d4dce4;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #2d3e52;
}

.section-title i {
    color: #5dade2;
}

/* ─── Order Detail: Operation Flow Cards ─── */
.op-flow-card {
    border-left: 4px solid #3a4a5e;
    transition: all 0.2s ease;
    margin-bottom: 0.75rem;
}

.op-flow-card:hover {
    border-left-color: #5dade2;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.op-flow-card.op-closed {
    border-left-color: #4cd964;
}

.op-flow-card.op-in-progress {
    border-left-color: #5dade2;
}

.op-flow-card.op-open {
    border-left-color: #5a6d85;
}

/* Operation bar */
.op-bar-track {
    background: #1a2332;
    border-radius: 4px;
    height: 24px;
    position: relative;
    overflow: hidden;
}

.op-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    position: relative;
}

.op-bar-fill.closed { background: linear-gradient(90deg, #2ea043, #4cd964); }
.op-bar-fill.in-progress { background: linear-gradient(90deg, #2b6eb0, #5dade2); }
.op-bar-fill.open { background: linear-gradient(90deg, #4a5a6e, #6a7d95); }

.op-bar-label {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    white-space: nowrap;
}

/* Norm vs actual comparison bar */
.compare-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.compare-bar .bar-track {
    flex: 1;
    height: 20px;
    background: #1a2332;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.compare-bar .norm-mark {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background: #ff6b6b;
    z-index: 2;
}

.compare-bar .actual-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #2b6eb0, #5dade2);
    transition: width 0.5s ease;
}

/* Employee chips */
.emp-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    background: #1f2a3a;
    border-radius: 1rem;
    font-size: 0.8rem;
    color: #cfd8e3;
    border: 1px solid #2d3e52;
}

.emp-chip .eff-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.emp-chip .eff-dot.good { background: #4cd964; }
.emp-chip .eff-dot.neutral { background: #f5a623; }
.emp-chip .eff-dot.bad { background: #ff6b6b; }

/* ─── KPI Grid Responsive ─── */
@media (max-width: 768px) {
    .order-header .order-number {
        font-size: 1.15rem;
    }
    .stat-card .stat-value {
        font-size: 1.4rem;
    }
}

/* ─── Summary row in operation cards ─── */
.op-summary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    font-size: 0.85rem;
}

.op-summary-row .ops-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #8a9db5;
}

.op-summary-row .ops-item strong {
    color: #cfd8e3;
}

/* ─── Work Chronology Timeline ─── */
.timeline-day {
    border-bottom: 1px solid #2d3e52;
    padding: 1rem 1.25rem;
}

.timeline-day:last-child {
    border-bottom: none;
}

.timeline-day-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #d4dce4;
    font-size: 0.95rem;
}

.timeline-day-header i {
    color: #5dade2;
}

.timeline-day-date {
    font-weight: 700;
}

.timeline-day-summary {
    margin-left: auto;
    color: #8a9db5;
    font-size: 0.8rem;
    font-weight: 500;
}

.timeline-day-track {
    background: #1a2332;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

.timeline-axis {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #5a6d85;
    margin-bottom: 0.5rem;
    padding: 0 0.25rem;
    border-bottom: 1px solid #2d3e52;
    padding-bottom: 0.25rem;
}



.timeline-bars {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.timeline-bar-row {
    position: relative;
    height: 28px;
}

.timeline-bar {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, #5dade2, #3498db);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.6rem;
    font-size: 0.8rem;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6), 0 0 6px rgba(0,0,0,0.3);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    min-width: 4px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.timeline-bar:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    z-index: 10;
}

.timeline-bar-name {
    font-weight: 600;
    flex-shrink: 0;
    margin-right: 0.5rem;
}

.timeline-bar-time {
    opacity: 0.9;
    font-size: 0.75rem;
    margin-right: auto;
}

.timeline-bar-hours {
    font-weight: 700;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.timeline-bar-narrow .timeline-bar-time,
.timeline-bar-narrow .timeline-bar-hours {
    display: none;
}

/* Help icon on column headers — dotted underline + "?" badge */
.col-help {
    border-bottom: 1px dotted #5dade2;
    cursor: help;
}
.col-help::after {
    content: "?";
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    color: #5dade2;
    margin-left: 4px;
    border: 1px solid #5dade2;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    text-align: center;
    line-height: 14px;
    vertical-align: super;
}
.col-help:hover::after {
    background: #5dade2;
    color: #1c2633;
}

/* Dark theme tooltips for timeline */
.tooltip .tooltip-inner {
    background-color: #1f2a3a;
    border: 1px solid #2d3e52;
    color: #cfd8e3;
    text-align: left;
    max-width: 280px;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
}

.tooltip .tooltip-arrow::before {
    border-top-color: #1f2a3a !important;
    border-bottom-color: #1f2a3a !important;
}

.tooltip {
    z-index: 1080 !important;
}

/* Allow custom Bootstrap color classes in tooltip HTML */
.tooltip-inner .text-success { color: #4cd964 !important; }
.tooltip-inner .text-primary { color: #5dade2 !important; }
.tooltip-inner .text-warning { color: #f5a623 !important; }
.tooltip-inner .text-danger { color: #ff6b6b !important; }
.tooltip-inner .text-info { color: #5bc0de !important; }
.tooltip-inner .text-secondary { color: #8a9db5 !important; }

/* ─── Employee Report: decision-ready A4 summary ─── */
.report-summary-page {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    color: #dce6f2;
}

.report-header-bar {
    background: linear-gradient(135deg, #263547 0%, #1f2a3a 100%);
    border: 1px solid #344a62;
    border-radius: 0.65rem;
    padding: 0.9rem 1.1rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.report-emp-name {
    color: #f2f6fb;
    font-size: 1.5rem;
    font-weight: 750;
    line-height: 1.15;
}

.report-meta-line,
.report-data-range {
    color: #b6c7d9;
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

.report-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 0.75rem;
}

.report-performance-panel,
.report-status-banner {
    min-height: 150px;
    border: 1px solid #344a62;
    border-radius: 0.75rem;
    padding: 1rem 1.1rem;
    overflow: hidden;
    position: relative;
}

.report-performance-panel {
    background: linear-gradient(145deg, rgba(93, 173, 226, 0.15), rgba(31, 42, 58, 0.7));
    border-left: 6px solid #5dade2;
}

.report-performance-panel.performance-danger {
    background: linear-gradient(145deg, rgba(255, 107, 107, 0.18), rgba(31, 42, 58, 0.75));
    border-left-color: #ff6b6b;
}
.report-performance-panel.performance-warning {
    background: linear-gradient(145deg, rgba(245, 166, 35, 0.16), rgba(31, 42, 58, 0.75));
    border-left-color: #f5a623;
}
.report-performance-panel.performance-good,
.report-performance-panel.performance-great {
    background: linear-gradient(145deg, rgba(76, 217, 100, 0.14), rgba(31, 42, 58, 0.75));
    border-left-color: #4cd964;
}
.report-performance-panel.performance-unknown { border-left-color: #8295aa; }

.report-eyebrow,
.report-metric-label {
    color: #b6c7d9;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.report-main-score {
    color: #eef5fb;
    font-size: 3.45rem;
    font-weight: 800;
    line-height: 1;
    margin: 0.3rem 0 0.45rem;
    letter-spacing: -0.04em;
}
.performance-danger .report-main-score { color: #ff8585; }
.performance-warning .report-main-score { color: #ffc45f; }
.performance-good .report-main-score,
.performance-great .report-main-score { color: #65e47b; }

.report-performance-label {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.035em;
}
.report-performance-explanation {
    color: #c4d1df;
    font-size: 0.9rem;
    line-height: 1.35;
    margin-top: 0.35rem;
    max-width: 620px;
}

.report-status-banner {
    background: rgba(31, 42, 58, 0.82);
    border-left: 5px solid #8295aa;
}
.report-status-banner.status-ready { border-left-color: #4cd964; }
.report-status-banner.status-caution { border-left-color: #f5a623; }
.report-status-banner.status-review { border-left-color: #ff6b6b; }

.report-status-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}
.report-status-icon {
    color: #b6c7d9;
    font-size: 1.5rem;
    line-height: 1;
}
.status-ready .report-status-icon { color: #4cd964; }
.status-caution .report-status-icon { color: #f5a623; }
.status-review .report-status-icon { color: #ff6b6b; }
.report-status-title {
    color: #edf3f9;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.035em;
}
.report-status-sub {
    color: #b9c8d8;
    font-size: 0.76rem;
    line-height: 1.3;
    margin-top: 0.15rem;
}
.report-confidence-row {
    display: flex;
    justify-content: space-between;
    color: #b9c8d8;
    font-size: 0.75rem;
    margin-top: 0.8rem;
}
.report-confidence-row strong { color: #edf3f9; }
.report-confidence-track {
    height: 7px;
    background: #17202c;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.35rem;
}
.report-confidence-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
}
.confidence-high { background: #4cd964; }
.confidence-medium { background: #f5a623; }
.confidence-low { background: #ff6b6b; }
.report-coverage-copy {
    color: #c5d2df;
    font-size: 0.76rem;
    margin-top: 0.65rem;
}

.report-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
}
.report-metric-card {
    background: rgba(36, 48, 64, 0.85);
    border: 1px solid #34475d;
    border-top: 3px solid #5dade2;
    border-radius: 0.55rem;
    padding: 0.7rem 0.75rem;
    min-width: 0;
}
.report-metric-card.metric-shared { border-top-color: #8e7dff; }
.report-metric-card.metric-nonorm { border-top-color: #f5a623; }
.report-metric-card.metric-time { border-top-color: #5bc0de; }
.report-metric-value {
    color: #f1f6fb;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0.25rem 0 0.18rem;
}
.report-metric-sub {
    color: #aebfd0;
    font-size: 0.75rem;
    line-height: 1.25;
}

.report-section,
.report-trend-section,
.report-decision-box {
    background: rgba(31, 42, 58, 0.62);
    border: 1px solid #34475d;
    border-radius: 0.6rem;
    padding: 0.75rem 0.85rem;
}
.report-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #e7eef6;
    font-size: 0.8rem;
    font-weight: 750;
    margin-bottom: 0.55rem;
}
.report-section-title > strong {
    color: #b9cadb;
    font-size: 0.78rem;
    font-weight: 650;
}

.report-hours-track {
    display: flex;
    width: 100%;
    height: 14px;
    overflow: hidden;
    background: #151e29;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}
.report-hours-track > span { display: block; min-width: 0; }
.hours-bar-verified, .dot-verified { background: #4cd964; }
.hours-bar-open, .dot-open { background: #5dade2; }
.hours-bar-nonorm, .dot-nonorm { background: #f5a623; }
.hours-bar-other, .dot-other { background: #8295aa; }
.report-hours-legend {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
    margin-top: 0.6rem;
}
.report-hours-legend > div {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.3rem;
    align-items: center;
    color: #b9c8d8;
    font-size: 0.69rem;
    min-width: 0;
}
.report-hours-legend strong { color: #edf3f9; font-size: 0.72rem; }
.report-hours-legend small {
    grid-column: 2 / 4;
    color: #8295aa;
    font-size: 0.62rem;
}
.hours-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.report-explain-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}
.report-explain-card {
    background: rgba(36, 48, 64, 0.9);
    border: 1px solid #34475d;
    border-left: 4px solid #5dade2;
    border-radius: 0.55rem;
    padding: 0.7rem 0.8rem;
}
.report-explain-card.explain-adjustment { border-left-color: #f5a623; }
.report-explain-heading {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.45rem;
    color: #e8eff6;
    font-size: 0.78rem;
    font-weight: 750;
}
.report-explain-heading i { color: #5dade2; }
.explain-adjustment .report-explain-heading i { color: #f5a623; }
.report-explain-heading strong { font-size: 1rem; white-space: nowrap; }
.report-explain-card p {
    color: #b9c8d8;
    font-size: 0.78rem;
    line-height: 1.35;
    margin: 0.45rem 0 0;
}

.report-insights-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
}
.report-insight {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    background: rgba(23, 32, 44, 0.72);
    border-left: 3px solid #5dade2;
    border-radius: 0.35rem;
    color: #d7e1eb;
    font-size: 0.78rem;
    line-height: 1.3;
    padding: 0.5rem 0.6rem;
}
.report-insight i { margin-top: 0.05rem; color: #5dade2; }
.report-insight.insight-danger { border-left-color: #ff6b6b; }
.report-insight.insight-danger i { color: #ff6b6b; }
.report-insight.insight-warning { border-left-color: #f5a623; }
.report-insight.insight-warning i { color: #f5a623; }
.report-insight.insight-good { border-left-color: #4cd964; }
.report-insight.insight-good i { color: #4cd964; }

.report-trend-values {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
}
.report-trend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1a2431;
    border: 1px solid #34475d;
    border-bottom: 3px solid #8295aa;
    border-radius: 0.4rem;
    padding: 0.45rem 0.55rem;
    color: #adbed0;
    font-size: 0.75rem;
}
.report-trend-item strong { color: #edf3f9; font-size: 0.9rem; }
.report-trend-item.performance-danger { border-bottom-color: #ff6b6b; }
.report-trend-item.performance-warning { border-bottom-color: #f5a623; }
.report-trend-item.performance-good,
.report-trend-item.performance-great { border-bottom-color: #4cd964; }

.report-decision-box {
    border: 1px dashed #5a7089;
    padding-bottom: 0.65rem;
}
.report-decision-title {
    color: #e9f0f7;
    font-size: 0.76rem;
    font-weight: 800;
    margin-bottom: 0.45rem;
}
.report-decision-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    color: #c6d3df;
    font-size: 0.69rem;
}
.report-notes-label {
    color: #9dafc1;
    font-size: 0.66rem;
    margin-top: 0.45rem;
}
.report-notes-area {
    height: 4.5rem;
    margin-top: 0.2rem;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 1.35rem,
        #53677d 1.35rem,
        #53677d calc(1.35rem + 1px)
    );
}
.report-signatures {
    display: flex;
    justify-content: flex-end;
    gap: 4rem;
    color: #8295aa;
    font-size: 0.58rem;
    margin-top: 0.35rem;
}

@media (max-width: 767.98px) {
    .report-hero-grid,
    .report-explain-grid { grid-template-columns: 1fr; }
    .report-metric-grid,
    .report-hours-legend,
    .report-insights-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-decision-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ═══ Print Optimizations — White theme, A4 portrait, ink-saving ═══ */
/* When printing on white paper: no dark fills, no gradients, no shadows.
   Badges use outline style (border only) to save toner/ink. */

@media print {
    /* ─── Page setup ─── */
    @page {
        size: A4 portrait;
        margin: 10mm 8mm;
    }

    .d-print-none { display: none !important; }
    .d-print-block { display: block !important; }

    /* ─── Report page structure ─── */
    .report-summary-page {
        break-after: page;
        page-break-after: always;
    }
    .report-annex {
        /* Annex starts on a new page automatically via break-after on summary */
    }
    /* Tryb "Podsumowanie A4" — ukryj aneks, drukuj tylko pierwszą stronę */
    body.print-summary-only .report-annex {
        display: none !important;
    }
    /* Tryb "Pełny raport" — wymuś break-before na aneksie */
    body.print-full-report .report-annex {
        break-before: page;
        page-break-before: always;
    }
    .report-annex-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* ─── Hide all chrome ─── */
    .navbar, footer, .btn, .breadcrumb,
    #helpModal, .modal, .modal-backdrop,
    .navbar-toggler, .spinner-border,
    .nav, .nav-tabs, .tab-content,
    /* Non-critical alerts hidden in print (no .print-critical-alert class) */
    .alert:not(.print-critical-alert) {
        display: none !important;
    }
    /* Critical alerts remain visible in print */
    .print-critical-alert {
        display: block !important;
    }

    /* ─── Base: white canvas ─── */
    body {
        background: white !important;
        color: #222 !important;
        font-size: 9pt !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* ─── Kill dark inline backgrounds (report stats boxes) ─── */
    /* Only target .rounded quick-stats boxes, NOT timeline bars (<div class="timeline-bar" style="background:...">) */
    #reportContent .rounded[style*="background:"] {
        background: white !important;
        border-color: #ddd !important;
    }
    #reportContent .rounded[style*="background:#"] {
        background: white !important;
        border: 0.5pt solid #ddd !important;
    }
    /* Inline border for footer etc. */
    [style*="border-color:#2d3e52"] {
        border-color: #ddd !important;
    }

    /* ─── Cards: thin border, no shadow ─── */
    .card {
        background: white !important;
        border: 0.5pt solid #ccc !important;
        box-shadow: none !important;
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 6pt !important;
    }

    .card-header {
        background: #f5f5f5 !important;
        color: #222 !important;
        border-bottom: 0.5pt solid #ddd !important;
        font-size: 8pt !important;
        padding: 4pt 8pt !important;
    }

    .card-body {
        padding: 0 !important;
    }

    /* ─── Profile / Report header ─── */
    .profile-header, .report-header {
        background: white !important;
        border: 0.5pt solid #ccc !important;
        padding: 8pt 10pt !important;
        margin-bottom: 8pt !important;
    }

    .profile-name, .report-emp-name {
        color: #222 !important;
        font-size: 13pt !important;
    }

    .profile-detail, .report-meta {
        color: #555 !important;
        font-size: 8pt !important;
    }

    .text-secondary {
        color: #555 !important;
    }

    /* ─── Tables: compact for A4 portrait ─── */
    .table {
        color: #222 !important;
        font-size: 8pt !important;
        width: 100% !important;
        --bs-table-bg: transparent !important;
    }

    .table td, .table th {
        background: white !important;
        color: #222 !important;
        padding: 2.5pt 3.5pt !important;
        border-bottom: 0.5pt solid #ddd !important;
        vertical-align: middle !important;
    }

    .table thead th {
        background: #f8f8f8 !important;
        font-size: 8pt !important;
        text-transform: uppercase !important;
        letter-spacing: 0.3px !important;
        font-weight: 700 !important;
        border-bottom: 0.5pt solid #bbb !important;
    }

    .table tbody tr:nth-child(even) > td,
    .table tbody tr:nth-child(even) > th {
        background: #fafafa !important;
    }

    /* Kill dark-mode gradients/glows on first column */
    .table td:first-child {
        background-image: none !important;
        box-shadow: none !important;
    }

    .table-responsive {
        overflow: visible !important;
    }

    /* ─── Decision-ready employee summary: A4 print ─── */
    .report-summary-page {
        gap: 4pt !important;
        color: #1d2733 !important;
        font-size: 8pt !important;
    }
    .report-summary-page * {
        text-shadow: none !important;
        box-shadow: none !important;
    }
    .report-header-bar {
        background: #f4f7fa !important;
        border: 0.7pt solid #aeb9c5 !important;
        border-radius: 5pt !important;
        padding: 5pt 7pt !important;
    }
    .report-emp-name { color: #111820 !important; font-size: 13pt !important; }
    .report-meta-line,
    .report-data-range { color: #465463 !important; font-size: 6.8pt !important; }

    .report-hero-grid {
        display: grid !important;
        grid-template-columns: 1.12fr 0.88fr !important;
        gap: 4pt !important;
    }
    .report-performance-panel,
    .report-status-banner {
        background: #fff !important;
        border: 0.7pt solid #c5cdd6 !important;
        border-left: 4pt solid #7c8b99 !important;
        border-radius: 5pt !important;
        min-height: 104pt !important;
        padding: 6pt 8pt !important;
        break-inside: avoid !important;
    }
    .report-performance-panel.performance-danger { border-left-color: #b42318 !important; }
    .report-performance-panel.performance-warning { border-left-color: #b86e00 !important; }
    .report-performance-panel.performance-good,
    .report-performance-panel.performance-great { border-left-color: #187a38 !important; }
    .report-status-banner.status-ready { border-left-color: #187a38 !important; }
    .report-status-banner.status-caution { border-left-color: #b86e00 !important; }
    .report-status-banner.status-review { border-left-color: #b42318 !important; }
    .report-eyebrow,
    .report-metric-label { color: #4b5968 !important; font-size: 8pt !important; }
    .report-main-score {
        color: #111820 !important;
        font-size: 30pt !important;
        line-height: 0.95 !important;
        margin: 3pt 0 !important;
    }
    .performance-danger .report-main-score { color: #b42318 !important; }
    .performance-warning .report-main-score { color: #9a5b00 !important; }
    .performance-good .report-main-score,
    .performance-great .report-main-score { color: #187a38 !important; }
    .report-performance-label { color: #17212b !important; font-size: 10pt !important; }
    .report-performance-explanation { color: #344252 !important; font-size: 8pt !important; margin-top: 2pt !important; }
    .report-status-heading { gap: 5pt !important; }
    .report-status-icon { font-size: 14pt !important; }
    .status-ready .report-status-icon { color: #187a38 !important; }
    .status-caution .report-status-icon { color: #9a5b00 !important; }
    .status-review .report-status-icon { color: #b42318 !important; }
    .report-status-title { color: #111820 !important; font-size: 8pt !important; }
    .report-status-sub,
    .report-coverage-copy { color: #344252 !important; font-size: 8pt !important; }
    .report-confidence-row { color: #344252 !important; font-size: 8pt !important; margin-top: 5pt !important; }
    .report-confidence-row strong { color: #111820 !important; }
    .report-confidence-track { background: #e2e7ec !important; height: 5pt !important; margin-top: 2pt !important; }
    .confidence-high { background: #2b9348 !important; }
    .confidence-medium { background: #d98b16 !important; }
    .confidence-low { background: #c43b32 !important; }
    .report-coverage-copy { margin-top: 4pt !important; }

    .report-metric-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 3pt !important;
    }
    .report-metric-card {
        background: #fff !important;
        border: 0.6pt solid #cbd3dc !important;
        border-top: 2.5pt solid #4c86a8 !important;
        border-radius: 4pt !important;
        padding: 4pt 5pt !important;
        min-height: 42pt !important;
    }
    .report-metric-card.metric-shared { border-top-color: #6959a8 !important; }
    .report-metric-card.metric-nonorm { border-top-color: #b86e00 !important; }
    .report-metric-value { color: #111820 !important; font-size: 12pt !important; margin: 2pt 0 1pt !important; }
    .report-metric-sub { color: #465463 !important; font-size: 7.3pt !important; }

    .report-section,
    .report-trend-section,
    .report-decision-box {
        background: #fff !important;
        border: 0.6pt solid #cbd3dc !important;
        border-radius: 4pt !important;
        padding: 4pt 6pt !important;
        break-inside: avoid !important;
    }
    .report-section-title { color: #111820 !important; font-size: 8pt !important; margin-bottom: 3pt !important; }
    .report-section-title > strong { color: #465463 !important; font-size: 6.8pt !important; }
    .report-hours-track { background: #e5e9ed !important; height: 8pt !important; }
    .hours-bar-verified, .dot-verified { background: #2b9348 !important; }
    .hours-bar-open, .dot-open { background: #397ca5 !important; }
    .hours-bar-nonorm, .dot-nonorm { background: #d98b16 !important; }
    .hours-bar-other, .dot-other { background: #7c8b99 !important; }
    .report-hours-legend { grid-template-columns: repeat(4, 1fr) !important; gap: 3pt !important; margin-top: 3pt !important; }
    .report-hours-legend > div { color: #344252 !important; font-size: 7.5pt !important; gap: 2pt !important; }
    .report-hours-legend strong { color: #111820 !important; font-size: 6.1pt !important; }
    .report-hours-legend small { color: #5b6876 !important; font-size: 6.8pt !important; }
    .hours-dot { width: 5pt !important; height: 5pt !important; }

    .report-explain-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 3pt !important;
    }
    .report-explain-card {
        background: #f8fafc !important;
        border: 0.6pt solid #cbd3dc !important;
        border-left: 3pt solid #397ca5 !important;
        border-radius: 4pt !important;
        padding: 4pt 5pt !important;
        break-inside: avoid !important;
    }
    .report-explain-card.explain-adjustment { border-left-color: #b86e00 !important; }
    .report-explain-heading { color: #111820 !important; font-size: 7.5pt !important; gap: 3pt !important; }
    .report-explain-heading i { color: #397ca5 !important; }
    .explain-adjustment .report-explain-heading i { color: #b86e00 !important; }
    .report-explain-heading strong { color: #111820 !important; font-size: 8pt !important; }
    .report-explain-card p { color: #344252 !important; font-size: 7.5pt !important; line-height: 1.25 !important; margin-top: 3pt !important; }

    .report-insights-list {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2.5pt !important;
    }
    .report-insight,
    .report-insight.print-critical-alert {
        display: flex !important;
        background: #f8fafc !important;
        border-left: 2.5pt solid #397ca5 !important;
        border-radius: 3pt !important;
        color: #202c38 !important;
        font-size: 7.5pt !important;
        line-height: 1.22 !important;
        gap: 3pt !important;
        padding: 3pt 4pt !important;
    }
    .report-insight i { color: #397ca5 !important; }
    .report-insight.insight-danger { border-left-color: #b42318 !important; }
    .report-insight.insight-danger i { color: #b42318 !important; }
    .report-insight.insight-warning { border-left-color: #b86e00 !important; }
    .report-insight.insight-warning i { color: #b86e00 !important; }
    .report-insight.insight-good { border-left-color: #187a38 !important; }
    .report-insight.insight-good i { color: #187a38 !important; }

    .report-trend-values { display: grid !important; grid-template-columns: repeat(4, 1fr) !important; gap: 3pt !important; }
    .report-trend-item {
        background: #f8fafc !important;
        border: 0.6pt solid #cbd3dc !important;
        border-bottom: 2pt solid #7c8b99 !important;
        border-radius: 3pt !important;
        color: #465463 !important;
        font-size: 7.5pt !important;
        padding: 3pt 4pt !important;
    }
    .report-trend-item strong { color: #111820 !important; font-size: 6.8pt !important; }
    .report-trend-item.performance-danger { border-bottom-color: #b42318 !important; }
    .report-trend-item.performance-warning { border-bottom-color: #b86e00 !important; }
    .report-trend-item.performance-good,
    .report-trend-item.performance-great { border-bottom-color: #187a38 !important; }

    .report-decision-box { border: 0.7pt dashed #8492a1 !important; padding: 4pt 6pt !important; }
    .report-decision-title { color: #111820 !important; font-size: 6.8pt !important; margin-bottom: 3pt !important; }
    .report-decision-options { grid-template-columns: repeat(4, 1fr) !important; color: #202c38 !important; font-size: 6.8pt !important; }
    .report-notes-label { color: #465463 !important; font-size: 8pt !important; margin-top: 4pt !important; }
    .report-notes-area {
        height: 120pt !important;
        margin-top: 1pt !important;
        background: repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent 20pt,
            #aab3bd 20pt,
            #aab3bd 20.6pt
        ) !important;
    }
    .report-signatures { color: #5b6876 !important; font-size: 8pt !important; margin-top: 3pt !important; }

    /* ─── Stat Cards (KPI) ─── */
    .stat-card {
        background: white !important;
        border: 0.5pt solid #ddd !important;
        border-left: 3pt solid #999 !important;
        padding: 5pt 3pt !important;
        margin-bottom: 0 !important;
    }

    .stat-card .stat-value {
        font-size: 12pt !important;
        font-weight: 700 !important;
    }

    .stat-card .stat-label {
        font-size: 6.8pt !important;
        color: #666 !important;
    }

    /* ─── KPI row: 3 columns for A4 portrait ─── */
    #repKpiRow .col-lg-2 {
        flex: 0 0 33.33% !important;
        max-width: 33.33% !important;
        padding: 2pt !important;
    }

    /* ─── text-light (white in dark mode) → dark for paper ─── */
    .text-light {
        color: #222 !important;
    }

    /* ─── Efficiency colors (darker for print contrast) ─── */
    .efficiency-good { color: #27ae60 !important; }
    .efficiency-neutral { color: #e67e22 !important; }
    .efficiency-bad { color: #c0392b !important; }

    /* ═══ INK SAVING: Badges → outline style (border only) ═══ */
    /* Filled badges eat tons of toner. Use outlined badges instead.
       No color on base .badge — let variant classes (efficiency-good,
       bg-success etc.) set their own color without conflict. */
    .badge {
        background: white !important;
        border: 0.5pt solid #aaa !important;
        font-weight: 600 !important;
        padding: 1pt 4pt !important;
        font-size: 8pt !important;
    }

    .badge.bg-success {
        border-color: #27ae60 !important;
        color: #27ae60 !important;
    }
    .badge.bg-primary {
        border-color: #2980b9 !important;
        color: #2980b9 !important;
    }
    .badge.bg-warning.text-dark {
        border-color: #e67e22 !important;
        color: #e67e22 !important;
    }
    .badge.bg-info.text-dark {
        border-color: #3498db !important;
        color: #3498db !important;
    }
    .badge.bg-secondary {
        border-color: #888 !important;
        color: #888 !important;
    }
    /* bg-dark efficiency badges — no color/border-color here, let efficiency-* and
       badge-efficiency set the right colors */
    .badge.bg-dark {
        background: white !important;
    }

    .badge-efficiency {
        border: 0.5pt solid #ddd !important;
        background: white !important;
        font-size: 8pt !important;
    }

    /* ─── Timeline ─── */
    .timeline-day {
        border-bottom: 0.5pt solid #ddd !important;
        padding: 3pt 5pt !important;
    }

    .timeline-day-header {
        color: #222 !important;
        font-size: 7.5pt !important;
        margin-bottom: 3pt !important;
    }

    .timeline-day-track {
        background: #f5f5f5 !important;
        border: 0.5pt solid #e0e0e0 !important;
        padding: 3pt 5pt !important;
    }

    .timeline-axis {
        color: #999 !important;
        border-bottom-color: #ddd !important;
        font-size: 6.8pt !important;
    }

    .timeline-bar {
        print-color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
        color: white !important;
        font-size: 6.8pt !important;
        height: 16pt !important;
        text-shadow: 0 1px 2px rgba(0,0,0,0.5) !important;
        box-shadow: none !important;
        min-width: 3px !important;
        /* NO background override here — let inline style keep the operation color */
    }
    .timeline-bar:hover {
        transform: none !important;
    }

    /* ─── Compact quick stats bars ─── */
    #reportContent .rounded {
        border: 0.5pt solid #ddd !important;
        padding: 4pt 6pt !important;
    }
    #reportContent .rounded .fs-4,
    #reportContent .rounded .fs-5 {
        font-size: 10pt !important;
    }
    #reportContent .rounded .small {
        font-size: 8pt !important;
    }

    /* ─── Container & grid cleanup ─── */
    .container-fluid {
        max-width: 100% !important;
        padding: 0 !important;
    }
    .row {
        margin: 0 !important;
    }
    .row.g-3 > [class*="col-"] {
        padding: 2pt !important;
    }
    /* ─── Quick stats row: 4 items in one line ─── */
    /* Target only .col-md-3 columns (quick stats), NOT .col-6.col-lg (settlement stats) */
    #reportContent .row.g-2.mb-4 {
        display: flex !important;
    }
    #reportContent .row.g-2.mb-4 > .col-md-3 {
        flex: 0 0 25% !important;
        max-width: 25% !important;
        padding: 2pt !important;
    }

    /* ─── Links ─── */
    a {
        color: #222 !important;
        text-decoration: none !important;
    }

    /* ─── Footer ─── */
    .border-top {
        border-top-color: #ddd !important;
    }

    /* ─── Dark theme override ─── */
    [data-bs-theme="dark"] {
        --bs-secondary-rgb: 80, 80, 80 !important;
    }

    /* ═══ Hide non-essential columns for A4 portrait ═══ */
    /* Operations audit: hide Maszyna col on A4 (pracownicy col stays visible) */
    #repOpsBody td:nth-child(10) { display: none !important; }
    .card:has(#repOpsBody) thead th:nth-child(10) { display: none !important; }

    /* Machine summary: hide "Okres" + "Ostatnia aktywność" (cols 5,6) */
    #repMachineBody td:nth-child(5),
    #repMachineBody td:nth-child(6) { display: none !important; }
    .card:has(#repMachineBody) thead th:nth-child(5),
    .card:has(#repMachineBody) thead th:nth-child(6) { display: none !important; }

    /* ─── Keep cards together ─── */
    .card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* ─── Suspicious ops border ─── */
    .border-warning {
        border-color: #e67e22 !important;
    }

    /* ─── Report spacing ─── */
    .report-header { margin-bottom: 1rem !important; }
    #reportContent { padding: 0 !important; }
}

/* ─── Synchronizacja danych ─── */
.sync-header {
    background: linear-gradient(135deg, #243040 0%, #1f2a3a 100%);
    border: 1px solid #2d3e52;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.sync-request-button {
    white-space: nowrap;
    min-width: 220px;
}

.sync-current-card {
    border-left: 4px solid #5dade2;
}

.sync-empty-state {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    color: rgb(170, 190, 210);
    text-align: center;
}

.sync-empty-state .bi {
    color: #5a6d85;
    font-size: 2rem;
}

.sync-status-badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.28rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.sync-status-badge.status-none,
.sync-status-badge.status-queued {
    color: #b8c7d9;
    background: rgba(90, 109, 133, 0.2);
    border-color: rgba(90, 109, 133, 0.5);
}

.sync-status-badge.status-claimed,
.sync-status-badge.status-exporting,
.sync-status-badge.status-uploading {
    color: #8bd0ff;
    background: rgba(93, 173, 226, 0.16);
    border-color: rgba(93, 173, 226, 0.45);
}

.sync-status-badge.status-pending {
    color: #ffd078;
    background: rgba(245, 166, 35, 0.14);
    border-color: rgba(245, 166, 35, 0.45);
}

.sync-status-badge.status-active {
    color: #7ceb8e;
    background: rgba(76, 217, 100, 0.13);
    border-color: rgba(76, 217, 100, 0.4);
}

.sync-status-badge.status-failed {
    color: #ff9a9a;
    background: rgba(255, 107, 107, 0.13);
    border-color: rgba(255, 107, 107, 0.4);
}

.sync-progress {
    height: 0.75rem;
    background: #18222f;
}

.sync-progress-small {
    min-width: 90px;
    height: 0.45rem;
}

.sync-progress .progress-bar {
    background: #5a6d85;
}

.sync-progress .progress-bar.status-claimed,
.sync-progress .progress-bar.status-exporting,
.sync-progress .progress-bar.status-uploading {
    background: #5dade2;
}

.sync-progress .progress-bar.status-pending {
    background: #f5a623;
}

.sync-progress .progress-bar.status-active {
    background: #4cd964;
}

.sync-progress .progress-bar.status-failed {
    background: #ff6b6b;
}

.sync-error {
    padding: 0.8rem 1rem;
    border-left: 4px solid #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    color: #ffb0b0;
}

.sync-safety-list {
    color: rgb(170, 190, 210);
    padding-left: 1.25rem;
}

.sync-safety-list li + li {
    margin-top: 0.75rem;
}

.sync-table {
    --bs-table-bg: transparent;
    --bs-table-color: #cfd8e3;
}

.sync-table > :not(caption) > * > * {
    border: none;
    background-color: #1f2a3a;
    vertical-align: middle;
    padding: 0.85rem 0.75rem;
}

.sync-table tbody tr:nth-child(even) > td {
    background-color: #233141;
}

.sync-table tr.status-active > td:first-child {
    box-shadow: inset 4px 0 0 rgba(76, 217, 100, 0.8);
}

.sync-table tr.status-failed > td:first-child {
    box-shadow: inset 4px 0 0 rgba(255, 107, 107, 0.8);
}

.sync-table tr.status-claimed > td:first-child,
.sync-table tr.status-exporting > td:first-child,
.sync-table tr.status-uploading > td:first-child {
    box-shadow: inset 4px 0 0 rgba(93, 173, 226, 0.8);
}

@media (max-width: 767.98px) {
    .sync-header {
        align-items: stretch;
        flex-direction: column;
    }

    .sync-request-button {
        min-width: 0;
        width: 100%;
    }
}

/* ─── Mini Timeline Widget (header) ─── */
.mini-timeline-track {
    background: #1a2332;
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
    max-width: 280px;
    margin-left: auto;
}

.mini-axis {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: #5a6d85;
    margin-bottom: 0.15rem;
    padding: 0 2px;
}

.mini-bars-container {
    position: relative;
    height: 18px;
}

.mini-bar {
    position: absolute;
    height: 100%;
    border-radius: 3px;
    min-width: 3px;
    opacity: 0.85;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
}

.mini-bar:hover {
    opacity: 1;
    transform: scaleY(1.15);
    z-index: 5;
}

/* ─── Condensed Timeline (Kalendarz pracy) ─── */
.timeline-condensed .timeline-day {
    padding: 0.5rem 0.75rem;
}

.timeline-condensed .timeline-day-header {
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

.timeline-condensed .timeline-day-track {
    padding: 0.4rem 0.6rem;
}

.timeline-condensed .timeline-axis {
    font-size: 0.65rem;
    margin-bottom: 0.3rem;
}

.timeline-condensed .timeline-bar-row {
    height: 22px;
}

.timeline-condensed .timeline-bar {
    font-size: 0.78rem;
    padding: 0 0.4rem;
}

.timeline-condensed .timeline-bar-name {
    font-size: 0.78rem;
}

.timeline-condensed .timeline-bar-time {
    font-size: 0.65rem;
}

.timeline-condensed .timeline-bar-hours {
    font-size: 0.78rem;
}

/* ─── Attendance Matrix ─── */
.att-normal {
    color: #4cd964;
    font-weight: 500;
}

.att-short {
    color: #f5a623;
    font-weight: 500;
}

.att-long {
    color: #5dade2;
    font-weight: 500;
}

.att-overtime {
    color: #ff6b6b;
    font-weight: 600;
}

.att-night {
    color: #a78bfa;
    font-weight: 500;
}

/* Sticky columns for attendance matrix */
#attTable thead th:nth-child(1),
#attTable thead th:nth-child(2),
#attTable tbody td:nth-child(1),
#attTable tbody td:nth-child(2) {
    position: sticky;
    z-index: 2;
}

#attTable thead th:nth-child(1),
#attTable tbody td:nth-child(1) {
    left: 0;
    background: #1f2a3a;
    min-width: 120px;
}

#attTable thead th:nth-child(2),
#attTable tbody td:nth-child(2) {
    left: 120px;
    background: #1f2a3a;
    min-width: 80px;
}

/* ─── Efficiency V2 ─── */
.row-below-norm > td:first-child {
    box-shadow: inset 4px 0 0 rgba(255, 107, 107, 0.4);
}

/* Suspicious (partial data) row — żółty pasek */
.row-suspicious > td:first-child {
    box-shadow: inset 4px 0 0 rgba(245, 166, 35, 0.5);
}

/* KPI grid in summary */
#summaryContent .stat-card {
    margin-bottom: 0;
    padding: 0.7rem 0.5rem;
}

#summaryContent .stat-card .stat-value {
    font-size: 1.2rem;
}

#summaryContent .stat-card .stat-label {
    font-size: 0.65rem;
}

/* Coverage progress in table */
#tableBody .op-progress {
    height: 8px;
    min-width: 40px;
}

/* Incomplete month warning */
#monthWarning.alert-warning {
    background: rgba(245, 166, 35, 0.12);
    border: 1px solid rgba(245, 166, 35, 0.3);
    color: #f5a623;
    border-radius: 0.5rem;
}

#monthWarning.alert-warning strong {
    color: #f5a623;
}

/* ─── Orders List Enhancements ─── */

/* Overdue badge/indicator */
.text-overdue { color: #ff6b6b !important; font-weight: 700; }
.text-due-soon { color: #f5a623 !important; font-weight: 600; }

/* Date range input styling */
.date-filter-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.date-filter-group .form-control {
    max-width: 140px;
}
.date-filter-group .date-separator {
    color: #5a6d85;
    font-size: 0.85rem;
}

/* Operations progress bar in table */
.op-progress {
    height: 6px;
    border-radius: 3px;
    background: #1a2332;
    min-width: 60px;
}
.op-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}
.op-progress-bar.complete { background: #4cd964; }
.op-progress-bar.partial { background: #5dade2; }
.op-progress-bar.pending { background: #5a6d85; }

/* Row urgency highlight */
/* Status indicators moved to box-shadow on td:first-child (see above — tr border-left doesn't render) */

/* Filter bar improvements */
.filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 0;
}
.filter-bar .form-control,
.filter-bar .form-select {
    font-size: 0.85rem;
}

/* ─── Radar Cards ─── */
.radar-card {
    background: #243040;
    border: 1px solid #2d3e52;
    border-left: 4px solid #5dade2;
    border-radius: 0.5rem;
    padding: 0.85rem 0.65rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.radar-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}
.radar-card .radar-icon {
    font-size: 1.4rem;
    line-height: 1;
    margin-bottom: 0.25rem;
}
.radar-card .radar-title {
    font-size: 0.78rem;
    color: #8a9db5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.15rem;
}
.radar-card .radar-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}
.radar-card .radar-subtitle {
    font-size: 0.78rem;
    color: #5a6d85;
    margin-top: 0.1rem;
}

/* ─── Analysis Accordion ─── */
.analysis-accordion-item {
    background: #243040;
    border: 1px solid #2d3e52;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
}
.analysis-accordion-item .accordion-button {
    background: #1f2a3a;
    color: #cfd8e3;
    font-weight: 600;
    padding: 0.85rem 1rem;
    box-shadow: none;
}
.analysis-accordion-item .accordion-button:not(.collapsed) {
    background: #1f2a3a;
    color: #d4dce4;
    box-shadow: inset 0 -1px 0 #2d3e52;
}
.analysis-accordion-item .accordion-button::after {
    filter: invert(1) grayscale(100%) brightness(200%);
}
.analysis-accordion-item .accordion-body {
    background: #243040;
    color: #cfd8e3;
    padding: 1rem;
}

/* ─── Classification Badges ─── */
.badge.bg-info.text-dark { color: #1c2633 !important; }

/* ─── Invoice / KSeF styles ─── */
.ksef-badge-sent {
    background: rgba(76, 217, 100, 0.15);
    color: #4cd964;
    padding: 0.2em 0.6em;
    border-radius: 1rem;
    font-size: 0.78rem;
    font-weight: 600;
}
.ksef-badge-new {
    background: rgba(93, 173, 226, 0.15);
    color: #5dade2;
    padding: 0.2em 0.6em;
    border-radius: 1rem;
    font-size: 0.78rem;
    font-weight: 600;
}
.invoice-actions .btn {
    font-size: 0.78rem;
    padding: 0.2rem 0.5rem;
}
.money-cell {
    font-family: 'Courier New', monospace;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ─── Finance Gauge ─── */
.finance-gauge {
    padding: 1.5rem 1rem;
    text-align: center;
    background: #1f2a3a;
    border-radius: 0.75rem;
    border: 1px solid #2d3e52;
}
.finance-gauge-value {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.1;
}
.finance-gauge-value.text-success { color: #4cd964; }
.finance-gauge-value.text-danger { color: #ff6b6b; }
.finance-gauge-value.text-secondary { color: #a0a8b4; }
.finance-gauge-label {
    font-size: 0.9rem;
    color: #8a9ba8;
    margin-top: 0.25rem;
}
.finance-gauge-threshold {
    font-size: 0.8rem;
    color: #5dade2;
    margin-top: 0.75rem;
    border-top: 1px solid #2d3e52;
    padding-top: 0.75rem;
}

/* ─── Monthly Employee Tabs ─── */
#monthlyTabsSection {
    margin-bottom: 1rem;
}
#monthlyTabsSection .nav-tabs {
    border-bottom-color: #2d3e52;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0;
    scrollbar-width: thin;
}
#monthlyTabsSection .nav-tabs .nav-link {
    color: #8a9db5;
    border: 1px solid #2d3e52;
    border-bottom: none;
    background: #1f2a3a;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    white-space: nowrap;
    margin-right: 2px;
    border-radius: 0.375rem 0.375rem 0 0;
}
#monthlyTabsSection .nav-tabs .nav-link:hover {
    color: #cfd8e3;
    background: #243040;
}
#monthlyTabsSection .nav-tabs .nav-link.active {
    color: #5dade2;
    background: #243040;
    border-color: #2d3e52 #2d3e52 #243040;
    font-weight: 600;
}
#monthlyTabsSection .tabs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}


body.printing-all #reportContent,
body.printing-all .profile-header,
body.printing-all .breadcrumb,
body.printing-all #monthlyTabsSection,
body.printing-all #emptyState {
    display: none !important;
}
body.printing-all #printAllContainer {
    display: block !important;
}
@media print {
    body.printing-all #printAllContainer {
        display: block !important;
    }
}

/* ─── Wyjaśnienia KPI i duże tabele ─── */
.kpi-help {
    cursor: help;
    outline: none;
}

.kpi-help:focus-visible {
    box-shadow:
        0 0 0 3px rgba(93, 173, 226, 0.35),
        0 2px 6px rgba(0, 0, 0, 0.2);
}

.kpi-help .stat-label::after {
    content: " ⓘ";
    color: #8a9db5;
    font-size: 0.82rem;
}

.sticky-table-container {
    max-height: calc(100vh - 7rem);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.sticky-table-container .table thead th {
    top: 0;
    z-index: 5;
    background: #1f2a3a;
    box-shadow: 0 1px 0 #2d3e52;
}

@media print {
    .sticky-table-container {
        max-height: none !important;
        overflow: visible !important;
    }

    .kpi-help .stat-label::after {
        content: none !important;
    }
}
