:root {
    --mf-bg: #f5f7fa;
    --mf-panel: #ffffff;
    --mf-line: #e5e7eb;
    --mf-text: #1f2937;
    --mf-muted: #64748b;
    --mf-orange: #ff6600;
    --mf-green: #0f766e;
    --mf-blue: #2563eb;
    --mf-sidebar: #101827;
    --mf-sidebar-deep: #0b1220;
    --mf-sidebar-soft: #182234;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--mf-bg);
    color: var(--mf-text);
    letter-spacing: 0;
}

#app-screen {
    background: var(--mf-bg);
}

#sidebar {
    width: 18rem;
    background:
        linear-gradient(180deg, rgba(255, 102, 0, .1) 0, transparent 190px),
        linear-gradient(180deg, var(--mf-sidebar-soft) 0%, var(--mf-sidebar-deep) 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 12px 0 32px rgba(15, 23, 42, .16);
}

#sidebar nav {
    padding: 1rem .75rem 1.25rem;
}

#sidebar > .h-20 {
    background:
        radial-gradient(circle at 24% 20%, rgba(255, 102, 0, .24), transparent 34%),
        linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)) !important;
    border-bottom-color: rgba(255, 255, 255, .08) !important;
}

#sidebar > .h-20 h1 {
    letter-spacing: 0 !important;
    text-shadow: 0 12px 30px rgba(0, 0, 0, .22);
}

.mf-sidebar-logo-card {
    align-items: center;
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 102, 0, .20), transparent 34%),
        linear-gradient(135deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .035));
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 11px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .06),
        0 16px 34px rgba(0, 0, 0, .18);
    display: inline-flex;
    justify-content: center;
    padding: 8px 12px;
    text-decoration: none;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.mf-sidebar-logo-card:hover {
    border-color: rgba(255, 102, 0, .34);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .08),
        0 20px 42px rgba(0, 0, 0, .24),
        0 0 0 3px rgba(255, 102, 0, .08);
    transform: translateY(-1px);
}

.mf-sidebar-logo-svg {
    display: block;
    height: 34px;
    width: 166px;
}

.mf-sidebar-logo-svg rect {
    fill: #07111f;
    stroke: rgba(255, 255, 255, .18);
    stroke-width: 1.4;
}

.mf-sidebar-logo-svg line {
    stroke: #ff6600;
}

.mf-sidebar-logo-svg text {
    fill: #f8fafc;
}

.mf-sidebar-logo-svg text tspan {
    fill: #ff6600;
}

#sidebar > .p-4.bg-gray-800 {
    background:
        linear-gradient(135deg, rgba(255, 102, 0, .12), rgba(37, 99, 235, .08)),
        rgba(15, 23, 42, .92) !important;
    border-top-color: rgba(255, 255, 255, .08) !important;
}

#sidebar > .p-4.bg-gray-800 .w-10 {
    background:
        linear-gradient(135deg, var(--mf-orange), #f59e0b) !important;
    border: 1px solid rgba(255, 255, 255, .22);
}

#sidebar > .p-4.bg-gray-800 button {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .12) !important;
    border-radius: 8px !important;
}

#sidebar > .p-4.bg-gray-800 button:hover {
    background: rgba(255, 255, 255, .11) !important;
}

#sidebar .nav-btn,
#sidebar button[onclick^="toggleMenu"] {
    min-height: 42px;
    border-radius: 8px;
    color: #cbd5e1;
    font-weight: 700;
}

#sidebar .nav-btn:hover,
#sidebar button[onclick^="toggleMenu"]:hover {
    background: rgba(255, 255, 255, .07) !important;
    color: #fff;
}

#sidebar .nav-btn.active,
#sidebar .submenu-btn.active {
    background: rgba(255, 255, 255, .1) !important;
    color: #fff !important;
    box-shadow: inset 3px 0 0 var(--section-accent, var(--mf-orange));
}

#sidebar .submenu-btn {
    min-height: 34px;
    border-radius: 7px;
    padding: .45rem .75rem !important;
    color: #94a3b8;
    font-size: .78rem;
    font-weight: 700;
}

#sidebar .submenu-btn:hover {
    background: rgba(255, 255, 255, .06);
}

main {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .55) 0, rgba(248, 250, 252, .1) 180px),
        linear-gradient(90deg, rgba(255, 102, 0, .045), transparent 22%, rgba(20, 184, 166, .035) 100%),
        linear-gradient(180deg, #f6f8fb 0, #eef3f8 46%, #f5f7fa 100%) !important;
}

main > header {
    background: var(--mf-bg) !important;
    padding-top: 1.15rem !important;
    padding-bottom: .75rem !important;
    pointer-events: auto !important;
}

#page-title {
    color: var(--mf-muted) !important;
    font-size: .72rem !important;
    letter-spacing: 0 !important;
}

#content-area {
    padding-top: .4rem;
}

#content-area > .view-section {
    max-width: 1660px;
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 2rem;
}

#content-area > .view-section::after {
    content: "";
    display: block;
    height: 1px;
}

.view-section > h2:first-child {
    font-size: 1.35rem !important;
    line-height: 1.2;
    font-weight: 900 !important;
    color: var(--mf-text);
}

.mf-workspace-map {
    background: #fff;
    border: 1px solid var(--mf-line);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
    margin-bottom: 1.25rem;
    padding: 1.1rem;
}

.mf-workspace-head {
    align-items: center;
    border-bottom: 1px solid #eef2f7;
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: .9rem;
    gap: 1rem;
}

.mf-eyebrow {
    color: var(--mf-orange);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: 0 !important;
    text-transform: uppercase;
}

.mf-workspace-head h3 {
    color: var(--mf-text);
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.2;
}

.mf-quiet-action {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    display: inline-flex;
    font-size: .8rem;
    font-weight: 800;
    gap: .45rem;
    padding: .55rem .75rem;
    white-space: nowrap;
}

.mf-quiet-action:hover {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #c2410c;
}

.mf-workspace-grid {
    display: grid;
    gap: .9rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mf-module-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: .95rem;
}

.mf-module-title {
    align-items: flex-start;
    display: flex;
    gap: .75rem;
    min-height: 84px;
}

.mf-module-title > span {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    flex: 0 0 38px;
    height: 38px;
    justify-content: center;
}

.mf-module-title h4 {
    color: var(--mf-text);
    font-size: .95rem;
    font-weight: 900;
    line-height: 1.2;
}

.mf-module-title p {
    color: var(--mf-muted);
    font-size: .76rem;
    line-height: 1.45;
    margin-top: .25rem;
}

.mf-module-actions {
    display: grid;
    gap: .45rem;
    /* auto-fit z minimalną szerokością — przyciski nie zwężają się poniżej 130px,
       zawijają do nowej linii zamiast ucinać tekst do "F..." */
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    margin-top: .8rem;
}

.mf-module-actions button {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    display: grid;
    font-size: .76rem;
    font-weight: 900;
    gap: .1rem .45rem;
    grid-template-columns: 18px minmax(0, 1fr);
    line-height: 1.15;
    min-height: 46px;
    padding: .48rem .55rem;
    text-align: left;
}

.mf-module-actions button i {
    grid-row: span 2;
    text-align: center;
}

.mf-module-actions button small {
    color: #94a3b8;
    font-size: .66rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Etykieta (pogrubiona) w przycisku — nie może wychodzić poza kafelek */
.mf-module-actions button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.mf-module-actions button:hover {
    background: #fff;
    border-color: #cbd5e1;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
}

.mf-blue .mf-module-title > span {
    background: #eff6ff;
    color: #2563eb;
}

.mf-green .mf-module-title > span {
    background: #ecfdf5;
    color: #0f766e;
}

.mf-orange .mf-module-title > span {
    background: #fff7ed;
    color: #ea580c;
}

.mf-work-center {
    background:
        linear-gradient(135deg, rgba(255, 102, 0, .07), rgba(20, 184, 166, .06)),
        #fff;
    border: 1px solid var(--mf-line);
    border-radius: 10px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .07);
    margin-bottom: 1.25rem;
    overflow: hidden;
    padding: 1.1rem;
    position: relative;
}

.mf-work-center::before {
    background: linear-gradient(180deg, var(--view-accent, #ff6600), #14b8a6);
    content: "";
    inset: 0 auto 0 0;
    position: absolute;
    width: 3px;
}

.mf-work-center-head {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: .9rem;
}

.mf-work-center-head h3 {
    color: var(--mf-text);
    font-size: 1.2rem;
    font-weight: 950;
    line-height: 1.15;
}

.mf-work-chips {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    justify-content: flex-end;
}

.mf-work-chips span {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    color: #64748b;
    display: inline-flex;
    font-size: .72rem;
    font-weight: 850;
    gap: .3rem;
    padding: .35rem .6rem;
    white-space: nowrap;
}

.mf-work-chips b {
    color: var(--mf-text);
    font-size: .84rem;
}

.mf-work-chips .danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.mf-work-chips .warn {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #c2410c;
}

.mf-work-chips .info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.mf-work-items {
    display: grid;
    gap: .65rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mf-work-item {
    align-items: center;
    background: rgba(255, 255, 255, .88);
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    display: grid;
    gap: .75rem;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    min-height: 92px;
    padding: .8rem;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.mf-work-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 12px 26px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.mf-work-item-icon {
    align-items: center;
    border-radius: 10px;
    display: inline-flex;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.mf-work-item.danger .mf-work-item-icon {
    background: #fef2f2;
    color: #dc2626;
}

.mf-work-item.warn .mf-work-item-icon {
    background: #fff7ed;
    color: #ea580c;
}

.mf-work-item.info .mf-work-item-icon,
.mf-work-item.ok .mf-work-item-icon {
    background: #eff6ff;
    color: #2563eb;
}

.mf-work-item-copy {
    min-width: 0;
}

.mf-work-item-copy small {
    color: #94a3b8;
    display: block;
    font-size: .67rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: .18rem;
    text-transform: uppercase;
}

.mf-work-item-copy strong {
    color: var(--mf-text);
    display: block;
    font-size: .9rem;
    font-weight: 950;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mf-work-item-copy p {
    color: #64748b;
    font-size: .75rem;
    line-height: 1.35;
    margin-top: .22rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mf-work-item-side {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: .45rem;
    justify-content: center;
    min-width: 110px;
}

.mf-work-item-side > span {
    color: #475569;
    font-size: .72rem;
    font-weight: 900;
    text-align: right;
    white-space: nowrap;
}

.mf-work-item-action {
    align-items: center;
    background: #fff;
    border: 1px solid #fed7aa;
    border-radius: 7px;
    color: #c2410c;
    display: inline-flex;
    font-size: .72rem;
    font-weight: 900;
    gap: .35rem;
    justify-content: center;
    padding: .4rem .55rem;
    white-space: nowrap;
}

.mf-work-item-action:hover {
    background: var(--mf-orange);
    border-color: var(--mf-orange);
    color: #fff;
}

.mf-work-empty {
    align-items: center;
    background: rgba(255, 255, 255, .78);
    border: 1px dashed #cbd5e1;
    border-radius: 9px;
    color: #64748b;
    display: flex;
    gap: .8rem;
    min-height: 92px;
    padding: 1rem;
}

.mf-work-empty > span {
    align-items: center;
    background: #ecfdf5;
    border-radius: 10px;
    color: #16a34a;
    display: inline-flex;
    flex: 0 0 42px;
    height: 42px;
    justify-content: center;
}

.mf-work-empty strong {
    color: var(--mf-text);
    display: block;
    font-size: .95rem;
    font-weight: 950;
}

.mf-work-empty p {
    font-size: .8rem;
    margin-top: .15rem;
}

.mf-vehicle-assistant {
    background: linear-gradient(135deg, rgba(255, 102, 0, .08), rgba(59, 130, 246, .06)), #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
}

.mf-vehicle-assistant h4 {
    color: var(--mf-text);
    font-size: 1.05rem;
    font-weight: 950;
    line-height: 1.15;
    margin-top: .15rem;
}

.mf-vehicle-assistant-grid {
    display: grid;
    gap: .7rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: .9rem;
}

.mf-vehicle-assistant-card {
    align-items: center;
    background: rgba(255, 255, 255, .82);
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    display: grid;
    gap: .65rem;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    min-height: 78px;
    padding: .72rem;
}

.mf-vehicle-assistant-card > span {
    align-items: center;
    border-radius: 9px;
    display: inline-flex;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.mf-vehicle-assistant-card strong {
    color: var(--mf-text);
    display: block;
    font-size: .86rem;
    font-weight: 950;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mf-vehicle-assistant-card p {
    color: #64748b;
    font-size: .72rem;
    font-weight: 750;
    line-height: 1.3;
    margin-top: .12rem;
}

.mf-vehicle-assistant-card button {
    background: #fff;
    border: 1px solid #fed7aa;
    border-radius: 7px;
    color: #c2410c;
    font-size: .7rem;
    font-weight: 950;
    padding: .38rem .55rem;
    white-space: nowrap;
}

.mf-vehicle-assistant-card button:hover {
    background: var(--mf-orange);
    border-color: var(--mf-orange);
    color: #fff;
}

.mf-vehicle-assistant-card.danger > span {
    background: #fef2f2;
    color: #dc2626;
}

.mf-vehicle-assistant-card.warn > span {
    background: #fff7ed;
    color: #ea580c;
}

.mf-vehicle-assistant-card.info > span {
    background: #eff6ff;
    color: #2563eb;
}

.mf-vehicle-assistant-card.ok > span {
    background: #ecfdf5;
    color: #16a34a;
}

#fleet-bulk-bar {
    backdrop-filter: blur(10px);
}

@media (max-width: 1100px) {
    .mf-work-items {
        grid-template-columns: 1fr;
    }

    .mf-vehicle-assistant-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 740px) {
    .mf-work-center-head,
    .mf-work-item {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .mf-work-center-head {
        flex-direction: column;
    }

    .mf-work-chips,
    .mf-work-item-side {
        align-items: flex-start;
        justify-content: flex-start;
    }

    .mf-work-item-copy strong,
    .mf-work-item-copy p {
        white-space: normal;
    }

    .audit-hero,
    .audit-row {
        grid-template-columns: 1fr;
    }

    .audit-hero,
    .audit-row-top,
    .mf-accounts-bulk {
        align-items: stretch;
        flex-direction: column;
    }

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

    .mf-folder-center-head {
        align-items: stretch;
        flex-direction: column;
    }

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

    .mf-service-flow {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.mf-accounts-summary {
    display: grid;
    gap: .85rem;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.mf-accounts-summary button {
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #334155;
    display: grid;
    gap: .15rem .65rem;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    min-height: 70px;
    padding: .85rem;
    text-align: left;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.mf-accounts-summary button i {
    align-items: center;
    background: #f1f5f9;
    border-radius: 8px;
    color: #475569;
    display: inline-flex;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.mf-accounts-summary button span {
    font-size: .78rem;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mf-accounts-summary button b {
    color: #111827;
    font-size: 1.35rem;
    font-weight: 950;
}

.mf-accounts-summary button:hover,
.mf-accounts-summary button.active {
    border-color: #fb923c;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}

.mf-accounts-summary button.active i {
    background: #fff7ed;
    color: var(--mf-orange);
}

.mf-btn-primary,
.mf-btn-secondary,
.mf-btn-danger {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    font-size: .86rem;
    font-weight: 900;
    gap: .45rem;
    justify-content: center;
    min-height: 40px;
    padding: .65rem 1rem;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}

.mf-btn-primary {
    background: var(--mf-orange, #ff6600);
    border: 1px solid var(--mf-orange, #ff6600);
    box-shadow: 0 12px 26px rgba(255, 102, 0, .18);
    color: #fff;
}

.mf-btn-primary:hover {
    background: #e85d00;
    box-shadow: 0 16px 34px rgba(255, 102, 0, .26);
    transform: translateY(-1px);
}

.mf-btn-secondary {
    background: #fff;
    border: 1px solid #dbe3ef;
    color: #334155;
}

.mf-btn-secondary:hover {
    border-color: #fb923c;
    color: #c2410c;
}

.mf-btn-danger {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #dc2626;
}

.mf-btn-danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.mf-btn-primary.small,
.mf-btn-secondary.small,
.mf-btn-danger.small {
    font-size: .78rem;
    min-height: 34px;
    padding: .48rem .75rem;
}

.mf-accounts-bulk {
    align-items: center;
    background: linear-gradient(135deg, #fff7ed, #eff6ff);
    border: 1px solid #fed7aa;
    border-radius: 8px;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin: -.35rem 0 1rem;
    padding: .85rem 1rem;
}

.mf-accounts-bulk > div:first-child {
    display: grid;
    gap: .15rem;
}

.mf-accounts-bulk strong {
    color: #111827;
    font-size: .92rem;
    font-weight: 950;
}

.mf-accounts-bulk span {
    color: #64748b;
    font-size: .76rem;
    font-weight: 700;
}

.mf-accounts-bulk > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.audit-shell {
    display: grid;
    gap: 1rem;
}

.audit-hero {
    align-items: center;
    background:
        radial-gradient(circle at 98% 0%, rgba(255, 102, 0, .11), transparent 28%),
        linear-gradient(135deg, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--view-accent, var(--mf-orange, #ff6600));
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .07);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1.25rem;
}

.audit-hero span,
.audit-toolbar span {
    color: #94a3b8;
    display: block;
    font-size: .72rem;
    font-weight: 950;
    letter-spacing: 0;
    text-transform: uppercase;
}

.audit-hero h2 {
    color: #0f172a;
    font-size: 1.65rem;
    font-weight: 950;
    margin: .15rem 0;
}

.audit-hero p {
    color: #64748b;
    font-weight: 650;
}

.audit-kpis {
    display: grid;
    gap: .85rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.audit-kpis div {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
    padding: .9rem 1rem;
}

.audit-kpis span {
    color: #94a3b8;
    display: block;
    font-size: .7rem;
    font-weight: 950;
    text-transform: uppercase;
}

.audit-kpis strong {
    color: #0f172a;
    display: block;
    font-size: 1.25rem;
    font-weight: 950;
    margin-top: .25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audit-toolbar {
    align-items: end;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    padding: 1rem;
}

.audit-toolbar label {
    display: grid;
    gap: .35rem;
    min-width: 180px;
}

.audit-toolbar select {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #0f172a;
    font-weight: 800;
    min-height: 42px;
    padding: .55rem .75rem;
}

.audit-list {
    display: grid;
    gap: .7rem;
}

.audit-row {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .045);
    display: grid;
    gap: .85rem;
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 1rem;
}

.audit-row.success { border-left-color: #16a34a; }
.audit-row.info { border-left-color: #2563eb; }
.audit-row.danger { border-left-color: #dc2626; }

.audit-row-icon {
    align-items: center;
    background: #f1f5f9;
    border-radius: 8px;
    color: #475569;
    display: flex;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.audit-row.success .audit-row-icon { background: #ecfdf5; color: #16a34a; }
.audit-row.info .audit-row-icon { background: #eff6ff; color: #2563eb; }
.audit-row.danger .audit-row-icon { background: #fff1f2; color: #dc2626; }

.audit-row-main {
    min-width: 0;
}

.audit-row-top {
    align-items: flex-start;
    display: flex;
    gap: .75rem;
    justify-content: space-between;
}

.audit-row-top strong {
    color: #0f172a;
    display: block;
    font-weight: 950;
}

.audit-row-top span,
.audit-row-top time {
    color: #94a3b8;
    font-size: .78rem;
    font-weight: 850;
}

.audit-row-main p {
    color: #475569;
    font-size: .9rem;
    font-weight: 650;
    margin-top: .3rem;
}

.audit-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: .65rem;
}

.audit-row-meta span {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    color: #64748b;
    display: inline-flex;
    font-size: .72rem;
    font-weight: 850;
    gap: .35rem;
    padding: .25rem .55rem;
}

.audit-meta {
    margin-top: .65rem;
}

.audit-meta summary {
    color: #ea580c;
    cursor: pointer;
    font-size: .78rem;
    font-weight: 950;
}

.audit-meta pre {
    background: #0f172a;
    border-radius: 8px;
    color: #dbeafe;
    font-size: .72rem;
    margin-top: .45rem;
    max-height: 220px;
    overflow: auto;
    padding: .8rem;
}

.audit-empty {
    align-items: center;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #94a3b8;
    display: grid;
    gap: .35rem;
    justify-items: center;
    min-height: 190px;
    padding: 2rem;
    text-align: center;
}

.audit-empty i {
    align-items: center;
    background: #f1f5f9;
    border-radius: 999px;
    color: var(--mf-orange, #ff6600);
    display: flex;
    height: 54px;
    justify-content: center;
    width: 54px;
}

.audit-empty strong {
    color: #334155;
    font-weight: 950;
}

.audit-empty.danger i {
    color: #dc2626;
}

.bg-white,
.modal-content,
table {
    border-color: var(--mf-line) !important;
}

.bg-white {
    box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
}

.rounded-xl,
.rounded-2xl {
    border-radius: 8px !important;
}

table {
    border-collapse: separate;
    border-spacing: 0;
}

thead th {
    background: #f8fafc;
    color: #475569 !important;
    font-size: .7rem !important;
    letter-spacing: 0 !important;
}

tbody tr {
    transition: background .16s ease, box-shadow .16s ease;
}

tbody tr:hover {
    background: #fff7ed !important;
}

input,
select,
textarea {
    border-radius: 7px !important;
}

button {
    letter-spacing: 0 !important;
}

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

.bg-orange-tech {
    background-color: var(--mf-orange) !important;
}

.custom-scroll::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border: 3px solid transparent;
    border-radius: 999px;
    background-clip: content-box;
}

.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}

@media (max-width: 767px) {
    #sidebar {
        width: 100%;
    }

    main > header,
    #system-banners-container,
    #content-area {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

@media (max-width: 1100px) {
    .mf-workspace-grid {
        grid-template-columns: 1fr;
    }

    .mf-module-title {
        min-height: 0;
    }
}

@media (max-width: 640px) {
    .mf-workspace-head {
        align-items: stretch;
        flex-direction: column;
    }

    .mf-module-actions {
        grid-template-columns: 1fr;
    }
}

#modal-history > div,
#modal-driver-folder > div {
    border-radius: 10px !important;
    box-shadow: 0 30px 80px rgba(15, 23, 42, .32);
}

#modal-car,
#modal-history,
#modal-intervals,
#modal-specs,
#modal-quick-refuel,
#modal-breakdown,
#modal-driver-folder,
#modal-user,
#modal-account,
#modal-client-folder,
#modal-admin-edit,
#modal-notification,
#modal-new-message,
#modal-insurance-request,
#modal-insurance-admin,
#modal-manual-insurance,
#modal-insurance-finalize {
    background: rgba(15, 23, 42, .72) !important;
    backdrop-filter: blur(8px);
}

#modal-car > div,
#modal-intervals > div,
#modal-specs > div,
#modal-quick-refuel > div,
#modal-breakdown > div,
#modal-user > div,
#modal-account > div,
#modal-client-folder > div,
#modal-admin-edit > div,
#modal-notification > div,
#modal-new-message > div,
#modal-insurance-request > div,
#modal-insurance-admin > div,
#modal-manual-insurance > div,
#modal-insurance-finalize > div {
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 10px !important;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .34) !important;
    overflow: hidden;
}

#modal-car > div {
    max-width: 960px !important;
    width: min(960px, calc(100vw - 32px)) !important;
    max-height: min(88vh, 860px) !important;
}

#modal-car form,
#modal-history form,
#modal-intervals form {
    min-width: 0;
}

#modal-car .overflow-y-auto,
#modal-history .overflow-y-auto,
#modal-intervals .overflow-y-auto {
    scrollbar-gutter: stable;
}

#modal-car .bg-white.rounded-xl,
#modal-history .bg-white.rounded-xl,
#modal-intervals .bg-white.rounded-xl {
    border-color: #dfe5ed !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .04) !important;
}

#modal-car .grid,
#modal-history .grid,
#modal-intervals .grid {
    min-width: 0;
}

#modal-car .std-input,
#modal-history .std-input,
#modal-intervals .std-input,
#modal-specs .std-input,
#modal-quick-refuel .std-input,
#modal-breakdown .std-input,
#modal-user .std-input,
#modal-account .std-input,
#modal-admin-edit .std-input,
#modal-insurance-request .std-input,
#modal-insurance-admin .std-input,
#modal-manual-insurance .std-input,
#modal-insurance-finalize .std-input {
    background: #fff !important;
    border: 1px solid #cfd8e3 !important;
    border-radius: 7px !important;
    color: #111827 !important;
    font-size: .92rem;
    line-height: 1.25;
    min-height: 42px;
    outline: none !important;
    padding: .62rem .72rem;
    width: 100%;
}

#modal-car input,
#modal-car select,
#modal-car textarea,
#modal-history input,
#modal-history select,
#modal-history textarea,
#modal-intervals input,
#modal-intervals select,
#modal-intervals textarea {
    max-width: 100%;
}

#modal-car .std-input:focus,
#modal-history .std-input:focus,
#modal-intervals .std-input:focus,
#modal-specs .std-input:focus,
#modal-quick-refuel .std-input:focus,
#modal-breakdown .std-input:focus,
#modal-user .std-input:focus,
#modal-account .std-input:focus,
#modal-admin-edit .std-input:focus,
#modal-insurance-request .std-input:focus,
#modal-insurance-admin .std-input:focus,
#modal-manual-insurance .std-input:focus,
#modal-insurance-finalize .std-input:focus {
    border-color: var(--mf-orange) !important;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, .14) !important;
}

#modal-car label,
#modal-history label,
#modal-intervals label,
#modal-specs label,
#modal-quick-refuel label,
#modal-breakdown label,
#modal-user label,
#modal-account label,
#modal-admin-edit label,
#modal-insurance-request label,
#modal-insurance-admin label,
#modal-manual-insurance label,
#modal-insurance-finalize label {
    color: #667085 !important;
    font-size: .72rem !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

#view-plan-pricing .std-input {
    width: 100%;
    min-height: 42px;
    border: 1px solid #cfd8e3;
    border-radius: 7px;
    background: #fff;
    color: #111827;
    font-size: .92rem;
    line-height: 1.25;
    outline: none;
    padding: .62rem .72rem;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

#view-plan-pricing .std-input:focus {
    border-color: var(--mf-orange);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, .14);
}

#view-plan-pricing .std-input.bg-gray-50 {
    background: #f8fafc;
}

#sidebar .mf-nav-section {
    --section-accent: #94a3b8;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 10px;
    overflow: hidden;
}

#sidebar .mf-nav-section + .mf-nav-section {
    margin-top: .6rem;
}

#sidebar .mf-nav-section-sky {
    --section-accent: #38bdf8;
    --section-glow: rgba(56, 189, 248, .14);
}

#sidebar .mf-nav-section-orange {
    --section-accent: var(--mf-orange);
    --section-glow: rgba(255, 102, 0, .16);
}

#sidebar .mf-nav-section-green {
    --section-accent: #22c55e;
    --section-glow: rgba(34, 197, 94, .14);
}

#sidebar .mf-nav-section-teal {
    --section-accent: #14b8a6;
    --section-glow: rgba(20, 184, 166, .14);
}

#sidebar .mf-nav-section-indigo {
    --section-accent: #818cf8;
    --section-glow: rgba(129, 140, 248, .14);
}

#sidebar .mf-nav-section-amber {
    --section-accent: #f59e0b;
    --section-glow: rgba(245, 158, 11, .14);
}

#sidebar .mf-nav-group-toggle {
    align-items: center;
    background:
        linear-gradient(90deg, var(--section-glow, rgba(148, 163, 184, .1)), rgba(255, 255, 255, .025));
    border: 0;
    color: #e5e7eb;
    display: flex;
    font-size: .76rem;
    font-weight: 950;
    justify-content: space-between;
    line-height: 1.1;
    min-height: 42px;
    padding: .7rem .75rem;
    text-align: left;
    width: 100%;
}

#sidebar .mf-nav-group-toggle:hover {
    background:
        linear-gradient(90deg, var(--section-glow, rgba(148, 163, 184, .16)), rgba(255, 255, 255, .06));
    color: #fff;
}

