/* ============================================================
   DESIGN SYSTEM — HGPT STEEL DESIGN TRACKER
   Industrial HUD aesthetic | Sharp edges | Red + Charcoal
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700;800&family=Roboto:wght@300;400;500;700&family=Montserrat:wght@400;600;700&family=Poppins:wght@300;400;500;600;700;800&display=swap');


/* ---- TOKENS ---- */
:root {
    --red: #C8102E;
    --red-dark: #9E0B23;
    --red-dim: rgba(200, 16, 46, 0.09);
    --blue-gradient: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
    --silver-gradient: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 100%);
    --danger: #DC2626;
    --danger-dim: rgba(220, 38, 38, 0.1);
    --charcoal: #F0F1F4;
    --surface: #FFFFFF;
    --surface-2: #F5F6F8;
    --surface-3: #EAECEF;
    --border: #DDE0E7;
    --border-2: #C2C8D4;
    --text: #111827;
    --text-muted: #6B7280;
    --text-dim: #9CA3AF;
    --green: #15803D;
    --yellow: #B45309;
    --orange: #C2410C;
    --blue-steel: #1D4ED8;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    --font-size-base: 15px;
    --font-weight-base: 400;

    --radius-sm: 2px;
    --radius: 4px;
    --radius-lg: 6px;

    --sidebar-w: 220px;
    --topbar-h: 56px;

    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* ── STAGE COLORS — Fixed, theme-independent ── */
    --c-bkl: #2563eb;
    /* Bốc Khối Lượng — Blue */
    --c-bkl-dim: rgba(37, 99, 235, 0.10);
    --c-sd: #ea580c;
    /* Shop Drawing — Orange */
    --c-sd-dim: rgba(234, 88, 12, 0.10);
    --c-qt: #16a34a;
    /* Quyết Toán — Green */
    --c-qt-dim: rgba(22, 163, 74, 0.10);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-base);
    background: var(--charcoal);
    color: var(--text);
    overflow-x: hidden;
}

.settings-group {
    margin-bottom: 24px;
}

.settings-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}

.theme-preset {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.theme-preset:hover {
    background: var(--surface-2);
}

.theme-preset.active {
    border-color: var(--red);
    background: var(--red-dim);
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* ---- UTILITY CLASSES ---- */
.text-red {
    color: var(--red) !important;
}

.text-green {
    color: var(--green) !important;
}

.text-orange {
    color: var(--orange) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* ---- DARK MODE ---- */
[data-theme="dark"] {
    --charcoal: #0F172A;
    --surface: #1E293B;
    --surface-2: #334155;
    --surface-3: #475569;
    --border: #334155;
    --border-2: #475569;
    --text: #F8FAFC;
    --text-muted: #94A3B8;
    --text-dim: #64748B;
    --red-dim: rgba(200, 16, 46, 0.15);
    --green: #22c55e;
    --yellow: #f59e0b;
    --orange: #f97316;
    --blue-steel: #60a5fa;
}

[data-theme="dark"] body,
[data-theme="dark"] {
    color-scheme: dark;
}

[data-theme="dark"] .brand-logo {
    filter: brightness(1.2) saturate(1.1);
}

[data-theme="dark"] .login-screen {
    background: var(--charcoal);
}

[data-theme="dark"] .kpi-card {
    background: var(--surface) !important;
    border-color: var(--border);
}

[data-theme="dark"] .order-card {
    background: var(--surface);
}

[data-theme="dark"] select,
[data-theme="dark"] input,
[data-theme="dark"] textarea {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .modal-content,
[data-theme="dark"] .modal-box {
    background: var(--surface);
    color: var(--text);
}

[data-theme="dark"] .data-table th {
    background: var(--surface-2);
}

/* Dark mode toggle button */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 8px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-2);
}

/* Accordion chevron rotation */
.chevron-icon {
    transition: transform 0.2s ease;
}

.chevron-icon.emp-expanded {
    transform: rotate(180deg);
}

/* ---- RESET ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font);
    background: var(--charcoal);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
    font-family: var(--font);
}

input,
select,
textarea {
    font-family: var(--font);
}

ul,
ol {
    list-style: none;
}

img {
    display: block;
    max-width: 100%;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
}

::-webkit-scrollbar-thumb {
    background: var(--border-2);
    border-radius: 2px;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition);
}

/* ---- BADGES ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-not-started {
    background: #F3F4F6;
    color: #6B7280;
}

.badge-in-progress {
    background: #E0F2FE;
    color: #0369A1;
}

.badge-completed {
    background: #DCFCE7;
    color: #15803D;
}

.badge-overdue {
    background: #FEE2E2;
    color: #DC2626;
}

/* ---- SIDEBAR FOOTER ---- */
.sidebar__footer {
    padding: 15px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 10px;
}

.fs-9 {
    font-size: 9px !important;
}

.fs-10 {
    font-size: 10px !important;
}

.ml-1 {
    margin-left: 4px !important;
}

.sidebar__logo {
    padding: 18px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.sidebar__logo::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    bottom: 25%;
    width: 3px;
    background: var(--red);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 12px rgba(200, 16, 46, 0.4);
}

.brand-logo {
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar__logo:hover .brand-logo {
    transform: translateX(2px) scale(1.02);
    filter: drop-shadow(0 4px 12px rgba(200, 16, 46, 0.2)) brightness(1.05);
}

.brand-dept {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--red);
    background: var(--red-dim);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(200, 16, 46, 0.08);
}

.sidebar__nav {
    flex: 1;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
}

.nav-item:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
}

.nav-item.active {
    background: var(--red-dim);
    color: var(--red);
    border-color: rgba(200, 16, 46, 0.3);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -9px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--red);
}

.nav-item svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 20px;
    min-width: 18px;
    text-align: center;
}

.sidebar__footer {
    border-top: 1px solid var(--border);
    margin-top: auto;
    background: var(--surface);
}

.sidebar__user {
    padding: 12px;
    border-top: 1px solid var(--border);
}

.sidebar__user-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--red-dim);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--red);
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.user-info {
    flex: 1;
    min-width: 0;
}