#sidebar .mf-nav-group-main,
#sidebar .mf-nav-group-meta {
    align-items: center;
    display: flex;
    gap: .55rem;
    min-width: 0;
}

#sidebar .mf-nav-group-main > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#sidebar .mf-nav-group-icon {
    align-items: center;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    color: var(--section-accent);
    display: inline-flex;
    flex: 0 0 28px;
    height: 28px;
    justify-content: center;
    width: 28px;
}

#sidebar .mf-nav-group-meta {
    color: #94a3b8;
    flex: 0 0 auto;
    font-size: .7rem;
    font-weight: 900;
}

#sidebar .mf-nav-chevron {
    color: var(--section-accent);
    font-size: .7rem;
    transition: transform .16s ease;
}

#sidebar .mf-nav-list {
    padding: .45rem;
}

#sidebar .mf-nav-section.is-collapsed .mf-nav-list {
    display: none;
}

#sidebar .mf-nav-section.is-collapsed .mf-nav-chevron {
    transform: rotate(-90deg);
}

#sidebar .mf-nav-item {
    border: 1px solid transparent;
    color: #cbd5e1 !important;
    min-height: 40px;
    padding-left: .7rem !important;
    padding-right: .7rem !important;
}

#sidebar .mf-nav-item:hover {
    background: rgba(255, 255, 255, .075) !important;
    border-color: rgba(255, 255, 255, .07);
}

#sidebar .mf-nav-item.active,
#sidebar .mf-nav-item.bg-gray-800 {
    background:
        linear-gradient(90deg, var(--section-glow, rgba(255, 102, 0, .18)), rgba(255, 255, 255, .08)) !important;
    border-color: rgba(255, 255, 255, .12);
    color: #fff !important;
    box-shadow: inset 3px 0 0 var(--section-accent);
}

#sidebar .mf-nav-item.active i,
#sidebar .mf-nav-item.bg-gray-800 i {
    color: var(--section-accent) !important;
}

#sidebar .mf-nav-badge {
    min-width: 1.25rem;
    text-align: center;
}

.mf-view-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(248, 250, 252, .78)),
        linear-gradient(90deg, rgba(255, 102, 0, .08), rgba(20, 184, 166, .06));
    border: 1px solid rgba(203, 213, 225, .86);
    border-radius: 8px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, .06);
    margin-bottom: 1.05rem;
    padding: 1.05rem 1.15rem;
    position: relative;
    overflow: hidden;
}

.mf-view-header::before {
    background: linear-gradient(180deg, var(--mf-orange), #14b8a6);
    content: "";
    height: calc(100% - 1.2rem);
    left: 0;
    position: absolute;
    top: .6rem;
    width: 4px;
    border-radius: 0 999px 999px 0;
}

.mf-view-title {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #111827;
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: 0;
}

.mf-view-title-icon {
    width: 2.45rem;
    height: 2.45rem;
    border-radius: 8px;
    background:
        linear-gradient(135deg, #fff7ed, #eff6ff);
    color: var(--mf-orange);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid #fed7aa;
}

.mf-view-desc {
    color: #56657a;
    font-size: .92rem;
    margin-top: .35rem;
}

.mf-view-header > div:last-child,
.mf-view-header .flex.gap-2,
.mf-view-header .flex.flex-wrap {
    align-items: center;
}

.mf-header-action {
    border-radius: 7px !important;
}

.mf-view-normalized .mf-toolbar {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(248, 250, 252, .9)),
        linear-gradient(90deg, rgba(255, 102, 0, .045), rgba(37, 99, 235, .035)) !important;
    border: 1px solid rgba(203, 213, 225, .82) !important;
    border-radius: 8px !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .055) !important;
    padding: .9rem 1rem !important;
}

.mf-view-normalized .mf-command-bar {
    align-items: center;
    gap: .75rem !important;
    position: relative;
}

.mf-view-normalized .mf-command-bar::before {
    background: linear-gradient(180deg, var(--mf-orange), #2563eb);
    border-radius: 999px;
    content: "";
    height: calc(100% - 1.2rem);
    left: 0;
    position: absolute;
    top: .6rem;
    width: 3px;
}

.mf-view-normalized .mf-control {
    border: 1px solid #cbd5e1 !important;
    border-radius: 7px !important;
    background: rgba(255, 255, 255, .96) !important;
    color: #111827 !important;
    min-height: 40px;
    outline: none !important;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.mf-view-normalized .mf-control:hover {
    border-color: #94a3b8 !important;
}

.mf-view-normalized .mf-control:focus {
    border-color: var(--mf-orange) !important;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, .13) !important;
}

.mf-view-normalized .mf-action {
    border-radius: 7px !important;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    white-space: nowrap;
}

.mf-view-normalized .mf-action-primary {
    box-shadow: 0 12px 26px rgba(255, 102, 0, .22) !important;
}

.mf-view-normalized .mf-kpi-card {
    position: relative;
    overflow: hidden;
}

.mf-view-normalized .mf-kpi-card::after {
    background: linear-gradient(90deg, rgba(255, 102, 0, .55), rgba(20, 184, 166, .36));
    bottom: 0;
    content: "";
    height: 3px;
    left: 0;
    position: absolute;
    right: 0;
}

.mf-view-normalized .mf-kpi-card > div:first-child {
    border-radius: 8px !important;
}

.mf-view-normalized .mf-table-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(241, 245, 249, .82)) !important;
    border: 1px solid rgba(203, 213, 225, .78) !important;
    border-radius: 8px !important;
    box-shadow: 0 16px 42px rgba(15, 23, 42, .065) !important;
    overflow: hidden;
    padding: .55rem;
}

.mf-view-normalized .mf-data-panel > div:first-child,
.mf-view-normalized .mf-table-card > div:first-child:not(.overflow-x-auto) {
    background:
        linear-gradient(135deg, #fff, #f8fafc);
}

.mf-view-normalized .mf-data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 .55rem;
}

.mf-view-normalized .mf-data-table thead {
    background: transparent !important;
}

.mf-view-normalized .mf-data-table th {
    background: transparent !important;
    color: #5f6b7d !important;
    font-size: .68rem !important;
    font-weight: 900 !important;
    letter-spacing: .02em;
    padding-bottom: .3rem !important;
    padding-top: .25rem !important;
    text-transform: uppercase;
}

.mf-view-normalized .mf-data-table td {
    background: #fff;
    border-bottom: 1px solid #eef2f6 !important;
    border-color: #eef2f6 !important;
    border-top: 1px solid #eef2f6 !important;
    vertical-align: middle;
}

.mf-view-normalized .mf-data-table tbody tr {
    filter: drop-shadow(0 6px 14px rgba(15, 23, 42, .035));
}

.mf-view-normalized .mf-data-table tbody tr:hover {
    filter: drop-shadow(0 12px 22px rgba(15, 23, 42, .07));
}

.mf-view-normalized .mf-data-table tbody tr:hover td {
    background: #fffaf5 !important;
    border-color: #fed7aa !important;
}

.mf-view-normalized .mf-data-table tbody td:first-child {
    border-left: 1px solid #eef2f6 !important;
    border-radius: 8px 0 0 8px;
    box-shadow: inset 4px 0 0 transparent;
}

.mf-view-normalized .mf-data-table tbody td:last-child {
    border-radius: 0 8px 8px 0;
    border-right: 1px solid #eef2f6 !important;
}

.mf-view-normalized .mf-data-table tbody tr:hover td:first-child {
    box-shadow: inset 4px 0 0 var(--mf-orange);
}

.mf-view-normalized .mf-kpi-card {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .88)) !important;
    border-radius: 8px !important;
    border: 1px solid rgba(203, 213, 225, .78) !important;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .055) !important;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.mf-view-normalized .mf-kpi-card:hover {
    border-color: rgba(255, 102, 0, .28) !important;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .075) !important;
    transform: translateY(-1px);
}

.mf-view-normalized .mf-surface {
    border-color: rgba(203, 213, 225, .78) !important;
    border-radius: 8px !important;
    box-shadow: 0 12px 34px rgba(15, 23, 42, .055) !important;
}

.mf-view-normalized .mf-surface h3,
.mf-view-normalized .mf-surface h4 {
    letter-spacing: 0 !important;
}

.mf-view-normalized [class*="rounded-2xl"],
.mf-view-normalized [class*="rounded-xl"] {
    border-radius: 8px !important;
}

.mf-row-panel-btn {
    align-items: center;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    color: #c2410c;
    display: inline-flex;
    font-size: .76rem;
    font-weight: 950;
    gap: .45rem;
    min-height: 34px;
    padding: .45rem .75rem;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
    white-space: nowrap;
}

.mf-row-panel-btn:hover {
    background: var(--mf-orange);
    border-color: var(--mf-orange);
    box-shadow: 0 10px 20px rgba(255, 102, 0, .18);
    color: #fff;
}

#view-fleet .mf-data-table td:first-child span,
#view-tires .mf-data-table td:first-child span,
#view-services .mf-data-table td:first-child span {
    box-shadow: inset 0 -8px 18px rgba(15, 23, 42, .04);
}

#view-fleet .mf-data-table tbody td,
#view-services .mf-data-table tbody td,
#view-tires .mf-data-table tbody td {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

#view-fleet .mf-command-bar {
    display: flex !important;
    justify-content: space-between !important;
}

#view-fleet .mf-command-bar > .flex,
#view-fleet .mf-command-bar > div {
    min-width: 0;
}

#view-fleet .mf-command-bar > .flex:first-child {
    flex: 1 1 520px;
}

#view-fleet .mf-command-bar .relative {
    max-width: 420px;
}

#view-fleet .mf-command-bar .relative:first-child {
    flex: 1 1 340px;
}

#view-fleet .mf-command-bar button.bg-orange-tech,
#view-fleet .mf-command-bar .bg-orange-tech {
    min-height: 42px;
}

#view-fleet .mf-data-table tbody td:nth-child(2) .font-black,
#view-services .mf-data-table tbody td:first-child .font-black,
#view-tires .mf-data-table tbody td:first-child .font-black {
    color: #0f172a !important;
    font-size: 1rem;
}

.mf-view-normalized tbody .text-gray-400,
.mf-view-normalized tbody .text-gray-300 {
    color: #8b98aa !important;
}

.mf-view-normalized tbody [class*="bg-green-100"],
.mf-view-normalized tbody [class*="bg-blue-100"],
.mf-view-normalized tbody [class*="bg-orange-100"],
.mf-view-normalized tbody [class*="bg-red-100"] {
    border: 1px solid currentColor;
    border-color: rgba(15, 23, 42, .08);
}

.mf-view-normalized table td[colspan] {
    background:
        linear-gradient(135deg, #fff, #f8fafc);
    color: #667085 !important;
    font-weight: 700;
}

.mf-alert-notifications {
    align-items: stretch;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    display: grid;
    gap: .85rem;
    margin-bottom: 1rem;
    padding: 1rem;
}

.mf-alert-notifications-head {
    align-items: center;
    border-bottom: 1px solid #eef2f6;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding-bottom: .85rem;
}

.mf-alert-notifications-head p {
    color: var(--mf-orange);
    font-size: .68rem;
    font-weight: 950;
    text-transform: uppercase;
}

.mf-alert-notifications-head h3 {
    color: #111827;
    font-size: .98rem;
    font-weight: 950;
}

.mf-alert-notifications-head button {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    display: inline-flex;
    font-size: .75rem;
    font-weight: 900;
    gap: .45rem;
    min-height: 34px;
    padding: .45rem .7rem;
}

.mf-alert-notifications-head button:hover {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #15803d;
}

.mf-alert-notifications-list {
    display: grid;
    gap: .5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mf-alert-notifications-list article {
    align-items: flex-start;
    background: #f8fafc;
    border: 1px solid #eef2f6;
    border-radius: 8px;
    display: flex;
    gap: .7rem;
    min-width: 0;
    padding: .75rem;
}

.mf-alert-notifications-list article > span,
.mf-alert-notifications-icon {
    align-items: center;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    color: var(--mf-orange);
    display: inline-flex;
    flex: 0 0 34px;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.mf-alert-notifications-list strong,
.mf-alert-notifications-empty strong {
    color: #111827;
    display: block;
    font-size: .84rem;
    font-weight: 900;
    line-height: 1.25;
}

.mf-alert-notifications-list small,
.mf-alert-notifications-empty p {
    color: #667085;
    display: block;
    font-size: .74rem;
    font-weight: 700;
    line-height: 1.35;
    margin-top: .2rem;
}

.mf-alert-notifications-empty {
    align-items: center;
    display: flex;
    flex-direction: row;
}

.is-client #view-services .mf-service-orders-card,
.is-driver #view-services .mf-service-orders-card,
.is-individual #view-services .mf-service-orders-card {
    grid-column: 1 / -1 !important;
}

.is-client #view-services .svc-kpi-partners-card,
.is-driver #view-services .svc-kpi-partners-card,
.is-individual #view-services .svc-kpi-partners-card {
    display: none !important;
}

.is-client #view-services .grid.grid-cols-2.md\:grid-cols-4,
.is-driver #view-services .grid.grid-cols-2.md\:grid-cols-4,
.is-individual #view-services .grid.grid-cols-2.md\:grid-cols-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.mf-service-source {
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    color: #64748b;
    display: inline-flex;
    font-size: .66rem;
    font-weight: 950;
    gap: .3rem;
    padding: .18rem .5rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.mf-service-source.request {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #c2410c;
}

.mf-service-source.history {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}

.mf-service-source.manual {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}

.mf-service-flow {
    align-items: stretch;
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    width: 100%;
}

.mf-service-flow span {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #94a3b8;
    display: grid;
    flex: 1 1 112px;
    gap: .25rem;
    justify-items: center;
    min-height: 58px;
    min-width: 0;
    padding: .5rem .35rem;
    text-align: center;
}

.mf-service-flow span i {
    font-size: .9rem;
}

.mf-service-flow span b {
    font-size: .66rem;
    font-weight: 950;
    letter-spacing: 0 !important;
    line-height: 1.05;
}

.mf-service-flow span.done {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #16a34a;
}

.mf-service-flow span.current {
    background: #fff7ed;
    border-color: #fdba74;
    box-shadow: 0 10px 22px rgba(255, 102, 0, .13);
    color: #ea580c;
}

.mf-service-flow.compact {
    gap: .22rem;
    max-width: 154px;
    width: auto;
}

.mf-service-flow.compact span {
    border-radius: 999px;
    flex: 0 0 18px;
    height: 18px;
    justify-content: center;
    min-height: 22px;
    min-width: 18px;
    padding: .12rem;
}

.mf-service-flow.compact span b {
    display: none;
}

.mf-service-flow.compact span i {
    font-size: .65rem;
}

.mf-folder-center {
    display: grid;
    gap: .75rem;
}

.mf-folder-center-head {
    align-items: center;
    display: flex;
    gap: .75rem;
    justify-content: space-between;
}

.mf-folder-center-head h3 {
    color: #0f172a;
    font-size: 1.15rem;
    font-weight: 950;
    line-height: 1.1;
}

.mf-folder-active,
.mf-folder-ok {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: .72rem;
    font-weight: 950;
    gap: .35rem;
    padding: .35rem .65rem;
    white-space: nowrap;
}

.mf-folder-active {
    background: #fff7ed;
    color: #c2410c;
}

.mf-folder-ok {
    background: #ecfdf5;
    color: #15803d;
}

.mf-folder-flow {
    max-width: 100%;
}

.mf-folder-grid {
    display: grid !important;
    gap: .55rem;
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

.mf-folder-grid button {
    align-items: center !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    color: #475569 !important;
    display: grid !important;
    gap: .12rem !important;
    justify-items: center !important;
    min-height: 78px !important;
    padding: .55rem .4rem !important;
    text-align: center !important;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease !important;
}

.mf-folder-grid button:hover:not(:disabled) {
    border-color: #fb923c;
    box-shadow: 0 12px 24px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.mf-folder-grid button:disabled {
    cursor: not-allowed;
    opacity: .42;
}

.mf-folder-grid button i {
    color: var(--mf-orange, #ff6600) !important;
    display: block !important;
    font-size: 1rem !important;
}

.mf-folder-grid button strong {
    color: #0f172a !important;
    display: block !important;
    font-size: .76rem !important;
    font-weight: 950 !important;
    letter-spacing: 0 !important;
}

.mf-folder-grid button span {
    color: #94a3b8 !important;
    display: block !important;
    font-size: .66rem !important;
    font-weight: 850 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#view-profile > .max-w-4xl > h2 {
    display: none;
}

#view-profile > .max-w-4xl {
    max-width: 1120px !important;
    margin-left: auto;
    margin-right: auto;
}

.mf-profile-hero {
    align-items: center;
    background:
        radial-gradient(circle at 12% 20%, rgba(255, 102, 0, .16), transparent 34%),
        linear-gradient(135deg, #172033 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, .10);
    border-left: 4px solid var(--mf-orange, #ff6600);
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .12);
    color: #fff;
    display: grid;
    gap: 1rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
    margin-bottom: 1rem;
    padding: 1.1rem;
}

.mf-profile-avatar {
    align-items: center;
    background: linear-gradient(135deg, var(--mf-orange, #ff6600), #f59e0b);
    border-radius: 14px;
    box-shadow: 0 16px 35px rgba(255, 102, 0, .24);
    display: inline-flex;
    font-size: 1.05rem;
    font-weight: 950;
    height: 58px;
    justify-content: center;
    width: 58px;
}

.mf-profile-main h3 {
    color: #fff;
    font-size: 1.35rem;
    font-weight: 950;
    line-height: 1.1;
    margin: .15rem 0 .5rem;
}

.mf-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.mf-profile-meta span,
.mf-profile-status div {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    color: #cbd5e1;
    font-size: .78rem;
    font-weight: 850;
    padding: .42rem .62rem;
}

.mf-profile-meta i {
    color: #ffb07a;
    margin-right: .35rem;
}

.mf-profile-status {
    display: grid;
    gap: .5rem;
    grid-template-columns: repeat(3, minmax(110px, 1fr));
}

.mf-profile-status div {
    min-width: 110px;
}

.mf-profile-status small {
    color: #94a3b8;
    display: block;
    font-size: .62rem;
    font-weight: 900;
    text-transform: uppercase;
}

.mf-profile-status strong {
    color: #f8fafc;
    display: block;
    font-size: .86rem;
    font-weight: 950;
    margin-top: .15rem;
}

#view-profile form {
    display: grid;
    gap: 1.1rem;
}

#view-profile form > div,
#view-profile form .role-element,
#view-profile form > .space-y-4 {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
}

#view-profile .bg-white.rounded-2xl {
    border-radius: 8px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04) !important;
    padding: 1rem !important;
}

#view-profile label {
    color: #667085 !important;
    display: block;
    font-size: .72rem !important;
    font-weight: 900 !important;
    letter-spacing: 0 !important;
    margin-bottom: .35rem;
    text-transform: none !important;
}

#view-profile .std-input {
    border: 1px solid #cfd8e3 !important;
    border-radius: 7px !important;
    min-height: 42px;
    padding: .62rem .72rem;
    width: 100%;
}

#view-profile h4 {
    align-items: center;
    display: flex;
    font-size: .86rem !important;
    gap: .5rem;
    letter-spacing: 0 !important;
    margin-bottom: .75rem;
    text-transform: none !important;
}

#view-profile h4::before {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 7px;
    color: var(--mf-orange);
    content: "\f05a";
    display: inline-flex;
    font-family: "Font Awesome 6 Free";
    font-size: .72rem;
    font-weight: 900;
    height: 28px;
    align-items: center;
    justify-content: center;
    width: 28px;
}

#view-profile form button[type="submit"] {
    justify-self: start;
    min-height: 42px;
}

@media (max-width: 980px) {
    .mf-profile-hero {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .mf-profile-status {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .mf-profile-hero {
        align-items: flex-start;
        grid-template-columns: 1fr;
    }

    .mf-profile-status {
        grid-template-columns: 1fr;
    }
}

#view-messages > .flex {
    border-radius: 8px !important;
    height: min(680px, calc(100vh - 190px)) !important;
    min-height: 500px;
    border-color: rgba(203, 213, 225, .78) !important;
    box-shadow: 0 16px 42px rgba(15, 23, 42, .065) !important;
}

#view-messages .w-80 {
    background: linear-gradient(180deg, #fff, #f8fafc);
    width: 340px !important;
}

#view-messages #msg-empty-state {
    background: linear-gradient(180deg, #fff, #f8fafc);
}

#view-messages #messages-container {
    background:
        linear-gradient(180deg, rgba(248, 250, 252, .68), rgba(255, 255, 255, .72)) !important;
}

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

    .mf-alert-notifications-head {
        align-items: stretch;
        flex-direction: column;
    }

    .mf-alert-notifications-list {
        grid-template-columns: 1fr;
    }

    .is-client #view-services .grid.grid-cols-2.md\:grid-cols-4,
    .is-driver #view-services .grid.grid-cols-2.md\:grid-cols-4,
    .is-individual #view-services .grid.grid-cols-2.md\:grid-cols-4 {
        grid-template-columns: 1fr !important;
    }

    #view-messages > .flex {
        flex-direction: column;
        height: auto !important;
        min-height: 620px;
    }

    #view-messages .w-80 {
        width: 100% !important;
        max-height: 260px;
    }
}

#modal-car button,
#modal-history button,
#modal-intervals button,
#modal-vehicle-panel button,
#modal-specs button,
#modal-quick-refuel button,
#modal-breakdown button,
#modal-user button,
#modal-account button,
#modal-client-folder button,
#modal-admin-edit button,
#modal-notification button,
#modal-new-message button,
#modal-insurance-request button,
#modal-insurance-admin button,
#modal-manual-insurance button,
#modal-insurance-finalize button {
    border-radius: 7px !important;
}

.mf-vehicle-line,
.mf-vehicle-term {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 8px;
    padding: .75rem .85rem;
}

.mf-vehicle-line span,
.mf-vehicle-term span {
    color: #667085;
    font-size: .72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.mf-vehicle-line strong,
.mf-vehicle-term strong {
    color: #111827;
    font-size: .9rem;
    font-weight: 900;
    text-align: right;
}

.mf-vehicle-term {
    align-items: flex-start;
    flex-direction: column;
    gap: .25rem;
}

.mf-vehicle-term strong {
    text-align: left;
}

.mf-vehicle-term small {
    color: #98a2b3;
    font-size: .72rem;
    font-weight: 800;
}

.mf-vehicle-action {
    min-height: 104px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 8px !important;
    padding: 1rem;
    text-align: left;
    display: grid;
    grid-template-columns: 2.4rem 1fr;
    grid-template-rows: auto auto;
    column-gap: .85rem;
    align-items: center;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.mf-vehicle-action:hover:not(:disabled) {
    border-color: var(--mf-orange);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.mf-vehicle-action span {
    grid-row: 1 / span 2;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 8px;
    background: #fff7ed;
    color: var(--mf-orange);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mf-vehicle-action strong {
    color: #111827;
    font-size: .92rem;
    font-weight: 900;
}

.mf-vehicle-action small {
    color: #667085;
    font-size: .75rem;
    font-weight: 700;
}

#modal-car select.std-input,
#modal-history select.std-input,
#modal-intervals select.std-input {
    appearance: auto;
}

#modal-car input[name="plate"] {
    font-size: 1rem !important;
    letter-spacing: 0 !important;
    text-align: left !important;
}

#modal-car input[name="vin"] {
    font-size: .82rem !important;
    letter-spacing: 0 !important;
    min-width: 0;
}

#modal-car input[type="date"],
#modal-history input[type="date"],
#modal-intervals input[type="date"] {
    min-width: 0;
}

#modal-car .rounded-b-2xl {
    border-radius: 0 0 10px 10px !important;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 5;
}

#modal-car .overflow-y-auto {
    padding-bottom: .5rem;
}

#modal-history > div {
    display: grid !important;
    grid-template-columns: 320px minmax(0, 1fr);
    height: min(88vh, 860px) !important;
    max-height: calc(100vh - 32px) !important;
    max-width: 1220px !important;
    min-height: 0;
}

#modal-history > div > button {
    right: 14px !important;
    top: 14px !important;
}

#modal-history > div > div:first-of-type {
    width: auto !important;
    padding: 1.4rem !important;
}

#modal-history > div > div:nth-of-type(2) {
    display: flex !important;
    flex-direction: column !important;
    height: 100%;
    width: auto !important;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

#modal-history > div > div:nth-of-type(2) > div:first-child {
    flex: 0 0 auto;
    max-height: 42vh;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

#modal-history > div > div:nth-of-type(2) > div:nth-child(2),
#modal-history #hist-stats-bar {
    flex: 0 0 auto;
}

#modal-history #form-add-history {
    display: grid;
    gap: .8rem;
}

#modal-history #form-add-history > .grid:first-of-type {
    grid-template-columns: 128px repeat(4, minmax(112px, 1fr)) !important;
}

#modal-history #form-add-history > .grid:nth-of-type(2) {
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 280px) !important;
}

#modal-history #form-add-history > .grid:nth-of-type(3) {
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) !important;
}

#modal-history #hist-timeline-container {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    padding: 1.2rem 1.35rem !important;
}

#modal-history #hist-mileage-container {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    padding: 1.2rem 1.35rem !important;
}

#modal-history #hist-mileage-container > div {
    max-height: 100%;
    overflow: auto;
}

#modal-history #hist-mileage-container thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

#modal-history #hist-timeline {
    padding-left: .35rem !important;
}

#modal-history #hist-timeline .timeline-item {
    padding-left: 3.8rem !important;
}

#modal-intervals > div {
    max-width: 760px !important;
    width: min(760px, calc(100vw - 32px)) !important;
}

#modal-intervals .p-6 {
    padding: 1.25rem !important;
}

#modal-intervals #intervals-list {
    min-height: 96px;
}

#modal-intervals #form-interval {
    display: grid;
    gap: .85rem;
}

#modal-intervals #form-interval .grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

#modal-intervals #int-name {
    font-size: 1rem;
    font-weight: 700;
}

#modal-intervals #intervals-list > p {
    background: #f8fafc;
    border: 1px dashed #d8e0ea;
    border-radius: 8px;
    color: #98a2b3 !important;
    padding: 1.4rem !important;
}

#modal-intervals h4,
#modal-history h3,
#modal-car p.uppercase {
    letter-spacing: .03em !important;
}

#modal-history input[type="file"] {
    align-items: center;
    display: flex;
    font-size: .82rem;
    padding-top: .5rem;
}

#modal-history #hist-submit-btn {
    min-width: 112px;
}

#modal-history > div {
    max-width: 1180px;
    height: min(88vh, 900px);
    max-height: calc(100vh - 32px) !important;
    min-height: 0;
}

#modal-history [class*="bg-graphite"],
#modal-driver-folder [class*="bg-graphite"] {
    background: #172033 !important;
}

#modal-history [id="hist-plate"],
#modal-driver-folder [id="driver-folder-name"] {
    letter-spacing: 0 !important;
}

#modal-history [id="hist-form-title"],
#modal-history label,
#modal-driver-folder label {
    letter-spacing: 0 !important;
}

#modal-history .std-input,
#modal-driver-folder .std-input,
#modal-client-folder .std-input {
    border: 1px solid #dbe2ea;
    background: #fff;
    min-height: 40px;
}

#modal-history .std-input:focus,
#modal-driver-folder .std-input:focus,
#modal-client-folder .std-input:focus {
    border-color: var(--mf-orange);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, .12);
    outline: none;
}

#hist-timeline .timeline-item > div:last-child {
    border-radius: 8px !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
}

#hist-stats-bar > div,
#modal-history .bg-gray-800,
#modal-driver-folder .bg-gray-50 {
    border-radius: 8px !important;
}

#modal-history button,
#modal-driver-folder button,
#modal-client-folder button {
    border-radius: 7px !important;
}

#modal-history .grid,
#modal-driver-folder .grid {
    min-width: 0;
}

@media (max-width: 980px) {
    .mf-accounts-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #modal-history > div,
    #modal-driver-folder > div {
        width: 100%;
        height: 92vh;
    }

    #modal-history > div {
        flex-direction: column;
        min-height: 0;
    }

    #modal-history > div > div:first-of-type,
    #modal-history > div > div:nth-of-type(2) {
        width: 100% !important;
    }

    #modal-history > div > div:first-of-type {
        max-height: 260px;
    }

    #modal-history > div > div:nth-of-type(2) {
        flex: 1 1 auto;
        min-height: 0;
    }

    #modal-history > div {
        display: flex !important;
        grid-template-columns: none;
    }

    #modal-history #form-add-history > .grid:first-of-type,
    #modal-history #form-add-history > .grid:nth-of-type(2),
    #modal-history #form-add-history > .grid:nth-of-type(3) {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 760px) {
    .mf-accounts-summary {
        grid-template-columns: 1fr;
    }

    #modal-car .grid-cols-4,
    #modal-car .grid-cols-3,
    #modal-car .grid-cols-2,
    #modal-car form > div:first-of-type > div:last-child,
    #modal-car form > div:nth-of-type(2) > div:last-child,
    #modal-history #form-add-history > .grid:first-of-type,
    #modal-history #form-add-history > .grid:nth-of-type(2),
    #modal-history #form-add-history > .grid:nth-of-type(3),
    #modal-intervals #form-interval .grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    #modal-car .col-span-2,
    #modal-history .col-span-2 {
        grid-column: auto !important;
    }

    #modal-car > div,
    #modal-history > div,
    #modal-intervals > div {
        width: calc(100vw - 20px) !important;
        max-height: 94vh !important;
    }

    #modal-car form {
        padding: 1rem !important;
    }

    #modal-car .px-7 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    #modal-car .py-5 {
        padding-top: .9rem !important;
        padding-bottom: .9rem !important;
    }
}

#modal-car form > div:first-of-type > div:last-child {
    grid-template-columns: 150px minmax(170px, 220px) minmax(260px, 1fr) !important;
}

#modal-intervals[data-enhanced="1"] > div {
    max-width: 1040px !important;
    width: min(1040px, calc(100vw - 32px)) !important;
}

#modal-intervals[data-enhanced="1"] #form-interval {
    display: block;
}

#modal-intervals[data-enhanced="1"] #intervals-list {
    min-height: 160px;
}

#modal-request-action > div {
    max-width: 620px !important;
    width: min(620px, calc(100vw - 28px)) !important;
    border-radius: 10px !important;
}

#modal-request-action .request-action-form {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#modal-request-action .request-action-form label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

#modal-request-action .request-action-form label.full,
#modal-request-action .request-action-footer {
    grid-column: 1 / -1;
}

#modal-request-action .request-action-form span {
    color: #667085;
    font-size: .72rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

#modal-request-action input,
#modal-request-action textarea {
    background: #fff;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    color: #111827;
    font-size: .95rem;
    line-height: 1.35;
    min-height: 44px;
    outline: none;
    padding: .7rem .8rem;
    width: 100%;
}

#modal-request-action textarea {
    min-height: 118px;
    resize: vertical;
}

#modal-request-action input:focus,
#modal-request-action textarea:focus {
    border-color: var(--mf-orange);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, .14);
}

#modal-request-action .request-action-footer {
    align-items: center;
    border-top: 1px solid #edf1f5;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 4px;
    padding-top: 16px;
}

#modal-request-action .btn-secondary,
#modal-request-action .btn-primary,
#modal-request-action .btn-success {
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 900;
    min-height: 42px;
    padding: 0 18px;
}

#modal-request-action .btn-secondary {
    background: #fff;
    border: 1px solid #d9e0ea;
    color: #475467;
}

#modal-request-action .btn-primary {
    background: var(--mf-orange);
    color: #fff;
}

#modal-request-action .btn-success {
    background: #16a34a;
    color: #fff;
}

@media (max-width: 640px) {
    #modal-request-action .request-action-form {
        grid-template-columns: 1fr;
    }
}

/* Ujednolicone okna dodatkowe: serwisy, zlecenia, dokumenty, zgłoszenia, opony */
#modal-service-partner,
#modal-service-order,
#modal-tire,
#modal-car-document,
#modal-driver-document,
#modal-driver-event,
#modal-breakdown[data-enhanced="1"],
#modal-request-action,
#plan-request-modal {
    background: rgba(15, 23, 42, .74) !important;
    backdrop-filter: blur(8px);
}

#offer-modal-overlay {
    background: rgba(15, 23, 42, .74) !important;
    backdrop-filter: blur(8px);
}

#modal-service-partner > div,
#modal-service-order > div,
#modal-tire > div,
#modal-car-document > div,
#modal-driver-document > div,
#modal-driver-event > div,
#modal-breakdown[data-enhanced="1"] > div,
#modal-request-action > div,
#plan-request-modal > div {
    border: 1px solid rgba(226, 232, 240, .95) !important;
    border-radius: 10px !important;
    box-shadow: 0 30px 90px rgba(15, 23, 42, .36) !important;
    overflow: hidden;
}

#offer-modal-overlay > div,
#plan-request-modal > div {
    max-width: 560px !important;
    padding: 0 !important;
    width: min(560px, calc(100vw - 28px)) !important;
}

#offer-modal-overlay h3,
#plan-request-modal h3 {
    background: #172033;
    border-bottom: 4px solid var(--mf-orange);
    color: #fff !important;
    font-size: 1.1rem !important;
    font-weight: 900 !important;
    margin: 0 !important;
    padding: 20px 24px !important;
}

#plan-request-modal h3 + p {
    background: #f8fafc;
    border-bottom: 1px solid #edf1f5;
    margin: 0 !important;
    padding: 16px 24px !important;
}

#offer-modal-overlay .space-y-3,
#plan-request-modal .space-y-3 {
    display: grid;
    gap: 14px;
    padding: 20px 24px 0;
}

#offer-modal-overlay label,
#plan-request-modal label {
    color: #667085 !important;
    display: block;
    font-size: .72rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    text-transform: uppercase;
}

#offer-modal-overlay input,
#offer-modal-overlay select,
#offer-modal-overlay textarea,
#plan-request-modal input,
#plan-request-modal select,
#plan-request-modal textarea {
    border: 1px solid #cfd8e3 !important;
    border-radius: 8px !important;
    font-size: .95rem !important;
    min-height: 44px;
    padding: .7rem .8rem !important;
}

#offer-modal-overlay input:focus,
#offer-modal-overlay select:focus,
#offer-modal-overlay textarea:focus,
#plan-request-modal input:focus,
#plan-request-modal select:focus,
#plan-request-modal textarea:focus {
    border-color: var(--mf-orange) !important;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, .14) !important;
}

#offer-modal-overlay .flex.gap-3,
#plan-request-modal .flex.gap-3 {
    border-top: 1px solid #edf1f5;
    margin-top: 20px !important;
    padding: 16px 24px 20px;
}

#modal-service-partner > div {
    max-width: 720px !important;
    width: min(720px, calc(100vw - 28px)) !important;
    max-height: min(90vh, 820px) !important;
}

#modal-manual-insurance .mf-manual-insurance-dialog {
    max-width: 760px !important;
    width: min(760px, calc(100vw - 28px)) !important;
}

#modal-service-order > div {
    max-width: 980px !important;
    width: min(980px, calc(100vw - 28px)) !important;
}

#modal-service-partner .mf-modal-head,
#modal-service-order .mf-modal-head,
#modal-tire .mf-modal-head,
#modal-driver-document .mf-modal-head,
#modal-driver-event .mf-modal-head,
#modal-manual-insurance .mf-modal-head {
    align-items: center;
    background: #172033;
    border-bottom: 4px solid var(--mf-orange);
    color: #fff;
    display: flex;
    justify-content: space-between;
    padding: 20px 24px;
}

#modal-service-partner .mf-modal-head h3,
#modal-service-order .mf-modal-head h3,
#modal-tire .mf-modal-head h3,
#modal-driver-document .mf-modal-head h3,
#modal-driver-event .mf-modal-head h2,
#modal-manual-insurance .mf-modal-head h3 {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1.15;
}

#modal-service-partner .mf-modal-head p,
#modal-service-order .mf-modal-head p,
#modal-tire .mf-modal-head p,
#modal-driver-document .mf-modal-head p,
#modal-driver-event .mf-modal-head p,
#modal-manual-insurance .mf-modal-head p {
    color: #cbd5e1;
    font-size: .78rem;
    margin-top: 4px;
}

#modal-service-partner .mf-modal-head button,
#modal-service-order .mf-modal-head button,
#modal-tire .mf-modal-head button,
#modal-driver-document .mf-modal-head button,
#modal-driver-event .mf-modal-head button,
#modal-manual-insurance .mf-modal-head button {
    align-items: center;
    background: rgba(255, 255, 255, .10);
    border: 0;
    border-radius: 10px !important;
    color: #fff;
    display: flex;
    height: 40px;
    justify-content: center;
    width: 40px;
}

#form-service-partner,
#form-service-order,
#form-tire,
#form-car-document,
#form-driver-document,
#form-driver-event,
#modal-breakdown[data-enhanced="1"] form {
    gap: 16px !important;
    padding: 22px 24px !important;
}

#form-service-partner.service-partner-form {
    display: flex !important;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0 !important;
    min-height: 0;
    overflow: hidden;
    padding: 0 !important;
}

#form-service-partner .service-partner-fields {
    display: grid;
    flex: 1 1 auto;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 0;
    overflow-y: auto;
    padding: 22px 24px;
}