/* ---- SNAPSHOT ENHANCEMENTS ---- */
.snapshot-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    border-left: 4px solid var(--border);
    transition: all 0.3s;
}

.snapshot-item.--bottleneck {
    border-left-color: var(--yellow);
    box-shadow: 0 4px 12px rgba(180, 83, 9, 0.08);
}

.snapshot-item.--overdue {
    border-left-color: var(--red);
}

.gantt-lite {
    display: flex;
    height: 6px;
    background: var(--surface-3);
    border-radius: 3px;
    overflow: hidden;
    margin: 12px 0;
}

.gantt-bar {
    height: 100%;
    transition: width 0.5s;
}

.gantt-bar.--bkl {
    background: #cbd5e1;
}

.gantt-bar.--sd {
    background: #94a3b8;
}

.gantt-bar.--qt {
    background: #64748b;
}

.gantt-bar.--active {
    background: var(--yellow) !important;
    position: relative;
}

.gantt-bar.--active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    animation: flash 1.5s infinite;
}

@keyframes flash {

    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

.gantt-labels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    font-size: 10px;
    color: var(--text-dim);
}

.gantt-labels span.active-stage {
    color: var(--text);
    font-weight: 800;
}

.gantt-labels span.done {
    color: var(--green);
}

.action-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-badge.--warning {
    background: rgba(180, 83, 9, 0.1);
    color: var(--yellow);
}

.action-badge.--danger {
    background: rgba(200, 16, 46, 0.1);
    color: var(--red);
}

.action-badge.--safe {
    background: rgba(21, 128, 61, 0.1);
    color: var(--green);
}

.user-name {
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.user-logout {
    color: var(--text-dim);
    transition: color var(--transition);
    cursor: pointer;
}

.user-logout:hover {
    color: var(--red);
}

.user-logout svg {
    width: 14px;
    height: 14px;
}

/* ---- MAIN ---- */
.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    /* Add constraint to prevent children from expanding beyond viewport */
}


/* ---- TOPBAR ---- */
.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 200;
}

.topbar__title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.topbar__title span {
    color: var(--red);
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---- TOPBAR ENHANCEMENTS ---- */
.topbar-datetime {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-muted);
    margin-right: 12px;
    font-variant-numeric: tabular-nums;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    margin-left: 4px;
    border-radius: var(--radius);
    transition: all var(--transition);
    cursor: pointer;
    user-select: none;
}

.topbar-user:hover {
    background: var(--surface-2);
}

.topbar-user-info {
    display: flex;
    flex-direction: column;
}

.topbar-user-name {
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
}

.topbar-user-role {
    font-size: 10.5px;
    color: var(--text-muted);
    font-weight: 400;
}

.btn-icon {
    width: 30px;
    height: 30px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    border: none !important;
}

.btn-icon:hover {
    background: var(--surface-2);
}

/* ---- PAGE CONTENT ---- */
.page {
    padding: 12px;
    flex: 1;
    min-width: 0;
    /* Add constraint to prevent flexbox blowing up width */
    animation: fadeSlideIn 250ms ease;
}

.page.hidden {
    display: none !important;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   COMPONENTS
   ============================================================ */

/* ---- BTN ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: var(--radius);
    border: 1px solid transparent;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn svg {
    width: 14px;
    height: 14px;
}

.btn-primary {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

.btn-primary:hover {
    background: var(--red-dark);
    border-color: var(--red-dark);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
}

.btn-ghost:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-2);
}

.btn-danger {
    background: transparent;
    color: var(--red);
    border-color: rgba(200, 16, 46, .4);
}

.btn-danger:hover {
    background: var(--red-dim);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 11.5px;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 11px;
}

/* ---- STATS ROW ---- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    position: relative;
    overflow: hidden;
    transition: border-color var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--red);
}

.stat-card:hover {
    border-color: var(--border-2);
}

.stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.02em;
}

.stat-sub {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-card.--green::before {
    background: var(--green);
}

.stat-card.--yellow::before {
    background: var(--yellow);
}

.stat-card.--orange::before {
    background: var(--orange);
}

.stat-card.--blue::before {
    background: var(--blue-steel);
}

/* ---- STATUS BADGE ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 2px;
    letter-spacing: .05em;
    white-space: nowrap;
}

.badge-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.badge-not-started {
    background: rgba(107, 114, 128, .12);
    color: var(--text-muted);
}

.badge-not-started .badge-dot {
    background: var(--text-dim);
}

.badge-in-progress {
    background: rgba(29, 78, 216, .10);
    color: var(--blue-steel);
}

.badge-in-progress .badge-dot {
    background: var(--blue-steel);
    animation: pulse 1.5s infinite;
}

.badge-completed {
    background: rgba(21, 128, 61, .10);
    color: var(--green);
}

.badge-completed .badge-dot {
    background: var(--green);
}

.badge-overdue {
    background: rgba(200, 16, 46, .10);
    color: var(--red);
}

.badge-overdue .badge-dot {
    background: var(--red);
    animation: pulse 1s infinite;
}

.badge-red {
    background: rgba(200, 16, 46, .12);
    color: var(--red);
}

.badge-red .badge-dot {
    background: var(--red);
}

.badge-lead {
    background: var(--red-dim);
    color: var(--red);
    border: 1px solid rgba(200, 16, 46, 0.2);
    font-weight: 800 !important;
    text-transform: none;
}

.badge-helper {
    background: var(--surface-3);
    color: var(--text-muted);
    border: 1px solid var(--border);
    opacity: 0.8;
    text-transform: none;
}

/* Custom Progress Slider */
.progress-slider-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
}

.progress-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 60px;
    height: 4px;
    background: var(--surface-3);
    border-radius: 2px;
    outline: none;
    accent-color: var(--red);
}

.progress-slider-val {
    font-size: 11px;
    font-weight: 700;
    width: 32px;
}

/* ---- PRIORITY BADGE ---- */
.priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 6px;
}