#form-service-partner .service-partner-footer {
    align-items: center;
    background: #fff;
    border-top: 1px solid #edf1f5;
    box-shadow: 0 -12px 28px rgba(15, 23, 42, .06);
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 24px 18px;
}

#form-service-partner .service-partner-active {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    display: flex !important;
    flex-direction: row !important;
    gap: 10px;
    justify-content: flex-start;
    padding: 12px 14px;
}

#form-service-partner .service-partner-active input {
    min-height: auto !important;
    width: 18px !important;
}

#modal-manual-insurance .mf-manual-insurance-form {
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px 24px 0;
}

#modal-manual-insurance .mf-modal-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
}

#modal-manual-insurance .mf-modal-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#modal-manual-insurance .mf-modal-grid-span {
    grid-column: 1 / -1;
}

#modal-manual-insurance label {
    display: flex !important;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

#modal-manual-insurance label span {
    color: #667085 !important;
    font-size: .72rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
}

#modal-manual-insurance textarea.std-input {
    min-height: 96px;
    resize: vertical;
}

#modal-manual-insurance .mf-insurance-current {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    color: #1d4ed8;
    font-size: .82rem;
    line-height: 1.45;
    margin-top: 12px;
    padding: 12px;
}

#modal-manual-insurance .mf-modal-foot {
    align-items: center;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin: 4px -24px 0;
    padding: 16px 24px 18px;
}

#modal-manual-insurance .mf-btn-secondary,
#modal-manual-insurance .mf-btn-primary {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    font-size: .9rem;
    font-weight: 900;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
}

#modal-manual-insurance .mf-btn-secondary {
    background: #fff;
    border: 1px solid #d7dee8;
    color: #475569;
}

#modal-manual-insurance .mf-btn-secondary:hover {
    background: #f8fafc;
    color: #111827;
}

#modal-manual-insurance .mf-btn-primary {
    background: var(--mf-orange);
    border: 1px solid var(--mf-orange);
    box-shadow: 0 10px 24px rgba(255, 102, 0, .22);
    color: #fff;
}

#modal-manual-insurance .mf-btn-primary:hover {
    background: #e85c00;
}

.mf-alert-summary-bar {
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .04);
    color: #667085;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: -4px 0 14px;
    padding: 10px 12px;
}

.mf-alert-summary-bar span {
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 800;
    padding: 6px 10px;
}

.mf-alert-summary-bar strong {
    color: #ff6600;
    font-size: .95rem;
}

#view-messages[data-enhanced="1"] {
    height: calc(100vh - 132px);
    min-height: 620px;
}

.mf-messages-shell {
    background: #fff;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .06);
    display: grid;
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.mf-messages-sidebar {
    background: #fbfcfe;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mf-messages-head {
    align-items: center;
    border-bottom: 1px solid #e8eef6;
    display: flex;
    justify-content: space-between;
    padding: 18px 18px 16px;
}

.mf-messages-title {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.mf-messages-title > span {
    align-items: center;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 9px;
    color: #ff6600;
    display: flex;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.mf-messages-title h2 {
    color: #0f172a;
    font-size: 1.15rem;
    font-weight: 950;
    line-height: 1.1;
}

.mf-messages-title p {
    color: #94a3b8;
    font-size: .76rem;
    margin-top: 4px;
}

.mf-messages-head button {
    align-items: center;
    background: #ff6600;
    border: 0;
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(255, 102, 0, .22);
    color: #fff;
    display: flex;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.mf-messages-search {
    margin: 14px 16px;
    position: relative;
}

.mf-messages-search i {
    color: #94a3b8;
    font-size: .85rem;
    left: 13px;
    position: absolute;
    top: 13px;
}

.mf-messages-search input {
    background: #fff;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    color: #0f172a;
    font-size: .88rem;
    min-height: 42px;
    outline: none;
    padding: 0 12px 0 38px;
    width: 100%;
}

.mf-messages-search input:focus {
    border-color: #ff6600;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, .12);
}

.mf-messages-stats {
    display: grid;
    gap: .5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 1rem 1rem;
}

.mf-messages-stats span {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    font-size: .72rem;
    font-weight: 850;
    padding: .55rem .65rem;
}

.mf-messages-stats b {
    color: var(--mf-text);
    display: block;
    font-size: 1rem;
    line-height: 1;
}

.mf-messages-stats .is-hot {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #c2410c;
}

.mf-conversations-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 10px 12px;
}

.mf-conversations-empty,
.mf-chat-empty,
.mf-chat-empty-inline {
    align-items: center;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.mf-conversations-empty {
    min-height: 220px;
}

.mf-conversations-empty i,
.mf-chat-empty-inline i {
    color: #cbd5e1;
    font-size: 2rem;
    margin-bottom: 10px;
}

.mf-conversations-empty strong {
    color: #475569;
    font-size: .95rem;
}

.mf-conversations-empty p,
.mf-chat-empty p,
.mf-chat-empty-inline p {
    font-size: .84rem;
    margin-top: 4px;
}

.mf-conversation-item {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    display: flex;
    gap: 12px;
    padding: 11px 10px;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.mf-conversation-item:hover,
.mf-conversation-item.is-active {
    background: #fff;
    border-color: #fed7aa;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
}

.mf-conversation-avatar,
.mf-chat-avatar {
    align-items: center;
    background: #172033;
    border-radius: 999px;
    color: #fff;
    display: flex;
    flex: 0 0 auto;
    font-size: .82rem;
    font-weight: 950;
    height: 42px;
    justify-content: center;
    position: relative;
    width: 42px;
}

.mf-conversation-avatar span {
    align-items: center;
    background: #2563eb;
    border: 2px solid #fff;
    border-radius: 999px;
    display: flex;
    font-size: .62rem;
    height: 19px;
    justify-content: center;
    position: absolute;
    right: -5px;
    top: -5px;
    width: 19px;
}

.mf-conversation-copy {
    flex: 1;
    min-width: 0;
}

.mf-conversation-copy div {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.mf-conversation-copy strong,
.mf-chat-head h3 {
    color: #0f172a;
    font-size: .9rem;
    font-weight: 900;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mf-conversation-copy time,
.mf-message-row time {
    color: #64748b;
    flex: 0 0 auto;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1.2;
}

.mf-conversation-copy p {
    color: #94a3b8;
    font-size: .78rem;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mf-chat-panel {
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    min-width: 0;
    min-height: 0;
}

.mf-chat-empty {
    height: 100%;
}

.mf-chat-empty div {
    align-items: center;
    background: #f1f5f9;
    border-radius: 999px;
    color: #cbd5e1;
    display: flex;
    height: 86px;
    justify-content: center;
    margin-bottom: 16px;
    width: 86px;
}

.mf-chat-empty h3 {
    color: #64748b;
    font-size: 1.1rem;
    font-weight: 900;
}

.mf-chat-area {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

#msg-chat-area.hidden,
#msg-empty-state.hidden {
    display: none !important;
}

.mf-chat-head {
    align-items: center;
    background: rgba(255, 255, 255, .88);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    padding: 15px 18px;
}

.mf-chat-head p {
    color: #94a3b8;
    font-size: .76rem;
    font-weight: 800;
    margin-top: 2px;
}

.mf-chat-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow-y: auto;
    padding: 22px;
}

.mf-chat-empty-inline {
    flex: 1;
    min-height: 220px;
}

.mf-message-row {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    max-width: min(620px, 78%);
}

.mf-message-row.is-mine {
    align-self: flex-end;
    align-items: flex-end;
}

.mf-message-bubble {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px 14px 14px 4px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
    color: #1f2937;
    font-size: .92rem;
    line-height: 1.45;
    padding: 10px 13px;
    white-space: normal;
    word-break: break-word;
}

.mf-message-row.is-mine .mf-message-bubble {
    background: #ff6600;
    border-color: #ff6600;
    border-radius: 14px 14px 4px 14px;
    box-shadow: 0 10px 22px rgba(255, 102, 0, .16);
    color: #fff;
}

.mf-message-row time {
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(226, 232, 240, .86);
    border-radius: 999px;
    margin-top: 6px;
    padding: 3px 8px;
}

.mf-message-row.is-mine time {
    background: rgba(255, 102, 0, .10);
    border-color: rgba(255, 102, 0, .18);
    color: #ea580c;
}

.mf-chat-composer {
    align-items: flex-end;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    padding: 14px 16px;
}

.mf-chat-composer textarea {
    border: 1px solid #cfd8e3;
    border-radius: 10px;
    color: #0f172a;
    flex: 1;
    font-size: .92rem;
    max-height: 130px;
    min-height: 44px;
    outline: none;
    padding: 11px 13px;
    resize: none;
}

.mf-chat-composer textarea:focus {
    border-color: #ff6600;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, .12);
}

.mf-chat-composer button {
    align-items: center;
    background: #ff6600;
    border: 0;
    border-radius: 10px;
    box-shadow: 0 10px 22px rgba(255, 102, 0, .2);
    color: #fff;
    display: flex;
    height: 44px;
    justify-content: center;
    width: 48px;
}

@media (max-width: 900px) {
    #view-messages[data-enhanced="1"] {
        height: auto;
        min-height: 720px;
    }

    .mf-messages-shell {
        grid-template-columns: 1fr;
    }

    .mf-messages-sidebar {
        border-right: 0;
        border-bottom: 1px solid #e2e8f0;
        max-height: 330px;
    }
}

@media (max-width: 720px) {
    #modal-manual-insurance .mf-modal-grid {
        grid-template-columns: 1fr;
    }

    #modal-manual-insurance .mf-modal-foot {
        align-items: stretch;
        flex-direction: column-reverse;
    }
}

#form-service-partner label,
#form-service-order label,
#form-tire label,
#form-car-document label,
#form-driver-document label,
#form-driver-event label,
#modal-breakdown[data-enhanced="1"] label {
    display: flex !important;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

#form-service-partner label span,
#form-service-order label span,
#form-car-document label span,
#form-driver-document label span,
#form-driver-event label,
#modal-breakdown[data-enhanced="1"] label span {
    color: #667085 !important;
    font-size: .72rem !important;
    font-weight: 900 !important;
    letter-spacing: 0 !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
}

#form-service-partner input,
#form-service-partner select,
#form-service-partner textarea,
#form-service-order input,
#form-service-order select,
#form-service-order textarea,
#form-tire input,
#form-tire select,
#form-tire textarea,
#form-car-document input,
#form-car-document select,
#form-car-document textarea,
#form-driver-document input,
#form-driver-document select,
#form-driver-document textarea,
#form-driver-event input,
#form-driver-event select,
#form-driver-event textarea,
#modal-breakdown[data-enhanced="1"] input,
#modal-breakdown[data-enhanced="1"] select,
#modal-breakdown[data-enhanced="1"] textarea {
    background: #fff !important;
    border: 1px solid #cfd8e3 !important;
    border-radius: 8px !important;
    color: #111827 !important;
    font-size: .95rem !important;
    line-height: 1.35 !important;
    min-height: 44px;
    outline: none !important;
    padding: .7rem .8rem !important;
    width: 100%;
}

#form-service-partner textarea,
#form-service-order textarea,
#form-car-document textarea,
#form-driver-document textarea,
#form-driver-event textarea,
#modal-breakdown[data-enhanced="1"] textarea {
    min-height: 106px;
    resize: vertical;
}

#form-service-partner input:focus,
#form-service-partner select:focus,
#form-service-partner textarea:focus,
#form-service-order input:focus,
#form-service-order select:focus,
#form-service-order textarea:focus,
#form-tire input:focus,
#form-tire select:focus,
#form-tire textarea:focus,
#form-car-document input:focus,
#form-car-document select:focus,
#form-car-document textarea:focus,
#form-driver-document input:focus,
#form-driver-document select:focus,
#form-driver-document textarea:focus,
#form-driver-event input:focus,
#form-driver-event select:focus,
#form-driver-event textarea:focus,
#modal-breakdown[data-enhanced="1"] input:focus,
#modal-breakdown[data-enhanced="1"] select:focus,
#modal-breakdown[data-enhanced="1"] textarea:focus {
    border-color: var(--mf-orange) !important;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, .14) !important;
}

#form-service-partner > div:last-child,
#form-service-order > div:last-child,
#form-car-document > div:last-child,
#form-driver-document > div:last-child,
#form-driver-event > div:last-child,
#modal-breakdown[data-enhanced="1"] form > div:last-child {
    align-items: center;
    border-top: 1px solid #edf1f5;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 2px;
    padding-top: 16px !important;
}

#form-service-partner .service-partner-footer {
    margin-top: 0 !important;
    padding: 14px 24px 18px !important;
}

#form-service-partner button,
#form-service-order button,
#form-car-document button,
#form-driver-document button,
#form-driver-event button,
#modal-breakdown[data-enhanced="1"] form button {
    border-radius: 8px !important;
    min-height: 42px;
}

@media (max-width: 760px) {
    #form-service-partner,
    #form-service-order,
    #form-car-document,
    #form-driver-document,
    #form-driver-event,
    #modal-breakdown[data-enhanced="1"] form {
        grid-template-columns: 1fr !important;
        padding: 18px !important;
    }

    #form-service-partner .md\:col-span-2,
    #form-service-order .md\:col-span-2,
    #form-service-order .md\:col-span-3,
    #form-car-document .md\:col-span-2,
    #form-driver-document .md\:col-span-2 {
        grid-column: auto !important;
    }
}

.driver-documents-panel {
    background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%) !important;
    border: 1px solid #dfe6ef !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .06) !important;
    padding: 14px !important;
}

.driver-documents-head {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.driver-documents-title {
    align-items: center;
    display: flex;
    gap: 10px;
    min-width: 0;
}

.driver-documents-mark {
    align-items: center;
    background: #fff4ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    color: #ff6600;
    display: flex;
    flex: 0 0 38px;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.driver-documents-title p {
    color: #172033 !important;
    font-size: .9rem !important;
    font-weight: 900 !important;
    letter-spacing: 0 !important;
    line-height: 1.15 !important;
    margin: 0 !important;
    text-transform: none !important;
}

.driver-documents-head span {
    color: #98a2b3;
    display: block;
    font-size: .72rem;
    font-weight: 800;
    margin-top: 3px;
}

.driver-documents-head button,
.driver-doc-add-btn {
    align-items: center;
    background: #ff6600 !important;
    border: 0 !important;
    border-radius: 8px !important;
    color: #fff !important;
    display: inline-flex;
    font-size: .78rem;
    font-weight: 900;
    gap: 7px;
    min-height: 36px;
    padding: 0 12px;
    white-space: nowrap;
}

.driver-documents-head button:hover,
.driver-doc-add-btn:hover {
    background: #cc5200 !important;
}

.driver-documents-list {
    display: grid;
    gap: 8px;
}

.driver-doc-filters {
    background: #f8fafc;
    border: 1px solid #edf1f5;
    border-radius: 9px;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(180px, 1fr) 170px 160px;
    margin-bottom: 12px;
    padding: 10px;
}

.driver-doc-search {
    position: relative;
}

.driver-doc-search i {
    color: #98a2b3;
    font-size: .78rem;
    left: 12px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.driver-doc-filters input,
.driver-doc-filters select {
    appearance: none;
    background: #fff !important;
    border: 1px solid #d9e0ea !important;
    border-radius: 8px !important;
    color: #172033 !important;
    font-size: .82rem !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    min-height: 38px !important;
    outline: none;
    padding: 0 10px !important;
    width: 100% !important;
}

.driver-doc-search input {
    padding-left: 32px !important;
}

.driver-doc-select {
    display: grid;
    gap: 4px;
}

.driver-doc-select span {
    color: #98a2b3;
    font-size: .62rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.driver-doc-filters input:focus,
.driver-doc-filters select:focus {
    border-color: #ff6600;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, .12);
}

.driver-doc-empty {
    align-items: center;
    background: #fff;
    border: 1px dashed #d9e0ea;
    border-radius: 10px;
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    min-height: 84px;
    padding: 14px;
    text-align: left;
}

.driver-doc-empty-icon {
    align-items: center;
    background: #f3f6fa;
    border-radius: 9px;
    color: #98a2b3;
    display: flex;
    flex: 0 0 40px;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.driver-doc-empty strong {
    color: #475467;
    display: block;
    font-size: .88rem;
    font-weight: 900;
    line-height: 1.2;
}

.driver-doc-empty span {
    color: #98a2b3;
    display: block;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.35;
    margin-top: 3px;
}

.driver-doc-row {
    align-items: flex-start;
    background: #fff;
    border: 1px solid #edf1f5;
    border-radius: 10px;
    display: grid;
    gap: 12px;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    padding: 12px;
}

.driver-doc-icon {
    align-items: center;
    background: #f3f6fa;
    border-radius: 9px;
    color: #667085;
    display: flex;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.driver-doc-main {
    min-width: 0;
}

.driver-doc-top {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.driver-doc-top strong {
    color: #172033;
    font-size: .9rem;
    line-height: 1.2;
}

.driver-doc-badge {
    border: 1px solid;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 900;
    padding: 3px 8px;
}

.driver-doc-meta {
    color: #667085;
    display: flex;
    flex-wrap: wrap;
    font-size: .74rem;
    font-weight: 700;
    gap: 6px 12px;
    margin-top: 6px;
}

.driver-doc-notes {
    color: #667085;
    font-size: .8rem;
    line-height: 1.45;
    margin-top: 8px;
}

.driver-doc-actions {
    display: flex;
    gap: 6px;
}

.driver-doc-action {
    align-items: center;
    background: #fff;
    border: 1px solid #d9e0ea;
    border-radius: 8px !important;
    color: #667085;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.driver-doc-action:hover {
    border-color: #ff6600;
    color: #ff6600;
}

.driver-doc-action.danger:hover {
    border-color: #ef4444;
    color: #ef4444;
}

#form-driver-document small {
    color: #98a2b3;
    font-size: .72rem;
    font-weight: 700;
}

#form-driver-document .btn-primary,
#form-driver-document .btn-secondary,
#form-driver-event .btn-primary {
    font-size: .9rem;
    font-weight: 900;
    padding: 0 18px;
}

#form-driver-document .btn-primary,
#form-driver-event .btn-primary {
    background: #ff6600;
    color: #fff;
}

#form-driver-document .btn-secondary {
    background: #fff;
    border: 1px solid #d9e0ea;
    color: #475467;
}

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

    .driver-doc-row {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .driver-doc-actions {
        grid-column: 2;
        justify-content: flex-start;
    }
}

#modal-car form > div:nth-of-type(2) > div:last-child {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

/* Dark mode hardening: dashboard, normalized tables and operational cards */
body.dark-mode {
    background: #0b1220 !important;
    color: #e5edf7 !important;
}

body.dark-mode #app-screen,
body.dark-mode main,
body.dark-mode #content-area,
body.dark-mode .view-section {
    background: #0b1220 !important;
    color: #e5edf7 !important;
}

body.dark-mode .mf-view-header {
    background:
        linear-gradient(135deg, rgba(22, 32, 51, .98), rgba(15, 23, 42, .96)) !important;
    border-color: #334155 !important;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .28) !important;
}

body.dark-mode .mf-view-title,
body.dark-mode .mf-view-title span,
body.dark-mode .mf-view-header h1,
body.dark-mode .mf-view-header h2,
body.dark-mode .mf-view-header h3,
body.dark-mode .mf-view-desc {
    color: #e5edf7 !important;
}

body.dark-mode .mf-workspace-map,
body.dark-mode .mf-module-card,
body.dark-mode .dash-card,
body.dark-mode #dashboard-content button.group,
body.dark-mode .mf-view-normalized .mf-kpi-card,
body.dark-mode .mf-view-normalized .mf-table-card,
body.dark-mode .mf-view-normalized .mf-toolbar,
body.dark-mode .mf-view-normalized .mf-surface,
body.dark-mode .bg-white {
    background:
        linear-gradient(135deg, #162033, #111a2b) !important;
    border-color: #334155 !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .24) !important;
    color: #e5edf7 !important;
}

body.dark-mode .mf-workspace-head {
    border-color: #334155 !important;
}

body.dark-mode .mf-workspace-head h3,
body.dark-mode .mf-module-title h4,
body.dark-mode .mf-module-actions button span,
body.dark-mode #dashboard-content button.group p,
body.dark-mode .dash-value,
body.dark-mode .font-black,
body.dark-mode .font-bold,
body.dark-mode .text-graphite,
body.dark-mode .text-gray-900,
body.dark-mode .text-gray-800,
body.dark-mode .text-gray-700 {
    color: #f8fafc !important;
}

body.dark-mode .mf-module-title p,
body.dark-mode .mf-module-actions button small,
body.dark-mode #dashboard-content button.group p.text-xs,
body.dark-mode .dash-label,
body.dark-mode .text-gray-600,
body.dark-mode .text-gray-500,
body.dark-mode .text-gray-400,
body.dark-mode .text-gray-300,
body.dark-mode small,
body.dark-mode time,
body.dark-mode label {
    color: #a8b3c5 !important;
}

body.dark-mode .mf-module-title > span,
body.dark-mode #dashboard-content button.group > div,
body.dark-mode .mf-accounts-summary button i,
body.dark-mode .mf-view-title-icon {
    background: #22314b !important;
    border-color: #3b4a63 !important;
    color: #fb923c !important;
}

body.dark-mode .mf-module-actions button,
body.dark-mode .mf-quiet-action,
body.dark-mode .svc-status-pill,
body.dark-mode .tire-season-pill,
body.dark-mode button.bg-white,
body.dark-mode .mf-row-panel-btn {
    background: #1b263b !important;
    border-color: #3b4a63 !important;
    color: #e5edf7 !important;
    box-shadow: none !important;
}

body.dark-mode .mf-module-actions button:hover,
body.dark-mode #dashboard-content button.group:hover,
body.dark-mode .mf-quiet-action:hover,
body.dark-mode .svc-status-pill:hover,
body.dark-mode .tire-season-pill:hover {
    background: rgba(255, 102, 0, .13) !important;
    border-color: #fb923c !important;
}

body.dark-mode .mf-service-source {
    background: rgba(15, 23, 42, .72) !important;
    border-color: rgba(148, 163, 184, .24) !important;
    color: #cbd5e1 !important;
}

body.dark-mode .mf-service-source.request {
    background: rgba(255, 102, 0, .14) !important;
    border-color: rgba(255, 102, 0, .32) !important;
    color: #fdba74 !important;
}

body.dark-mode .mf-service-source.history {
    background: rgba(59, 130, 246, .14) !important;
    border-color: rgba(59, 130, 246, .32) !important;
    color: #93c5fd !important;
}

body.dark-mode .mf-service-flow span {
    background: rgba(15, 23, 42, .72) !important;
    border-color: rgba(148, 163, 184, .24) !important;
    color: #94a3b8 !important;
}

body.dark-mode .mf-service-flow span.done {
    background: rgba(34, 197, 94, .12) !important;
    border-color: rgba(34, 197, 94, .28) !important;
    color: #86efac !important;
}

body.dark-mode .mf-service-flow span.current {
    background: rgba(255, 102, 0, .15) !important;
    border-color: rgba(255, 102, 0, .38) !important;
    color: #fdba74 !important;
}

body.dark-mode .mf-folder-center-head h3,
body.dark-mode .mf-folder-grid button strong {
    color: #f8fafc !important;
}

body.dark-mode .mf-folder-grid button {
    background: rgba(15, 23, 42, .72) !important;
    border-color: rgba(148, 163, 184, .24) !important;
    color: #cbd5e1 !important;
}

body.dark-mode .mf-folder-grid button:hover:not(:disabled) {
    border-color: rgba(255, 102, 0, .42) !important;
    box-shadow: 0 14px 28px rgba(0, 0, 0, .28) !important;
}

body.dark-mode .mf-folder-grid button span {
    color: #a8b3c7 !important;
}

body.dark-mode .mf-folder-active {
    background: rgba(255, 102, 0, .14) !important;
    color: #fdba74 !important;
}

body.dark-mode .mf-folder-ok {
    background: rgba(34, 197, 94, .14) !important;
    color: #86efac !important;
}

body.dark-mode .mf-view-normalized .mf-data-table td,
body.dark-mode .mf-view-normalized .mf-data-table tbody td,
body.dark-mode table td,
body.dark-mode tbody tr {
    background: #162033 !important;
    border-color: #2b3a52 !important;
    color: #e5edf7 !important;
}

body.dark-mode .mf-view-normalized .mf-data-table th,
body.dark-mode table th,
body.dark-mode thead th {
    background: #101827 !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

body.dark-mode .mf-view-normalized .mf-data-table tbody tr:hover td,
body.dark-mode tbody tr:hover td,
body.dark-mode tbody tr:hover {
    background: #1f2d44 !important;
    border-color: #fb923c !important;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea,
body.dark-mode .std-input,
body.dark-mode .mf-control {
    background: #0b1220 !important;
    border-color: #3b4a63 !important;
    color: #f8fafc !important;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #738199 !important;
}

body.dark-mode [class*="bg-gray-50"],
body.dark-mode [class*="bg-gray-100"],
body.dark-mode [class*="bg-orange-50"],
body.dark-mode [class*="bg-blue-50"],
body.dark-mode [class*="bg-green-50"],
body.dark-mode [class*="bg-red-50"],
body.dark-mode [class*="bg-purple-50"],
body.dark-mode [class*="bg-indigo-50"],
body.dark-mode [class*="bg-yellow-50"] {
    background: rgba(148, 163, 184, .12) !important;
    border-color: rgba(148, 163, 184, .2) !important;
}

body.dark-mode .text-orange-tech,
body.dark-mode [class*="text-orange-"] {
    color: #fb923c !important;
}

body.dark-mode [class*="text-blue-"],
body.dark-mode [class*="text-indigo-"],
body.dark-mode [class*="text-purple-"] {
    color: #93c5fd !important;
}

body.dark-mode [class*="text-green-"] {
    color: #86efac !important;
}

body.dark-mode [class*="text-red-"] {
    color: #fca5a5 !important;
}

body.dark-mode .bg-orange-tech,
body.dark-mode button.bg-orange-tech {
    background: #ff6600 !important;
    color: #fff !important;
}

/* Dark mode v3: active section color follows left navigation */
body.dark-mode main {
    background:
        radial-gradient(circle at 18% 0%, var(--view-glow, rgba(56, 189, 248, .16)), transparent 34%),
        radial-gradient(circle at 96% 6%, rgba(255, 102, 0, .10), transparent 26%),
        linear-gradient(180deg, #0b1220 0%, #08111f 100%) !important;
}

body.dark-mode main > header {
    background:
        linear-gradient(90deg, rgba(11, 18, 32, .92), rgba(15, 23, 42, .82)) !important;
    border-bottom: 1px solid rgba(51, 65, 85, .62);
}

body.dark-mode #page-title {
    color: #a8b3c5 !important;
}

body.dark-mode #page-title i {
    color: var(--view-accent, #38bdf8) !important;
}

body.dark-mode .mf-view-header {
    background:
        linear-gradient(135deg, rgba(22, 32, 51, .98), rgba(15, 23, 42, .94)),
        radial-gradient(circle at 0% 0%, var(--view-glow, rgba(56, 189, 248, .18)), transparent 42%) !important;
    border-color: rgba(148, 163, 184, .22) !important;
}

body.dark-mode .mf-view-header::before {
    background: linear-gradient(180deg, var(--view-accent, #38bdf8), #ff6600) !important;
    box-shadow: 0 0 24px var(--view-glow, rgba(56, 189, 248, .18));
}

body.dark-mode .mf-view-title-icon {
    background:
        linear-gradient(135deg, var(--view-glow, rgba(56, 189, 248, .20)), rgba(255, 255, 255, .04)) !important;
    border-color: color-mix(in srgb, var(--view-accent, #38bdf8) 42%, #334155) !important;
    color: var(--view-accent, #38bdf8) !important;
}

body.dark-mode .mf-workspace-map,
body.dark-mode .mf-module-card,
body.dark-mode .dash-card,
body.dark-mode #dashboard-content button.group,
body.dark-mode .mf-view-normalized .mf-kpi-card,
body.dark-mode .mf-view-normalized .mf-table-card,
body.dark-mode .mf-view-normalized .mf-toolbar,
body.dark-mode .mf-view-normalized .mf-surface,
body.dark-mode .mf-service-orders-card,
body.dark-mode .mf-messages-shell,
body.dark-mode .mf-alert-notifications {
    background:
        linear-gradient(135deg, rgba(22, 32, 51, .98), rgba(17, 26, 43, .98)) !important;
    border-color: rgba(148, 163, 184, .20) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .035),
        0 16px 38px rgba(0, 0, 0, .26) !important;
}

body.dark-mode .mf-module-card,
body.dark-mode .dash-card,
body.dark-mode #dashboard-content button.group,
body.dark-mode .mf-view-normalized .mf-kpi-card {
    position: relative;
    overflow: hidden;
}

body.dark-mode .mf-module-card::before,
body.dark-mode .dash-card::before,
body.dark-mode #dashboard-content button.group::before,
body.dark-mode .mf-view-normalized .mf-kpi-card::before {
    background: linear-gradient(180deg, var(--view-accent, #38bdf8), transparent);
    border-radius: 999px;
    content: "";
    height: calc(100% - 18px);
    left: 0;
    opacity: .95;
    position: absolute;
    top: 9px;
    width: 3px;
}

body.dark-mode .mf-module-title > span,
body.dark-mode #dashboard-content button.group > div,
body.dark-mode .mf-accounts-summary button i,
body.dark-mode .driver-doc-icon,
body.dark-mode .mf-alert-notifications-icon {
    background:
        linear-gradient(135deg, var(--view-glow, rgba(56, 189, 248, .18)), rgba(255, 255, 255, .05)) !important;
    border: 1px solid rgba(148, 163, 184, .18) !important;
    color: var(--view-accent, #38bdf8) !important;
}

body.dark-mode .mf-module-actions button,
body.dark-mode .mf-quiet-action,
body.dark-mode .svc-status-pill,
body.dark-mode .tire-season-pill,
body.dark-mode .mf-row-panel-btn,
body.dark-mode .btn-driver-folder,
body.dark-mode td button,
body.dark-mode .mf-chat-composer button:not(.bg-orange-tech) {
    background: rgba(15, 23, 42, .72) !important;
    border-color: rgba(148, 163, 184, .20) !important;
    color: #e5edf7 !important;
}

body.dark-mode .mf-module-actions button:hover,
body.dark-mode .mf-quiet-action:hover,
body.dark-mode .svc-status-pill:hover,
body.dark-mode .tire-season-pill:hover,
body.dark-mode .mf-row-panel-btn:hover,
body.dark-mode td button:hover {
    background: var(--view-glow, rgba(56, 189, 248, .14)) !important;
    border-color: var(--view-accent, #38bdf8) !important;
    color: #fff !important;
}

body.dark-mode .mf-view-normalized .mf-data-table td,
body.dark-mode .mf-view-normalized .mf-data-table tbody td,
body.dark-mode table td {
    background: rgba(22, 32, 51, .94) !important;
}

body.dark-mode .mf-view-normalized .mf-data-table tbody tr:hover td,
body.dark-mode tbody tr:hover td {
    background: rgba(31, 45, 68, .98) !important;
    border-color: var(--view-accent, #38bdf8) !important;
}

body.dark-mode .mf-view-normalized .mf-data-table tbody td:first-child,
body.dark-mode .mf-record-table tbody td:first-child {
    box-shadow: inset 3px 0 0 rgba(148, 163, 184, .08);
}

body.dark-mode .mf-view-normalized .mf-data-table tbody tr:hover td:first-child,
body.dark-mode .mf-record-table tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 var(--view-accent, #38bdf8);
}

body.dark-mode .dash-card.blue { border-left-color: #3b82f6 !important; }
body.dark-mode .dash-card.orange { border-left-color: #ff6600 !important; }
body.dark-mode .dash-card.red { border-left-color: #ef4444 !important; }
body.dark-mode .dash-card.green { border-left-color: #10b981 !important; }

body.dark-mode .dash-value {
    color: #f8fafc !important;
    text-shadow: 0 0 22px var(--view-glow, rgba(56, 189, 248, .18));
}

body.dark-mode .dash-label,
body.dark-mode .mf-eyebrow {
    color: var(--view-accent, #38bdf8) !important;
}

body.dark-mode #smart-drivers-body tr,
body.dark-mode #accounts-body tr,
body.dark-mode #service-orders-body tr,
body.dark-mode #fleet-body tr {
    background: transparent !important;
}

body.dark-mode #smart-drivers-body td,
body.dark-mode #accounts-body td,
body.dark-mode #service-orders-body td,
body.dark-mode #fleet-body td {
    background: rgba(22, 32, 51, .96) !important;
}

body.dark-mode #smart-drivers-body tr:hover td,
body.dark-mode #accounts-body tr:hover td,
body.dark-mode #service-orders-body tr:hover td,
body.dark-mode #fleet-body tr:hover td {
    background: rgba(31, 45, 68, .98) !important;
}

body.dark-mode .bg-graphite {
    background: #22314b !important;
}

body.dark-mode .mf-chat-panel,
body.dark-mode .mf-chat-messages {
    background:
        radial-gradient(circle at 96% 0%, var(--view-glow, rgba(56, 189, 248, .10)), transparent 34%),
        linear-gradient(180deg, #111a2b 0%, #0d1626 100%) !important;
}

body.dark-mode .mf-conversation-copy time {
    color: #cbd5e1 !important;
}

body.dark-mode .mf-message-row time {
    background: rgba(15, 23, 42, .78) !important;
    border: 1px solid rgba(148, 163, 184, .22) !important;
    color: #cbd5e1 !important;
}

body.dark-mode .mf-message-row.is-mine time {
    background: rgba(255, 102, 0, .16) !important;
    border-color: rgba(255, 102, 0, .26) !important;
    color: #fed7aa !important;
}

/* Dark mode v4: remove leftover light islands in cards, empty states and modals */
body.dark-mode .bg-white,
body.dark-mode .bg-slate-50,
body.dark-mode .bg-gray-50,
body.dark-mode .bg-gray-100,
body.dark-mode [style*="background:white"],
body.dark-mode [style*="background: white"],
body.dark-mode [style*="background:#fff"],
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background:#ffffff"],
body.dark-mode [style*="background: #ffffff"],
body.dark-mode [style*="background:#f8fafc"],
body.dark-mode [style*="background: #f8fafc"],
body.dark-mode [style*="background:#f1f5f9"],
body.dark-mode [style*="background: #f1f5f9"] {
    background: linear-gradient(135deg, rgba(22, 32, 51, .98), rgba(15, 23, 42, .98)) !important;
    border-color: rgba(148, 163, 184, .22) !important;
    color: #e5edf7 !important;
}

body.dark-mode .mf-chat-empty,
body.dark-mode .mf-chat-empty-inline,
body.dark-mode #msg-empty-state {
    background: transparent !important;
    color: #a8b3c5 !important;
}

body.dark-mode .mf-chat-empty div,
body.dark-mode .mf-chat-empty-inline i,
body.dark-mode .mf-conversations-empty i {
    background: rgba(148, 163, 184, .10) !important;
    color: var(--view-accent, #38bdf8) !important;
}

body.dark-mode .mf-chat-empty h3,
body.dark-mode .mf-chat-empty-inline p,
body.dark-mode .mf-conversations-empty strong,
body.dark-mode .mf-conversations-empty p {
    color: #dbe7f6 !important;
}

body.dark-mode .mf-vehicle-line,
body.dark-mode .mf-vehicle-term,
body.dark-mode .mf-vehicle-action,
body.dark-mode #modal-intervals #intervals-list > p,
body.dark-mode #modal-intervals #intervals-list > div,
body.dark-mode #modal-intervals #intervals-summary > div {
    background: rgba(15, 23, 42, .72) !important;
    border-color: rgba(148, 163, 184, .24) !important;
    color: #e5edf7 !important;
}

body.dark-mode .mf-vehicle-line span,
body.dark-mode .mf-vehicle-term span,
body.dark-mode .mf-vehicle-action small,
body.dark-mode #modal-vehicle-panel p,
body.dark-mode #modal-intervals label,
body.dark-mode #modal-intervals p,
body.dark-mode #modal-history label,
body.dark-mode #modal-history p {
    color: #a8b3c5 !important;
}

body.dark-mode .mf-vehicle-line strong,
body.dark-mode .mf-vehicle-term strong,
body.dark-mode .mf-vehicle-action strong,
body.dark-mode #modal-intervals strong,
body.dark-mode #modal-intervals .text-graphite,
body.dark-mode #modal-history strong,
body.dark-mode #modal-history .text-graphite {
    color: #f8fafc !important;
}

body.dark-mode .mf-vehicle-action span {
    background: var(--view-glow, rgba(255, 102, 0, .16)) !important;
    color: var(--view-accent, #ff6600) !important;
}

body.dark-mode .mf-vehicle-action:hover:not(:disabled) {
    border-color: var(--view-accent, #ff6600) !important;
    box-shadow: 0 16px 32px rgba(0, 0, 0, .24), inset 0 0 0 1px var(--view-glow, rgba(255, 102, 0, .18)) !important;
}

body.dark-mode #modal-intervals input,
body.dark-mode #modal-intervals select,
body.dark-mode #modal-intervals textarea,
body.dark-mode #modal-history input,
body.dark-mode #modal-history select,
body.dark-mode #modal-history textarea,
body.dark-mode #modal-vehicle-panel input,
body.dark-mode #modal-vehicle-panel select,
body.dark-mode #modal-vehicle-panel textarea {
    background: #0b1220 !important;
    border-color: rgba(148, 163, 184, .30) !important;
    color: #f8fafc !important;
}

body.dark-mode #modal-intervals input::placeholder,
body.dark-mode #modal-intervals textarea::placeholder,
body.dark-mode #modal-history input::placeholder,
body.dark-mode #modal-history textarea::placeholder {
    color: #94a3b8 !important;
}

body.dark-mode .mf-view-normalized .mf-table-card > div:first-child,
body.dark-mode .mf-view-normalized .mf-data-panel > div:first-child,
body.dark-mode .mf-service-orders-card > div:first-child,
body.dark-mode .border-b,
body.dark-mode .border-gray-50,
body.dark-mode .border-gray-100,
body.dark-mode .border-gray-200 {
    border-color: rgba(148, 163, 184, .20) !important;
}

/* Dark mode v5: driver folder document section */
body.dark-mode .driver-documents-panel {
    background:
        radial-gradient(circle at 0% 0%, var(--view-glow, rgba(255, 102, 0, .14)), transparent 42%),
        linear-gradient(135deg, rgba(22, 32, 51, .98), rgba(15, 23, 42, .98)) !important;
    border-color: rgba(148, 163, 184, .22) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 16px 36px rgba(0, 0, 0, .26) !important;
}

body.dark-mode .driver-documents-title p,
body.dark-mode .driver-doc-empty strong,
body.dark-mode .driver-doc-top strong {
    color: #f8fafc !important;
}

body.dark-mode .driver-documents-head span,
body.dark-mode .driver-doc-empty span,
body.dark-mode .driver-doc-meta,
body.dark-mode .driver-doc-notes,
body.dark-mode .driver-doc-select span {
    color: #a8b3c5 !important;
}

body.dark-mode .driver-documents-mark,
body.dark-mode .driver-doc-empty-icon,
body.dark-mode .driver-doc-icon {
    background: var(--view-glow, rgba(255, 102, 0, .16)) !important;
    border-color: rgba(255, 102, 0, .26) !important;
    color: var(--view-accent, #ff6600) !important;
}

body.dark-mode .driver-doc-filters,
body.dark-mode .driver-doc-empty,
body.dark-mode .driver-doc-row {
    background: rgba(15, 23, 42, .72) !important;
    border-color: rgba(148, 163, 184, .24) !important;
}

body.dark-mode .driver-doc-filters input,
body.dark-mode .driver-doc-filters select {
    background: #0b1220 !important;
    border-color: rgba(148, 163, 184, .30) !important;
    color: #f8fafc !important;
}

/* Driver folder: HR history must stay readable in light and dark mode */
#df-events-list {
    display: grid;
    gap: .75rem;
}

.driver-event-row {
    background: #fff;
    border: 1px solid #e5eaf1;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
    padding: 1rem;
}

.driver-event-icon {
    align-items: center;
    border-style: solid;
    border-width: 1px;
    border-radius: 10px;
    display: flex;
    flex-shrink: 0;
    height: 2.25rem;
    justify-content: center;
    width: 2.25rem;
}

.driver-event-actions {
    border-top: 1px solid #edf1f6;
    display: flex;
    gap: 1rem;
    margin-top: .75rem;
    padding-top: .65rem;
}

.driver-event-action {
    font-size: .75rem;
    font-weight: 800;
    transition: color .18s ease;
}

.driver-event-action.edit {
    color: #2563eb;
}

.driver-event-action.delete {
    color: #ef4444;
}

.driver-event-empty {
    align-items: center;
    background: #fff;
    border: 1px dashed #cfd8e3;
    border-radius: 10px;
    color: #64748b;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
}

.driver-event-empty-icon {
    align-items: center;
    background: #f1f5f9;
    border-radius: 999px;
    color: #94a3b8;
    display: flex;
    height: 3rem;
    justify-content: center;
    margin-bottom: .35rem;
    width: 3rem;
}

.driver-event-empty strong {
    color: #1f2937;
    font-size: .95rem;
}

.driver-event-empty span {
    color: #94a3b8;
    font-size: .8rem;
}

body.dark-mode #modal-driver-folder > div {
    background: #172033 !important;
    border-color: rgba(148, 163, 184, .24) !important;
}

body.dark-mode #modal-driver-folder .bg-gray-50\/40,
body.dark-mode #modal-driver-folder .bg-gray-50 {
    background: #111827 !important;
}

body.dark-mode #modal-driver-folder .text-graphite,
body.dark-mode #modal-driver-folder .font-black {
    color: #f8fafc !important;
}

body.dark-mode #modal-driver-folder .text-gray-400,
body.dark-mode #modal-driver-folder .text-gray-500,
body.dark-mode #modal-driver-folder .text-gray-600 {
    color: #a8b3c5 !important;
}

body.dark-mode .driver-event-row,
body.dark-mode .driver-event-empty {
    background: rgba(15, 23, 42, .72) !important;
    border-color: rgba(148, 163, 184, .24) !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, .24);
}

body.dark-mode .driver-event-actions {
    border-color: rgba(148, 163, 184, .20) !important;
}

body.dark-mode .driver-event-empty-icon {
    background: rgba(255, 102, 0, .16) !important;
    color: var(--view-accent, #ff6600) !important;
}

body.dark-mode .driver-event-empty strong {
    color: #f8fafc !important;
}

body.dark-mode .driver-event-empty span {
    color: #a8b3c5 !important;
}

body.dark-mode .driver-doc-filters input::placeholder {
    color: #94a3b8 !important;
}

body.dark-mode .driver-doc-search i {
    color: #93c5fd !important;
}

body.dark-mode .driver-doc-action {
    background: rgba(15, 23, 42, .78) !important;
    border-color: rgba(148, 163, 184, .24) !important;
    color: #dbe7f6 !important;
}

body.dark-mode .driver-doc-action:hover {
    border-color: var(--view-accent, #ff6600) !important;
    color: var(--view-accent, #ff6600) !important;
}

/* Dark mode v6: every editable field must be dark and readable */
body.dark-mode input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
body.dark-mode select,
body.dark-mode textarea,
body.dark-mode .std-input,
body.dark-mode [contenteditable="true"],
body.dark-mode [role="textbox"],
body.dark-mode .mf-chat-composer textarea,
body.dark-mode .mf-messages-search input,
body.dark-mode .driver-doc-filters input,
body.dark-mode .driver-doc-filters select,
body.dark-mode #modal-driver-document input,
body.dark-mode #modal-driver-document select,
body.dark-mode #modal-driver-document textarea,
body.dark-mode #modal-service-partner input,
body.dark-mode #modal-service-partner select,
body.dark-mode #modal-service-partner textarea,
body.dark-mode #modal-service-order input,
body.dark-mode #modal-service-order select,
body.dark-mode #modal-service-order textarea,
body.dark-mode #modal-tire input,
body.dark-mode #modal-tire select,
body.dark-mode #modal-tire textarea,
body.dark-mode #modal-document input,
body.dark-mode #modal-document select,
body.dark-mode #modal-document textarea,
body.dark-mode #modal-car input,
body.dark-mode #modal-car select,
body.dark-mode #modal-car textarea,
body.dark-mode #view-profile input,
body.dark-mode #view-profile select,
body.dark-mode #view-profile textarea {
    background: #0b1220 !important;
    border: 1px solid rgba(148, 163, 184, .32) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035) !important;
    color: #f8fafc !important;
    caret-color: var(--view-accent, #ff6600) !important;
    color-scheme: dark;
}

body.dark-mode input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus,
body.dark-mode .std-input:focus,
body.dark-mode [contenteditable="true"]:focus,
body.dark-mode [role="textbox"]:focus {
    border-color: var(--view-accent, #ff6600) !important;
    box-shadow: 0 0 0 3px var(--view-glow, rgba(255, 102, 0, .18)), inset 0 1px 0 rgba(255, 255, 255, .04) !important;
    outline: none !important;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder,
body.dark-mode .std-input::placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

body.dark-mode input[type="date"],
body.dark-mode input[type="datetime-local"],
body.dark-mode input[type="time"],
body.dark-mode input[type="month"],
body.dark-mode input[type="week"],
body.dark-mode input[type="number"] {
    color: #f8fafc !important;
}

body.dark-mode #form-service-partner .service-partner-footer,
body.dark-mode #form-service-partner .service-partner-active {
    background: #111827 !important;
    border-color: rgba(148, 163, 184, .24) !important;
}

body.dark-mode input[type="date"]::-webkit-calendar-picker-indicator,
body.dark-mode input[type="datetime-local"]::-webkit-calendar-picker-indicator,
body.dark-mode input[type="time"]::-webkit-calendar-picker-indicator,
body.dark-mode input[type="month"]::-webkit-calendar-picker-indicator,
body.dark-mode input[type="week"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.45) saturate(.8);
    opacity: .86;
}

body.dark-mode input[type="file"] {
    padding: .44rem .55rem !important;
}

body.dark-mode input[type="file"]::file-selector-button {
    background: rgba(255, 102, 0, .16) !important;
    border: 1px solid rgba(255, 102, 0, .34) !important;
    border-radius: 7px !important;
    color: #fed7aa !important;
    cursor: pointer;
    font-weight: 900;
    margin-right: .7rem;
    padding: .42rem .7rem;
}

body.dark-mode select option,
body.dark-mode select optgroup {
    background: #0b1220 !important;
    color: #f8fafc !important;
}

body.dark-mode input:-webkit-autofill,
body.dark-mode input:-webkit-autofill:hover,
body.dark-mode input:-webkit-autofill:focus,
body.dark-mode textarea:-webkit-autofill,
body.dark-mode select:-webkit-autofill {
    -webkit-text-fill-color: #f8fafc !important;
    box-shadow: 0 0 0 1000px #0b1220 inset !important;
    caret-color: var(--view-accent, #ff6600) !important;
}

body.dark-mode .mf-work-center {
    background:
        linear-gradient(135deg, rgba(255, 102, 0, .12), rgba(20, 184, 166, .08)),
        #172236 !important;
    border-color: rgba(148, 163, 184, .24) !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, .28) !important;
}

body.dark-mode .mf-work-center-head h3,
body.dark-mode .mf-work-item-copy strong,
body.dark-mode .mf-work-empty strong,
body.dark-mode .mf-work-chips b {
    color: #f8fafc !important;
}

body.dark-mode .mf-work-chips span,
body.dark-mode .mf-work-item,
body.dark-mode .mf-work-empty {
    background: rgba(15, 23, 42, .72) !important;
    border-color: rgba(148, 163, 184, .24) !important;
    color: #cbd5e1 !important;
}

body.dark-mode .mf-work-item:hover {
    border-color: rgba(255, 102, 0, .45) !important;
    box-shadow: 0 14px 30px rgba(0, 0, 0, .28) !important;
}

body.dark-mode .mf-work-item-copy small,
body.dark-mode .mf-work-item-copy p,
body.dark-mode .mf-work-empty p {
    color: #a8b3c7 !important;
}

body.dark-mode .mf-work-item-side > span {
    color: #dbeafe !important;
}

body.dark-mode .mf-work-item-action {
    background: rgba(255, 102, 0, .14) !important;
    border-color: rgba(255, 102, 0, .34) !important;
    color: #fed7aa !important;
}

body.dark-mode .mf-work-item-action:hover {
    background: var(--mf-orange) !important;
    border-color: var(--mf-orange) !important;
    color: #fff !important;
}

body.dark-mode .mf-work-item.danger .mf-work-item-icon,
body.dark-mode .mf-work-chips .danger {
    background: rgba(239, 68, 68, .14) !important;
    border-color: rgba(239, 68, 68, .28) !important;
    color: #fca5a5 !important;
}

body.dark-mode .mf-work-item.warn .mf-work-item-icon,
body.dark-mode .mf-work-chips .warn {
    background: rgba(255, 102, 0, .14) !important;
    border-color: rgba(255, 102, 0, .3) !important;
    color: #fdba74 !important;
}

body.dark-mode .mf-work-item.info .mf-work-item-icon,
body.dark-mode .mf-work-item.ok .mf-work-item-icon,
body.dark-mode .mf-work-chips .info {
    background: rgba(59, 130, 246, .14) !important;
    border-color: rgba(59, 130, 246, .3) !important;
    color: #93c5fd !important;
}

body.dark-mode .mf-messages-stats span {
    background: rgba(15, 23, 42, .72) !important;
    border-color: rgba(148, 163, 184, .24) !important;
    color: #a8b3c7 !important;
}

body.dark-mode .mf-messages-stats b {
    color: #f8fafc !important;
}

body.dark-mode .mf-messages-stats .is-hot {
    background: rgba(255, 102, 0, .14) !important;
    border-color: rgba(255, 102, 0, .32) !important;
    color: #fdba74 !important;
}

body.dark-mode .mf-vehicle-assistant,
body.dark-mode .mf-vehicle-assistant-card {
    background: rgba(15, 23, 42, .74) !important;
    border-color: rgba(148, 163, 184, .24) !important;
}

body.dark-mode .mf-vehicle-assistant h4,
body.dark-mode .mf-vehicle-assistant-card strong {
    color: #f8fafc !important;
}

body.dark-mode .mf-vehicle-assistant-card p {
    color: #a8b3c7 !important;
}

body.dark-mode .mf-vehicle-assistant-card button {
    background: rgba(255, 102, 0, .14) !important;
    border-color: rgba(255, 102, 0, .34) !important;
    color: #fed7aa !important;
}

body.dark-mode .mf-vehicle-assistant-card button:hover {
    background: var(--mf-orange) !important;
    color: #fff !important;
}

body.dark-mode .mf-vehicle-assistant-card.danger > span {
    background: rgba(239, 68, 68, .16) !important;
    color: #fca5a5 !important;
}

body.dark-mode .mf-vehicle-assistant-card.warn > span {
    background: rgba(255, 102, 0, .16) !important;
    color: #fdba74 !important;
}

body.dark-mode .mf-vehicle-assistant-card.info > span {
    background: rgba(59, 130, 246, .16) !important;
    color: #93c5fd !important;
}

body.dark-mode .mf-vehicle-assistant-card.ok > span {
    background: rgba(34, 197, 94, .16) !important;
    color: #86efac !important;
}

body.dark-mode #fleet-bulk-bar {
    background: rgba(255, 102, 0, .14) !important;
    border-color: rgba(255, 102, 0, .32) !important;
}

body.dark-mode .mf-btn-secondary {
    background: rgba(15, 23, 42, .72) !important;
    border-color: rgba(148, 163, 184, .28) !important;
    color: #dbeafe !important;
}

body.dark-mode .mf-btn-secondary:hover {
    border-color: rgba(255, 102, 0, .42) !important;
    color: #fed7aa !important;
}

body.dark-mode .mf-btn-danger {
    background: rgba(239, 68, 68, .12) !important;
    border-color: rgba(239, 68, 68, .26) !important;
    color: #fca5a5 !important;
}

body.dark-mode .mf-accounts-bulk {
    background: linear-gradient(135deg, rgba(255, 102, 0, .14), rgba(59, 130, 246, .10)) !important;
    border-color: rgba(255, 102, 0, .32) !important;
}

body.dark-mode .mf-accounts-bulk strong {
    color: #f8fafc !important;
}

body.dark-mode .mf-accounts-bulk span {
    color: #a8b3c7 !important;
}

body.dark-mode .audit-hero,
body.dark-mode .audit-toolbar,
body.dark-mode .audit-kpis div,
body.dark-mode .audit-row,
body.dark-mode .audit-empty {
    background:
        radial-gradient(circle at 98% 0%, var(--view-glow, rgba(255, 102, 0, .10)), transparent 30%),
        linear-gradient(135deg, rgba(22, 32, 51, .98), rgba(15, 23, 42, .98)) !important;
    border-color: rgba(148, 163, 184, .24) !important;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .26) !important;
}

body.dark-mode .audit-hero h2,
body.dark-mode .audit-kpis strong,
body.dark-mode .audit-row-top strong,
body.dark-mode .audit-empty strong {
    color: #f8fafc !important;
}

body.dark-mode .audit-hero p,
body.dark-mode .audit-row-main p,
body.dark-mode .audit-row-top span,
body.dark-mode .audit-row-top time,
body.dark-mode .audit-empty,
body.dark-mode .audit-empty span {
    color: #a8b3c7 !important;
}

body.dark-mode .audit-row-meta span,
body.dark-mode .audit-row-icon {
    background: rgba(15, 23, 42, .72) !important;
    border-color: rgba(148, 163, 184, .24) !important;
    color: #cbd5e1 !important;
}

body.dark-mode .audit-row.success .audit-row-icon {
    background: rgba(34, 197, 94, .14) !important;
    color: #86efac !important;
}

body.dark-mode .audit-row.info .audit-row-icon {
    background: rgba(59, 130, 246, .14) !important;
    color: #93c5fd !important;
}

body.dark-mode .audit-row.danger .audit-row-icon {
    background: rgba(239, 68, 68, .14) !important;
    color: #fca5a5 !important;
}

body.dark-mode .audit-toolbar select {
    background: #0b1220 !important;
    border-color: rgba(148, 163, 184, .32) !important;
    color: #f8fafc !important;
}

body.dark-mode .audit-meta pre {
    background: #050914 !important;
    border: 1px solid rgba(148, 163, 184, .22);
    color: #dbeafe !important;
}

/* Alert Center 2.0 i wspolne filtry */
.mf-filter-bar {
    align-items: center;
    background: rgba(255, 255, 255, .92);
    border: 1px solid #e2e8f0;
    border-left: 4px solid #ff5f00 !important;
    border-radius: 14px;
    box-shadow: 0 14px 35px rgba(15, 23, 42, .06);
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    padding: .9rem;
}

.mf-list-toolbar {
    margin-bottom: 1rem;
}

.mf-filter-bar select,
.mf-filter-bar button {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    color: #0f172a;
    font-size: .82rem;
    font-weight: 850;
    min-height: 40px;
    outline: none;
    padding: 0 .85rem;
    transition: .16s ease;
}

.mf-filter-bar select:focus,
.mf-filter-bar button:hover,
.mf-filter-search:focus-within {
    border-color: #ff5f00;
    box-shadow: 0 0 0 3px rgba(255, 95, 0, .10);
}

.mf-filter-count {
    color: #64748b;
    font-size: .76rem;
    font-weight: 900;
    margin-left: auto;
    white-space: nowrap;
}

.mf-filter-search {
    align-items: center;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    color: #94a3b8;
    display: flex;
    gap: .55rem;
    min-height: 40px;
    min-width: min(340px, 100%);
    padding: 0 .8rem;
}

.mf-filter-search input {
    background: transparent;
    border: 0;
    color: #0f172a;
    flex: 1;
    font-size: .86rem;
    font-weight: 700;
    outline: none;
}

.mf-alert-center2 {
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-left: 4px solid #2563eb;
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
    overflow: hidden;
}

.mf-alert-center2-head {
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
}

.mf-alert-center2-head h3 {
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 950;
    margin: 0;
}

.mf-alert-center2-head span,
.mf-alert-main2 p,
.mf-alert-date2 span {
    color: #64748b;
    font-size: .8rem;
}

.mf-alert-center2-actions,
.mf-alert-actions2 {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-end;
}

.mf-alert-center2-actions button,
.mf-alert-actions2 button {
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    color: #334155;
    display: inline-flex;
    font-size: .78rem;
    font-weight: 900;
    gap: .4rem;
    padding: .58rem .75rem;
    transition: .16s ease;
}

.mf-alert-center2-actions button:hover,
.mf-alert-actions2 button:hover {
    border-color: #ff5f00;
    color: #ff5f00;
}

.mf-alert-list2 {
    display: grid !important;
    gap: .65rem !important;
    padding: 1rem !important;
}

.mf-alert-row2 {
    align-items: center !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    display: grid !important;
    gap: .8rem !important;
    grid-template-columns: 22px 44px minmax(0, 1fr) 135px auto !important;
    padding: .85rem !important;
}

.mf-alert-row2.critical { border-left: 4px solid #ef4444; }
.mf-alert-row2.urgent { border-left: 4px solid #f97316; }
.mf-alert-row2.upcoming { border-left: 4px solid #eab308; }

.mf-alert-check2 input {
    accent-color: #ff5f00;
}

.mf-alert-icon2 {
    align-items: center !important;
    background: #f1f5f9 !important;
    border-radius: 12px !important;
    color: #475569 !important;
    display: inline-flex !important;
    height: 44px !important;
    justify-content: center !important;
    width: 44px !important;
}

.mf-alert-row2.critical .mf-alert-icon2 { background: #fef2f2; color: #dc2626; }
.mf-alert-row2.urgent .mf-alert-icon2 { background: #fff7ed; color: #ea580c; }
.mf-alert-row2.upcoming .mf-alert-icon2 { background: #fefce8; color: #ca8a04; }

.mf-alert-main2 {
    min-width: 0;
}

.mf-alert-main2 small {
    color: #94a3b8 !important;
    display: block !important;
    font-size: .68rem !important;
    font-weight: 950 !important;
    text-transform: uppercase !important;
}

.mf-alert-main2 strong,
.mf-alert-date2 strong {
    color: #0f172a !important;
    display: block !important;
    font-weight: 950 !important;
}

.mf-alert-main2 p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mf-alert-date2 {
    text-align: right;
}

.mf-alert-empty2 {
    align-items: center;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    color: #64748b;
    display: flex;
    gap: .8rem;
    padding: 1.2rem;
}

.mf-alert-empty2 i {
    background: #dcfce7;
    border-radius: 999px;
    color: #16a34a;
    padding: .65rem;
}

.mf-alert-empty2 strong {
    color: #0f172a;
}

body.dark-mode .mf-filter-bar,
body.dark-mode .mf-alert-center2,
body.dark-mode #view-drivers .mf-filter-bar {
    background: linear-gradient(135deg, #172033 0%, #111827 100%) !important;
    border-color: #334155 !important;
}

body.dark-mode .mf-filter-search,
body.dark-mode .mf-filter-bar select,
body.dark-mode .mf-filter-bar button,
body.dark-mode .mf-alert-row2,
body.dark-mode .mf-alert-center2-actions button,
body.dark-mode .mf-alert-actions2 button {
    background: #0b1220 !important;
    border-color: #334155 !important;
    color: #dbeafe !important;
}

body.dark-mode .mf-filter-search input,
body.dark-mode .mf-filter-bar select,
body.dark-mode .mf-filter-count,
body.dark-mode .mf-alert-center2-head h3,
body.dark-mode .mf-alert-main2 strong,
body.dark-mode .mf-alert-date2 strong,
body.dark-mode .mf-alert-empty2 strong {
    color: #f8fafc !important;
}

body.dark-mode .mf-alert-center2-head span,
body.dark-mode .mf-alert-main2 p,
body.dark-mode .mf-alert-date2 span,
body.dark-mode .mf-alert-empty2 {
    color: #a8b3c7 !important;
}

body.dark-mode .mf-alert-icon2 {
    background: #1e293b !important;
    color: #bfdbfe !important;
}

#modal-history *,
#modal-service-order *,
#modal-service-partner *,
.mf-folder-center *,
.mf-service-flow * {
    letter-spacing: 0 !important;
    word-spacing: normal !important;
}

@media (max-width: 980px) {
    .mf-alert-center2-head,
    .mf-alert-row2 {
        align-items: flex-start;
        grid-template-columns: 22px 44px minmax(0, 1fr);
    }

    .mf-alert-center2-head {
        flex-direction: column;
    }

    .mf-alert-date2,
    .mf-alert-actions2 {
        grid-column: 3;
        justify-content: flex-start;
        text-align: left;
    }
}

/* Centrum dokumentow 2.0 */
.mf-doc-center {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-left: 4px solid #ff5f00;
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
    padding: 22px;
}

.mf-doc-center-head,
.mf-doc-driver-strip,
.mf-doc-worklist article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.mf-doc-center-head h3 {
    color: #0f172a;
    font-size: 1.35rem;
    font-weight: 900;
    margin: 0;
}

.mf-doc-center-head span,
.mf-doc-worklist p {
    color: #64748b;
    font-size: .875rem;
}

.mf-doc-actions,
.mf-doc-work-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.mf-doc-actions button,
.mf-doc-work-actions button {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    border-radius: 10px;
    padding: .65rem .85rem;
    font-size: .8rem;
    font-weight: 800;
    transition: .18s ease;
}

.mf-doc-actions button:hover,
.mf-doc-work-actions button:hover {
    border-color: #ff5f00;
    color: #ff5f00;
    transform: translateY(-1px);
}

.mf-doc-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.mf-doc-kpis button {
    text-align: left;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 4px 12px;
    align-items: center;
    transition: .18s ease;
}

.mf-doc-kpis button:hover {
    border-color: #ff5f00;
    box-shadow: 0 14px 28px rgba(255, 95, 0, .12);
}

.mf-doc-kpis i {
    grid-row: span 2;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff7ed;
    color: #ff5f00;
}

.mf-doc-kpis .danger i { background: #fef2f2; color: #dc2626; }
.mf-doc-kpis .warn i { background: #fff7ed; color: #ea580c; }
.mf-doc-kpis .info i { background: #eff6ff; color: #2563eb; }

.mf-doc-kpis small {
    color: #94a3b8;
    font-size: .7rem;
    font-weight: 900;
    text-transform: uppercase;
}

.mf-doc-kpis strong {
    color: #0f172a;
    font-size: 1.65rem;
    font-weight: 950;
    line-height: 1;
}

.mf-doc-driver-strip {
    margin-top: 14px;
    background: #0f172a;
    color: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.mf-doc-driver-strip i { color: #ff8a3d; }

.mf-doc-driver-strip span {
    color: #cbd5e1;
    font-size: .8rem;
    font-weight: 800;
}

.mf-doc-worklist {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.mf-doc-worklist article {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
}

.mf-doc-worklist article.expired { border-left: 4px solid #ef4444; }
.mf-doc-worklist article.urgent { border-left: 4px solid #f97316; }
.mf-doc-worklist article.missing { border-left: 4px solid #3b82f6; }

.mf-doc-work-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.mf-doc-worklist article > div:nth-child(2) {
    flex: 1;
    min-width: 0;
}

.mf-doc-worklist small {
    color: #94a3b8;
    display: block;
    font-size: .72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.mf-doc-worklist strong {
    color: #0f172a;
    display: block;
    font-size: .98rem;
    font-weight: 900;
}

.mf-doc-empty-state {
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
}

.mf-doc-empty-state i {
    background: #dcfce7;
    color: #16a34a;
    border-radius: 999px;
    padding: 10px;
}

body.dark-mode .mf-doc-center {
    background: linear-gradient(135deg, #172033 0%, #111827 100%);
    border-color: #334155;
    box-shadow: 0 20px 55px rgba(0, 0, 0, .22);
}

body.dark-mode .mf-doc-center-head h3,
body.dark-mode .mf-doc-kpis strong,
body.dark-mode .mf-doc-worklist strong {
    color: #f8fafc;
}

body.dark-mode .mf-doc-center-head span,
body.dark-mode .mf-doc-worklist p {
    color: #a8b3c7;
}

body.dark-mode .mf-doc-actions button,
body.dark-mode .mf-doc-work-actions button,
body.dark-mode .mf-doc-kpis button,
body.dark-mode .mf-doc-worklist article {
    background: #0b1220;
    border-color: #334155;
    color: #dbeafe;
}

body.dark-mode .mf-doc-work-icon {
    background: #1e293b;
    color: #bfdbfe;
}

body.dark-mode .mf-doc-empty-state {
    border-color: #334155;
    color: #a8b3c7;
}

body.dark-mode #view-documents .bg-white {
    background: #111827 !important;
    border-color: #334155 !important;
}

body.dark-mode #view-documents .text-graphite,
body.dark-mode #view-documents .text-gray-700,
body.dark-mode #view-documents .font-black {
    color: #f8fafc !important;
}

body.dark-mode #view-documents .text-gray-400,
body.dark-mode #view-documents .text-gray-500,
body.dark-mode #view-documents .text-gray-600 {
    color: #a8b3c7 !important;
}

body.dark-mode #view-documents .bg-gray-50 {
    background: #0b1220 !important;
}

body.dark-mode #view-documents input,
body.dark-mode #view-documents select {
    background: #0b1220 !important;
    border-color: #334155 !important;
    color: #e5edf8 !important;
}

@media (max-width: 900px) {
    .mf-doc-center-head,
    .mf-doc-worklist article {
        align-items: flex-start;
        flex-direction: column;
    }

    .mf-doc-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mf-doc-work-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .mf-doc-kpis {
        grid-template-columns: 1fr;
    }
}

/* Dalsze porzadkowanie prawych widokow */
#view-worktime > .bg-white.rounded-xl.shadow-sm.border.border-gray-100.p-4 {
    background: rgba(255, 255, 255, .94) !important;
    border-left: 4px solid #0ea5e9 !important;
    border-radius: 14px !important;
    box-shadow: 0 14px 35px rgba(15, 23, 42, .06) !important;
}

#view-client-insurances .bg-white.rounded-xl,
#view-worktime .bg-white.rounded-xl {
    border-radius: 14px !important;
    box-shadow: 0 14px 35px rgba(15, 23, 42, .055) !important;
}

#view-client-insurances tbody tr,
#view-worktime tbody tr {
    transition: background-color .16s ease, box-shadow .16s ease;
}

#view-client-insurances tbody tr:hover,
#view-worktime tbody tr:hover {
    background: #fff7ed !important;
}

body.dark-mode #view-worktime > .bg-white.rounded-xl.shadow-sm.border.border-gray-100.p-4,
body.dark-mode #view-client-insurances .bg-white,
body.dark-mode #view-worktime .bg-white {
    background: #111827 !important;
    border-color: #334155 !important;
    color: #e5edf8 !important;
}

body.dark-mode #view-client-insurances thead,
body.dark-mode #view-worktime thead,
body.dark-mode #view-worktime #wt-pagination {
    background: #0b1220 !important;
    border-color: #334155 !important;
}

body.dark-mode #view-client-insurances tbody tr,
body.dark-mode #view-worktime tbody tr {
    border-color: #263449 !important;
}

body.dark-mode #view-client-insurances tbody tr:hover,
body.dark-mode #view-worktime tbody tr:hover {
    background: rgba(255, 102, 0, .10) !important;
}

#view-export > .grid .bg-white {
    border-radius: 14px !important;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .06) !important;
    overflow: hidden;
    position: relative;
}

#view-export > .grid .bg-white::before {
    background: linear-gradient(90deg, var(--view-accent, #ff6600), rgba(37, 99, 235, .72));
    content: "";
    height: 3px;
    inset: 0 0 auto 0;
    position: absolute;
}

#view-export > .grid .bg-white:hover {
    transform: translateY(-1px);
}

#view-export .bg-graphite {
    background:
        radial-gradient(circle at 12% 20%, rgba(255, 102, 0, .18), transparent 36%),
        linear-gradient(135deg, #172033, #0b1220) !important;
    border: 1px solid rgba(255, 255, 255, .10);
    border-left: 4px solid var(--mf-orange, #ff6600);
    border-radius: 14px !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .12);
}

body.dark-mode #view-export .bg-white,
body.dark-mode #view-charts .bg-white {
    background: #111827 !important;
    border-color: #334155 !important;
    color: #e5edf8 !important;
}

body.dark-mode #view-export .text-graphite,
body.dark-mode #view-charts .text-graphite {
    color: #f8fafc !important;
}

body.dark-mode #view-export .text-gray-400,
body.dark-mode #view-export .text-gray-500,
body.dark-mode #view-charts .text-gray-400,
body.dark-mode #view-charts .text-gray-500 {
    color: #a8b3c7 !important;
}

.mf-chart-kpi {
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .06);
    display: grid;
    gap: .85rem;
    grid-template-columns: 48px minmax(0, 1fr);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.mf-chart-kpi::before {
    content: "";
    inset: 0 auto 0 0;
    position: absolute;
    width: 4px;
}

.mf-chart-kpi > i {
    align-items: center;
    border-radius: 13px;
    display: inline-flex;
    font-size: 1.05rem;
    height: 48px;
    justify-content: center;
    width: 48px;
}

.mf-chart-kpi p {
    color: #64748b;
    font-size: .72rem;
    font-weight: 900;
    margin: 0 0 .2rem;
    text-transform: uppercase;
}

.mf-chart-kpi strong {
    color: #0f172a;
    display: block;
    font-size: clamp(1.05rem, 1.7vw, 1.45rem);
    font-weight: 950;
    line-height: 1.1;
    word-break: break-word;
}

.mf-chart-kpi.mf-blue::before { background: #2563eb; }
.mf-chart-kpi.mf-green::before { background: #16a34a; }
.mf-chart-kpi.mf-orange::before { background: #ff6600; }
.mf-chart-kpi.mf-purple::before { background: #7c3aed; }

.mf-chart-kpi.mf-blue > i { background: #eff6ff; color: #2563eb; }
.mf-chart-kpi.mf-green > i { background: #f0fdf4; color: #16a34a; }
.mf-chart-kpi.mf-orange > i { background: #fff7ed; color: #ff6600; }
.mf-chart-kpi.mf-purple > i { background: #faf5ff; color: #7c3aed; }

#view-charts .chart-range-btn {
    min-height: 38px;
}

#view-charts canvas {
    max-width: 100%;
}

body.dark-mode .mf-chart-kpi {
    background: #111827;
    border-color: #334155;
    box-shadow: 0 16px 38px rgba(0, 0, 0, .18);
}

body.dark-mode .mf-chart-kpi p {
    color: #a8b3c7;
}

body.dark-mode .mf-chart-kpi strong {
    color: #f8fafc;
}

body.dark-mode .mf-chart-kpi > i {
    background: #0b1220;
}

/* Stabilizacja widokow po prawej stronie: dokumenty, alerty, wiadomosci, polisy i modal serwisu */
#view-documents #document-center {
    display: block !important;
    margin-top: 1rem !important;
}

#view-documents .mf-doc-center,
#view-alerts .mf-alert-center2 {
    background:
        radial-gradient(circle at 0 0, rgba(255, 102, 0, .09), transparent 30%),
        linear-gradient(135deg, #fff 0%, #f8fbff 100%) !important;
    border: 1px solid #dbe5f0 !important;
    border-left: 4px solid var(--view-accent, #ff6600) !important;
    border-radius: 12px !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .07) !important;
    color: #172033 !important;
    padding: 18px !important;
}

#view-alerts .mf-alert-center2 {
    padding: 0 !important;
}

#view-documents .mf-doc-center-head,
#view-alerts .mf-alert-center2-head {
    align-items: center !important;
    display: flex !important;
    gap: 1rem !important;
    justify-content: space-between !important;
}

#view-alerts .mf-alert-center2-head {
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 1.1rem 1.2rem !important;
}

#view-documents .mf-doc-center-head h3,
#view-alerts .mf-alert-center2-head h3 {
    color: #172033 !important;
    font-size: 1.22rem !important;
    font-weight: 950 !important;
    line-height: 1.15 !important;
    margin: 0 !important;
}

#view-documents .mf-doc-center-head span,
#view-alerts .mf-alert-center2-head span {
    color: #667085 !important;
    display: block !important;
    font-size: .84rem !important;
    margin-top: .25rem !important;
}

#view-documents .mf-doc-kpis {
    display: grid !important;
    gap: .75rem !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    margin-top: 1rem !important;
}

#view-documents .mf-doc-kpis button {
    align-items: center !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .035) !important;
    color: #172033 !important;
    display: grid !important;
    gap: .12rem .7rem !important;
    grid-template-columns: 40px minmax(0, 1fr) !important;
    min-height: 78px !important;
    padding: .85rem !important;
    text-align: left !important;
}

#view-documents .mf-doc-kpis i {
    align-items: center !important;
    background: #fff7ed !important;
    border-radius: 10px !important;
    color: #ff6600 !important;
    display: inline-flex !important;
    grid-row: span 2 !important;
    height: 40px !important;
    justify-content: center !important;
    width: 40px !important;
}

#view-documents .mf-doc-kpis small {
    color: #8a95a6 !important;
    display: block !important;
    font-size: .68rem !important;
    font-weight: 950 !important;
    text-transform: uppercase !important;
}

#view-documents .mf-doc-kpis strong {
    color: #172033 !important;
    display: block !important;
    font-size: 1.55rem !important;
    font-weight: 950 !important;
    line-height: 1 !important;
}

#view-documents .mf-doc-driver-strip {
    align-items: center !important;
    background: #172033 !important;
    border-radius: 10px !important;
    color: #fff !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: .65rem !important;
    margin-top: .85rem !important;
    padding: .8rem .9rem !important;
}

#view-documents .mf-doc-driver-strip span {
    color: #cbd5e1 !important;
    font-size: .78rem !important;
    font-weight: 850 !important;
}

#view-documents .mf-doc-worklist,
#view-alerts .mf-alert-list2 {
    display: grid !important;
    gap: .7rem !important;
    margin-top: .95rem !important;
}