.priority-badge.--normal {
    background: var(--surface-3);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.priority-badge.--high {
    background: rgba(180, 83, 9, 0.1);
    color: var(--yellow);
    border: 1px solid rgba(180, 83, 9, 0.2);
}

.priority-badge.--urgent {
    background: rgba(200, 16, 46, 0.1);
    color: var(--red);
    border: 1px solid rgba(200, 16, 46, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .3;
    }
}

/* ---- PROGRESS BAR ---- */
.progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 10px;
    /* Increased to 10px */
    background: var(--surface-3);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: var(--red);
    border-radius: 5px;
    transition: width 800ms cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Added slight bounce effect */
}

.progress-fill.--green {
    background: var(--green);
}

.progress-fill.--yellow {
    background: var(--yellow);
}

.progress-fill.--gray {
    background: var(--border-2);
}

.progress-pct {
    font-size: 12px;
    /* Increased from 11px */
    font-weight: 700;
    color: var(--text);
    min-width: 35px;
    text-align: right;
}

/* ---- TABLE ---- */
.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.data-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: var(--surface-2);
}

.data-table .col-actions {
    text-align: right;
    white-space: nowrap;
}

/* ---- ORDER CARD ---- */
.order-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 8px;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: var(--border-2);
    transition: background var(--transition);
}

.order-card:hover {
    border-color: var(--border-2);
    transform: translateX(3px);
}

.order-card:hover::before {
    background: var(--red);
}

.order-card.active-card {
    border-color: rgba(200, 16, 46, .4);
}

.order-card.active-card::before {
    background: var(--red);
}

.order-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.order-card__title {
    font-size: 12.5px;
    font-weight: 700;
}

.order-card__meta {
    font-size: 10.5px;
    color: var(--text-muted);
}

.order-card__modules {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.module-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 2px 6px;
    font-size: 10px;
}

.module-pill__label {
    color: var(--text-muted);
}

.module-pill__pct {
    font-weight: 700;
}

.module-pill__count {
    font-weight: 800;
    color: var(--text);
    font-size: 11px;
}

.module-pill__pct-small {
    font-size: 10px;
    font-weight: 800;
    opacity: 0.8;
    color: var(--text-dim);
    margin-left: 2px;
}

/* Order Item Preview */
.order-card__items-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 4px;
    padding: 6px 0;
    border-top: 1px dashed var(--border);
}

.item-preview-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--text-dim);
    border-radius: 4px;
    font-size: 10px;
    transition: all 0.2s;
}

.order-card:hover .item-preview-tag {
    background: var(--surface);
    border-color: var(--border-2);
}

.item-preview-name {
    font-weight: 600;
    color: var(--text);
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Pinned Item highlight */
.item-preview-tag.item-pinned {
    background: #FFFBEB;
    /* Light yellow/gold tint */
    border-color: #FCD34D;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.item-preview-pct {
    font-weight: 800;
    color: var(--text-dim);
}

.item-preview-more {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    font-style: italic;
    align-self: center;
}

/* Dashboard Layout Adjustments */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    /* Increased from 300px */
    gap: 20px;
}

.perf-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
    /* Prevent long names from breaking layout */
}

.dashboard-main {
    min-width: 0;
}

/* ---- CARD ---- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title svg {
    width: 15px;
    height: 15px;
    color: var(--red);
}

/* ---- FORM ---- */

/* ---- FORM ---- */
.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 8px 10px;
    font-size: 13px;
    transition: border-color var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--red);
}