#view-alerts .mf-alert-list2 {
    margin-top: 0 !important;
    padding: 1rem !important;
}

#view-documents .mf-doc-worklist article,
#view-alerts .mf-alert-row2 {
    align-items: center !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    color: #172033 !important;
    display: grid !important;
    gap: .8rem !important;
    padding: .9rem !important;
}

#view-documents .mf-doc-worklist article.expired,
#view-alerts .mf-alert-row2.critical {
    border-left: 4px solid #ef4444 !important;
}

#view-documents .mf-doc-worklist article.urgent,
#view-alerts .mf-alert-row2.urgent {
    border-left: 4px solid #f97316 !important;
}

#view-documents .mf-doc-worklist article.missing,
#view-alerts .mf-alert-row2.upcoming {
    border-left: 4px solid #2563eb !important;
}

#view-documents .mf-doc-worklist article {
    grid-template-columns: 42px minmax(0, 1fr) auto !important;
}

#view-alerts .mf-alert-row2 {
    grid-template-columns: 22px 42px minmax(0, 1fr) 130px auto !important;
}

#view-documents .mf-doc-empty-state,
#view-alerts .mf-alert-empty2 {
    align-items: center !important;
    background: rgba(255, 255, 255, .72) !important;
    border: 1px dashed #cbd5e1 !important;
    border-radius: 10px !important;
    color: #667085 !important;
    display: flex !important;
    gap: .8rem !important;
    padding: 1rem !important;
}