.form-control::placeholder {
    color: var(--text-dim);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select[multiple].form-control {
    padding: 5px;
}

select[multiple].form-control option {
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 2px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.section-divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

.section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* ---- MODAL ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(12px) scale(.98);
    transition: transform var(--spring);
}

.modal--lg {
    max-width: 850px;
}

.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 14px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.modal-close:hover {
    background: var(--surface-2);
    color: var(--red);
    transform: rotate(90deg);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ---- LOGIN SCREEN ---- */
.login-screen {
    min-height: 100vh;
    background: var(--charcoal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 380px;
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.login-logo img {
    height: 64px;
    object-fit: contain;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.08));
    animation: loginLogoFloat 4s ease-in-out infinite;
}

@keyframes loginLogoFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.login-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.login-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.login-emp-btn {
    padding: 10px 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.login-emp-btn:hover,
.login-emp-btn.selected {
    background: var(--red-dim);
    border-color: rgba(200, 16, 46, .5);
    color: var(--red);
}

.login-emp-btn.manager {
    grid-column: 1 / -1;
    background: var(--red-dim);
    border-color: rgba(200, 16, 46, .4);
    color: var(--red);
    font-weight: 700;
}

/* ---- CHECKLIST ---- */
.checklist {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.checklist-item:hover {
    border-color: var(--border-2);
}

.checklist-item.done {
    border-color: rgba(34, 197, 94, .3);
    background: rgba(34, 197, 94, .05);
}

.checklist-checkbox {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 2px solid var(--border-2);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.checklist-item.done .checklist-checkbox {
    background: var(--green);
    border-color: var(--green);
}

.checklist-label {
    font-size: 12.5px;
    flex: 1;
}

.checklist-item.done .checklist-label {
    text-decoration: line-through;
    color: var(--text-muted);
}

.checklist-date {
    font-size: 10px;
    color: var(--text-muted);
}

/* ---- DRAWING STATUS ---- */
.drawing-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.ds-draft {
    background: rgba(80, 80, 80, .3);
    color: var(--text-muted);
}

.ds-review {
    background: rgba(234, 179, 8, .15);
    color: var(--yellow);
}

.ds-approved {
    background: rgba(34, 197, 94, .15);
    color: var(--green);
}

/* ---- EMPTY STATE ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 40px;
    height: 40px;
    color: var(--text-dim);
    margin: 0 auto 12px;
}

.empty-state p {
    font-size: 13px;
}

.empty-state small {
    font-size: 11px;
}

/* ---- PAGE HEADER ---- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 16px 0 12px 0;
    border-bottom: 1px solid var(--surface-3);
}

.page-header__title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

/* Sticky Header enhancement */
.sticky-header {
    position: sticky;
    top: -16px;
    /* Offset parent padding if page has top:16px */
    top: var(--topbar-h);
    /* Lock immediately under the topbar */
    z-index: 100 !important;
    background: var(--charcoal);
    margin: -16px -16px 20px -16px !important;
    padding: 16px 24px !important;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.page-header__title small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 2px;
    letter-spacing: 0;
}

/* ---- SEARCH / FILTER ---- */
.filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.search-input-wrap {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 180px;
}

.search-input-wrap .form-control {
    border: none !important;
    background: transparent !important;
    padding: 8px 0 !important;
    font-size: 13px;
    box-shadow: none !important;
}

.search-input-wrap input:focus {
    outline: none !important;
}

/* ---- TOOLBAR (Dashboard Search + Filters) ---- */
.toolbar {
    display: flex;
    flex-direction: row;
    /* single row on desktop */
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: nowrap;
}

/* Search input takes all remaining space */
.toolbar__search {
    flex: 1;
    min-width: 160px;
}

.toolbar__search .form-control {
    width: 100%;
    font-size: 13px;
}

/* Filters cluster sits to the right, fixed-size items */
.toolbar__filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.toolbar__filters .form-control {
    width: 140px;
    font-size: 12.5px;
    padding: 7px 8px;
    flex-shrink: 0;
}

/* Date range wrapper stays compact */
.toolbar__filters .date-filter-wrap {
    display: flex;
    align-items: center;
}

/* View toggle button group */
.toolbar__view-toggle {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    flex-shrink: 0;
}

.view-toggle-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.view-toggle-btn:hover {
    background: var(--surface-3);
    color: var(--text);
}

.view-toggle-btn.active {
    background: var(--surface);
    color: var(--blue-steel);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* ---- DASHBOARD MINI PROGRESS (Summary Card) ---- */
.mini-progress-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mini-progress-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ---- CUSTOM STAGE BAR CHART ---- */
.chart-legend {
    display: flex;
    gap: 10px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    align-items: center;
}

.stage-chart {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 8px;
    flex: 1;
}

.sc-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sc-label {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-muted);
    width: 100px;
    flex-shrink: 0;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sc-bars {
    flex: 1;
    min-width: 0;
}

.sc-track {
    width: 100%;
    height: 32px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sc-bar--plan {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 8px;
}

.sc-bar--actual {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 8px;
    transform-origin: left center;
    animation: scSlideRight 1.5s cubic-bezier(0.16, 1, 0.3, 1) both;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sc-bar--actual::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 8px 8px 0 0;
}

@keyframes scSlideRight {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

.sc-values {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
    min-width: 140px;
    flex-shrink: 0;
    justify-content: flex-end;
}

.sc-values small {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
}

.sc-pct {
    font-size: 11px;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-left: 8px;
}

/* ---- ORDERS TABLE VIEW ---- */
.orders-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.orders-table thead th {
    background: var(--surface-2);
    padding: 10px 12px;
    text-align: left;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.orders-table__row {
    cursor: pointer;
    transition: background 0.12s;
    border-bottom: 1px solid var(--border);
}

.orders-table__row:last-child {
    border-bottom: none;
}

.orders-table__row:hover {
    background: var(--surface-2);
}

.orders-table__row.row-urgent {
    border-left: 3px solid var(--danger);
}

.orders-table td {
    padding: 9px 12px;
    vertical-align: middle;
    white-space: nowrap;
}

.ot-name {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Stage mini-bars: BKL, SD, QT each on own row */
.ot-stage-bars {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 120px;
}

.ot-stage-bars>div {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ot-pbar {
    width: 70px;
    height: 5px;
    background: var(--surface-3);
    border-radius: 99px;
    overflow: hidden;
    flex-shrink: 0;
}

.ot-pbar__fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.8s ease;
}

.ot-pbar__label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 28px;
}

/* Overall bar cell */
.ot-overall-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 90px;
}

.ot-overall-bar {
    flex: 1;
    height: 6px;
    background: var(--surface-3);
    border-radius: 99px;
    overflow: hidden;
}

.ot-overall-bar>div {
    height: 100%;
    border-radius: 99px;
    transition: width 0.8s ease;
}

/* ---- DATE FILTER ---- */
.date-filter-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 0 10px;
    border-radius: var(--radius);
}

.date-filter-wrap .form-control {
    border: none !important;
    background: transparent !important;
    padding: 6px 0 !important;
    width: 100px;
    font-size: 11px;
    text-align: center;
}

.date-filter-wrap .form-control:focus {
    box-shadow: none !important;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    :root {
        --sidebar-w: 0px;
    }

    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
    }

    .main {
        margin-left: 0 !important;
    }

    .topbar {
        padding: 0 16px;
    }

    .page {
        padding: 16px 12px;
    }

    .filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .filter-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .filter-row .search-input-wrap,
    .filter-row .filter-group,
    .filter-row .date-filter-wrap {
        width: 100% !important;
        flex: none !important;
    }

    .date-filter-wrap {
        justify-content: space-between;
    }

    .date-filter-wrap .form-control {
        width: 42%;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-value {
        font-size: 20px;
    }
}

/* ---- UTILITY ---- */
.mobile-only-btn {
    display: none !important;
}

.flex {
    display: flex;
}

.flex-1 {
    flex: 1;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.text-muted {
    color: var(--text-muted);
}

.text-red {
    color: var(--danger);
}

.text-green {
    color: var(--green);
}

.text-yellow {
    color: var(--yellow);
}

.fw-700 {
    font-weight: 700;
}

.fs-11 {
    font-size: 11px;
}

.fs-12 {
    font-size: 12.5px;
}

.mt-4 {
    margin-top: 16px;
}

.mb-2 {
    margin-bottom: 8px;
}

.w-full {
    width: 100%;
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   MANAGEMENT DASHBOARD ENHANCEMENTS
   ============================================================ */

/* ---- DASHBOARD GRID ---- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- KPI SECTION ---- */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 1400px) {
    .kpi-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

@media (max-width: 900px) {
    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.kpi-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: currentColor;
    opacity: 0.03;
    border-radius: 50%;
    transform: translate(30%, 30%);
    pointer-events: none;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    border-color: var(--border-2);
}

.kpi-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kpi-card__label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
}

.kpi-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s;
}

.kpi-card:hover .kpi-card__icon {
    transform: scale(1.1) rotate(8deg);
}

/* Color Themes */
.kpi-card.--blue {
    color: var(--blue-steel);
    background: linear-gradient(135deg, var(--surface) 0%, rgba(29, 78, 216, 0.02) 100%);
}

.kpi-card.--blue .kpi-card__icon {
    background: rgba(29, 78, 216, 0.08);
}

.kpi-card.--green {
    color: var(--green);
    background: linear-gradient(135deg, var(--surface) 0%, rgba(34, 197, 94, 0.02) 100%);
}

.kpi-card.--green .kpi-card__icon {
    background: rgba(34, 197, 94, 0.08);
}

.kpi-card.--yellow {
    color: #f59e0b;
    background: linear-gradient(135deg, var(--surface) 0%, rgba(245, 158, 11, 0.02) 100%);
}

/* Custom amber for visibility */
.kpi-card.--yellow .kpi-card__icon {
    background: rgba(245, 158, 11, 0.08);
}

.kpi-card.--red .kpi-card__icon {
    background: var(--danger-dim);
}

/* ---- NEW: Summary & Interactive KPI Cards ---- */
.kpi-card.kpi-card--summary {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(29, 78, 216, 0.03) 100%);
    justify-content: flex-start;
    gap: 0;
    padding: 16px 18px;
}

.kpi-card.kpi-card--interactive {
    cursor: pointer;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.kpi-card.kpi-card--interactive::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.04);
    opacity: 0;
    transition: opacity 0.15s;
}

.kpi-card.kpi-card--interactive:hover::after {
    opacity: 1;
}

.kpi-card.kpi-card--interactive:hover {
    transform: translateY(-5px);
    border-color: var(--border-2);
}

.kpi-card.kpi-card--interactive:active {
    transform: scale(0.97);
}

.kpi-card.kpi-card--active {
    border-color: var(--blue-steel);
    box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.15), 0 8px 16px rgba(0, 0, 0, 0.06);
}

.kpi-card.kpi-card--active-danger {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15), 0 8px 16px rgba(0, 0, 0, 0.06) !important;
}

.kpi-card.kpi-card--active-success {
    border-color: var(--green) !important;
    box-shadow: 0 0 0 2px rgba(21, 128, 61, 0.15), 0 8px 16px rgba(0, 0, 0, 0.06) !important;
}

.kpi-card__active-hint {
    font-size: 9px;
    font-weight: 800;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-top: 6px;
    opacity: .7;
}

.kpi-card__value {
    font-size: 54px;
    font-weight: 850;
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: var(--text);
    margin-bottom: 4px;
}

.kpi-card__subtext {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ---- PERFORMANCE CARD ---- */
.perf-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.perf-card__header {
    padding: 16px 20px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.perf-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.perf-table td {
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
}

.perf-name {
    font-weight: 600;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

.perf-sub {
    font-size: 10px;
    color: var(--text-muted);
}

.perf-bar-wrap {
    height: 6px;
    background: var(--surface-3);
    border-radius: 3px;
    overflow: hidden;
    width: 100%;
}

.perf-bar-fill {
    height: 100%;
    background: var(--red);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- ACTION TOOLBAR ---- */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    gap: 12px;
}

.toolbar__search {
    flex: 1;
    position: relative;
    max-width: 320px;
}

/* .toolbar__search i removed per user request */

.toolbar__search input {
    padding-left: 12px !important;
    background: var(--surface-2) !important;
    border-color: var(--border) !important;
}

.toolbar__filters {
    display: flex;
    gap: 8px;
}

.toolbar__filters select {
    width: auto !important;
    font-size: 11.5px;
    padding-top: 6px;
    padding-bottom: 6px;
}

/* ---- PROGRESS RING ---- */
.progress-ring-mini {
    position: relative;
    width: 24px;
    height: 24px;
}

.progress-ring-mini svg {
    transform: rotate(-90deg);
}

.progress-ring-mini circle {
    fill: none;
    stroke-width: 3;
}

/* ---- TEAM PICKER ---- */
.team-picker {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    height: 120px;
    overflow-y: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.team-member {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11.5px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    border: 1px solid transparent;
    margin-bottom: 2px;
}

.team-member:hover {
    background: var(--surface-3);
}

.team-member.active {
    background: var(--surface);
    border-color: var(--red);
    box-shadow: 0 1px 4px rgba(214, 28, 45, 0.1);
    color: var(--red);
    position: relative;
}

.team-member.active::after {
    content: 'Trực chính';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    background: var(--red);
    color: #fff;
    padding: 2px 4px;
    border-radius: 2px;
}

.team-member.active~.team-member.active::after {
    display: none;
}

.team-member__check {
    width: 14px;
    height: 14px;
    border: 1px solid var(--border);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
}

.team-member.active .team-member__check {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.td-pill.active {
    border-color: #10B981;
    color: #10B981;
}

/* ---- SIDEBAR COLLAPSED (DESKTOP) ---- */
@media (min-width: 769px) {
    body.sidebar-collapsed .sidebar {
        width: 64px;
    }

    body.sidebar-collapsed .main {
        margin-left: 64px;
    }

    body.sidebar-collapsed .sidebar__logo-text,
    body.sidebar-collapsed .sidebar__logo-sub,
    body.sidebar-collapsed .nav-item span,
    body.sidebar-collapsed .sidebar__user-info,
    body.sidebar-collapsed .sidebar__user-action {
        display: none;
    }

    body.sidebar-collapsed .sidebar__logo {
        justify-content: center;
        padding: 20px 0 16px;
    }

    body.sidebar-collapsed .nav-item {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    body.sidebar-collapsed .sidebar__user {
        padding: 16px;
        justify-content: center;
    }

    /* Hiệu ứng vòng tròn nổi bật bọc nút khi sidebar thu gọn */
    body.sidebar-collapsed .breadcrumb-sidebar-btn {
        box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--red) !important;
        border-color: var(--red) !important;
        color: var(--red) !important;
        background: var(--red-dim) !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform: scale(1.05);
        /* Tùy chọn: Nhấn mạnh chút về kích thước */
    }
}

.team-member__avatar {
    width: 20px;
    height: 20px;
    background: var(--surface-3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
}

.team-member.active .team-member__avatar {
    background: var(--red);
    color: #fff;
}

.team-member__name {
    flex: 1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-picker::-webkit-scrollbar {
    width: 4px;
}

.team-picker::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* ============================================================
   RESPONSIVE — MOBILE (≤768px)
   ============================================================ */
@media (max-width: 768px) {
    :root {
        --topbar-h: 48px;
    }

    /* ---- SIDEBAR DRAWER on mobile ---- */
    .sidebar {
        position: fixed !important;
        width: 250px !important;
        height: 100vh !important;
        top: 0 !important;
        left: 0 !important;
        bottom: auto !important;
        right: auto !important;
        flex-direction: column !important;
        border-right: 1px solid var(--border) !important;
        border-top: none !important;
        background: var(--surface) !important;
        z-index: 500 !important;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex !important;
    }

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

    /* Overlay che mờ */
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(2px);
        z-index: 499;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    /* CSS cho nút hamburger */
    .btn-hamburger {
        background: none;
        border: none;
        color: var(--text);
        padding: 5px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        border-radius: 4px;
    }

    .btn-hamburger:hover {
        background: var(--surface-2);
    }

    .mobile-only-btn {
        display: flex !important;
    }

    .desktop-only-btn {
        display: none !important;
    }



    /* Hide logo & user card on mobile */
    .sidebar__logo,
    .sidebar__user {
        display: flex;
    }

    .sidebar__nav {
        flex-direction: column;
        flex: 1;
        padding: 12px 8px;
        gap: 2px;
        overflow-y: auto;
        justify-content: flex-start;
    }

    .nav-item {
        flex-direction: row;
        gap: 10px;
        padding: 9px 10px;
        font-size: 12.5px;
        border: 1px solid transparent;
        border-radius: var(--radius);
        text-align: left;
        min-width: auto;
    }

    .nav-item.active {
        background: var(--red-dim);
        color: var(--red);
        border-color: rgba(200, 16, 46, 0.3);
    }

    .nav-item svg {
        width: 15px;
        height: 15px;
    }

    /* Main content: full width, NO bottom padding (no bottom bar) */
    .main {
        margin-left: 0;
        padding-bottom: 20px;
        width: 100%;
        min-width: 0;
    }

    /* Topbar */
    .topbar {
        position: sticky;
        top: 0;
        z-index: 200;
        padding: 0 10px;
        height: 48px;
    }

    .topbar__title {
        font-size: 13px;
    }

    /* Hide datetime on mobile — saves ~120px horizontal space */
    .topbar-datetime {
        display: none !important;
    }

    /* Hide user name/role text on mobile — keep only avatar */
    .topbar-user-info {
        display: none !important;
    }

    /* Tighten user button on mobile */
    .topbar-user {
        padding: 4px;
        gap: 4px;
    }

    /* Hide chevron on mobile */
    .topbar-user .topbar-chevron,
    .topbar-user [data-lucide="chevron-down"] {
        display: none !important;
    }

    /* Breadcrumb: hide home text & chevron on mobile, keep only icons + label */
    .breadcrumb-sidebar-btn {
        display: none !important;
    }

    .breadcrumb-home-label,
    .breadcrumb-chevron {
        display: none !important;
    }

    /* Shrink the blue page-label badge */
    .breadcrumb-current {
        font-size: 11px !important;
        padding: 3px 8px !important;
    }

    /* Make topbar-actions tighter */
    .topbar__actions {
        gap: 4px;
    }

    /* Smaller icon buttons on mobile */
    .btn-icon {
        width: 28px;
        height: 28px;
    }

    /* Page header */
    .page-header {
        flex-direction: row;
        align-items: center;
        margin-bottom: 16px;
    }

    .page-header__title {
        font-size: 20px;
    }

    /* Ẩn sub-title trên mobile */
    .page-header__title small {
        display: none !important;
    }

    /* Đưa nút Tạo đơn hàng xuống góc dưới dạng FAB */
    .page-header button.btn-primary {
        position: fixed;
        bottom: 80px;
        right: 16px;
        z-index: 90;
        box-shadow: 0 4px 12px rgba(200, 16, 46, 0.4);
        border-radius: 50px;
        padding: 12px 20px;
        font-size: 14px;
        transition: transform 0.2s;
    }

    .page-header button.btn-primary:active {
        transform: scale(0.95);
    }

    /* KPI grid: 2 columns on mobile */
    #kpiRow {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .kpi-card {
        padding: 14px 12px;
    }

    .kpi-card__value {
        font-size: 28px !important;
    }

    /* KPI "Tổng KL" large value — prevent wrapping */
    .kpi-card .kpi-card__value[style*="28px"] {
        font-size: 22px !important;
        white-space: nowrap;
    }

    /* Order cards */
    .order-card {
        padding: 12px;
    }

    .order-card__title {
        font-size: 13px;
    }

    /* Module cards in order detail: stack vertically */
    [style*="grid-template-columns:repeat(3,1fr)"],
    [style*="grid-template-columns: repeat(3, 1fr)"] {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
    }

    /* Tables: horizontal scroll */
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Employee list: reduce padding */
    .perf-table {
        font-size: 11px;
    }

    /* ---- TOOLBAR (Dashboard) on mobile ---- */
    .toolbar {
        flex-direction: column !important;
        gap: 10px !important;
        align-items: flex-start !important;
    }

    .toolbar__search {
        width: 100% !important;
    }

    .toolbar__filters {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 10px !important;
        width: 100% !important;
    }

    #filterStatus,
    #filterEmployee {
        grid-column: span 1;
        width: 100% !important;
    }

    #filterTimeRange {
        grid-column: span 2;
        width: 100% !important;
    }

    .date-filter-wrap {
        display: none !important;
    }

    .date-filter-wrap input {
        background: var(--surface-2) !important;
        border: 1px solid var(--border) !important;
        border-radius: var(--radius) !important;
        padding: 8px !important;
        width: 100% !important;
        height: 38px !important;
    }

    .toolbar__filters .form-control {
        height: 38px;
        font-size: 13px;
    }



    /* dashboard-grid: single column (hide performance ranking on mobile) */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    .dashboard-side {
        display: none;
    }

    /* Modals: full screen on mobile */
    .modal-content,
    .modal-box {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 95vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        margin: auto 0 0 0;
    }

    .modal {
        align-items: flex-end;
    }

    /* Report modal: full screen */
    #modalReport .modal-content,
    #modalReport .modal-box {
        width: 100% !important;
        height: 95vh;
        max-height: 95vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    /* Snapshot items: simpler layout */
    .snapshot-item {
        padding: 12px;
    }

    /* Login screen adjustments */
    .login-box {
        padding: 24px 16px;
        margin: 16px;
    }

    .login-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}

/* ============================================================
   RESPONSIVE — SMALL PHONES (≤400px)
   ============================================================ */
@media (max-width: 400px) {
    #kpiRow {
        grid-template-columns: 1fr 1fr !important;
    }

    .kpi-card__value {
        font-size: 24px !important;
    }

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

/* ---- PERFORMANCE / RANKING CARD ---- */
.perf-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

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

.perf-table th {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 8px 6px;
    text-align: left;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.perf-table td {
    padding: 10px 6px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    vertical-align: middle;
}

[data-theme="dark"] .perf-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.perf-table tr:last-child td {
    border-bottom: none;
}

.perf-table tr:hover {
    background: var(--surface-2);
}

.perf-name {
    font-size: 12.5px;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.perf-sub {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 1px;
}

.performance-card {
    transition: all var(--transition);
}

.performance-card:hover {
    box-shadow: var(--shadow-md);
}

/* ============================================================
   FRAPPE GANTT OVERRIDES (High Contrast)
   ============================================================ */
.gantt .bar-label {
    fill: var(--text) !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    letter-spacing: -0.01em;
}

.gantt .bar-label.big {
    fill: var(--text) !important;
}

/* Background bars - more solid/distinguishable */
.gantt .bar {
    fill: var(--surface-2) !important;
    stroke: var(--border);
    stroke-width: 1px;
}

/* Progress Colors */
.gantt .bar-wrapper.gantt-bkl .bar-progress {
    fill: var(--blue-steel) !important;
}

.gantt .bar-wrapper.gantt-sd .bar-progress {
    fill: var(--orange) !important;
}

.gantt .bar-wrapper.gantt-qt .bar-progress {
    fill: var(--green) !important;
}

.gantt .bar-wrapper.gantt-overdue .bar-progress {
    fill: var(--danger) !important;
}

.gantt .bar-wrapper.gantt-overdue .bar {
    fill: rgba(220, 38, 38, 0.1) !important;
    stroke: var(--danger);
}

/* Grid & Text */
.gantt .grid-header {
    fill: var(--surface-2);
}

.gantt .grid-row,
.gantt .grid-row:nth-child(even) {
    fill: transparent !important;
}

.gantt .tick {
    stroke: var(--border);
}

.gantt .lower-text,
.gantt .upper-text {
    fill: var(--text-muted);
    font-family: var(--font);
    font-size: 11px;
}

[data-theme="dark"] .gantt .bar {
    fill: var(--surface-3) !important;
}

[data-theme="dark"] .gantt .grid-header {
    fill: var(--surface-3);
}

[data-theme="dark"] .gantt .tick {
    stroke: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .gantt .bar-label {
    fill: #fff !important;
}

[data-theme="dark"] .gantt .lower-text,
[data-theme="dark"] .gantt .upper-text {
    fill: var(--text-dim);
}

/* ---- TOAST NOTIFICATIONS ---- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: var(--surface);
    color: var(--text);
    padding: 12px 18px;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    min-width: 280px;
    border-left: 4px solid var(--border);
    animation: toastIn 300ms cubic-bezier(0.16, 1, 0.3, 1), toastOut 300ms 2.7s forwards;
    pointer-events: auto;
}

.toast.--success {
    border-left-color: var(--green);
}

.toast.--error {
    border-left-color: var(--red);
}

.toast.--info {
    border-left-color: var(--blue-steel);
}

.toast svg,
.toast i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.toast.--success svg,
.toast.--success i {
    color: var(--green);
}

.toast.--error svg,
.toast.--error i {
    color: var(--red);
}

.toast.--info svg,
.toast.--info i {
    color: var(--blue-steel);
}

@keyframes toastIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastOut {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Pinned items styling */
.row-pinned {
    background-color: rgba(255, 243, 205, 0.45) !important;
    border-left: 3px solid #ffc107 !important;
}

/* Overdue items — hardcoded red, theme-independent */
.row-overdue {
    background-color: rgba(220, 38, 38, 0.07) !important;
    border-left: 3px solid #dc2626 !important;
    animation: overdueGlow 2.2s ease-in-out infinite;
}

@keyframes overdueGlow {

    0%,
    100% {
        background-color: rgba(220, 38, 38, 0.07);
        border-left-color: #dc2626;
    }

    50% {
        background-color: rgba(220, 38, 38, 0.16);
        border-left-color: #ef4444;
    }
}

.row-overdue td:first-child {
    position: relative;
}

.data-table tr.row-overdue:hover {
    background-color: rgba(220, 38, 38, 0.18) !important;
}

.btn-pin {
    background: var(--surface-2);
    border: 1px solid var(--border);
    width: 28px;
    height: 28px;
    cursor: pointer;
    color: var(--text-dim);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.btn-pin:hover {
    background: var(--surface-3);
    color: var(--blue-steel);
    transform: scale(1.1);
}

.btn-pin.active {
    background: #ffc107;
    color: #000;
    border-color: #e5ad06;
    box-shadow: 0 2px 4px rgba(230, 174, 6, 0.2);
}

.btn-confirm {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-dim);
    transition: all 0.2s;
}

.btn-confirm:hover {
    background: var(--surface-3);
    color: var(--green);
    transform: scale(1.1);
}

.btn-confirm.active {
    background: var(--green);
    color: white;
    border-color: #116631;
    box-shadow: 0 2px 4px rgba(21, 128, 61, 0.2);
}

.data-table tr.row-pinned:hover {
    background-color: rgba(255, 243, 205, 0.6) !important;
}

/* ---- CIRCULAR PROGRESS ---- */
.circular-progress {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.circular-progress svg {
    transform: rotate(-90deg);
}

.circular-bg {
    fill: none;
    stroke: var(--border);
    stroke-opacity: 0.4;
}

.circular-fill {
    fill: none;
    stroke-linecap: round;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.1));
    transition: stroke-dashoffset 0.5s ease;
}

/* Subtle glow for colorful feel */
.circular-progress:hover .circular-fill {
    filter: drop-shadow(0 0 4px currentColor);
}

.circular-center {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
    z-index: 2;
}

.circular-pct {
    font-size: 14px;
    font-weight: 900;
    color: var(--text);
    letter-spacing: -0.02em;
}

.circular-label {
    font-size: 8px;
    font-weight: 800;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1px;
    opacity: 0.8;
}

.kpi-card--summary {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    padding: 18px 24px !important;
    background: var(--surface);
    background: linear-gradient(135deg, var(--surface) 0%, rgba(29, 78, 216, 0.02) 100%);
    border: 1px solid var(--border);
    justify-content: flex-start;
}

.mini-progress-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mini-progress-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mini-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    /* Align by text baseline for better look with different sizes */
    font-size: 11px;
}

.mini-progress-label {
    font-weight: 700;
    color: var(--text);
    opacity: 0.8;
}

.mini-progress-value {
    color: var(--text-muted);
    font-size: 16px;
    /* Increased from 11px */
    letter-spacing: -0.02em;
}

.mini-progress-value b {
    color: var(--text);
}

.mini-progress-track {
    height: 12px;
    background: var(--surface-3);
    border-radius: 99px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.mini-progress-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 1s var(--transition);
}

.mini-progress-pct {
    position: absolute;
    right: 8px;
    font-size: 9px;
    font-weight: 800;
    color: var(--text);
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
    pointer-events: none;
}

.column-chart-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    gap: 12px;
}

.column-chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    /* Slightly more gap */
    height: 100%;
    padding: 20px 4px 0;
    /* More top padding for labels */
}

.column-bar {
    width: 20px;
    /* Wider individual bars */
    border-radius: 4px 4px 0 0;
    transition: height 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    display: flex;
    justify-content: center;
}

.bar-val {
    position: absolute;
    top: -18px;
    /* Adjusted for larger font */
    font-size: 10px;
    /* Larger font */
    font-weight: 800;
    color: var(--text-dim);
    white-space: nowrap;
}

.bar-done .bar-val {
    color: var(--text);
    font-weight: 900;
}

.bar-total {
    background: var(--surface-3);
    border: 1px solid var(--border);
}

.bar-done {
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.12);
}

.column-chart-container {
    flex: 1;
    width: 48px;
    /* Total cluster width */
    position: relative;
    min-height: 100px;
}

.column-chart-track {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.08);
    /* Slightly lighter track for larger area */
}

.column-chart-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    transition: height 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4px;
}

.column-chart-pct {
    font-size: 10px;
    font-weight: 900;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.column-chart-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-card--summary .stage-info {
    margin-top: 12px;
    text-align: center;
    width: 100%;
}

.kpi-card--summary .stage-name {
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 4px;
}

.kpi-card--summary .stage-val {
    font-size: 14px;
    /* Larger font for values */
    font-weight: 900;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Clean up legacy stage chart styles */

.stage-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.stage-name {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stage-val {
    font-size: 10px;
    color: var(--text);
    font-weight: 700;
    white-space: nowrap;
}

.stage-val small {
    font-weight: 400;
    color: var(--text-dim);
    margin: 0 1px;
}

/* ---- DASHBOARD NEWS FEED ---- */
.news-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    padding-left: 14px;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    margin-top: 16px;
}

.news-feed::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: var(--border);
    border-radius: 1px;
}

.news-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.news-item::after {
    content: '';
    position: absolute;
    left: -12px;
    top: 5px;
    width: 10px;
    height: 10px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.news-item.--bkl::after {
    border-color: var(--c-bkl);
}

.news-item.--sd::after {
    border-color: var(--c-sd);
}

.news-item.--qt::after {
    border-color: var(--c-qt);
}

.news-meta {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.news-meta b {
    color: var(--text);
}

.news-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    transition: color 0.2s;
}

.news-header:hover {
    color: var(--red);
}

.news-content {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--surface-2);
    padding: 6px 8px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    line-height: 1.4;
    white-space: pre-wrap;
}

.news-time {
    font-size: 9px;
    color: var(--text-dim);
    margin-top: 2px;
}

/* News Card Header Override */
#recentNotesCard {
    padding: 0 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#recentNotesCard .perf-card__header {
    background: var(--silver-gradient);
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    margin-bottom: 0 !important;
}

#recentNotesCard .perf-card__header span {
    color: var(--text) !important;
}

#recentNotesCard .perf-card__header i {
    color: var(--blue-steel) !important;
}

#recentNotesCard .news-feed,
#recentNotesCard .empty-state {
    padding: 0 20px 20px 20px;
}

/* Ranking Card Header Override */
#performanceCard {
    padding: 0 !important;
    overflow: hidden;
}

#performanceCard .perf-card__header {
    background: var(--silver-gradient);
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    margin-bottom: 0 !important;
}

#performanceCard .perf-card__header i {
    color: var(--red) !important;
}

#performanceCard .perf-table {
    margin-top: 0;
}

#performanceCard .perf-table th {
    background: var(--surface-2);
    font-size: 10px;
    letter-spacing: 0.02em;
}