#view-alerts .mf-alert-empty2 {
    min-height: 92px !important;
}

#view-alerts .mf-alert-empty2 strong,
#view-documents .mf-doc-empty-state strong {
    color: #172033 !important;
}

#view-alerts .mf-alert-center2-actions button,
#view-alerts .mf-alert-actions2 button,
#view-documents .mf-doc-actions button,
#view-documents .mf-doc-work-actions button {
    align-items: center !important;
    background: #fff !important;
    border: 1px solid #d7dee8 !important;
    border-radius: 9px !important;
    color: #344054 !important;
    display: inline-flex !important;
    font-size: .78rem !important;
    font-weight: 900 !important;
    gap: .42rem !important;
    min-height: 38px !important;
    padding: 0 .75rem !important;
}

#view-alerts .mf-filter-bar,
#client-insurance-filter-bar {
    align-items: center !important;
    background: rgba(255, 255, 255, .92) !important;
    border: 1px solid #dbe5f0 !important;
    border-left: 4px solid #2563eb !important;
    border-radius: 12px !important;
    box-shadow: 0 14px 32px rgba(15, 23, 42, .055) !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: .75rem !important;
    padding: .9rem !important;
}

#client-insurance-filter-bar {
    margin: .9rem 0 1rem !important;
}

#view-alerts .mf-filter-search,
#client-insurance-filter-bar .mf-filter-search {
    flex: 1 1 280px !important;
    margin: 0 !important;
    max-width: none !important;
    min-width: 260px !important;
}

#view-client-insurances #client-insurance-filter-bar + .bg-white {
    border-radius: 12px !important;
    overflow: hidden !important;
}

#view-messages[data-enhanced="1"] {
    height: auto !important;
    min-height: 0 !important;
}

#view-messages[data-enhanced="1"] .mf-messages-shell {
    background: #fff !important;
    border: 1px solid #dbe5f0 !important;
    border-left: 4px solid #2563eb !important;
    border-radius: 12px !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .07) !important;
    grid-template-columns: minmax(300px, 420px) minmax(0, 1fr) !important;
    height: min(660px, calc(100vh - 170px)) !important;
    min-height: 520px !important;
}

#view-messages[data-enhanced="1"] .mf-chat-panel {
    background:
        radial-gradient(circle at 50% 42%, rgba(37, 99, 235, .08), transparent 28%),
        linear-gradient(135deg, #ffffff, #f8fbff) !important;
}

#view-messages[data-enhanced="1"] .mf-chat-empty {
    min-height: 100% !important;
    padding: 2rem !important;
}

#view-messages[data-enhanced="1"] .mf-messages-sidebar {
    background: #fbfcfe !important;
}

#modal-service-order #so-status-flow {
    grid-column: 1 / -1 !important;
}

#modal-service-order .mf-service-flow {
    display: grid !important;
    gap: .5rem !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    margin: .15rem 0 .25rem !important;
    width: 100% !important;
}

#modal-service-order .mf-service-flow span {
    align-items: center !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    color: #667085 !important;
    display: flex !important;
    gap: .42rem !important;
    justify-content: center !important;
    min-height: 42px !important;
    padding: 0 .55rem !important;
    text-align: center !important;
}

#modal-service-order .mf-service-flow span.done {
    background: #ecfdf3 !important;
    border-color: #bbf7d0 !important;
    color: #15803d !important;
}

#modal-service-order .mf-service-flow span.current {
    background: #fff7ed !important;
    border-color: #fed7aa !important;
    color: #ea580c !important;
}

#modal-service-order .mf-service-flow span b {
    display: inline !important;
    font-size: .76rem !important;
    font-weight: 950 !important;
    line-height: 1.1 !important;
}

#modal-service-order #so-notes {
    min-height: 76px !important;
}

body.dark-mode #view-documents .mf-doc-center,
body.dark-mode #view-alerts .mf-alert-center2,
body.dark-mode #view-messages[data-enhanced="1"] .mf-messages-shell {
    background:
        radial-gradient(circle at 0 0, var(--view-glow, rgba(255, 102, 0, .14)), transparent 34%),
        linear-gradient(135deg, #172033 0%, #0f172a 100%) !important;
    border-color: rgba(148, 163, 184, .24) !important;
    color: #e5edf8 !important;
}

body.dark-mode #view-documents .mf-doc-center-head h3,
body.dark-mode #view-documents .mf-doc-kpis strong,
body.dark-mode #view-documents .mf-doc-worklist strong,
body.dark-mode #view-alerts .mf-alert-center2-head h3,
body.dark-mode #view-alerts .mf-alert-empty2 strong {
    color: #f8fafc !important;
}

body.dark-mode #view-documents .mf-doc-center-head span,
body.dark-mode #view-documents .mf-doc-worklist p,
body.dark-mode #view-alerts .mf-alert-center2-head span {
    color: #a8b3c7 !important;
}

body.dark-mode #view-documents .mf-doc-kpis button,
body.dark-mode #view-documents .mf-doc-worklist article,
body.dark-mode #view-documents .mf-doc-empty-state,
body.dark-mode #view-alerts .mf-alert-row2,
body.dark-mode #view-alerts .mf-alert-empty2,
body.dark-mode #view-alerts .mf-filter-bar,
body.dark-mode #client-insurance-filter-bar,
body.dark-mode #view-messages[data-enhanced="1"] .mf-messages-sidebar,
body.dark-mode #view-messages[data-enhanced="1"] .mf-chat-panel,
body.dark-mode #modal-service-order .mf-service-flow span {
    background: rgba(15, 23, 42, .74) !important;
    border-color: rgba(148, 163, 184, .24) !important;
    color: #dbe7f6 !important;
}

body.dark-mode #modal-service-order .mf-service-flow span.done {
    background: rgba(34, 197, 94, .12) !important;
    border-color: rgba(34, 197, 94, .28) !important;
    color: #86efac !important;
}

body.dark-mode #modal-service-order .mf-service-flow span.current {
    background: rgba(255, 102, 0, .14) !important;
    border-color: rgba(255, 102, 0, .34) !important;
    color: #fdba74 !important;
}

@media (max-width: 980px) {
    #view-documents .mf-doc-center-head,
    #view-alerts .mf-alert-center2-head {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    #view-documents .mf-doc-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    #view-alerts .mf-alert-row2 {
        grid-template-columns: 22px 42px minmax(0, 1fr) !important;
    }

    #view-alerts .mf-alert-date2,
    #view-alerts .mf-alert-actions2 {
        grid-column: 3 !important;
        justify-content: flex-start !important;
        text-align: left !important;
    }

    #modal-service-order .mf-service-flow {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 720px) {
    #view-documents .mf-doc-kpis,
    #modal-service-order .mf-service-flow {
        grid-template-columns: 1fr !important;
    }

    #view-documents .mf-doc-worklist article,
    #view-alerts .mf-alert-row2 {
        align-items: flex-start !important;
        grid-template-columns: 42px minmax(0, 1fr) !important;
    }

    #view-documents .mf-doc-work-actions,
    #view-alerts .mf-alert-actions2,
    #view-alerts .mf-alert-date2 {
        grid-column: 1 / -1 !important;
    }

    #view-messages[data-enhanced="1"] .mf-messages-shell {
        grid-template-columns: 1fr !important;
        height: auto !important;
        min-height: 620px !important;
    }
}

/* ============================================================
   GLOBALNA WYSZUKIWARKA
   ============================================================ */
#global-search-overlay { animation: mf-fade-in .15s ease; }
@keyframes mf-fade-in { from { opacity: 0; } to { opacity: 1; } }

#global-search-overlay > div { animation: mf-slide-in .18s ease; }
@keyframes mf-slide-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

#global-search-input { font-size: .95rem !important; }

.gsearch-item { transition: background .1s !important; }
.gsearch-item:hover, .gsearch-item.active { background: #fff7ed !important; }

/* ============================================================
   EMPTY STATES — Puste widoki z CTA
   ============================================================ */

.mf-empty-state {
    align-items: center !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    padding: 3.5rem 2rem !important;
    text-align: center !important;
}

.mf-empty-icon {
    align-items: center !important;
    background: linear-gradient(135deg, #fff7ed, #ffedd5) !important;
    border-radius: 50% !important;
    color: #ff6600 !important;
    display: flex !important;
    font-size: 2rem !important;
    height: 80px !important;
    justify-content: center !important;
    width: 80px !important;
    margin-bottom: .5rem !important;
}

.mf-empty-state h3 {
    color: #0f172a !important;
    font-size: 1.15rem !important;
    font-weight: 950 !important;
    margin: 0 !important;
}

.mf-empty-state > p {
    color: #64748b !important;
    font-size: .9rem !important;
    max-width: 400px !important;
    margin: 0 !important;
}

.mf-empty-actions {
    align-items: center !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: .75rem !important;
    justify-content: center !important;
    margin-top: .5rem !important;
}

.mf-empty-btn-primary {
    align-items: center !important;
    background: #ff6600 !important;
    border: none !important;
    border-radius: 10px !important;
    color: white !important;
    cursor: pointer !important;
    display: inline-flex !important;
    font-size: .875rem !important;
    font-weight: 700 !important;
    gap: .375rem !important;
    padding: .6rem 1.25rem !important;
    transition: background .16s !important;
}
.mf-empty-btn-primary:hover { background: #cc5200 !important; }

.mf-empty-btn-secondary {
    align-items: center !important;
    background: white !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    color: #475569 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    font-size: .875rem !important;
    font-weight: 700 !important;
    gap: .375rem !important;
    padding: .6rem 1.25rem !important;
    transition: border-color .16s !important;
}
.mf-empty-btn-secondary:hover { border-color: #ff6600 !important; color: #ff6600 !important; }

.mf-empty-btn-danger {
    align-items: center !important;
    background: white !important;
    border: 1px solid #fecaca !important;
    border-radius: 8px !important;
    color: #dc2626 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    font-size: .75rem !important;
    font-weight: 700 !important;
    gap: .25rem !important;
    padding: .35rem .75rem !important;
    transition: border-color .16s !important;
}
.mf-empty-btn-danger:hover { background: #fef2f2 !important; }

.mf-empty-hint {
    color: #94a3b8 !important;
    font-size: .8rem !important;
    margin-top: -.25rem !important;
}

/* ============================================================
   STATUS POJAZDU — Badges i select
   ============================================================ */

.mf-car-status-badge {
    align-items: center !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    font-size: .65rem !important;
    font-weight: 800 !important;
    gap: .25rem !important;
    letter-spacing: .04em !important;
    padding: .2rem .6rem !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
}
.mf-car-status-active     { background: #dcfce7 !important; color: #15803d !important; }
.mf-car-status-in-service { background: #dbeafe !important; color: #1d4ed8 !important; }
.mf-car-status-breakdown  { background: #fee2e2 !important; color: #dc2626 !important; animation: mf-pulse 1.5s infinite !important; }
.mf-car-status-inactive   { background: #f1f5f9 !important; color: #94a3b8 !important; }

@keyframes mf-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .6; }
}

.mf-status-select {
    background: white !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    color: #475569 !important;
    cursor: pointer !important;
    font-size: .72rem !important;
    font-weight: 700 !important;
    margin-top: .3rem !important;
    padding: .2rem .4rem !important;
}
.mf-status-select:focus { border-color: #ff6600 !important; outline: none !important; }

/* ============================================================
   HISTORIA — pasek wyszukiwania
   ============================================================ */

#hist-search-bar {
    background: white !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: .5rem !important;
    padding: .5rem .75rem !important;
}
#hist-search-bar .mf-filter-search {
    flex: 1 !important;
    min-width: 150px !important;
    border: none !important;
    background: transparent !important;
}

/* ============================================================
   FIX PODWÓJNEJ RAMKI — usuwa domyślny outline przeglądarki
   przy klikaniu w pola wyszukiwania i formularzy.
   Zostaje JEDNA czysta ramka + delikatny pomarańczowy focus-ring.
   ============================================================ */

/* Input WEWNĄTRZ paska wyszukiwania nie ma własnej ramki ani outline */
.mf-filter-search input,
.mf-filter-search input:focus,
#global-search-input,
#global-search-input:focus,
#hist-search-input,
#hist-search-input:focus {
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Pasek wyszukiwania pokazuje focus jako JEDEN ring (nie podwójna ramka) */
.mf-filter-search:focus-within {
    border-color: #ff6600 !important;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, .12) !important;
    outline: none !important;
}

/* Wszystkie pola tekstowe/selecty/textarea — usuń podwójny outline przeglądarki */
input[type="text"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none !important;
}

/* std-input: jedna ramka + czysty focus-ring zamiast podwójnego outline */
.std-input:focus {
    border-color: #ff6600 !important;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, .12) !important;
    outline: none !important;
}

/* ============================================================
   TOASTY — powiadomienia (sukces / błąd / info / uwaga)
   ============================================================ */
.mf-toast {
    align-items: flex-start !important;
    background: #fff !important;
    border-left: 4px solid #ff6600 !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .18) !important;
    display: flex !important;
    gap: .75rem !important;
    max-width: 380px !important;
    min-width: 300px !important;
    overflow: hidden !important;
    padding: .9rem 1rem !important;
    pointer-events: auto !important;
    position: relative !important;
    transform: translateX(120%) !important;
    transition: transform .3s cubic-bezier(.22,1,.36,1), opacity .3s !important;
}
.mf-toast.mf-toast-show { transform: translateX(0) !important; }
.mf-toast-icon { font-size: 1.25rem !important; margin-top: .1rem !important; flex-shrink: 0 !important; }
.mf-toast-body { flex: 1 !important; min-width: 0 !important; }
.mf-toast-label { font-size: .65rem !important; font-weight: 900 !important; text-transform: uppercase !important; letter-spacing: .05em !important; color: #94a3b8 !important; margin: 0 0 .1rem !important; }
.mf-toast-msg { font-size: .85rem !important; font-weight: 600 !important; color: #1f2937 !important; margin: 0 !important; line-height: 1.35 !important; }
.mf-toast-close { background: none !important; border: 0 !important; color: #cbd5e1 !important; cursor: pointer !important; font-size: .85rem !important; padding: .1rem !important; flex-shrink: 0 !important; transition: color .15s !important; }
.mf-toast-close:hover { color: #64748b !important; }
.mf-toast-progress { position: absolute !important; bottom: 0 !important; left: 0 !important; height: 3px !important; width: 100% !important; opacity: .5 !important; }

/* ============================================================
   CENTRUM ALERTÓW — grupy zwijane
   ============================================================ */
.mf-alert-group { margin-bottom: .6rem !important; }

.mf-alert-group-head {
    align-items: center !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    display: flex !important;
    gap: .65rem !important;
    padding: .7rem .9rem !important;
    transition: background .12s !important;
    width: 100% !important;
    text-align: left !important;
}
.mf-alert-group-head:hover { background: #f1f5f9 !important; }

.mf-ag-icon {
    align-items: center !important;
    border-radius: 9px !important;
    display: inline-flex !important;
    flex-shrink: 0 !important;
    height: 34px !important;
    justify-content: center !important;
    width: 34px !important;
    font-size: .95rem !important;
}
.mf-ag-title { font-weight: 900 !important; color: #0f172a !important; font-size: .9rem !important; }
.mf-ag-count {
    background: #1f2937 !important; color: #fff !important;
    border-radius: 999px !important; font-size: .7rem !important; font-weight: 800 !important;
    min-width: 22px !important; padding: .1rem .4rem !important; text-align: center !important;
}
.mf-ag-breakdown { display: flex !important; gap: .35rem !important; margin-left: auto !important; flex-wrap: wrap !important; }
.mf-ag-pill { border-radius: 999px !important; font-size: .65rem !important; font-weight: 800 !important; padding: .15rem .5rem !important; white-space: nowrap !important; }
.mf-ag-crit { background: #fee2e2 !important; color: #dc2626 !important; }
.mf-ag-urg  { background: #ffedd5 !important; color: #ea580c !important; }
.mf-ag-chevron { color: #94a3b8 !important; font-size: .75rem !important; margin-left: .5rem !important; transition: transform .18s !important; flex-shrink: 0 !important; }

.mf-alert-group-body {
    display: grid !important;
    gap: .5rem !important;
    padding: .6rem .2rem .2rem !important;
}
.mf-alert-group-body.hidden { display: none !important; }

/* ============================================================
   DZWONEK POWIADOMIEŃ
   ============================================================ */
#mf-bell-dropdown { animation: mf-slide-in .18s ease; }
.mf-bell-item {
    align-items: center !important;
    background: none !important;
    border: 0 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    cursor: pointer !important;
    display: flex !important;
    gap: .65rem !important;
    padding: .7rem 1rem !important;
    position: relative !important;
    text-align: left !important;
    transition: background .12s !important;
    width: 100% !important;
}
.mf-bell-item:hover { background: #fff7ed !important; }
.mf-bell-dot { border-radius: 999px !important; flex-shrink: 0 !important; height: 8px !important; width: 8px !important; }
.mf-bell-ic { font-size: .95rem !important; flex-shrink: 0 !important; width: 18px !important; text-align: center !important; }
.mf-bell-txt { display: flex !important; flex-direction: column !important; min-width: 0 !important; }
.mf-bell-txt strong { color: #0f172a !important; font-size: .82rem !important; font-weight: 800 !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }
.mf-bell-txt small { color: #94a3b8 !important; font-size: .72rem !important; }

/* ============================================================
   SKELETON LOADING — animowane szkielety
   ============================================================ */
.mf-skeleton-bar {
    background: linear-gradient(90deg, #eef2f7 25%, #e2e8f0 50%, #eef2f7 75%) !important;
    background-size: 200% 100% !important;
    animation: mf-shimmer 1.3s infinite !important;
    border-radius: 6px !important;
    display: inline-block !important;
    height: 11px !important;
}
@keyframes mf-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.mf-skeleton-grid { display: grid !important; gap: 1rem !important; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important; padding: 1rem !important; }
.mf-skeleton-card {
    background: #fff !important;
    border: 1px solid #eef2f7 !important;
    border-radius: 14px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: .6rem !important;
    padding: 1.1rem !important;
}

/* ============================================================
   TAILWIND CDN OVERRIDE BLOCK
   Tailwind Play CDN injektuje style dynamicznie i może nadpisać
   nasze display: grid/flex. Ten blok gwarantuje poprawne
   renderowanie wszystkich komponentów niezależnie od kolejności.
   ============================================================ */

/* --- Workspace / Dashboard ---------------------------------- */
.mf-workspace-head       { display: flex !important; }
.mf-workspace-grid       { display: grid !important; }
/* Panel kierowcy/prywatnego — szersze karty (mniej kolumn) żeby etykiety się mieściły */
.mf-driver-grid          { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)) !important; }
/* Przyciski akcji: ikona + tekst, tekst nie wychodzi poza kafelek */
.mf-module-actions button span,
.mf-module-actions button small { overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; min-width: 0 !important; }
.mf-quiet-action         { display: inline-flex !important; }
.mf-module-title         { display: flex !important; }
.mf-module-title > span  { display: inline-flex !important; }
.mf-module-actions       { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important; }
.mf-module-actions button { display: grid !important; }
.mf-module-card          { display: flex !important; flex-direction: column !important; }

/* --- Work Center -------------------------------------------- */
.mf-work-center-head     { display: flex !important; }
.mf-work-chips           { display: flex !important; }
.mf-work-chips span      { display: inline-flex !important; }
.mf-work-items           { display: grid !important; }
.mf-work-item            { display: grid !important; }
.mf-work-item-icon       { display: inline-flex !important; }
.mf-work-item-copy small { display: block !important; }
.mf-work-item-copy strong { display: block !important; }
.mf-work-item-side       { display: flex !important; }
.mf-work-item-action     { display: inline-flex !important; }
.mf-work-empty           { display: flex !important; }
.mf-work-empty > span    { display: inline-flex !important; }
.mf-work-empty strong    { display: block !important; }

/* --- Vehicle assistant / panel ----------------------------- */
.mf-vehicle-assistant-grid         { display: grid !important; }
.mf-vehicle-assistant-card         { display: grid !important; }
.mf-vehicle-assistant-card > span  { display: inline-flex !important; }
.mf-vehicle-assistant-card strong  { display: block !important; }
.mf-vehicle-line, .mf-vehicle-term { display: flex !important; }
.mf-vehicle-action                 { display: grid !important; }
.mf-vehicle-action span            { display: flex !important; }

/* --- Sidebar & navigation ---------------------------------- */
.mf-sidebar-logo-card              { display: inline-flex !important; }
.mf-sidebar-logo-svg               { display: block !important; }
#sidebar .mf-nav-group-toggle      { display: flex !important; }
#sidebar .mf-nav-group-main,
#sidebar .mf-nav-group-meta        { display: flex !important; }
#sidebar .mf-nav-group-icon        { display: inline-flex !important; }

/* --- View header ------------------------------------------- */
.mf-view-header          { display: flex !important; }
.mf-view-title           { display: flex !important; }
.mf-view-title-icon      { display: inline-flex !important; }
.mf-row-panel-btn        { display: inline-flex !important; }

/* --- Accounts / users ------------------------------------- */
.mf-accounts-summary          { display: grid !important; }
.mf-accounts-summary button   { display: grid !important; }
.mf-accounts-summary button i { display: inline-flex !important; }
.mf-accounts-bulk             { display: flex !important; }
.mf-accounts-bulk > div:first-child { display: grid !important; }
.mf-accounts-bulk > div:last-child  { display: flex !important; }

/* --- Buttons ----------------------------------------------- */
.mf-btn-primary,
.mf-btn-secondary,
.mf-btn-danger { display: inline-flex !important; }
.mf-btn-primary i,
.mf-btn-secondary i,
.mf-btn-danger i { display: inline !important; }

/* --- Audit log -------------------------------------------- */
.audit-shell            { display: grid !important; }
.audit-hero             { display: flex !important; }
.audit-hero span,
.audit-toolbar span     { display: block !important; }
.audit-kpis             { display: grid !important; }
.audit-kpis span        { display: block !important; }
.audit-kpis strong      { display: block !important; }
.audit-toolbar          { display: flex !important; }
.audit-toolbar label    { display: grid !important; }
.audit-list             { display: grid !important; }
.audit-row              { display: grid !important; }
.audit-row-icon         { display: flex !important; }
.audit-row-top          { display: flex !important; }
.audit-row-top strong   { display: block !important; }
.audit-row-meta         { display: flex !important; }
.audit-row-meta span    { display: inline-flex !important; }
.audit-empty            { display: grid !important; }
.audit-empty i          { display: flex !important; }

/* --- Alert notifications panel ---------------------------- */
.mf-alert-notifications                    { display: grid !important; }
.mf-alert-notifications-head               { display: flex !important; }
.mf-alert-notifications-head button        { display: inline-flex !important; }
.mf-alert-notifications-list              { display: grid !important; }
.mf-alert-notifications-list article      { display: flex !important; }
.mf-alert-notifications-list article > span,
.mf-alert-notifications-icon              { display: inline-flex !important; }
.mf-alert-notifications-list strong,
.mf-alert-notifications-empty strong      { display: block !important; }
.mf-alert-notifications-list small,
.mf-alert-notifications-empty p           { display: block !important; }
.mf-alert-notifications-empty             { display: flex !important; }
.mf-alert-summary-bar                     { display: flex !important; }

/* --- Alert center 2 (Centrum Alertów) -------------------- */
.mf-alert-center2-head                    { display: flex !important; }
.mf-alert-center2-actions,
.mf-alert-actions2                        { display: flex !important; }
.mf-alert-center2-actions button,
.mf-alert-actions2 button                 { display: inline-flex !important; }
.mf-alert-empty2                          { display: flex !important; }
.mf-filter-bar                            { display: flex !important; }
.mf-filter-search                         { display: flex !important; }

/* --- Folder center (Centrum Auta / teczka pojazdu) -------- */
.mf-folder-center      { display: grid !important; }
.mf-folder-center-head { display: flex !important; }
.mf-folder-active,
.mf-folder-ok          { display: inline-flex !important; }

/* --- Service flow ----------------------------------------- */
.mf-service-source  { display: inline-flex !important; }
.mf-service-flow    { display: flex !important; }
.mf-service-flow span { display: grid !important; }

/* --- Profile view ----------------------------------------- */
.mf-profile-hero         { display: grid !important; }
.mf-profile-avatar       { display: inline-flex !important; }
.mf-profile-meta         { display: flex !important; }
.mf-profile-status       { display: grid !important; }
.mf-profile-status small { display: block !important; }
.mf-profile-status strong { display: block !important; }
#view-profile form       { display: grid !important; }
#view-profile label      { display: block !important; }
#view-profile h4         { display: flex !important; }

/* --- Messages --------------------------------------------- */
.mf-messages-shell            { display: grid !important; }
.mf-messages-sidebar          { display: flex !important; }
.mf-messages-head             { display: flex !important; }
.mf-messages-title            { display: flex !important; }
.mf-messages-title > span     { display: flex !important; }
.mf-messages-head button      { display: flex !important; }
.mf-messages-stats            { display: grid !important; }
.mf-messages-stats b          { display: block !important; }
.mf-conversations-empty,
.mf-chat-empty,
.mf-chat-empty-inline         { display: flex !important; }
.mf-conversation-item         { display: flex !important; }
.mf-conversation-avatar,
.mf-chat-avatar               { display: flex !important; }
.mf-conversation-avatar span  { display: flex !important; }
.mf-conversation-copy div     { display: flex !important; }
.mf-chat-empty div            { display: flex !important; }
.mf-chat-area                 { display: flex !important; }
.mf-chat-head                 { display: flex !important; }
.mf-chat-messages             { display: flex !important; }
.mf-message-row               { display: flex !important; }
.mf-chat-composer             { display: flex !important; }
.mf-chat-composer button      { display: flex !important; }

/* --- Driver documents ------------------------------------- */
.driver-documents-head        { display: flex !important; }
.driver-documents-title       { display: flex !important; }
.driver-documents-mark        { display: flex !important; }
.driver-documents-head span   { display: block !important; }
.driver-documents-head button,
.driver-doc-add-btn           { display: inline-flex !important; }
.driver-documents-list        { display: grid !important; }
.driver-doc-filters           { display: grid !important; }
.driver-doc-select            { display: grid !important; }
.driver-doc-empty             { display: flex !important; }
.driver-doc-empty-icon        { display: flex !important; }
.driver-doc-empty strong      { display: block !important; }
.driver-doc-empty span        { display: block !important; }
.driver-doc-row               { display: grid !important; }
.driver-doc-icon              { display: flex !important; }
.driver-doc-top               { display: flex !important; }
.driver-doc-meta              { display: flex !important; }
.driver-doc-actions           { display: flex !important; }
.driver-doc-action            { display: inline-flex !important; }
.driver-doc-search            { display: flex !important; }
#df-events-list               { display: grid !important; }
.driver-event-icon            { display: flex !important; }
.driver-event-actions         { display: flex !important; }
.driver-event-empty           { display: flex !important; }
.driver-event-empty-icon      { display: flex !important; }

/* --- Documents center ------------------------------------- */
.mf-doc-center-head,
.mf-doc-driver-strip,
.mf-doc-worklist article      { display: flex !important; }
.mf-doc-actions,
.mf-doc-work-actions          { display: flex !important; }
.mf-doc-kpis                  { display: grid !important; }
.mf-doc-kpis button           { display: grid !important; }
.mf-doc-kpis i                { display: inline-flex !important; }
.mf-doc-worklist              { display: grid !important; }
.mf-doc-work-icon             { display: inline-flex !important; }
.mf-doc-worklist small        { display: block !important; }
.mf-doc-worklist strong       { display: block !important; }
.mf-doc-empty-state           { display: flex !important; }

/* --- Charts / KPI ----------------------------------------- */
.mf-chart-kpi        { display: grid !important; }
.mf-chart-kpi > i    { display: inline-flex !important; }
.mf-chart-kpi strong { display: block !important; }

/* --- Service order modals --------------------------------- */
#modal-service-partner .mf-modal-head { display: flex !important; }
#form-service-partner .service-partner-fields { display: grid !important; }
#form-service-partner .service-partner-footer { display: flex !important; }
#modal-manual-insurance .mf-manual-insurance-form { display: flex !important; }
#modal-manual-insurance .mf-modal-grid { display: grid !important; }
#modal-manual-insurance .mf-modal-foot { display: flex !important; }
#modal-request-action .request-action-form { display: grid !important; }
#modal-request-action .request-action-form label { display: flex !important; }
#modal-request-action .request-action-footer { display: flex !important; }

/* ============================================================
   RESPONSYWNOŚĆ MOBILNA — telefony (≤768px)
   Kompleksowe dopasowanie: padding, tabele, siatki, modale,
   sidebar jako nakładka, nagłówek.
   ============================================================ */
@media (max-width: 768px) {

    /* --- Obszar treści: mniejszy padding --- */
    #content-area {
        padding-left: .75rem !important;
        padding-right: .75rem !important;
        padding-bottom: 5rem !important; /* miejsce na pasek instalacji/bezpieczny obszar iOS */
    }
    main > header { padding-left: .9rem !important; padding-right: .9rem !important; }

    /* --- Nagłówki widoków: mniejsze --- */
    .view-section h2 { font-size: 1.25rem !important; }
    .mf-view-header, .mf-view-title { flex-wrap: wrap !important; }

    /* --- SIDEBAR jako pełnoekranowa nakładka --- */
    #app-screen { position: relative !important; }
    #sidebar:not(.hidden) {
        position: fixed !important;
        top: 0 !important; left: 0 !important; bottom: 0 !important;
        width: 82vw !important; max-width: 320px !important;
        z-index: 1000 !important;
        box-shadow: 0 0 0 100vw rgba(0,0,0,.5) !important; /* przyciemnienie tła */
        animation: mf-slide-left .2s ease !important;
    }
    @keyframes mf-slide-left { from { transform: translateX(-100%); } to { transform: none; } }

    /* --- TABELE: przewijanie poziome zamiast rozjeżdżania --- */
    .view-section table { min-width: 640px !important; }
    .view-section .bg-white > table,
    .view-section table {
        display: table !important;
    }
    /* Owijka tabeli przewija w poziomie */
    .view-section .overflow-x-auto,
    .view-section .bg-white:has(> table),
    .view-section .bg-white:has(table) {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* --- SIATKI KPI/kart: zwiń do 1-2 kolumn --- */
    .grid.grid-cols-2.md\:grid-cols-4,
    .grid.md\:grid-cols-4,
    #requests-kpi-row,
    .mf-doc-kpis,
    .mf-chart-kpis { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }

    .grid.grid-cols-3,
    .grid.md\:grid-cols-3 { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }

    /* Workspace / centrum pracy — jedna kolumna */
    .mf-workspace-grid,
    .mf-driver-grid { grid-template-columns: 1fr !important; }

    /* --- MODALE: pełna szerokość, prawie pełna wysokość --- */
    [id^="modal-"] > div,
    .fixed.inset-0 > .bg-white,
    #modal-history > div,
    #modal-driver-folder > div {
        width: 96vw !important;
        max-width: 96vw !important;
        max-height: 92vh !important;
        margin: 0 !important;
        border-radius: 14px !important;
    }
    /* Teczka pojazdu: panel boczny nad treścią (kolumna) */
    #modal-history > div { flex-direction: column !important; }
    #modal-history .w-1\/3 { width: 100% !important; max-height: 38vh !important; }
    #modal-history .w-2\/3 { width: 100% !important; }

    /* --- Wiadomości: lista + czat jeden pod drugim --- */
    .mf-messages-shell { grid-template-columns: 1fr !important; }

    /* --- Centrum Auta (kafelki teczki) — 3 kolumny max --- */
    .mf-folder-grid { grid-template-columns: repeat(3, minmax(0,1fr)) !important; }

    /* --- Karty alertów: kompaktowo, akcje pod spodem --- */
    .mf-alert-row2 {
        grid-template-columns: 22px 38px minmax(0,1fr) !important;
        row-gap: .35rem !important;
    }
    .mf-alert-date2, .mf-alert-actions2 {
        grid-column: 1 / -1 !important;
        justify-content: flex-start !important;
    }

    /* --- Przyciski akcji w wierszach: zawijają się --- */
    td .flex.justify-end { flex-wrap: wrap !important; justify-content: flex-start !important; }

    /* --- Nagłówek: ukryj długie etykiety, zostaw ikony --- */
    #page-title { display: none !important; }
    .gsearch-item small { font-size: .7rem !important; }

    /* --- Globalna wyszukiwarka pełna szerokość --- */
    #global-search-overlay > div { max-width: 94vw !important; }

    /* --- Toasty: nie wychodzą poza ekran --- */
    #toast-container { left: .5rem !important; right: .5rem !important; bottom: .5rem !important; }
    .mf-toast { min-width: 0 !important; max-width: 100% !important; width: 100% !important; }

    /* --- Mniejsze odstępy w kartach --- */
    .mf-module-card { padding: .8rem !important; }
    .dash-card { padding: .85rem !important; }
    .dash-value { font-size: 1.6rem !important; }
}

/* --- Bardzo małe ekrany (≤420px) --- */
@media (max-width: 420px) {
    .grid.grid-cols-2.md\:grid-cols-4,
    #requests-kpi-row { grid-template-columns: 1fr 1fr !important; gap: .5rem !important; }
    .mf-folder-grid { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
    .mf-module-actions { grid-template-columns: 1fr !important; }
    .view-section h2 { font-size: 1.1rem !important; }
}
