/* -------------------------------------------------------------------------- */
/* Base / defaults                                                            */
/* -------------------------------------------------------------------------- */
:root {
    --font-sans: "Inter", "Segoe UI", "Roboto", "Arial", sans-serif;
    --kc-radius: 6px;
}

.pilotage-dashboard {
    min-height: 100%;
    padding: 24px;
    color: #edf7ff;
    background:
        radial-gradient(circle at 12% 0%, rgba(39, 160, 255, 0.26), transparent 30%),
        radial-gradient(circle at 88% 12%, rgba(36, 214, 186, 0.18), transparent 28%),
        linear-gradient(135deg, #07111f 0%, #0a1528 48%, #09101b 100%);
}

.pilotage-shell {
    max-width: 1560px;
    margin: 0 auto;
}

.pilotage-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.pilotage-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #76e4ff;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.pilotage-title {
    color: #ffffff;
    font-weight: 850;
}

.pilotage-subtitle,
.pilotage-muted {
    color: rgba(226, 239, 255, 0.72);
}

.pilotage-header__meta {
    min-width: 150px;
    padding: 12px 14px;
    border: 1px solid rgba(113, 204, 255, 0.24);
    border-radius: 8px;
    background: rgba(7, 18, 34, 0.68);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.18);
}

.pilotage-header__meta span {
    display: block;
    color: rgba(226, 239, 255, 0.68);
    font-size: 0.76rem;
}

.pilotage-header__meta strong {
    display: block;
    margin-top: 3px;
    color: #ffffff;
    font-size: 1.18rem;
}

.pilotage-loader {
    border-radius: 999px;
    overflow: hidden;
}

.pilotage-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.pilotage-kpi,
.pilotage-panel {
    border: 1px solid rgba(132, 184, 255, 0.18);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(16, 31, 54, 0.9), rgba(8, 18, 34, 0.92));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.pilotage-kpi {
    position: relative;
    overflow: hidden;
    min-height: 142px;
    padding: 16px;
}

.pilotage-kpi::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, #27e0a7, #68e8ff);
}

.pilotage-kpi--warning::before { background: linear-gradient(90deg, #ff9f43, #ffc857); }
.pilotage-kpi--danger::before { background: linear-gradient(90deg, #ff4d6d, #ff8a80); }
.pilotage-kpi--primary::before { background: linear-gradient(90deg, #4da3ff, #8dc7ff); }
.pilotage-kpi--info::before { background: linear-gradient(90deg, #50d5ff, #7cffe8); }

.pilotage-kpi__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: rgba(226, 239, 255, 0.75);
    font-size: 0.82rem;
    font-weight: 700;
}

.pilotage-kpi__value {
    margin-top: 22px;
    color: #ffffff;
    font-size: clamp(1.22rem, 1.4vw, 1.72rem);
    font-weight: 850;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.pilotage-kpi__trend {
    margin-top: 10px;
    color: #95e8ff;
    font-size: 0.82rem;
}

.pilotage-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.pilotage-panel {
    padding: 18px;
}

.pilotage-chart-panel {
    min-height: 430px;
}

.pilotage-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.pilotage-panel__title {
    color: #ffffff;
    font-weight: 800;
}

.pilotage-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    color: rgba(226, 239, 255, 0.72);
    font-size: 0.8rem;
}

.pilotage-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.pilotage-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    display: inline-block;
}

.pilotage-dot--green { background: #2ee6a6; box-shadow: 0 0 14px rgba(46, 230, 166, 0.72); }
.pilotage-dot--orange { background: #ffae42; box-shadow: 0 0 14px rgba(255, 174, 66, 0.68); }
.pilotage-dot--blue { background: #5aa9ff; box-shadow: 0 0 14px rgba(90, 169, 255, 0.68); }

.pilotage-chart {
    width: 100%;
    aspect-ratio: 2.55 / 1;
    min-height: 270px;
}

.pilotage-chart svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.pilotage-gridline {
    stroke: rgba(184, 214, 255, 0.11);
    stroke-width: 1;
}

.pilotage-axis-label {
    fill: rgba(226, 239, 255, 0.58);
    font-size: 11px;
}

.pilotage-line {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 9px rgba(85, 169, 255, 0.28));
}

.pilotage-line--green { stroke: #2ee6a6; }
.pilotage-line--orange { stroke: #ffae42; }
.pilotage-line--blue { stroke: #5aa9ff; }

.pilotage-point {
    fill: #081322;
    stroke-width: 2;
}

.pilotage-summary__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.pilotage-summary__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(132, 184, 255, 0.14);
    border-radius: 8px;
    background: rgba(5, 15, 29, 0.52);
}

.pilotage-summary__row span {
    color: rgba(226, 239, 255, 0.74);
    font-size: 0.84rem;
}

.pilotage-summary__row strong {
    color: #ffffff;
    font-size: 1rem;
    text-align: right;
}

.pilotage-badge {
    justify-self: start;
    padding: 3px 8px;
    border-radius: 999px;
    color: #d9f5ff;
    background: rgba(90, 169, 255, 0.16);
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 800;
}

.pilotage-badge--success { color: #bfffe9; background: rgba(46, 230, 166, 0.16); }
.pilotage-badge--warning { color: #ffe0ad; background: rgba(255, 174, 66, 0.17); }
.pilotage-badge--danger { color: #ffc4ce; background: rgba(255, 77, 109, 0.16); }
.pilotage-badge--info { color: #c7e4ff; background: rgba(90, 169, 255, 0.16); }

@media (max-width: 1280px) {
    .pilotage-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .pilotage-summary__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .pilotage-dashboard {
        padding: 16px;
    }

    .pilotage-header,
    .pilotage-chart-grid {
        grid-template-columns: 1fr;
    }

    .pilotage-header {
        display: grid;
    }

    .pilotage-kpi-grid,
    .pilotage-summary__grid {
        grid-template-columns: 1fr;
    }
}

.scoring-dashboard {
    min-height: calc(100vh - 150px);
    margin: -8px -16px 0;
    padding: 24px;
    color: #f7fbff;
    background:
        radial-gradient(circle at 14% 8%, rgba(44, 139, 255, 0.16), transparent 24%),
        radial-gradient(circle at 86% 16%, rgba(255, 125, 25, 0.12), transparent 24%),
        linear-gradient(135deg, #040910 0%, #07111d 48%, #050910 100%);
}

.scoring-shell {
    max-width: 1780px;
    margin: 0 auto;
}

.scoring-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.scoring-card {
    position: relative;
    border: 1px solid rgba(70, 150, 255, 0.48);
    border-radius: 8px;
    background: rgba(3, 12, 22, 0.88);
    box-shadow: inset 0 0 28px rgba(60, 145, 255, 0.10), 0 0 22px rgba(60, 145, 255, 0.18);
}

.scoring-card--blue { border-color: rgba(64, 153, 255, 0.78); box-shadow: inset 0 0 34px rgba(64, 153, 255, 0.10), 0 0 24px rgba(64, 153, 255, 0.28); }
.scoring-card--orange { border-color: rgba(255, 130, 24, 0.82); box-shadow: inset 0 0 34px rgba(255, 130, 24, 0.12), 0 0 24px rgba(255, 130, 24, 0.30); }
.scoring-card--green { border-color: rgba(134, 224, 61, 0.82); box-shadow: inset 0 0 34px rgba(134, 224, 61, 0.12), 0 0 24px rgba(134, 224, 61, 0.26); }
.scoring-card--red { border-color: rgba(255, 72, 72, 0.82); box-shadow: inset 0 0 34px rgba(255, 72, 72, 0.12), 0 0 24px rgba(255, 72, 72, 0.30); }

.scoring-kpi {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 18px;
    min-height: 172px;
    padding: 28px 24px;
}

.scoring-kpi__icon {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.scoring-kpi__icon .mud-icon-root {
    width: 62px;
    height: 62px;
    font-size: 62px;
    color: #3ea1ff !important;
    filter: drop-shadow(0 0 14px rgba(62, 161, 255, 0.78));
}

.scoring-card--orange .scoring-kpi__icon .mud-icon-root,
.scoring-card--orange .scoring-alert__title .mud-icon-root,
.scoring-card--orange .scoring-metric-row .mud-icon-root {
    color: #ff8a1f !important;
    filter: drop-shadow(0 0 12px rgba(255, 138, 31, 0.80));
}

.scoring-card--green .scoring-kpi__icon .mud-icon-root {
    color: #92e849 !important;
    filter: drop-shadow(0 0 12px rgba(146, 232, 73, 0.76));
}

.scoring-card--green .scoring-alert__title .mud-icon-root,
.scoring-card--green .scoring-metric-row .mud-icon-root {
    color: #92e849 !important;
    filter: drop-shadow(0 0 12px rgba(146, 232, 73, 0.76));
}

.scoring-card--red .scoring-kpi__icon .mud-icon-root,
.scoring-card--red .scoring-alert__title .mud-icon-root,
.scoring-card--red .scoring-metric-row .mud-icon-root {
    color: #ff4c4c !important;
    filter: drop-shadow(0 0 12px rgba(255, 76, 76, 0.82));
}

.scoring-kpi__content span,
.scoring-kpi__content small {
    display: block;
    color: rgba(232, 236, 249, 0.74);
    font-size: 1.05rem;
}

.scoring-kpi__content strong {
    display: block;
    margin-top: 16px;
    color: #ffffff;
    font-size: clamp(1.55rem, 2vw, 2.35rem);
    font-weight: 900;
    line-height: 1;
}

.scoring-kpi__content em {
    display: block;
    margin-top: 20px;
    color: #8ee044;
    font-size: 1.18rem;
    font-style: normal;
    font-weight: 900;
}

.scoring-card--orange .scoring-kpi__content em { color: #ff8a1f; }
.scoring-card--red .scoring-kpi__content em { color: #ff3838; }

.scoring-kpi__content small {
    margin-top: 14px;
}

.scoring-alert-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    margin-bottom: 28px;
}

.scoring-alert {
    padding: 34px 38px 28px;
}

.scoring-alert__header,
.scoring-actions,
.scoring-alert__title,
.scoring-analysis header {
    display: flex;
    align-items: center;
}

.scoring-alert__header {
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 30px;
}

.scoring-alert__title {
    gap: 16px;
    font-size: clamp(1.6rem, 2.3vw, 2.45rem);
    font-weight: 900;
    line-height: 1;
}

.scoring-alert__title .mud-icon-root {
    width: 54px;
    height: 54px;
    font-size: 54px;
}

.scoring-alert__title--red { color: #ff4c4c; text-shadow: 0 0 18px rgba(255, 76, 76, 0.36); }
.scoring-alert__title--orange { color: #ff881b; text-shadow: 0 0 18px rgba(255, 136, 27, 0.36); }
.scoring-alert__title--green { color: #92e849; text-shadow: 0 0 18px rgba(146, 232, 73, 0.36); }

.scoring-pill {
    padding: 12px 18px;
    border: 2px solid currentColor;
    border-radius: 8px;
    font-size: 1.18rem;
    font-weight: 900;
    text-transform: uppercase;
    box-shadow: inset 0 0 18px currentColor, 0 0 18px currentColor;
}

.scoring-pill--red { color: #ff4c4c; background: rgba(255, 76, 76, 0.14); }
.scoring-pill--orange { color: #ff881b; background: rgba(255, 136, 27, 0.14); }
.scoring-pill--green { color: #92e849; background: rgba(146, 232, 73, 0.14); }

.scoring-alert h2 {
    margin: 0 0 28px;
    color: #ffffff;
    font-size: clamp(1.55rem, 2.15vw, 2.35rem);
    font-weight: 900;
    line-height: 1.2;
}

.scoring-metric-list {
    border-top: 1px solid rgba(150, 176, 215, 0.17);
}

.scoring-metric-row {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    min-height: 96px;
    border-bottom: 1px solid rgba(150, 176, 215, 0.17);
}

.scoring-metric-row .mud-icon-root {
    width: 42px;
    height: 42px;
    font-size: 42px;
}

.scoring-metric-row span {
    color: rgba(232, 236, 249, 0.76);
    font-size: clamp(1.05rem, 1.45vw, 1.52rem);
}

.scoring-metric-row strong {
    color: #ffffff;
    font-size: clamp(1.1rem, 1.8vw, 2rem);
    font-weight: 900;
    text-align: right;
    white-space: nowrap;
}

.scoring-text-orange { color: #ff8218 !important; }
.scoring-text-red { color: #ff3838 !important; }
.scoring-text-green { color: #86dc42 !important; }

.scoring-actions {
    justify-content: space-between;
    gap: 28px;
    margin-top: 28px;
}

.scoring-button.mud-button {
    flex: 1 1 0;
    min-height: 70px;
    border: 2px solid currentColor !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    font-size: clamp(1rem, 1.35vw, 1.45rem) !important;
    font-weight: 900 !important;
    box-shadow: inset 0 0 24px currentColor, 0 0 20px currentColor;
}

.scoring-button--red.mud-button { color: #ff4c4c !important; background-color: rgba(255, 76, 76, 0.14) !important; }
.scoring-button--orange.mud-button { color: #ff881b !important; background-color: rgba(255, 136, 27, 0.14) !important; }
.scoring-button--blue.mud-button { color: #3ea1ff !important; background-color: rgba(62, 161, 255, 0.14) !important; }

.scoring-empty-state {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    min-height: 230px;
    border-top: 1px solid rgba(150, 176, 215, 0.17);
    color: rgba(232, 236, 249, 0.82);
    font-size: clamp(1.05rem, 1.45vw, 1.5rem);
    line-height: 1.45;
}

.scoring-empty-state .mud-icon-root {
    width: 48px;
    height: 48px;
    font-size: 48px;
    color: #92e849 !important;
    filter: drop-shadow(0 0 12px rgba(146, 232, 73, 0.76));
}

.scoring-analysis {
    padding: 32px 38px 42px;
}

.scoring-analysis header {
    gap: 16px;
    margin-bottom: 18px;
}

.scoring-analysis header .mud-icon-root {
    width: 44px;
    height: 44px;
    font-size: 44px;
    color: #3ea1ff !important;
    filter: drop-shadow(0 0 13px rgba(62, 161, 255, 0.80));
}

.scoring-analysis h2 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1.6rem, 2.05vw, 2.25rem);
    font-weight: 900;
}

.scoring-bars {
    overflow: hidden;
    border: 1px solid rgba(92, 138, 194, 0.28);
    border-radius: 8px;
    background: rgba(5, 15, 28, 0.78);
}

.scoring-bar-row {
    display: grid;
    grid-template-columns: 320px minmax(240px, 1fr) 150px 160px;
    min-height: 78px;
    border-bottom: 1px solid rgba(92, 138, 194, 0.28);
}

.scoring-bar-row:last-child {
    border-bottom: 0;
}

.scoring-bar-row__label,
.scoring-bar-row__count,
.scoring-bar-row__amount,
.scoring-bar-row__track {
    display: flex;
    align-items: center;
}

.scoring-bar-row__label {
    padding: 0 30px;
    border-right: 1px solid rgba(92, 138, 194, 0.42);
    color: #ffffff;
    font-size: clamp(1rem, 1.35vw, 1.45rem);
}

.scoring-bar-row__track {
    padding: 0 22px;
    background-image: linear-gradient(rgba(92, 138, 194, 0.16) 1px, transparent 1px);
    background-size: 100% 39px;
}

.scoring-bar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    min-width: 84px;
    border: 2px solid currentColor;
    border-radius: 6px;
    color: #ffffff;
    font-size: 1.12rem;
    font-weight: 900;
}

.scoring-bar--green { background: rgba(124, 229, 55, 0.34); border-color: #9cff4d; box-shadow: inset 0 0 18px #9cff4d, 0 0 18px rgba(156, 255, 77, 0.72); }
.scoring-bar--yellow { background: rgba(255, 203, 34, 0.34); border-color: #ffd32a; box-shadow: inset 0 0 18px #ffd32a, 0 0 18px rgba(255, 211, 42, 0.72); }
.scoring-bar--orange { background: rgba(255, 119, 23, 0.40); border-color: #ff8218; box-shadow: inset 0 0 18px #ff8218, 0 0 18px rgba(255, 130, 24, 0.72); }
.scoring-bar--red { background: rgba(255, 31, 51, 0.42); border-color: #ff3838; box-shadow: inset 0 0 18px #ff3838, 0 0 18px rgba(255, 56, 56, 0.72); }

.scoring-bar-row__count {
    justify-content: flex-end;
    color: #ffffff;
    font-size: clamp(1rem, 1.35vw, 1.45rem);
}

.scoring-bar-row__amount {
    justify-content: flex-end;
    padding-right: 30px;
    font-size: clamp(1.1rem, 1.55vw, 1.7rem);
    font-weight: 900;
}

@media (max-width: 1320px) {
    .scoring-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .scoring-alert-grid {
        grid-template-columns: 1fr;
    }

    .scoring-bar-row {
        grid-template-columns: 240px minmax(220px, 1fr) 120px 140px;
    }
}

@media (max-width: 860px) {
    .scoring-dashboard {
        margin: 0;
        padding: 14px;
    }

    .scoring-kpis {
        grid-template-columns: 1fr;
    }

    .scoring-kpi {
        grid-template-columns: 62px minmax(0, 1fr);
        min-height: 150px;
        padding: 22px 18px;
    }

    .scoring-alert {
        padding: 24px 18px;
    }

    .scoring-alert__header,
    .scoring-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .scoring-metric-row {
        grid-template-columns: 42px minmax(0, 1fr);
        min-height: 88px;
    }

    .scoring-metric-row strong {
        grid-column: 2;
        text-align: left;
        white-space: normal;
    }

    .scoring-analysis {
        padding: 22px 14px;
    }

    .scoring-bar-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 14px;
    }

    .scoring-bar-row__label,
    .scoring-bar-row__track,
    .scoring-bar-row__amount {
        padding: 0;
        border-right: 0;
    }

    .scoring-bar-row__count,
    .scoring-bar-row__amount {
        justify-content: flex-start;
    }
}

.cooperative-dashboard {
    min-height: calc(100vh - 150px);
    margin: -8px -16px 0;
    padding: 24px;
    color: #f7fbff;
    background:
        radial-gradient(circle at 12% 10%, rgba(139, 232, 73, 0.16), transparent 24%),
        radial-gradient(circle at 78% 12%, rgba(64, 153, 255, 0.14), transparent 26%),
        linear-gradient(135deg, #040910 0%, #07111d 48%, #050910 100%);
}

.cooperative-shell {
    max-width: 1780px;
    margin: 0 auto;
}

.cooperative-dashboard,
.cooperative-dashboard * {
    font-variant-numeric: tabular-nums;
}

.cooperative-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.cooperative-card {
    position: relative;
    border: 1px solid rgba(70, 150, 255, 0.48);
    border-radius: 8px;
    background: rgba(3, 12, 22, 0.90);
    box-shadow: inset 0 0 28px rgba(60, 145, 255, 0.10), 0 0 22px rgba(60, 145, 255, 0.18);
}

.cooperative-card--blue { border-color: rgba(64, 153, 255, 0.78); box-shadow: inset 0 0 34px rgba(64, 153, 255, 0.10), 0 0 24px rgba(64, 153, 255, 0.28); }
.cooperative-card--green { border-color: rgba(134, 224, 61, 0.82); box-shadow: inset 0 0 34px rgba(134, 224, 61, 0.12), 0 0 24px rgba(134, 224, 61, 0.26); }
.cooperative-card--orange { border-color: rgba(255, 130, 24, 0.82); box-shadow: inset 0 0 34px rgba(255, 130, 24, 0.12), 0 0 24px rgba(255, 130, 24, 0.30); }
.cooperative-card--red { border-color: rgba(255, 72, 72, 0.82); box-shadow: inset 0 0 34px rgba(255, 72, 72, 0.12), 0 0 24px rgba(255, 72, 72, 0.30); }

.cooperative-kpi {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 14px;
    min-height: 180px;
    padding: 24px 18px;
}

.cooperative-kpi__icon .mud-icon-root {
    width: 58px;
    height: 58px;
    font-size: 58px;
    color: #3ea1ff !important;
    filter: drop-shadow(0 0 14px rgba(62, 161, 255, 0.78));
}

.cooperative-card--green .cooperative-kpi__icon .mud-icon-root { color: #92e849 !important; filter: drop-shadow(0 0 12px rgba(146, 232, 73, 0.76)); }
.cooperative-card--orange .cooperative-kpi__icon .mud-icon-root { color: #ff8a1f !important; filter: drop-shadow(0 0 12px rgba(255, 138, 31, 0.80)); }
.cooperative-card--red .cooperative-kpi__icon .mud-icon-root { color: #ff4c4c !important; filter: drop-shadow(0 0 12px rgba(255, 76, 76, 0.82)); }

.cooperative-kpi__body {
    min-width: 0;
}

.cooperative-kpi__body span,
.cooperative-kpi__body small {
    display: block;
    color: rgba(232, 236, 249, 0.76);
    font-size: clamp(0.92rem, 1.02vw, 1.12rem);
}

.cooperative-kpi__body strong {
    display: block;
    min-height: 2.45rem;
    margin-top: 14px;
    color: #ffffff;
    font-size: clamp(1.35rem, 1.65vw, 2.05rem);
    font-weight: 900;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.cooperative-kpi__body em {
    display: block;
    min-height: 1.5rem;
    margin-top: 18px;
    font-size: clamp(1rem, 1.12vw, 1.24rem);
    font-style: normal;
    font-weight: 900;
}

.cooperative-kpi__body small {
    margin-top: 10px;
}

.cooperative-text-green { color: #8ee044 !important; }
.cooperative-text-orange { color: #ff8a1f !important; }
.cooperative-text-red { color: #ff4c4c !important; }

.cooperative-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.05fr);
    gap: 22px;
    margin-bottom: 22px;
}

.cooperative-panel {
    padding: 28px 34px;
}

.cooperative-panel__header,
.cooperative-actions,
.cooperative-wide header,
.cooperative-legend {
    display: flex;
    align-items: center;
}

.cooperative-panel__header {
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 22px;
}

.cooperative-panel__header span,
.cooperative-wide header span {
    color: rgba(232, 236, 249, 0.78);
    font-size: clamp(1rem, 1.15vw, 1.25rem);
    font-weight: 700;
}

.cooperative-panel__header h2,
.cooperative-wide h2 {
    margin: 10px 0 0;
    color: #ffffff;
    font-size: clamp(1.55rem, 2vw, 2.35rem);
    font-weight: 900;
    line-height: 1.15;
}

.cooperative-panel__header .mud-icon-root {
    width: 72px;
    height: 72px;
    font-size: 72px;
    color: #92e849 !important;
    filter: drop-shadow(0 0 14px rgba(146, 232, 73, 0.78));
}

.cooperative-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.cooperative-tags strong,
.cooperative-member-pill {
    border: 1px solid currentColor;
    border-radius: 8px;
    padding: 8px 12px;
    color: #63adff;
    background: rgba(62, 161, 255, 0.14);
    font-size: 1rem;
    font-weight: 900;
    box-shadow: inset 0 0 12px currentColor, 0 0 12px currentColor;
}

.cooperative-tags .cooperative-tag--green,
.cooperative-member-pill {
    color: #92e849;
    background: rgba(146, 232, 73, 0.14);
}

.cooperative-metric-table,
.cooperative-global-list {
    overflow: hidden;
    border: 1px solid rgba(92, 138, 194, 0.28);
    border-radius: 8px;
}

.cooperative-metric-table > div,
.cooperative-global-list > div {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) minmax(140px, auto);
    align-items: center;
    gap: 14px;
    min-height: 70px;
    padding: 0 18px;
    border-bottom: 1px solid rgba(92, 138, 194, 0.28);
}

.cooperative-global-list > div {
    grid-template-columns: 54px minmax(0, 1fr) minmax(170px, auto);
}

.cooperative-metric-table > div:last-child,
.cooperative-global-list > div:last-child {
    border-bottom: 0;
}

.cooperative-metric-table .mud-icon-root,
.cooperative-global-list .mud-icon-root {
    color: #63adff !important;
    font-size: 36px;
    filter: drop-shadow(0 0 12px rgba(62, 161, 255, 0.72));
}

.cooperative-metric-table span,
.cooperative-global-list span {
    color: rgba(232, 236, 249, 0.82);
    font-size: clamp(1rem, 1.2vw, 1.35rem);
    min-width: 0;
}

.cooperative-metric-table strong,
.cooperative-global-list strong {
    justify-self: end;
    max-width: 100%;
    color: #ffffff;
    font-size: clamp(1.05rem, 1.45vw, 1.75rem);
    font-weight: 900;
    line-height: 1.05;
    text-align: right;
    overflow-wrap: anywhere;
}

.cooperative-global-list small {
    grid-column: 3;
    justify-self: end;
    color: rgba(232, 236, 249, 0.72);
    font-size: 0.95rem;
}

.cooperative-mini-chart {
    margin-top: 18px;
}

.cooperative-mini-chart h3 {
    margin: 0 0 12px;
    color: rgba(232, 236, 249, 0.86);
    font-size: 1.05rem;
}

.cooperative-bars {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: end;
    gap: 14px;
    min-height: 172px;
    padding: 12px 8px 0;
    border-bottom: 1px solid rgba(232, 236, 249, 0.34);
}

.cooperative-bar-cell {
    display: grid;
    grid-template-rows: 24px 1fr 26px;
    justify-items: center;
    height: 172px;
    min-width: 0;
}

.cooperative-bar-cell i {
    align-self: end;
    width: min(52px, 70%);
    min-height: 0;
    border: 2px solid #92e849;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, rgba(146, 232, 73, 0.88), rgba(54, 128, 22, 0.42));
    box-shadow: inset 0 0 16px #92e849, 0 0 18px rgba(146, 232, 73, 0.62);
}

.cooperative-bar-cell span,
.cooperative-bar-cell small {
    color: rgba(232, 236, 249, 0.82);
    white-space: nowrap;
}

.cooperative-actions {
    gap: 18px;
    margin-top: 22px;
}

.cooperative-button.mud-button {
    flex: 1 1 0;
    min-height: 58px;
    border: 2px solid currentColor !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    font-size: clamp(0.95rem, 1.15vw, 1.25rem) !important;
    font-weight: 900 !important;
    box-shadow: inset 0 0 18px currentColor, 0 0 16px currentColor;
}

.cooperative-button--blue.mud-button { color: #63adff !important; background-color: rgba(62, 161, 255, 0.14) !important; }
.cooperative-button--orange.mud-button { color: #ff8a1f !important; background-color: rgba(255, 136, 27, 0.14) !important; }

.cooperative-ranking {
    overflow: hidden;
    margin-bottom: 22px;
    border: 1px solid rgba(92, 138, 194, 0.28);
    border-radius: 8px;
}

.cooperative-ranking__head,
.cooperative-ranking__row {
    display: grid;
    grid-template-columns: minmax(210px, 1fr) minmax(120px, auto) minmax(170px, auto);
    gap: 18px;
    align-items: center;
    min-height: 58px;
    padding: 0 18px;
    border-bottom: 1px solid rgba(92, 138, 194, 0.28);
}

.cooperative-ranking__head {
    color: rgba(232, 236, 249, 0.76);
    font-size: 1rem;
    font-weight: 800;
}

.cooperative-ranking__row:last-child {
    border-bottom: 0;
}

.cooperative-ranking__row span {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    color: #ffffff;
    font-size: clamp(1rem, 1.25vw, 1.35rem);
}

.cooperative-ranking__row b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(146, 232, 73, 0.7);
    border-radius: 50%;
    color: #92e849;
    background: rgba(146, 232, 73, 0.12);
}

.cooperative-ranking__row strong {
    justify-self: end;
    color: #ffffff;
    font-size: clamp(1rem, 1.25vw, 1.45rem);
    font-weight: 900;
    text-align: right;
}

.cooperative-empty {
    padding: 24px;
    color: rgba(232, 236, 249, 0.76);
}

.cooperative-wide {
    padding: 26px 34px 30px;
}

.cooperative-wide header {
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.cooperative-combo-chart {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 28px;
    min-height: 330px;
    padding: 28px 18px 0;
    border: 1px solid rgba(92, 138, 194, 0.28);
    border-radius: 8px;
    background-image: linear-gradient(rgba(92, 138, 194, 0.16) 1px, transparent 1px);
    background-size: 100% 64px;
}

.cooperative-combo-cell {
    display: grid;
    grid-template-rows: 1fr 34px;
    min-width: 0;
}

.cooperative-combo-cell strong {
    align-self: center;
    color: rgba(232, 236, 249, 0.86);
    text-align: center;
    font-size: 1.15rem;
}

.cooperative-combo-bars {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 14px;
}

.cooperative-combo-bars i {
    position: relative;
    width: min(62px, 38%);
    min-height: 0;
    border-radius: 6px 6px 0 0;
}

.cooperative-combo-bars i span {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    color: inherit;
    font-size: clamp(0.82rem, 1vw, 1.08rem);
    font-style: normal;
    font-weight: 900;
    white-space: nowrap;
}

.cooperative-volume-bar {
    border: 2px solid #92e849;
    color: #92e849;
    background: linear-gradient(180deg, rgba(146, 232, 73, 0.88), rgba(54, 128, 22, 0.42));
    box-shadow: inset 0 0 16px #92e849, 0 0 18px rgba(146, 232, 73, 0.62);
}

.cooperative-money-bar {
    border: 2px solid #3ea1ff;
    color: #63adff;
    background: linear-gradient(180deg, rgba(62, 161, 255, 0.86), rgba(22, 78, 145, 0.42));
    box-shadow: inset 0 0 16px #3ea1ff, 0 0 18px rgba(62, 161, 255, 0.62);
}

.cooperative-legend {
    justify-content: center;
    gap: 34px;
    margin-top: 18px;
    color: rgba(232, 236, 249, 0.78);
}

.cooperative-dot {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 10px;
    border-radius: 4px;
    vertical-align: -3px;
}

.cooperative-dot--green { background: #92e849; box-shadow: 0 0 12px rgba(146, 232, 73, 0.82); }
.cooperative-dot--blue { background: #3ea1ff; box-shadow: 0 0 12px rgba(62, 161, 255, 0.82); }

@media (max-width: 1480px) {
    .cooperative-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .cooperative-main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 880px) {
    .cooperative-dashboard {
        margin: 0;
        padding: 14px;
    }

    .cooperative-kpis,
    .cooperative-combo-chart {
        grid-template-columns: 1fr;
    }

    .cooperative-kpi {
        min-height: 150px;
    }

    .cooperative-panel,
    .cooperative-wide {
        padding: 22px 16px;
    }

    .cooperative-panel__header,
    .cooperative-actions,
    .cooperative-wide header {
        align-items: stretch;
        flex-direction: column;
    }

    .cooperative-metric-table > div,
    .cooperative-global-list > div {
        grid-template-columns: 42px minmax(0, 1fr);
        padding: 12px;
    }

    .cooperative-metric-table strong,
    .cooperative-global-list strong,
    .cooperative-global-list small {
        grid-column: 2;
        justify-self: start;
        text-align: left;
    }

    .cooperative-ranking__head {
        display: none;
    }

    .cooperative-ranking__row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 14px;
    }

    .cooperative-ranking__row strong {
        justify-self: start;
        text-align: left;
    }

    .cooperative-combo-chart {
        min-height: auto;
        gap: 18px;
    }

    .cooperative-combo-cell {
        min-height: 240px;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
    margin: 0;
    font-family: var(--font-sans);
    font-size: 15px;
    background: #101620;
}

/* Keep links neutral by default (MudBlazor-friendly) */
a, .btn-link { color: inherit; }

/* Legacy bootstrap-ish button (kept) */
.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content { padding-top: 1.1rem; }
h1:focus { outline: none; }

/* Typography helpers */
h1 { font-size: 42px; font-weight: 700; }
h2 { font-size: 30px; font-weight: 600; }
h3 { font-size: 22px; font-weight: 600; }

/* -------------------------------------------------------------------------- */
/* Validation / Blazor error boundary                                         */
/* -------------------------------------------------------------------------- */
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after { content: "An error has occurred."; }

.darker-border-checkbox.form-check-input { border-color: #929292; }

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}
.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* -------------------------------------------------------------------------- */
/* Marketing / UI blocks                                                      */
/* -------------------------------------------------------------------------- */
.billing-hero {
    background: #F8FAFC;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 10px;
}
.billing-hero-title {
    color: #111827;
    font-size: 42px;
    font-weight: 700;
    line-height: 1.1;
}
.billing-hero-subtitle {
    color: #6B7280;
    font-size: 16px;
    font-weight: 500;
}

.plan-card {
    border: 1px solid rgba(17, 24, 39, 0.12);
    transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.plan-card:hover {
    border: 2px solid #16A34A;
    transform: scale(1.02);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}
.plan-card--current {
    border: 2px solid #D4AF37;
    transform: scale(1.02);
}
.plan-card--current:hover { border-color: #16A34A; }

.module-status-chip.mud-chip {
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
}
.module-status-chip .mud-chip-content {
    font-size: 12px;
    line-height: 1;
    padding: 0;
}

/* MudBlazor switches: make on/off states explicit across the app. */
.mud-switch .mud-switch-track,
.mud-switch-span .mud-switch-track,
.mud-switch-button .mud-switch-track {
    min-width: 52px !important;
    width: 52px !important;
    height: 28px !important;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 999px !important;
    background: linear-gradient(180deg, rgba(71, 85, 105, 0.82), rgba(30, 41, 59, 0.92)) !important;
    opacity: 1 !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.34), 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.mud-switch .mud-switch-base,
.mud-switch-span .mud-switch-base,
.mud-switch-button .mud-switch-base {
    padding: 3px !important;
    color: transparent !important;
    transition: transform 160ms ease !important;
}

.mud-switch .mud-switch-thumb,
.mud-switch-span .mud-switch-thumb,
.mud-switch-button .mud-switch-thumb {
    width: 22px !important;
    height: 22px !important;
    background: linear-gradient(180deg, #ffffff, #dbeafe) !important;
    border: 1px solid rgba(226, 232, 240, 0.92);
    box-shadow: 0 4px 12px rgba(2, 6, 23, 0.28);
}

.mud-switch .mud-switch-base.mud-checked,
.mud-switch .mud-switch-input:checked + .mud-switch-base,
.mud-switch:has(input:checked) .mud-switch-base,
.mud-switch-span:has(input:checked) .mud-switch-base,
.mud-switch-button:has(input:checked) .mud-switch-base {
    transform: translateX(24px) !important;
}

.mud-switch .mud-switch-base.mud-checked + .mud-switch-track,
.mud-switch .mud-switch-input:checked ~ .mud-switch-track,
.mud-switch .mud-checked ~ .mud-switch-track,
.mud-switch .mud-checked + .mud-switch-track,
.mud-switch:has(input:checked) .mud-switch-track,
.mud-switch-span:has(input:checked) .mud-switch-track,
.mud-switch-button:has(input:checked) .mud-switch-track {
    border-color: rgba(45, 212, 191, 0.78);
    background: linear-gradient(135deg, #0d9488, #2dd4bf) !important;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.12), 0 8px 20px rgba(13, 148, 136, 0.22);
}

.mud-switch .mud-switch-base.mud-checked .mud-switch-thumb,
.mud-switch .mud-switch-input:checked ~ .mud-switch-thumb,
.mud-switch:has(input:checked) .mud-switch-thumb,
.mud-switch-span:has(input:checked) .mud-switch-thumb,
.mud-switch-button:has(input:checked) .mud-switch-thumb {
    border-color: rgba(240, 253, 250, 0.9);
    background: linear-gradient(180deg, #ffffff, #ccfbf1) !important;
}

.mud-switch:hover .mud-switch-track {
    border-color: rgba(45, 212, 191, 0.52);
}

.mud-switch .mud-switch-base.mud-focus-visible + .mud-switch-track,
.mud-switch:focus-within .mud-switch-track {
    outline: 2px solid rgba(20, 184, 166, 0.38);
    outline-offset: 2px;
}

.profile-page .mud-switch {
    min-width: 56px;
    margin: 0;
}

.profile-page .mud-switch-label {
    color: #e5f3ff !important;
    font-weight: 700;
}

.cash-forecast {
    padding: 18px;
    min-height: 410px;
    border: 1px solid rgba(45, 212, 191, 0.26);
    border-radius: 8px;
    background:
        radial-gradient(circle at 18% 4%, rgba(20, 184, 166, 0.22), transparent 32%),
        radial-gradient(circle at 82% 8%, rgba(37, 99, 235, 0.18), transparent 30%),
        linear-gradient(135deg, #08111f 0%, #101827 52%, #080d16 100%);
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.30);
    color: #e8f6ff;
}

.cash-forecast__header,
.cash-forecast__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cash-forecast__eyebrow {
    color: #5eead4;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cash-forecast__title {
    color: #f8fafc;
    font-size: 1rem;
    font-weight: 850;
}

.cash-forecast__risk {
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
}

.cash-forecast__risk--stable { color: #ccfbf1; background: rgba(20, 184, 166, 0.20); }
.cash-forecast__risk--warning { color: #fed7aa; background: rgba(249, 115, 22, 0.22); }
.cash-forecast__risk--critical { color: #fecdd3; background: rgba(239, 68, 68, 0.22); }

.cash-forecast__kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0 10px;
}

.cash-forecast__kpis div {
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.62);
}

.cash-forecast__kpis span,
.cash-forecast__footer,
.cash-forecast__empty {
    color: rgba(226, 232, 240, 0.72);
    font-size: 0.78rem;
}

.cash-forecast__kpis strong {
    display: block;
    margin-top: 4px;
    color: #f8fafc;
    font-size: 1rem;
}

.cash-forecast__chart-wrap {
    position: relative;
}

.cash-forecast__hover-layer {
    position: absolute;
    inset: 0 0 auto 0;
    height: 260px;
    z-index: 2;
    pointer-events: none;
}

.cash-forecast__chart {
    width: 100%;
    height: 260px;
    overflow: visible;
}

.cash-forecast__grid {
    stroke: rgba(148, 163, 184, 0.18);
    stroke-width: 1;
}

.cash-forecast__grid--vertical {
    stroke: rgba(148, 163, 184, 0.10);
}

.cash-forecast__axis-label {
    fill: rgba(226, 232, 240, 0.72);
    font-size: 11px;
    font-weight: 700;
}

.cash-forecast__axis-label--y {
    fill: rgba(226, 232, 240, 0.62);
}

.cash-forecast__zero {
    stroke: rgba(249, 115, 22, 0.50);
    stroke-width: 1.2;
    stroke-dasharray: 5 6;
}

.cash-forecast__line {
    fill: none;
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cash-forecast__line--cash {
    stroke-width: 3.5;
}

.cash-forecast__line--inflow {
    stroke-width: 2.6;
    opacity: 0.92;
}

.cash-forecast__line--outflow {
    stroke: #f97316;
    stroke-width: 2.6;
    filter: none;
    opacity: 0.92;
}

.cash-forecast__line--critical {
    stroke: #ef4444;
    filter: none;
}

.cash-forecast__cursor {
    stroke: rgba(226, 232, 240, 0.36);
    stroke-width: 1;
    stroke-dasharray: 4 5;
}

.cash-forecast__dot {
    fill: #ffffff;
    stroke: #14b8a6;
    stroke-width: 3;
    filter: drop-shadow(0 0 8px rgba(20, 184, 166, 0.55));
}

.cash-forecast__dot--inflow {
    fill: #ecfeff;
    stroke: #14b8a6;
    stroke-width: 2.4;
}

.cash-forecast__dot--outflow {
    fill: #fff7ed;
    stroke: #f97316;
    stroke-width: 2.4;
    filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.45));
}

.cash-forecast__hit-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: crosshair;
    pointer-events: auto;
}

.cash-forecast__hit-zone:hover,
.cash-forecast__hit-zone:focus-visible {
    background: rgba(94, 234, 212, 0.045);
    outline: 0;
}

.cash-forecast__tooltip {
    position: absolute;
    z-index: 4;
    min-width: 220px;
    padding: 10px 12px;
    pointer-events: none;
    transform: translate(10px, -50%);
    color: #f8fafc;
    background: rgba(8, 13, 22, 0.96);
    border: 1px solid rgba(94, 234, 212, 0.30);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38), 0 0 18px rgba(20, 184, 166, 0.14);
}

.cash-forecast__tooltip strong,
.cash-forecast__tooltip span {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    font-size: 0.78rem;
}

.cash-forecast__tooltip strong {
    margin-bottom: 8px;
    color: #5eead4;
}

.cash-forecast__positive {
    color: #6ee7a7;
}

.cash-forecast__negative {
    color: #fb7185;
}

.cash-forecast__legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin: 8px 0 12px;
    color: rgba(226, 232, 240, 0.78);
    font-size: 0.78rem;
    font-weight: 800;
}

.cash-forecast__legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.cash-forecast__legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    box-shadow: 0 0 12px currentColor;
}

.cash-forecast__legend-dot--inflow {
    color: #14b8a6;
    background: linear-gradient(90deg, #16a34a, #14b8a6);
}

.cash-forecast__legend-dot--outflow {
    color: #f97316;
    background: #f97316;
}

.cash-forecast__legend-dot--cash {
    color: #38bdf8;
    background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.cash-forecast__empty {
    min-height: 210px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 720px) {
    .cash-forecast__kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* -------------------------------------------------------------------------- */
/* Suite Portal utilities                                                     */
/* -------------------------------------------------------------------------- */
.sp-minw-320 { min-width: 320px; }
.sp-prewrap { white-space: pre-wrap; }
.sp-nowrap { white-space: nowrap; }
.sp-w-1 { width: 1%; }

.facturia-pdf-viewer {
    width: 100%;
    min-height: min(78vh, 900px);
    border: 0;
    border-radius: 8px;
    background: #ffffff;
}

/* -------------------------------------------------------------------------- */
/* Document platform V1: GED / Workflow / Audit                               */
/* -------------------------------------------------------------------------- */
.platform-page {
    min-height: calc(100vh - 150px);
    margin: -8px -16px 0;
    padding: 22px;
    color: #eef6ff;
    background:
        radial-gradient(circle at 14% 0%, rgba(37, 99, 235, 0.22), transparent 28%),
        radial-gradient(circle at 86% 8%, rgba(20, 184, 166, 0.14), transparent 28%),
        linear-gradient(135deg, #070d18 0%, #0d1728 48%, #07101d 100%);
    border: 1px solid rgba(120, 155, 210, 0.18);
    border-radius: 8px;
}

.platform-shell {
    max-width: 1760px;
    margin: 0 auto;
}

.platform-header,
.platform-toolbar,
.platform-card__header,
.platform-row-main {
    display: flex;
    align-items: center;
}

.platform-header {
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.platform-title {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1.55rem, 2.2vw, 2.4rem);
    font-weight: 850;
    letter-spacing: 0;
}

.platform-subtitle {
    margin-top: 4px;
    color: rgba(238, 246, 255, 0.68);
}

.platform-toolbar {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.platform-filter-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, minmax(160px, 0.7fr));
    gap: 12px;
    margin-bottom: 14px;
}

.platform-card {
    overflow: hidden;
    border: 1px solid rgba(132, 184, 255, 0.18);
    border-radius: 8px;
    background: rgba(13, 23, 40, 0.92);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.platform-card__header {
    justify-content: space-between;
    min-height: 56px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(132, 184, 255, 0.14);
    background: rgba(255, 255, 255, 0.035);
}

.platform-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
    gap: 16px;
}

.platform-row-main {
    gap: 12px;
    min-width: 0;
}

.platform-file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 42px;
    flex: 0 0 34px;
    border: 1px solid rgba(96, 165, 250, 0.35);
    border-radius: 6px;
    color: #bfdbfe;
    background: rgba(37, 99, 235, 0.16);
}

.platform-name {
    min-width: 0;
    color: #ffffff;
    font-weight: 760;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.platform-muted {
    color: rgba(238, 246, 255, 0.62);
}

.platform-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 780;
}

.platform-status--draft,
.platform-status--pendingvalidation { color: #fed7aa; background: rgba(245, 158, 11, 0.16); border: 1px solid rgba(245, 158, 11, 0.30); }
.platform-status--validated,
.platform-status--active,
.platform-status--sent { color: #bbf7d0; background: rgba(34, 197, 94, 0.15); border: 1px solid rgba(34, 197, 94, 0.28); }
.platform-status--rejected,
.platform-status--cancelled { color: #fecaca; background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.28); }
.platform-status--archived,
.platform-status--inactive { color: #dbeafe; background: rgba(100, 116, 139, 0.20); border: 1px solid rgba(148, 163, 184, 0.26); }

.workflow-vertical {
    position: relative;
    display: grid;
    gap: 12px;
}

.workflow-step {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 15px;
    border: 1px solid rgba(132, 184, 255, 0.18);
    border-radius: 8px;
    background: rgba(15, 29, 52, 0.86);
}

.workflow-step__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    color: white;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.30);
}

.workflow-step:nth-child(2n) .workflow-step__icon { background: linear-gradient(135deg, #059669, #34d399); }
.workflow-step:nth-child(3n) .workflow-step__icon { background: linear-gradient(135deg, #d97706, #fbbf24); }
.workflow-step:nth-child(4n) .workflow-step__icon { background: linear-gradient(135deg, #7c3aed, #a78bfa); }

.workflow-model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.audit-timeline {
    position: relative;
    display: grid;
    gap: 0;
}

.audit-row {
    display: grid;
    grid-template-columns: 42px 210px minmax(180px, 0.8fr) minmax(180px, 1fr) minmax(160px, 0.7fr);
    gap: 14px;
    align-items: center;
    min-height: 82px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(132, 184, 255, 0.12);
}

.audit-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    color: white;
    background: #2563eb;
}

.audit-row:nth-child(3n) .audit-dot { background: #16a34a; }
.audit-row:nth-child(4n) .audit-dot { background: #dc2626; }

@media (max-width: 1100px) {
    .platform-filter-grid,
    .platform-grid,
    .audit-row {
        grid-template-columns: 1fr;
    }

    .platform-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* -------------------------------------------------------------------------- */
/* App chrome (AppBar / Drawer / Footer)                                      */
/* -------------------------------------------------------------------------- */
.sp-layout.mud-layout,
.sp-layout .mud-main-content {
    background:
        radial-gradient(circle at 16% 8%, rgba(53, 211, 194, 0.10), transparent 28%),
        radial-gradient(circle at 88% 0%, rgba(87, 199, 255, 0.10), transparent 24%),
        #101620 !important;
}

.sp-appbar.mud-appbar {
    background: rgba(14, 21, 33, 0.96) !important;
    color: #f5fbff !important;
    border-bottom: 1px solid rgba(126, 240, 225, 0.18) !important;
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.22) !important;
    backdrop-filter: blur(14px);
}
.sp-appbar .mud-icon-button,
.sp-appbar .mud-icon-root,
.sp-appbar .mud-button-root,
.sp-appbar .mud-icon-button-label,
.sp-appbar .mud-button-label {
    color: #f5fbff !important;
}
.sp-menu-toggle {
    margin-right: 8px !important;
}
.sp-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #ffffff;
    font-size: 1.22rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
}
.sp-brand .mud-icon-root {
    color: #6ff4df !important;
    filter: drop-shadow(0 0 10px rgba(111, 244, 223, 0.35));
}
.sp-brand__ai {
    color: #57c7ff;
    text-shadow: 0 0 12px rgba(87, 199, 255, 0.72), 0 0 22px rgba(87, 199, 255, 0.40);
}
.sp-appbar-signal {
    color: rgba(111, 244, 223, 0.86) !important;
}
.sp-appbar-company {
    max-width: 32vw;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(245, 251, 255, 0.88) !important;
    font-weight: 700 !important;
}

.sp-drawer.mud-drawer {
    background: linear-gradient(180deg, #141f31 0%, #101824 100%) !important;
    color: #e8f6ff !important;
    border-right: 1px solid rgba(126, 240, 225, 0.16) !important;
}
.sp-drawer .mud-divider { background-color: rgba(126, 240, 225, 0.14) !important; }
.sp-drawer .mud-nav-link {
    color: rgba(232, 246, 255, 0.82) !important;
    border-radius: 8px;
    margin: 1px 8px;
}
.sp-drawer .mud-nav-link .mud-icon-root { color: rgba(111, 244, 223, 0.78) !important; }
.sp-drawer .mud-nav-link:hover { background-color: rgba(126, 240, 225, 0.09) !important; }
.sp-drawer .mud-nav-link.active {
    background: linear-gradient(90deg, rgba(111, 244, 223, 0.20), rgba(87, 199, 255, 0.12)) !important;
    color: #ffffff !important;
    box-shadow: inset 3px 0 0 #6ff4df;
}
.sp-drawer .mud-nav-link.active .mud-icon-root { color: #ffffff !important; }

/* Drawer section titles */
.sp-drawer .sp-drawer-section-title {
    color: rgba(111, 244, 223, 0.86) !important;
    letter-spacing: 0.04em;
    font-weight: 800;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(126, 240, 225, 0.12);
    padding-bottom: 6px;
    margin-bottom: 6px;
}

/* Let drawer content fill height so MudSpacer pushes bottom section correctly */
.sp-drawer .mud-drawer-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.sp-drawer .mud-navmenu { flex: 1 1 auto; }

/* Footer look */
.sp-footer {
    background: #101824 !important;
    color: #e8f6ff !important;
    border-top: 1px solid rgba(126, 240, 225, 0.16) !important;
}
.sp-footer a { color: rgba(232, 246, 255, 0.88) !important; }
.sp-footer a:hover { color: #6ff4df !important; text-decoration: underline; }
.sp-footer-title { color: rgba(111, 244, 223, 0.82) !important; letter-spacing: 0.04em; }

/* -------------------------------------------------------------------------- */
/* Sticky footer                                                               */
/* MudBlazor already offsets .mud-main-content for appbar/drawer. The flex     */
/* height belongs to our inner page wrapper, otherwise the page gets too tall.  */
/* -------------------------------------------------------------------------- */
.sp-layout .mud-main-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.sp-page {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: calc(100dvh - var(--mud-appbar-height, 64px));
}

.sp-page-body {
    flex: 1 1 auto;
    min-height: 0;
}

.app-surface {
    color: #e8f6ff;
}

.app-surface,
.app-surface .mud-typography,
.app-surface .mud-input,
.app-surface .mud-input-label,
.app-surface .mud-select,
.app-surface .mud-icon-root,
.app-surface .mud-table-cell,
.app-surface .mud-list-item-text {
    color: #f5fbff !important;
}

.app-surface .mud-text-secondary,
.app-surface .mud-typography-color-secondary,
.app-surface .mud-input-helper-text,
.app-surface .mud-table-pagination-caption,
.app-surface .mud-table-pagination-select {
    color: rgba(245, 251, 255, 0.74) !important;
}

.app-surface .mud-paper:not(.fin-kpi):not(.fin-panel):not(.fin-chat__bubble):not(.sp-footer),
.app-surface .mud-card {
    color: #edfaff !important;
    background: rgba(20, 31, 49, 0.92) !important;
    border: 1px solid rgba(126, 240, 225, 0.18) !important;
    border-radius: 8px !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22) !important;
}

.app-surface .mud-paper.pa-2,
.app-surface .mud-paper.pa-3,
.app-surface .mud-paper.pa-4,
.app-surface .mud-card.pa-2,
.app-surface .mud-card.pa-3,
.app-surface .mud-card.pa-4 {
    overflow: hidden;
}

.app-surface .mud-table-container,
.app-surface .mud-table,
.app-surface .mud-table-root {
    color: #edfaff !important;
    background: transparent !important;
}

.app-surface .mud-table-container {
    overflow: auto;
    border: 1px solid rgba(126, 240, 225, 0.18);
    border-radius: 8px;
    background: rgba(20, 31, 49, 0.92) !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
}

.app-surface .mud-table-head th {
    color: rgba(232, 246, 255, 0.74) !important;
    background: rgba(255, 255, 255, 0.045) !important;
    border-bottom-color: rgba(232, 246, 255, 0.12) !important;
    font-weight: 800 !important;
}

.app-surface .mud-table-body td {
    color: rgba(255, 255, 255, 0.90) !important;
    border-bottom-color: rgba(232, 246, 255, 0.08) !important;
}

.app-surface .mud-table-row:hover td {
    background: rgba(126, 240, 225, 0.07) !important;
}

.app-surface .mud-input-root,
.app-surface .mud-input-control,
.app-surface .mud-input-slot,
.app-surface input,
.app-surface textarea {
    color: #ffffff !important;
}

.app-surface .mud-input-underline::before,
.app-surface .mud-input-underline::after {
    border-bottom-color: rgba(245, 251, 255, 0.34) !important;
}

.app-surface .mud-input-outlined-border {
    border-color: rgba(126, 240, 225, 0.30) !important;
}

.app-surface .mud-input-control > .mud-input-control-input-container > .mud-input-label-inputcontrol {
    color: rgba(245, 251, 255, 0.78) !important;
}

.app-surface .mud-button-outlined,
.app-surface .mud-button-text {
    color: #e8fbff !important;
    border-color: rgba(126, 240, 225, 0.42) !important;
}

.app-surface .mud-button-filled-primary {
    color: #041019 !important;
    background: #7ef0e1 !important;
}

.app-surface .mud-alert {
    color: #f5fbff !important;
    border: 1px solid rgba(126, 240, 225, 0.18) !important;
    border-radius: 8px !important;
    background: rgba(20, 31, 49, 0.88) !important;
}

.app-surface .mud-chip {
    font-weight: 700;
}

.app-surface .mud-divider {
    background-color: rgba(126, 240, 225, 0.16) !important;
}

.mud-dialog {
    color: #edfaff !important;
    background: rgba(20, 31, 49, 0.98) !important;
    border: 1px solid rgba(126, 240, 225, 0.22) !important;
    border-radius: 8px !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45) !important;
}

.mud-dialog .mud-dialog-title,
.mud-dialog .mud-dialog-content,
.mud-dialog .mud-dialog-actions,
.mud-dialog .mud-typography,
.mud-dialog .mud-input,
.mud-dialog .mud-input-label,
.mud-dialog .mud-select,
.mud-dialog .mud-icon-root {
    color: #f5fbff !important;
}

.mud-dialog .mud-input-outlined-border,
.mud-dialog .mud-input-underline::before,
.mud-dialog .mud-input-underline::after {
    border-color: rgba(126, 240, 225, 0.30) !important;
}

.mud-dialog .mud-paper {
    color: #edfaff !important;
    background: rgba(15, 22, 35, 0.74) !important;
    border-color: rgba(126, 240, 225, 0.18) !important;
}

/* Footer goes to bottom when content is short */
.sp-footer {
    margin-top: auto;
}

/* -------------------------------------------------------------------------- */
/* Billing fintech dashboard                                                   */
/* -------------------------------------------------------------------------- */
.sp-page,
.sp-page-body {
    background: transparent;
}

.fin-dashboard {
    min-height: calc(100vh - 150px);
    margin: -8px -16px 0;
    padding: 18px;
    color: #e8f6ff;
    background:
        radial-gradient(circle at 14% 10%, rgba(53, 211, 194, 0.22), transparent 28%),
        radial-gradient(circle at 82% 4%, rgba(126, 116, 255, 0.18), transparent 28%),
        linear-gradient(135deg, #101620 0%, #152033 48%, #0f1520 100%);
    border: 1px solid rgba(126, 240, 225, 0.16);
    border-radius: 8px;
}

.fin-dashboard,
.fin-dashboard .mud-typography,
.fin-dashboard .mud-typography-body1,
.fin-dashboard .mud-typography-body2,
.fin-dashboard .mud-typography-subtitle1,
.fin-dashboard .mud-typography-subtitle2,
.fin-dashboard .mud-typography-caption,
.fin-dashboard .mud-typography-h1,
.fin-dashboard .mud-typography-h2,
.fin-dashboard .mud-typography-h3,
.fin-dashboard .mud-typography-h4,
.fin-dashboard .mud-typography-h5,
.fin-dashboard .mud-typography-h6,
.fin-dashboard .mud-list-item-text,
.fin-dashboard .mud-table-cell,
.fin-dashboard .mud-input,
.fin-dashboard .mud-input-label,
.fin-dashboard .mud-select,
.fin-dashboard .mud-icon-root {
    color: #f5fbff !important;
}

.fin-dashboard .mud-text-secondary,
.fin-dashboard .mud-typography-color-secondary,
.fin-dashboard .mud-input-helper-text,
.fin-dashboard .mud-table-pagination-caption,
.fin-dashboard .mud-table-pagination-select {
    color: rgba(245, 251, 255, 0.76) !important;
}

.fin-dashboard .mud-text-disabled,
.fin-dashboard .mud-disabled,
.fin-dashboard .mud-input.mud-disabled {
    color: rgba(245, 251, 255, 0.46) !important;
}

.fin-dashboard .mud-button-label,
.fin-dashboard .mud-chip-content,
.fin-dashboard .mud-badge,
.fin-dashboard .mud-alert-message {
    color: inherit !important;
}

.fin-dashboard .mud-button-outlined,
.fin-dashboard .mud-button-text {
    color: #e8fbff !important;
    border-color: rgba(126, 240, 225, 0.42) !important;
}

.fin-dashboard .mud-button-filled-primary {
    color: #041019 !important;
    background: #7ef0e1 !important;
}

.fin-dashboard .mud-input-control > .mud-input-control-input-container > .mud-input-label-inputcontrol {
    color: rgba(245, 251, 255, 0.78) !important;
}

.fin-dashboard .mud-input-root,
.fin-dashboard .mud-input-control,
.fin-dashboard .mud-input-slot,
.fin-dashboard input,
.fin-dashboard textarea {
    color: #ffffff !important;
}

.fin-dashboard .mud-input-underline::before,
.fin-dashboard .mud-input-underline::after {
    border-bottom-color: rgba(245, 251, 255, 0.34) !important;
}

.fin-dashboard .mud-paper:not(.fin-kpi):not(.fin-panel):not(.fin-chat__bubble) {
    color: #f5fbff !important;
    background: rgba(20, 31, 49, 0.92) !important;
    border-color: rgba(126, 240, 225, 0.18) !important;
}

.fin-shell {
    max-width: 1800px;
    margin: 0 auto;
}

.fin-hero,
.fin-kpi.mud-paper,
.fin-panel.mud-paper {
    color: #edfaff !important;
    background: rgba(20, 31, 49, 0.92) !important;
    border: 1px solid rgba(126, 240, 225, 0.18) !important;
    border-radius: 8px !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25) !important;
}

.fin-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 20px;
}

.fin-hero__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.fin-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #6ff4df;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.fin-title {
    margin: 6px 0 2px;
    color: #ffffff !important;
    font-weight: 800 !important;
}

.fin-subtitle,
.fin-muted {
    color: rgba(232, 246, 255, 0.72) !important;
}

.fin-kpi.mud-paper {
    min-height: 132px;
    padding: 16px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.fin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    align-items: stretch;
}

.fin-kpi-grid .fin-kpi.mud-paper {
    height: 100%;
}

.fin-kpi.mud-paper:hover {
    transform: translateY(-2px);
    border-color: rgba(126, 240, 225, 0.46) !important;
    background: rgba(25, 39, 61, 0.96) !important;
}

.fin-kpi::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #7ef0e1;
}

.fin-kpi--success::before { background: #6ee7a7; }
.fin-kpi--warning::before { background: #f7c95d; }
.fin-kpi--danger::before { background: #ff6b88; }
.fin-kpi--info::before { background: #57c7ff; }
.fin-kpi--neutral::before { background: #a9b8d8; }

.fin-kpi__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: rgba(232, 246, 255, 0.78);
    font-size: 0.82rem;
    font-weight: 800;
}

.fin-kpi__value {
    margin-top: 14px;
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.fin-kpi__trend {
    margin-top: 8px;
    color: #6ff4df;
    font-size: 0.82rem;
    font-weight: 800;
}

.fin-panel.mud-paper {
    height: 100%;
    padding: 16px;
}

.fin-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.fin-panel__title {
    color: #ffffff !important;
    font-weight: 800 !important;
}

.fin-flow {
    display: grid;
    gap: 12px;
}

.fin-flow__row {
    display: grid;
    grid-template-columns: minmax(90px, 1fr) minmax(140px, 2.2fr) 46px;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    color: #e8f6ff;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 8px;
    text-align: left;
}

.fin-flow__label,
.fin-flow__count {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.86rem;
    font-weight: 800;
}

.fin-flow__count {
    text-align: right;
}

.fin-flow__bar {
    height: 10px;
    overflow: hidden;
    background: rgba(232, 246, 255, 0.14);
    border-radius: 999px;
}

.fin-flow__fill {
    display: block;
    height: 100%;
    min-width: 4px;
    border-radius: 999px;
}

.fin-flow__fill--success { background: linear-gradient(90deg, #40d98f, #89ffc0); }
.fin-flow__fill--warning { background: linear-gradient(90deg, #f0a83b, #f7d46f); }
.fin-flow__fill--primary { background: linear-gradient(90deg, #7367f0, #58d5ff); }
.fin-flow__fill--info { background: linear-gradient(90deg, #37b7ff, #7ef0e1); }
.fin-flow__fill--neutral { background: #a9b8d8; }

.fin-alerts {
    display: grid;
    gap: 10px;
}

.fin-alert {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 10px;
    align-items: center;
    min-height: 44px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 8px;
}

.fin-alert__level {
    display: inline-flex;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
}

.fin-alert__message {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.88rem;
}

.fin-alert--danger .fin-alert__level { color: #ffdae2; background: rgba(255, 107, 136, 0.22); }
.fin-alert--warning .fin-alert__level { color: #ffe9ab; background: rgba(246, 200, 95, 0.22); }
.fin-alert--success .fin-alert__level { color: #d8ffe8; background: rgba(103, 242, 164, 0.20); }
.fin-alert--info .fin-alert__level { color: #d7f7ff; background: rgba(87, 199, 255, 0.20); }

.fin-table .mud-table-root,
.fin-table .mud-table-container,
.fin-table .mud-table {
    color: #edfaff !important;
    background: transparent !important;
}

.fin-table .mud-table-head th {
    color: rgba(232, 246, 255, 0.72) !important;
    background: rgba(255, 255, 255, 0.045) !important;
    border-bottom-color: rgba(232, 246, 255, 0.12) !important;
    font-weight: 800 !important;
}

.fin-table .mud-table-body td {
    color: rgba(255, 255, 255, 0.9) !important;
    border-bottom-color: rgba(232, 246, 255, 0.08) !important;
}

.fin-chat {
    height: min(420px, calc(100vh - 430px));
    min-height: 230px;
    overflow: auto;
    padding: 8px;
    background: rgba(7, 12, 20, 0.36);
    border: 1px solid rgba(232, 246, 255, 0.10);
    border-radius: 8px;
}

.fin-chat__bubble.mud-paper {
    max-width: 92%;
    padding: 10px 12px;
    border-radius: 8px !important;
    color: #eefbff !important;
}

.fin-chat__bubble--assistant.mud-paper {
    background: rgba(87, 199, 255, 0.14) !important;
    border: 1px solid rgba(87, 199, 255, 0.20) !important;
}

.fin-chat__bubble--user.mud-paper {
    background: rgba(103, 242, 164, 0.16) !important;
    border: 1px solid rgba(103, 242, 164, 0.22) !important;
}

@media (max-width: 960px) {
    .sp-appbar-company {
        display: none !important;
    }

    .sp-appbar-signal {
        display: none !important;
    }

    .sp-brand {
        font-size: 1.08rem;
    }

    .fin-dashboard {
        margin: 0;
        padding: 12px;
    }

    .fin-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .fin-hero__actions {
        justify-content: flex-start;
    }

    .fin-flow__row {
        grid-template-columns: 1fr 42px;
    }

    .fin-flow__bar {
        grid-column: 1 / -1;
        order: 3;
    }
}
/* FacturIA platform foundation: GED, Workflow, Audit */
.platform-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 4px 0 28px;
}

.platform-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding: 22px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(240, 253, 250, .88));
    box-shadow: 0 18px 50px rgba(15, 23, 42, .07);
}

.platform-hero.compact {
    align-items: center;
    padding: 18px 20px;
}

.platform-hero h1 {
    margin: 0;
    color: #0f172a;
    font-size: 2rem;
    font-weight: 760;
    letter-spacing: 0;
}

.platform-hero h2,
.platform-panel h2,
.platform-detail-panel h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 720;
    letter-spacing: 0;
}

.platform-hero p {
    max-width: 760px;
    margin: 6px 0 0;
    color: #64748b;
}

.platform-kicker {
    margin: 0 0 4px;
    color: #0f766e;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.platform-hero-actions,
.platform-actions-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.platform-panel {
    padding: 16px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 8px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 16px 42px rgba(15, 23, 42, .06);
}

.platform-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(150px, .7fr) minmax(150px, .7fr) auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.platform-toolbar.audit-filters {
    grid-template-columns: minmax(220px, 1.2fr) repeat(4, minmax(130px, .7fr));
}

.platform-baskets,
.platform-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 14px;
}

.platform-basket,
.platform-tab,
.workflow-model-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

.platform-basket.active,
.platform-tab.active,
.workflow-model-card.active {
    border-color: rgba(20, 184, 166, .45);
    background: rgba(20, 184, 166, .09);
    color: #0f766e;
}

.platform-master-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(310px, 380px);
    gap: 14px;
    align-items: start;
}

.platform-table-wrap {
    min-width: 0;
}

.platform-table .mud-table-container {
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 8px;
}

.platform-table .mud-table-head {
    background: #f8fafc;
}

.platform-table .selected-row {
    background: rgba(20, 184, 166, .08);
}

.platform-doc-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 230px;
}

.platform-doc-cell strong,
.workflow-model-card strong {
    display: block;
    color: #0f172a;
    font-weight: 720;
}

.platform-doc-cell small,
.workflow-model-card span,
.platform-detail-head span {
    display: block;
    color: #64748b;
    font-size: .78rem;
}

.platform-detail-panel {
    position: sticky;
    top: 84px;
    min-height: 420px;
    padding: 16px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 42px rgba(15, 23, 42, .06);
}

.platform-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.platform-preview {
    width: 100%;
    height: 320px;
    margin-bottom: 14px;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 8px;
    background: #f8fafc;
}

.platform-preview.large {
    height: min(72vh, 780px);
}

.platform-meta-grid {
    display: grid;
    grid-template-columns: minmax(100px, .45fr) minmax(0, 1fr);
    gap: 9px 12px;
    margin: 12px 0;
    color: #64748b;
    font-size: .86rem;
}

.platform-meta-grid strong {
    min-width: 0;
    color: #0f172a;
    overflow-wrap: anywhere;
}

.platform-upload-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr)) minmax(220px, 1.2fr);
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.platform-upload-target {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid rgba(37, 99, 235, .18);
    border-radius: 8px;
    background: rgba(59, 130, 246, .08);
    color: #334155;
}

.platform-upload-target strong {
    min-width: 0;
    color: #0f172a;
    overflow-wrap: anywhere;
}

.platform-file-input {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px dashed rgba(15, 23, 42, .24);
    border-radius: 8px;
    color: #475569;
    background: #f8fafc;
    cursor: pointer;
}

.platform-file-input input {
    display: none;
}

.platform-empty {
    padding: 28px 16px;
    color: #64748b;
    text-align: center;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 760;
    white-space: nowrap;
}

.status-pill.ok {
    color: #047857;
    background: rgba(16, 185, 129, .13);
}

.status-pill.warn {
    color: #a16207;
    background: rgba(234, 179, 8, .16);
}

.status-pill.danger {
    color: #b91c1c;
    background: rgba(239, 68, 68, .12);
}

.status-pill.info {
    color: #0369a1;
    background: rgba(14, 165, 233, .12);
}

.status-pill.muted {
    color: #475569;
    background: rgba(100, 116, 139, .14);
}

.platform-detail-layout,
.workflow-config-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, .55fr);
    gap: 14px;
    align-items: start;
}

.workflow-config-layout {
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr) minmax(280px, 340px);
}

.workflow-models,
.workflow-side {
    position: sticky;
    top: 84px;
}

.workflow-model-card {
    width: 100%;
    justify-content: space-between;
    margin-top: 10px;
    text-align: left;
}

.workflow-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.workflow-step-card {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 8px;
    background: #f8fafc;
}

.workflow-step-card h3 {
    margin: 0;
    color: #0f172a;
    font-size: .98rem;
    font-weight: 760;
}

.workflow-step-card p {
    margin: 3px 0 8px;
    color: #64748b;
}

.workflow-step-index {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: #ffffff;
    background: #0f766e;
    font-weight: 800;
}

.audit-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.audit-event {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid rgba(15, 23, 42, .08);
}

.audit-event strong {
    display: block;
    color: #0f172a;
}

.audit-event span,
.audit-event p {
    margin: 2px 0 0;
    color: #64748b;
    font-size: .84rem;
}

.platform-json {
    max-height: 220px;
    overflow: auto;
    padding: 10px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 8px;
    background: #0f172a;
    color: #d1fae5;
    font-size: .78rem;
    white-space: pre-wrap;
}

@media (max-width: 1180px) {
    .platform-master-detail,
    .platform-detail-layout,
    .workflow-config-layout {
        grid-template-columns: 1fr;
    }

    .platform-detail-panel,
    .workflow-models,
    .workflow-side {
        position: static;
    }
}

@media (max-width: 780px) {
    .platform-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .platform-toolbar,
    .platform-toolbar.audit-filters,
    .platform-upload-grid {
        grid-template-columns: 1fr;
    }
}

/* Workflow designer step library */
.workflow-library-strip {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    margin-bottom: 1rem;
    padding: .85rem;
    border: 1px solid color-mix(in srgb, var(--mud-palette-text-primary) 10%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--mud-palette-surface) 96%, transparent);
}

.workflow-library-title {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    color: var(--mud-palette-text-secondary);
    font-size: .82rem;
}

.workflow-library-title strong {
    color: var(--mud-palette-text-primary);
}

.workflow-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .5rem;
}

.workflow-library-card {
    display: grid;
    grid-template-columns: 2rem 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    gap: .1rem .5rem;
    text-align: left;
    border: 1px solid color-mix(in srgb, var(--mud-palette-text-primary) 10%, transparent);
    border-radius: 8px;
    padding: .55rem;
    background: transparent;
    color: var(--mud-palette-text-primary);
}

.workflow-studio-page .workflow-copy-name {
    min-width: 260px;
}

.workflow-studio-page .workflow-library-card {
    border: 1px solid rgba(96, 165, 250, .22);
    background: linear-gradient(135deg, rgba(15, 30, 52, .98), rgba(9, 18, 32, .98));
    color: #f8fafc;
    cursor: pointer;
}

.workflow-studio-page .workflow-library-card:hover,
.workflow-studio-page .workflow-library-card.selected {
    border-color: rgba(45, 212, 191, .62);
    background: linear-gradient(135deg, rgba(19, 78, 74, .96), rgba(12, 40, 62, .98));
}

.workflow-studio-page .workflow-library-card small {
    color: #94a3b8;
}

.workflow-studio-page .workflow-library-card em {
    grid-column: 2;
    width: fit-content;
    margin-top: .2rem;
    padding: .18rem .48rem;
    border-radius: 999px;
    background: rgba(45, 212, 191, .14);
    color: #99f6e4;
    font-style: normal;
    font-size: .72rem;
    font-weight: 760;
}

.workflow-studio-page .workflow-library-card em:hover {
    background: rgba(45, 212, 191, .24);
}

.workflow-studio-page .workflow-drop-zone {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed rgba(96, 165, 250, .34);
    border-radius: 12px;
    background: rgba(2, 6, 23, .38);
}

.workflow-studio-page .workflow-drop-zone.active-drop {
    border-color: rgba(45, 212, 191, .9);
    background: rgba(20, 184, 166, .14);
}

.workflow-insert-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    width: 100%;
    min-height: 38px;
    border: 0;
    background: transparent;
    color: #bae6fd;
    font-size: .82rem;
    font-weight: 760;
    cursor: pointer;
}

.workflow-insert-button:disabled {
    color: rgba(203, 213, 225, .48);
    cursor: default;
}

.workflow-insert-button:not(:disabled):hover {
    color: #5eead4;
}

.workflow-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(2, 6, 23, .58);
    backdrop-filter: blur(8px);
}

.workflow-modal-card {
    width: min(520px, 100%);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(96, 165, 250, .24);
    background: var(--mud-palette-surface);
    box-shadow: 0 24px 80px rgba(2, 6, 23, .35);
}

.workflow-modal-field {
    display: grid;
    gap: .45rem;
    color: #e2e8f0;
    font-size: .86rem;
}

.workflow-modal-field input {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(96, 165, 250, .38);
    border-radius: 8px;
    background: rgba(2, 6, 23, .88);
    color: #f8fafc;
    padding: 0 .8rem;
    outline: none;
}

.workflow-modal-field input:focus {
    border-color: rgba(45, 212, 191, .82);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, .14);
}

.workflow-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: .65rem;
    flex-wrap: wrap;
}

.workflow-config-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    border-bottom: 1px solid var(--wf-border);
    background: transparent;
    color: var(--wf-text);
    padding: 0 0 16px;
    cursor: pointer;
}

.workflow-config-toggle h2 {
    margin: 0;
    padding: 0;
    border: 0;
}

.workflow-config-summary {
    display: grid;
    gap: 6px;
    padding: 16px;
    border: 1px solid rgba(96, 165, 250, .22);
    border-radius: 12px;
    background: rgba(2, 6, 23, .34);
    color: #f8fafc;
}

.workflow-config-summary span {
    color: #94a3b8;
}

.workflow-library-card span {
    grid-row: 1 / span 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 7px;
    color: white;
    font-weight: 700;
}

.workflow-library-card strong {
    font-size: .85rem;
}

.workflow-library-card small {
    color: var(--mud-palette-text-secondary);
}

.workflow-drop-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    margin: 6px 0;
    border: 1px dashed rgba(148, 163, 184, .34);
    border-radius: 8px;
    color: rgba(226, 232, 240, .58);
    font-size: .78rem;
    background: rgba(15, 23, 42, .24);
}

.workflow-drop-zone:hover {
    border-color: rgba(34, 211, 238, .78);
    color: #e0f2fe;
    background: rgba(8, 145, 178, .16);
}

.ged-document-row {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 9px 10px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
}

.ged-document-row + .ged-document-row {
    margin-top: 8px;
}

.ged-document-row.selected,
.ged-document-row:hover {
    border-color: rgba(20, 184, 166, .42);
    background: rgba(240, 253, 250, .86);
}

.ged-document-row span {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.ged-document-row strong,
.ged-document-row small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ged-document-row small {
    color: #64748b;
    font-size: .78rem;
}

.ged-preview-panel {
    display: grid;
    gap: 12px;
}

.ged-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.ged-preview-head h3 {
    margin: 0;
}

.ged-preview-head span {
    color: #64748b;
    font-size: .82rem;
}

.ged-preview-frame {
    overflow: hidden;
    min-height: 260px;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 8px;
    background: #0f172a;
}

.ged-preview-frame iframe {
    width: 100%;
    height: 320px;
    border: 0;
    background: #fff;
}

.ged-pdf-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, .64);
}

.ged-pdf-modal {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: min(1180px, calc(100vw - 48px));
    height: min(860px, calc(100vh - 48px));
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 72px rgba(15, 23, 42, .35);
}

.ged-pdf-modal .ged-preview-head {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(15, 23, 42, .1);
}

.ged-pdf-modal-frame {
    min-height: 0;
    background: #111827;
}

.ged-pdf-modal-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
}

@media (max-width: 720px) {
    .ged-pdf-modal-backdrop {
        padding: 10px;
    }

    .ged-pdf-modal {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
    }
}

.ged-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.audit-page .platform-hero,
.documents-page .platform-hero,
.work-center-page .work-center-header,
.users-admin-page .platform-hero {
    border: 1px solid rgba(96, 165, 250, .18);
    background: linear-gradient(135deg, #0b1220, #111827 62%, #082f49);
    color: #f8fafc;
}

.audit-page .platform-hero h1,
.documents-page .platform-hero h1,
.work-center-page .work-center-header h1,
.users-admin-page .platform-hero h1 {
    color: #f8fafc;
}

.audit-page .platform-hero p,
.documents-page .platform-hero p,
.work-center-page .work-center-header p,
.users-admin-page .platform-hero p {
    color: #94a3b8;
}

.audit-page .platform-panel,
.documents-page .platform-panel,
.work-center-page .work-center-column,
.work-center-page .work-task-card,
.users-admin-page .platform-panel {
    border: 1px solid rgba(148, 163, 184, .16);
    background: #111827;
    color: #e5e7eb;
    box-shadow: none;
}

.audit-page .platform-table .mud-table-container,
.documents-page .platform-table .mud-table-container,
.users-admin-page .mud-table-container {
    background: #0b1220;
    color: #e5e7eb;
}

.audit-page .platform-table .mud-table-head,
.documents-page .platform-table .mud-table-head,
.users-admin-page .mud-table-head {
    background: #151f31;
    color: #94a3b8;
}

.audit-user-cell,
.users-cell-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}

.audit-user-cell img,
.audit-user-cell > span,
.users-cell-user img,
.users-cell-user > span {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 999px;
    object-fit: cover;
}

.audit-user-cell > span,
.users-cell-user > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb, #14b8a6);
    color: #fff;
    font-size: .76rem;
    font-weight: 800;
}

.audit-user-cell strong,
.users-cell-user strong,
.users-cell-user h2 {
    color: #f8fafc;
}

.audit-user-cell small,
.users-cell-user small {
    display: block;
    color: #94a3b8;
}

.audit-event-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(100, 116, 139, .22);
    color: #cbd5e1;
}

.audit-event-icon.ok { background: rgba(34, 197, 94, .18); color: #86efac; }
.audit-event-icon.info { background: rgba(59, 130, 246, .18); color: #93c5fd; }
.audit-event-icon.danger { background: rgba(239, 68, 68, .18); color: #fca5a5; }

.audit-json-panels .mud-expand-panel {
    border: 1px solid rgba(148, 163, 184, .16);
    background: #0b1220;
    color: #e5e7eb;
}

.ged-document-row,
.ged-document-chip,
.ged-folder-inline,
.ged-preview-panel,
.ged-upload-panel {
    border-color: rgba(148, 163, 184, .16);
    background: #0b1220;
    color: #f8fafc;
}

.ged-document-row.selected,
.ged-document-row:hover,
.ged-document-chip.selected,
.ged-document-chip:hover {
    border-color: rgba(45, 212, 191, .52);
    background: rgba(20, 184, 166, .12);
}

.ged-document-row small,
.ged-preview-head span,
.ged-document-chip em {
    color: #94a3b8;
}

.ged-folder-inline {
    display: grid;
    gap: .75rem;
    padding: .85rem;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
}

.ged-folder-inline > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: #94a3b8;
}

.ged-inline-docs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.ged-document-chip {
    display: inline-grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .2rem .45rem;
    align-items: center;
    max-width: 260px;
    padding: .55rem .7rem;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
}

.ged-document-chip em {
    grid-column: 2;
    font-size: .72rem;
    font-style: normal;
}

.ged-preview-frame {
    border-color: rgba(148, 163, 184, .16);
    background: #020617;
}

.ged-confirm-card p {
    color: #cbd5e1;
}

.actor-edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: .55rem;
}

.actor-check {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: .65rem;
    padding: .65rem;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: #0b1220;
    color: #e5e7eb;
}

.actor-check small {
    display: block;
    color: #94a3b8;
}

.work-center-stats > div {
    border: 1px solid rgba(148, 163, 184, .16);
    background: #111827;
    color: #e5e7eb;
}

.work-task-card.empty {
    background: #0b1220;
    color: #94a3b8;
}

.fin-work-panel {
    min-height: 390px;
}

.fin-work-list,
.fin-folder-list {
    display: grid;
    gap: .65rem;
}

.fin-work-row,
.fin-folder-row {
    width: 100%;
    display: grid;
    align-items: center;
    gap: .75rem;
    min-height: 64px;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 8px;
    background: rgba(15, 23, 42, .62);
    color: #f8fafc;
    text-align: left;
    cursor: pointer;
}

.fin-work-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: .65rem .75rem;
}

.fin-work-row:hover,
.fin-folder-row:hover {
    border-color: rgba(96, 165, 250, .38);
    background: rgba(30, 41, 59, .74);
}

.fin-work-row strong,
.fin-folder-row strong {
    display: block;
    color: #f8fafc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fin-work-row small,
.fin-folder-row small {
    display: block;
    margin-top: .16rem;
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fin-work-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(59, 130, 246, .18);
    color: #93c5fd;
}

.fin-work-icon.success { background: rgba(34, 197, 94, .16); color: #86efac; }
.fin-work-icon.warning { background: rgba(245, 158, 11, .16); color: #fcd34d; }
.fin-work-icon.danger { background: rgba(239, 68, 68, .16); color: #fca5a5; }

.fin-folder-row {
    position: relative;
    grid-template-columns: auto minmax(0, .85fr) minmax(0, 1.1fr) auto;
    padding: .7rem .75rem 1rem;
    overflow: hidden;
}

.fin-folder-row > span {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(124, 58, 237, .16);
    color: #c4b5fd;
}

.fin-folder-row i {
    position: absolute;
    left: .75rem;
    bottom: .45rem;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #14b8a6);
}

.fin-folder-row em {
    justify-self: end;
    color: #cbd5e1;
    font-style: normal;
    font-size: .82rem;
}

.fin-empty-row {
    min-height: 120px;
    display: grid;
    place-items: center;
    border: 1px dashed rgba(148, 163, 184, .18);
    border-radius: 8px;
    color: #94a3b8;
    background: rgba(15, 23, 42, .42);
}

.ged-upload-rules,
.ged-selected-file,
.ged-upload-error,
.ged-version-upload {
    grid-column: 1 / -1;
}

.ged-upload-rules {
    display: flex;
    align-items: center;
    gap: .45rem;
    color: #94a3b8;
    font-size: .82rem;
}

.ged-selected-file {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .72rem .85rem;
    border: 1px solid rgba(34, 197, 94, .24);
    border-radius: 8px;
    background: rgba(15, 23, 42, .68);
    color: #f8fafc;
}

.ged-selected-file.invalid,
.platform-file-input.invalid {
    border-color: rgba(239, 68, 68, .42);
}

.ged-selected-file span {
    min-width: 0;
}

.ged-selected-file strong,
.ged-selected-file small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ged-selected-file small {
    color: #94a3b8;
    margin-top: .12rem;
}

.ged-upload-error {
    color: #fecaca;
    background: rgba(127, 29, 29, .24);
    border: 1px solid rgba(248, 113, 113, .26);
    border-radius: 8px;
    padding: .6rem .75rem;
    font-size: .86rem;
}

.ged-version-upload {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .65rem;
    align-items: center;
    margin-top: .4rem;
}

.ged-file-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(59, 130, 246, .16);
    color: #93c5fd;
    flex: 0 0 auto;
}

.ged-file-icon.large {
    width: 58px;
    height: 58px;
}

.ged-file-icon.pdf { background: rgba(239, 68, 68, .16); color: #fca5a5; }
.ged-file-icon.word { background: rgba(37, 99, 235, .18); color: #93c5fd; }
.ged-file-icon.excel { background: rgba(22, 163, 74, .18); color: #86efac; }
.ged-file-icon.powerpoint { background: rgba(234, 88, 12, .18); color: #fdba74; }
.ged-file-icon.image { background: rgba(168, 85, 247, .18); color: #d8b4fe; }
.ged-file-icon.file { background: rgba(148, 163, 184, .14); color: #cbd5e1; }

.ged-preview-unavailable {
    min-height: 240px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: .55rem;
    border: 1px dashed rgba(148, 163, 184, .22);
    border-radius: 8px;
    background: rgba(15, 23, 42, .56);
    color: #e2e8f0;
    text-align: center;
}

.ged-preview-unavailable small {
    color: #94a3b8;
}

.audit-action-cell {
    display: grid;
    gap: .25rem;
}

.audit-action-cell small {
    color: #94a3b8;
    line-height: 1.25;
}

.work-task-card {
    position: relative;
    overflow: hidden;
}

.work-task-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: #3b82f6;
}

.work-task-card.overdue::before {
    background: #ef4444;
}

.work-task-actions {
    align-items: center;
}

.work-center-page .work-center-header h1,
.work-center-page .work-center-section-title h2,
.work-center-page .work-task-card h3,
.work-center-page .work-center-stats strong,
.users-admin-page .users-cell-user strong,
.users-admin-page .users-detail-head h2,
.users-admin-page .profile-section-title h2,
.users-admin-page .actor-check strong {
    color: #f8fafc;
}

.work-center-page .work-center-stats > div,
.work-center-page .work-task-card,
.users-admin-page .platform-panel,
.users-admin-page .users-list-panel,
.users-admin-page .users-detail-panel {
    background: rgba(15, 23, 42, .76);
    border-color: rgba(148, 163, 184, .14);
    box-shadow: none;
}

.work-center-page .work-center-stats span,
.work-center-page .work-task-card p,
.work-center-page .work-task-top,
.work-center-page .work-task-meta span,
.users-admin-page .users-cell-user small,
.users-admin-page .users-history-item span,
.users-admin-page .users-history-item small,
.users-admin-page .actor-check small {
    color: #94a3b8;
}

.work-center-page .work-center-section-title > span {
    color: #bfdbfe;
    background: rgba(37, 99, 235, .18);
}

.workflow-template-head.secondary {
    margin-top: 22px;
}

.mud-theme-dark .platform-hero,
.mud-theme-dark .platform-panel,
.mud-theme-dark .platform-detail-panel,
.mud-theme-dark .platform-basket,
.mud-theme-dark .platform-tab,
.mud-theme-dark .workflow-model-card {
    border-color: rgba(148, 163, 184, .16);
    background: #111827;
    box-shadow: none;
}

.mud-theme-dark .platform-hero h1,
.mud-theme-dark .platform-hero h2,
.mud-theme-dark .platform-panel h2,
.mud-theme-dark .platform-detail-panel h2,
.mud-theme-dark .platform-doc-cell strong,
.mud-theme-dark .workflow-model-card strong,
.mud-theme-dark .workflow-step-card h3,
.mud-theme-dark .audit-event strong,
.mud-theme-dark .platform-meta-grid strong {
    color: #f8fafc;
}

.mud-theme-dark .platform-table .mud-table-head,
.mud-theme-dark .workflow-step-card,
.mud-theme-dark .platform-file-input,
.mud-theme-dark .platform-preview {
    background: #0b1220;
}

.mud-theme-dark .platform-table .selected-row {
    background: rgba(20, 184, 166, .14);
}

/* Platform visual pass 2: align GED / Workflow / Audit with the provided fintech mockups. */
.platform-page {
    color: #0f172a;
}

.platform-hero {
    min-height: 132px;
    padding: 24px;
    border-color: rgba(20, 184, 166, .16);
    background:
        linear-gradient(135deg, rgba(8, 47, 73, .96), rgba(15, 118, 110, .92)),
        #0f172a;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .14);
}

.platform-hero h1 {
    color: #ffffff;
}

.platform-hero p {
    color: rgba(226, 232, 240, .86);
}

.platform-kicker {
    color: #5eead4;
}

.platform-workspace {
    padding: 14px;
}

.platform-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.platform-metric-card {
    min-height: 92px;
    padding: 14px 15px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .05);
}

.platform-metric-card span,
.platform-metric-card small {
    display: block;
    color: #64748b;
    font-size: .78rem;
    font-weight: 650;
}

.platform-metric-card strong {
    display: block;
    margin: 5px 0 3px;
    color: #0f172a;
    font-size: 1.55rem;
    line-height: 1;
    font-weight: 800;
}

.platform-workspace .platform-master-detail {
    grid-template-columns: 220px minmax(0, 1fr) minmax(320px, 390px);
}

.platform-rail {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 460px;
    padding: 12px;
    border-radius: 8px;
    background: #0f172a;
}

.platform-rail-title {
    padding: 4px 4px 8px;
    color: #94a3b8;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.platform-rail .platform-basket {
    width: 100%;
    justify-content: flex-start;
    border-color: transparent;
    background: transparent;
    color: #cbd5e1;
}

.platform-rail .platform-basket strong {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    min-height: 22px;
    margin-left: auto;
    padding: 1px 6px;
    border-radius: 999px;
    color: #e2e8f0;
    background: rgba(148, 163, 184, .14);
    font-size: .72rem;
}

.platform-rail .platform-basket.active {
    border-color: rgba(94, 234, 212, .26);
    background: rgba(20, 184, 166, .16);
    color: #ffffff;
}

.platform-table .mud-table-container {
    overflow: hidden;
}

.platform-table .mud-table-head {
    background: #f1f5f9;
}

.platform-table .mud-table-row {
    cursor: pointer;
}

.platform-empty.state-card {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 230px;
    border: 1px dashed rgba(15, 23, 42, .14);
    border-radius: 8px;
    background: #f8fafc;
}

.platform-empty.state-card .mud-icon-root {
    color: #0f766e;
    font-size: 2.3rem;
}

.platform-empty.state-card strong {
    color: #0f172a;
    font-size: 1rem;
}

.platform-empty.state-card span {
    max-width: 360px;
}

.workflow-step-card::before {
    content: "";
    position: absolute;
    left: 30px;
    bottom: -13px;
    width: 2px;
    height: 13px;
    background: rgba(20, 184, 166, .34);
}

.workflow-step-card:last-child::before {
    display: none;
}

.workflow-step-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}

.workflow-step-footer small {
    color: #64748b;
    font-weight: 650;
}

@media (max-width: 1180px) {
    .platform-workspace .platform-master-detail {
        grid-template-columns: 1fr;
    }

    .platform-rail {
        min-height: auto;
    }
}

@media (max-width: 780px) {
    .platform-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .platform-metrics {
        grid-template-columns: 1fr;
    }
}

.mud-theme-dark .platform-metric-card {
    border-color: rgba(148, 163, 184, .16);
    background: #111827;
    box-shadow: none;
}

.mud-theme-dark .platform-metric-card strong,
.mud-theme-dark .platform-empty.state-card strong {
    color: #f8fafc;
}

.mud-theme-dark .platform-empty.state-card {
    background: #0b1220;
}

.platform-file-input.compact {
    min-height: 40px;
    padding: 8px 10px;
}

.platform-side-section {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(15, 23, 42, .08);
}

.platform-side-section h3 {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: .92rem;
    font-weight: 800;
}

.platform-mini-row {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(15, 23, 42, .06);
    color: #475569;
    font-size: .84rem;
}

.platform-mini-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.platform-mini-row small {
    color: #94a3b8;
}

.audit-timeline.compact {
    gap: 4px;
}

.audit-timeline.compact .audit-event {
    padding: 7px 0;
}

.workflow-model-logic {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 18px;
}

.workflow-model-logic > div {
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(111, 143, 190, .22);
    border-radius: 12px;
    background: rgba(15, 30, 52, .72);
}

.workflow-model-logic strong,
.workflow-model-logic span {
    display: block;
}

.workflow-model-logic strong {
    color: #ffffff;
    font-size: .86rem;
}

.workflow-model-logic span {
    margin-top: 4px;
    color: #a8b3c7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mud-theme-dark .platform-side-section {
    border-top-color: rgba(148, 163, 184, .16);
}

.mud-theme-dark .platform-side-section h3 {
    color: #f8fafc;
}

.mud-theme-dark .platform-mini-row {
    border-bottom-color: rgba(148, 163, 184, .12);
    color: #cbd5e1;
}

/* Workflow studio: business configurator inspired by the provided fintech mockup. */
.workflow-studio-page {
    --wf-bg: #050d18;
    --wf-panel: rgba(15, 30, 52, .92);
    --wf-border: rgba(111, 143, 190, .22);
    --wf-text: #f8fafc;
    --wf-muted: #a8b3c7;
    background:
        radial-gradient(circle at 78% 0%, rgba(14, 165, 233, .16), transparent 32%),
        linear-gradient(180deg, #06111f, #030711);
    border-radius: 18px;
    padding: 12px;
}

.workflow-studio-shell,
.workflow-template-dock {
    border: 1px solid var(--wf-border);
    border-radius: 18px;
    background: rgba(5, 13, 24, .84);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .34);
}

.workflow-studio-shell {
    padding: 22px 26px 26px;
}

.workflow-studio-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 26px;
}

.workflow-studio-toolbar .mud-button-root {
    min-height: 44px;
    border-radius: 10px;
    border-color: rgba(148, 163, 184, .25);
    color: #eef4ff;
    background: rgba(20, 34, 56, .76);
    text-transform: none;
    font-weight: 760;
}

.workflow-studio-toolbar .mud-button-filled-primary {
    background: linear-gradient(135deg, #1477ff, #0d4fd7);
    box-shadow: 0 10px 24px rgba(37, 99, 235, .32);
}

.workflow-import-bar {
    margin: -10px 0 20px auto;
    max-width: 560px;
}

.workflow-studio-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.workflow-studio-header h1 {
    margin: 0;
    color: var(--wf-text);
    font-size: clamp(1.55rem, 2.4vw, 2.25rem);
    line-height: 1.08;
    letter-spacing: 0;
}

.workflow-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.workflow-studio-header p {
    margin: 8px 0 0;
    color: var(--wf-muted);
    font-size: 1.02rem;
}

.workflow-header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--wf-muted);
    white-space: nowrap;
}

.workflow-studio-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 22px;
    align-items: start;
}

.workflow-flow-panel,
.workflow-config-card {
    border: 1px solid var(--wf-border);
    border-radius: 16px;
    background: var(--wf-panel);
}

.workflow-flow-panel {
    padding: 16px;
}

.workflow-step-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.workflow-step-tile {
    position: relative;
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    min-height: 112px;
    width: 100%;
    padding: 16px 18px;
    border: 1px solid var(--wf-border);
    border-radius: 15px;
    color: var(--wf-text);
    background: linear-gradient(135deg, rgba(20, 42, 70, .94), rgba(12, 26, 46, .94));
    text-align: left;
    cursor: pointer;
}

.workflow-step-tile::after {
    content: "";
    position: absolute;
    left: 58px;
    bottom: -20px;
    width: 2px;
    height: 20px;
    background: linear-gradient(180deg, rgba(226, 232, 240, .88), rgba(226, 232, 240, .18));
}

.workflow-step-tile:last-child::after {
    content: none;
}

.workflow-step-tile.selected {
    border-color: rgba(20, 184, 166, .58);
    background: linear-gradient(135deg, rgba(19, 78, 74, .9), rgba(12, 40, 62, .95));
}

.workflow-step-tile.disabled {
    opacity: .58;
}

.workflow-step-icon {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    color: #ffffff;
    background: linear-gradient(135deg, #1477ff, #0f4ed8);
    box-shadow: 0 12px 28px rgba(20, 119, 255, .28);
    font-size: 1.7rem;
    font-weight: 900;
}

.workflow-step-tile:nth-child(2) .workflow-step-icon { background: linear-gradient(135deg, #10b981, #047857); }
.workflow-step-tile:nth-child(3) .workflow-step-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.workflow-step-tile:nth-child(4) .workflow-step-icon { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.workflow-step-tile:nth-child(5) .workflow-step-icon { background: linear-gradient(135deg, #64748b, #475569); }

.workflow-step-content {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.workflow-step-content strong {
    color: #ffffff;
    font-size: 1.05rem;
}

.workflow-step-content span,
.workflow-step-content small {
    color: var(--wf-muted);
}

.workflow-step-content small {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.workflow-step-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.workflow-config-card {
    position: sticky;
    top: 84px;
    padding: 24px;
}

.workflow-config-card h2 {
    margin: 0 0 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--wf-border);
    color: #ffffff;
    font-size: 1.13rem;
}

.workflow-form {
    display: grid;
    gap: 17px;
}

.workflow-form label {
    display: grid;
    gap: 8px;
    color: #dbe7ff;
    font-weight: 720;
}

.workflow-form input,
.workflow-form select {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid rgba(121, 151, 193, .28);
    border-radius: 10px;
    color: #f8fafc;
    background: rgba(18, 39, 68, .84);
    outline: none;
}

.workflow-form input:focus,
.workflow-form select:focus {
    border-color: rgba(20, 119, 255, .72);
    box-shadow: 0 0 0 3px rgba(20, 119, 255, .15);
}

.workflow-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.workflow-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #dbe7ff;
    font-weight: 720;
}

.nice-switch {
    position: relative;
    width: 50px;
    height: 28px;
    flex: 0 0 50px;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, .25);
    border-radius: 999px;
    background: rgba(71, 85, 105, .72);
    cursor: pointer;
}

.nice-switch span {
    position: absolute;
    top: 50%;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
    transform: translateY(-50%);
    transition: transform .18s ease;
}

.nice-switch.on {
    border-color: rgba(45, 212, 191, .36);
    background: linear-gradient(135deg, #10b981, #0f766e);
}

.nice-switch.on span {
    transform: translate(21px, -50%);
}

.workflow-template-dock {
    margin-top: 14px;
    padding: 22px 24px 24px;
}

.workflow-template-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.workflow-template-head h2 {
    margin: 0;
    color: #ffffff;
    font-size: 1.15rem;
}

.workflow-template-head button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--wf-border);
    border-radius: 10px;
    color: #dbe7ff;
    background: rgba(20, 34, 56, .76);
}

.workflow-template-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(140px, 1fr));
    gap: 14px;
}

.workflow-template-card {
    display: grid;
    justify-items: center;
    gap: 9px;
    min-height: 184px;
    padding: 18px 14px 14px;
    border: 1px solid var(--wf-border);
    border-radius: 15px;
    color: #f8fafc;
    background: linear-gradient(135deg, rgba(20, 39, 66, .9), rgba(13, 27, 48, .9));
    font: inherit;
    text-align: center;
    cursor: pointer;
}

.workflow-template-card.active {
    border-color: rgba(16, 185, 129, .62);
    background: linear-gradient(135deg, rgba(6, 95, 70, .72), rgba(13, 43, 62, .92));
}

.workflow-template-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1477ff, #0f4ed8);
    font-size: 1.7rem;
    font-weight: 900;
}

.workflow-template-card:nth-child(2) .workflow-template-icon { background: linear-gradient(135deg, #34d399, #059669); }
.workflow-template-card:nth-child(3) .workflow-template-icon { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.workflow-template-card:nth-child(4) .workflow-template-icon { background: linear-gradient(135deg, #fb923c, #ea580c); }
.workflow-template-card:nth-child(5) .workflow-template-icon { background: linear-gradient(135deg, #84cc16, #4d7c0f); }
.workflow-template-card:nth-child(6) .workflow-template-icon { background: linear-gradient(135deg, #38bdf8, #0284c7); }

.workflow-template-card strong {
    display: grid;
    justify-items: center;
    gap: 7px;
    color: #ffffff;
    font-size: .98rem;
}

.workflow-template-card small {
    min-height: 40px;
    color: var(--wf-muted);
}

.workflow-template-card em {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 9px;
    color: #dbe7ff;
    font-style: normal;
    background: rgba(15, 30, 52, .86);
}

.workflow-template-card .status-pill {
    width: auto;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: .72rem;
}

.workflow-template-action {
    width: 100%;
}

.workflow-timeline-panel {
    margin-bottom: 22px;
}

@media (max-width: 1240px) {
    .workflow-template-grid {
        grid-template-columns: repeat(3, minmax(160px, 1fr));
    }
}

@media (max-width: 980px) {
    .workflow-studio-grid {
        grid-template-columns: 1fr;
    }

    .workflow-config-card {
        position: static;
    }
}

@media (max-width: 720px) {
    .workflow-studio-shell,
    .workflow-template-dock {
        padding: 16px;
    }

    .workflow-studio-toolbar {
        justify-content: stretch;
    }

    .workflow-studio-toolbar .mud-button-root {
        flex: 1 1 190px;
    }

    .workflow-studio-header,
    .workflow-template-head {
        flex-direction: column;
        align-items: stretch;
    }

    .workflow-step-tile {
        grid-template-columns: 58px minmax(0, 1fr);
    }

    .workflow-step-actions {
        grid-column: 2;
        justify-content: space-between;
    }

    .workflow-step-icon {
        width: 48px;
        height: 48px;
    }

    .workflow-step-tile::after {
        left: 40px;
    }

    .workflow-template-grid,
    .workflow-form-grid {
        grid-template-columns: 1fr;
    }
}
/* Work center */
.work-center-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.work-center-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.work-center-header h1 {
    margin: 0;
    font-size: 1.8rem;
}

.work-center-stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .75rem;
}

.work-center-stats > div,
.work-task-card {
    border: 1px solid color-mix(in srgb, var(--mud-palette-text-primary) 12%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--mud-palette-surface) 94%, transparent);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.work-center-stats > div {
    padding: .85rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.work-center-stats span {
    color: var(--mud-palette-text-secondary);
    font-size: .78rem;
}

.work-center-stats strong {
    font-size: 1.35rem;
}

.work-center-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.work-center-stack {
    grid-template-columns: 1fr;
}

.work-center-column {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    min-width: 0;
}

.work-center-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.work-center-section-title h2 {
    margin: 0;
    font-size: 1.05rem;
}

.work-center-section-title span {
    border-radius: 999px;
    padding: .15rem .55rem;
    background: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent);
    color: var(--mud-palette-primary);
}

.work-task-card {
    padding: .9rem;
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.work-task-card.overdue {
    border-color: color-mix(in srgb, var(--mud-palette-error) 42%, transparent);
}

.work-task-card.empty {
    border-style: dashed;
    color: var(--mud-palette-text-secondary);
}

.work-task-card.compact {
    padding: .75rem .9rem;
}

.work-center-wide {
    margin-top: 1rem;
}

.work-task-top,
.work-task-meta,
.work-task-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.work-task-top {
    justify-content: space-between;
    color: var(--mud-palette-text-secondary);
    font-size: .8rem;
}

.work-task-card h3 {
    margin: 0;
    font-size: .98rem;
}

.work-task-card p {
    margin: 0;
    color: var(--mud-palette-text-secondary);
}

.work-task-flow {
    display: grid;
    gap: .45rem;
    padding: .65rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, .48);
    border: 1px solid rgba(148, 163, 184, .14);
}

.work-task-flow span {
    color: #93c5fd;
    font-size: .78rem;
    font-weight: 700;
}

.work-task-flow strong {
    color: #f8fafc;
}

.work-progress {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, .18);
}

.work-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e, #38bdf8);
}

.work-task-meta span {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    color: var(--mud-palette-text-secondary);
    font-size: .82rem;
}

.status-pill.danger {
    background: color-mix(in srgb, var(--mud-palette-error) 13%, transparent);
    color: var(--mud-palette-error);
}

@media (max-width: 1100px) {
    .work-center-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 780px) {
    .work-center-header,
    .work-center-grid {
        grid-template-columns: 1fr;
        display: grid;
    }

    .work-center-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* User profile and administration */
.sp-user-menu-button .mud-button-label {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
}

.sp-user-avatar-img,
.sp-user-avatar-fallback,
.users-cell-user img,
.users-cell-user > span {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}

.sp-user-avatar-fallback,
.users-cell-user > span,
.profile-avatar-xl span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--mud-palette-primary) 18%, var(--mud-palette-surface));
    color: var(--mud-palette-primary);
    font-weight: 700;
}

.profile-page,
.users-admin-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-page {
    color: #edfaff;
}

.profile-hero,
.users-admin-hero,
.users-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.profile-avatar-xl {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--mud-palette-primary) 28%, transparent);
    background: color-mix(in srgb, var(--mud-palette-surface) 92%, transparent);
    flex: 0 0 auto;
}

.profile-avatar-xl img,
.profile-avatar-xl span {
    width: 100%;
    height: 100%;
    object-fit: cover;
    font-size: 1.45rem;
}

.profile-grid,
.users-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(340px, .7fr);
    gap: 1rem;
    align-items: start;
}

.profile-card,
.users-list-panel,
.users-detail-panel,
.users-invite-panel {
    padding: 1rem;
    border: 1px solid rgba(126, 240, 225, 0.20);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(22, 32, 49, 0.96), rgba(15, 23, 36, 0.94)),
        #101824;
    color: #edfaff;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24);
}

.profile-tabs {
    padding: 1rem;
    border: 1px solid rgba(126, 240, 225, 0.18);
    border-radius: 8px;
    background:
        radial-gradient(circle at top right, rgba(126, 240, 225, 0.10), transparent 36%),
        #101824;
    color: #edfaff;
}

.profile-page .mud-tabs-panels,
.profile-page .mud-tabs-toolbar,
.profile-page .mud-tab,
.profile-page .mud-paper,
.profile-page .mud-table,
.profile-page .mud-table-container,
.profile-page .mud-table-root,
.profile-page .mud-table-head,
.profile-page .mud-table-body,
.profile-page .mud-table-row {
    background: transparent !important;
    color: #edfaff !important;
}

.profile-page .mud-input,
.profile-page .mud-input-control,
.profile-page .mud-select {
    background-color: rgba(9, 16, 28, 0.22) !important;
}

.profile-page .mud-tab.mud-tab-active {
    color: #7ef0e1 !important;
}

.profile-page .mud-typography,
.profile-page .mud-input,
.profile-page .mud-input-slot,
.profile-page .mud-input-label,
.profile-page .mud-select,
.profile-page .mud-select-input,
.profile-page .mud-table-cell,
.profile-page .mud-list-item-text {
    color: #edfaff !important;
}

.profile-page .mud-typography-color-secondary,
.profile-page .mud-input-helper-text {
    color: rgba(237, 250, 255, 0.74) !important;
}

.profile-page .mud-input-outlined-border,
.profile-page .mud-input-underline::before,
.profile-page .mud-input-underline::after {
    border-color: rgba(126, 240, 225, 0.32) !important;
}

.profile-page .mud-button-filled-primary {
    color: #041019 !important;
    background: #7ef0e1 !important;
}

.profile-page .mud-button-text,
.profile-page .mud-button-outlined {
    color: #edfaff !important;
    border-color: rgba(126, 240, 225, 0.42) !important;
}

.profile-preference-list {
    display: grid;
    gap: .65rem;
    margin-top: .75rem;
}

.profile-preference-row {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .6rem .75rem;
    border: 1px solid rgba(126, 240, 225, 0.16);
    border-radius: 8px;
    background: rgba(9, 16, 28, 0.48);
}

.profile-preference-row > span {
    color: #f5fbff;
    font-weight: 600;
    line-height: 1.25;
}

.profile-preference-row .mud-switch {
    margin: 0;
    flex: 0 0 auto;
}

.profile-page .mud-switch {
    display: inline-flex !important;
    align-items: center !important;
    min-width: 58px !important;
    min-height: 32px !important;
    margin: 0 !important;
    overflow: visible !important;
}

.profile-page .mud-switch-span,
.profile-page .mud-switch .mud-switch-span {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    width: 58px !important;
    min-width: 58px !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    overflow: visible !important;
}

.profile-page .mud-switch-track {
    position: absolute !important;
    inset: 2px !important;
    width: 54px !important;
    min-width: 54px !important;
    height: 28px !important;
    border: 1px solid rgba(148, 163, 184, 0.42) !important;
    border-radius: 999px !important;
    background: linear-gradient(180deg, #334155, #1e293b) !important;
    opacity: 1 !important;
    box-shadow: inset 0 1px 3px rgba(2, 6, 23, .52), 0 1px 0 rgba(255, 255, 255, .04) !important;
}

.profile-page .mud-switch-button {
    position: absolute !important;
    top: 5px !important;
    left: 5px !important;
    z-index: 2 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 22px !important;
    height: 22px !important;
    padding: 0 !important;
    margin: 0 !important;
    color: transparent !important;
    transform: translateX(0) !important;
    transition: transform 160ms ease !important;
}

.profile-page .mud-switch-thumb {
    width: 22px !important;
    height: 22px !important;
    border: 1px solid rgba(226, 232, 240, .95) !important;
    border-radius: 999px !important;
    background: linear-gradient(180deg, #ffffff, #dbeafe) !important;
    box-shadow: 0 5px 14px rgba(2, 6, 23, .35) !important;
}

.profile-page .mud-switch-input {
    position: absolute !important;
    inset: -5px !important;
    width: 64px !important;
    height: 42px !important;
    cursor: pointer;
}

.profile-page .mud-switch-span:has(.mud-switch-input:checked) .mud-switch-button,
.profile-page .mud-switch:has(.mud-switch-input:checked) .mud-switch-button {
    transform: translateX(26px) !important;
}

.profile-page .mud-switch-span:has(.mud-switch-input:checked) .mud-switch-track,
.profile-page .mud-switch:has(.mud-switch-input:checked) .mud-switch-track {
    border-color: rgba(45, 212, 191, .86) !important;
    background: linear-gradient(135deg, #0f766e, #2dd4bf) !important;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, .14), 0 10px 24px rgba(13, 148, 136, .24) !important;
}

.profile-page .mud-switch-span:has(.mud-switch-input:checked) .mud-switch-thumb,
.profile-page .mud-switch:has(.mud-switch-input:checked) .mud-switch-thumb {
    border-color: rgba(240, 253, 250, .95) !important;
    background: linear-gradient(180deg, #ffffff, #ccfbf1) !important;
}

.profile-section-title {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: .85rem;
}

.profile-section-title h1,
.profile-section-title h2,
.users-detail-head h2 {
    margin: 0;
    font-size: 1.05rem;
}

.profile-photo-actions,
.profile-badges,
.users-detail-head,
.users-history-list {
    display: flex;
    gap: .65rem;
    flex-wrap: wrap;
}

.profile-photo-actions {
    align-items: center;
}

.profile-form,
.users-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
    margin: 1rem 0;
}

.profile-toggles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .4rem .8rem;
    margin-bottom: 1rem;
}

.users-table .mud-table-row {
    cursor: pointer;
}

.users-cell-user {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
}

.users-cell-user div {
    min-width: 0;
}

.users-cell-user strong,
.users-cell-user small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.users-cell-user small,
.users-history-item small,
.users-history-item span {
    color: var(--mud-palette-text-secondary);
}

.users-detail-panel {
    position: sticky;
    top: 82px;
}

.users-history-list {
    flex-direction: column;
}

.users-history-item {
    padding: .75rem;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--mud-palette-text-primary) 9%, transparent);
}

.admin-user-tabs {
    margin: 1rem 0;
}

.users-admin-page .admin-user-tabs,
.users-admin-page .admin-user-tabs .mud-tabs-toolbar,
.users-admin-page .admin-user-tabs .mud-tabs-toolbar-wrapper,
.users-admin-page .admin-user-tabs .mud-tabs-panels,
.users-admin-page .admin-user-tabs .mud-tab-panel {
    background: transparent !important;
    color: #e2e8f0 !important;
}

.users-admin-page .admin-user-tabs .mud-tab {
    min-height: 42px;
    margin-right: .35rem;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 10px 10px 0 0;
    background: rgba(15, 23, 42, .72) !important;
    color: #cbd5e1 !important;
    opacity: 1 !important;
}

.users-admin-page .admin-user-tabs .mud-tab.mud-tab-active {
    border-color: rgba(56, 189, 248, .42);
    background: rgba(14, 165, 233, .18) !important;
    color: #f8fafc !important;
}

.users-admin-page .admin-user-tabs .mud-tab .mud-tab-text,
.users-admin-page .admin-user-tabs .mud-tab .mud-typography,
.users-admin-page .admin-user-tabs .mud-tab .mud-icon-root {
    color: inherit !important;
}

.users-admin-page .admin-user-tabs .mud-tabs-toolbar-content {
    background: transparent !important;
}

.users-admin-page .admin-user-tabs .mud-tabs-slider {
    background-color: #38bdf8 !important;
}

.admin-orchestration-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.admin-orchestration-panel {
    padding: 1rem;
}

.admin-orchestration-row {
    display: grid;
    gap: .25rem;
    padding: .75rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, .16);
    background: rgba(15, 23, 42, .58);
}

.admin-orchestration-row + .admin-orchestration-row {
    margin-top: .65rem;
}

.admin-orchestration-row strong {
    color: #f8fafc;
}

.admin-orchestration-row span {
    color: #cbd5e1;
    font-size: .82rem;
}

.assignment-current {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    gap: .75rem;
    align-items: stretch;
    margin-bottom: 1rem;
}

.assignment-current > div {
    display: grid;
    gap: .2rem;
    padding: .75rem;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 10px;
    background: rgba(2, 6, 23, .48);
}

.assignment-current span,
.assignment-current small {
    color: #94a3b8;
}

.assignment-current strong {
    color: #f8fafc;
}

@media (max-width: 980px) {
    .profile-grid,
    .users-admin-grid,
    .admin-orchestration-grid {
        grid-template-columns: 1fr;
    }

    .users-detail-panel {
        position: static;
    }
}

@media (max-width: 680px) {
    .profile-hero,
    .users-admin-hero,
    .users-detail-head {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-form,
    .users-form-grid,
    .profile-toggles,
    .assignment-current {
        grid-template-columns: 1fr;
    }
}

/* Final dark readability overrides for BPM, GED and user administration */
.work-center-page .work-center-header h1,
.work-center-page .work-center-section-title h2,
.work-center-page .work-task-card h3,
.work-center-page .work-center-stats strong,
.users-admin-page .users-cell-user strong,
.users-admin-page .users-detail-head h2,
.users-admin-page .profile-section-title h2,
.users-admin-page .actor-check strong {
    color: #f8fafc !important;
}

.work-center-page .work-center-stats > div,
.work-center-page .work-task-card,
.users-admin-page .platform-panel,
.users-admin-page .users-list-panel,
.users-admin-page .users-detail-panel {
    background: rgba(15, 23, 42, .82) !important;
    border-color: rgba(148, 163, 184, .16) !important;
    box-shadow: none !important;
}

.work-center-page .work-center-stats span,
.work-center-page .work-task-card p,
.work-center-page .work-task-top,
.work-center-page .work-task-meta span,
.users-admin-page .users-cell-user small,
.users-admin-page .users-history-item span,
.users-admin-page .users-history-item small,
.users-admin-page .actor-check small {
    color: #94a3b8 !important;
}

.work-center-page .work-center-section-title > span {
    color: #bfdbfe !important;
    background: rgba(37, 99, 235, .18) !important;
}

.work-center-page .platform-hero p,
.users-admin-page .platform-hero p,
.users-admin-page .mud-table-cell,
.users-admin-page .mud-input,
.users-admin-page .mud-input-slot,
.users-admin-page .mud-select,
.users-admin-page .mud-select-input,
.users-admin-page .mud-select-root,
.users-admin-page .mud-list-item-text,
.users-admin-page .mud-typography,
.users-admin-page .mud-button-label,
.users-admin-page .users-form-grid label,
.users-admin-page .profile-badges,
.users-admin-page .profile-badges span {
    color: #e2e8f0 !important;
}

.users-admin-page .mud-input-label,
.users-admin-page .mud-table-head .mud-table-cell,
.users-admin-page .mud-placeholder,
.users-admin-page .mud-input-adornment,
.users-admin-page .users-table .mud-table-row:hover .mud-table-cell {
    color: #cbd5e1 !important;
}

.users-admin-page .mud-input-control,
.users-admin-page .mud-input-outlined-border,
.users-admin-page .actor-check,
.users-admin-page .users-history-item {
    background: rgba(15, 23, 42, .62) !important;
    border-color: rgba(148, 163, 184, .2) !important;
}

.users-admin-page .actor-check {
    color: #e2e8f0 !important;
}

.users-admin-page .actor-check input {
    accent-color: #38bdf8;
}

.users-admin-page .actor-check-all {
    margin-bottom: .75rem;
    background: rgba(14, 165, 233, .12) !important;
    border-color: rgba(56, 189, 248, .38) !important;
}

.users-admin-page .admin-orchestration-panel,
.users-admin-page .admin-orchestration-row,
.users-admin-page .assignment-current > div {
    background: rgba(15, 23, 42, .82) !important;
    color: #e2e8f0 !important;
}

.work-center-page .mud-button-root,
.users-admin-page .mud-button-root {
    border-radius: 10px !important;
}

.work-step-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin: .75rem 0;
}

.work-step-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    max-width: 100%;
    padding: .3rem .55rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, .22);
    background: rgba(15, 23, 42, .66);
    color: #cbd5e1;
    font-size: .76rem;
    font-weight: 700;
    line-height: 1.15;
}

.work-step-badge.done {
    border-color: rgba(34, 197, 94, .35);
    background: rgba(22, 101, 52, .18);
    color: #86efac;
}

.work-step-badge.current {
    border-color: rgba(56, 189, 248, .55);
    background: rgba(14, 165, 233, .18);
    color: #bae6fd;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, .12);
}

.work-step-badge.pending {
    color: #94a3b8;
}

.work-step-badge.disabled {
    opacity: .52;
    text-decoration: line-through;
}

.work-step-badge.final {
    border-style: dashed;
}

.ged-lifecycle-strip {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin: .85rem 0;
}

.ged-lifecycle-step {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: .32rem .6rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, .22);
    background: rgba(15, 23, 42, .68);
    color: #94a3b8;
    font-size: .76rem;
    font-weight: 800;
}

.ged-lifecycle-step.done {
    border-color: rgba(34, 197, 94, .35);
    background: rgba(22, 101, 52, .2);
    color: #86efac;
}

.ged-lifecycle-step.current {
    border-color: rgba(56, 189, 248, .55);
    background: rgba(14, 165, 233, .18);
    color: #bae6fd;
}

.ged-lifecycle-step.pending {
    color: #94a3b8;
}

/* Final foundation dark pass: GED, Workflow, Work Center and Admin must not fall back to white Mud surfaces. */
.documents-page .platform-panel,
.documents-page .platform-basket,
.documents-page .platform-tab,
.documents-page .audit-event,
.documents-page .platform-mini-row,
.documents-page .platform-meta-grid,
.documents-page .platform-table .mud-table-container,
.documents-page .platform-table .mud-table-head,
.documents-page .platform-table .mud-table-body,
.documents-page .platform-table .mud-table-row,
.documents-page .platform-detail-panel,
.documents-page .platform-side-section,
.documents-page .ged-document-row,
.documents-page .ged-preview-panel,
.documents-page .ged-upload-panel,
.documents-page .ged-folder-inline,
.documents-page .ged-document-chip,
.work-center-page .work-center-stats > div,
.work-center-page .work-center-column,
.work-center-page .work-task-card,
.workflow-studio-page .workflow-modal-card,
.workflow-studio-page .workflow-flow-panel,
.workflow-studio-page .workflow-config-card,
.workflow-studio-page .workflow-template-dock,
.workflow-studio-page .workflow-library-card,
.workflow-studio-page .workflow-template-card,
.users-admin-page .mud-paper,
.users-admin-page .mud-tabs-panels,
.users-admin-page .mud-tab-panel {
    background: rgba(15, 23, 42, .86) !important;
    border-color: rgba(148, 163, 184, .18) !important;
    color: #e2e8f0 !important;
    box-shadow: none !important;
}

.documents-page .platform-basket.active,
.documents-page .platform-tab.active,
.documents-page .ged-document-row.selected,
.documents-page .ged-document-row:hover,
.documents-page .ged-document-chip.selected,
.documents-page .ged-document-chip:hover,
.workflow-studio-page .workflow-library-card.selected,
.workflow-studio-page .workflow-template-card.active {
    background: rgba(14, 165, 233, .18) !important;
    border-color: rgba(56, 189, 248, .45) !important;
    color: #f8fafc !important;
}

.documents-page .platform-panel h2,
.documents-page .audit-event strong,
.documents-page .platform-mini-row span,
.documents-page .platform-meta-grid strong,
.documents-page .platform-doc-cell strong,
.documents-page .platform-detail-head strong,
.documents-page .ged-document-row strong,
.documents-page .ged-document-chip strong,
.documents-page .ged-preview-head h3,
.work-center-page .work-task-card h3,
.work-center-page .work-task-flow strong,
.workflow-studio-page .workflow-template-card strong,
.workflow-studio-page .workflow-library-card strong,
.users-admin-page .admin-orchestration-row strong,
.users-admin-page .users-history-item strong {
    color: #f8fafc !important;
}

.documents-page .platform-doc-cell small,
.documents-page .audit-event span,
.documents-page .audit-event p,
.documents-page .platform-mini-row small,
.documents-page .platform-meta-grid span,
.documents-page .platform-detail-head span,
.documents-page .ged-document-row small,
.documents-page .ged-document-chip em,
.documents-page .ged-preview-head span,
.documents-page .platform-table .mud-table-cell,
.work-center-page .work-task-card p,
.work-center-page .work-task-meta span,
.workflow-studio-page .workflow-template-card small,
.workflow-studio-page .workflow-library-card small,
.users-admin-page .admin-orchestration-row span,
.users-admin-page .admin-orchestration-row small {
    color: #cbd5e1 !important;
}

.documents-page .platform-table .mud-table-head .mud-table-cell,
.users-admin-page .mud-table-head .mud-table-cell {
    background: rgba(2, 6, 23, .52) !important;
    color: #bfdbfe !important;
}

.documents-page .mud-input,
.documents-page .mud-input-slot,
.documents-page .mud-select,
.documents-page .mud-select-input,
.workflow-studio-page input,
.workflow-studio-page select,
.users-admin-page .mud-input,
.users-admin-page .mud-input-slot,
.users-admin-page .mud-select,
.users-admin-page .mud-select-input {
    background: rgba(2, 6, 23, .42) !important;
    color: #f8fafc !important;
}

.workflow-studio-page .workflow-modal-field input {
    background: rgba(2, 6, 23, .74) !important;
    color: #f8fafc !important;
    border-color: rgba(56, 189, 248, .32) !important;
}

.automation-page .platform-panel,
.automation-rule-card {
    background: rgba(15, 23, 42, .86) !important;
    border-color: rgba(148, 163, 184, .18) !important;
    color: #e2e8f0 !important;
}

.automation-rule-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.automation-rule-card {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 10px;
}

.automation-rule-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: center;
}

.automation-rule-head strong {
    display: block;
    color: #f8fafc;
}

.automation-rule-head span {
    display: block;
    color: #94a3b8;
    font-size: .84rem;
}

.automation-rule-fields {
    display: grid;
    gap: .75rem;
}

.automation-page .mud-input,
.automation-page .mud-input-slot,
.automation-page .mud-select,
.automation-page .mud-select-input {
    background: rgba(2, 6, 23, .42) !important;
    color: #f8fafc !important;
}

@media (max-width: 980px) {
    .automation-rule-grid {
        grid-template-columns: 1fr;
    }
}

/* Folder pilotage polish: the folder is the workspace, GED is a dark contextual tab. */
.work-center-page .platform-panel,
.work-center-page .mud-tabs,
.work-center-page .mud-tabs-panels,
.work-center-page .mud-tab-panel,
.work-center-page .platform-mini-row,
.work-center-page .audit-event,
.work-center-page .ged-document-row,
.work-center-page .folder-timeline,
.work-center-page .folder-ged-preview,
.work-center-page .ged-preview-frame,
.work-center-page .ged-preview-unavailable,
.work-center-page .platform-table .mud-table-container,
.work-center-page .platform-table .mud-table-head,
.work-center-page .platform-table .mud-table-body,
.work-center-page .platform-table .mud-table-row {
    background: rgba(15, 23, 42, .88) !important;
    border-color: rgba(148, 163, 184, .18) !important;
    color: #e2e8f0 !important;
    box-shadow: none !important;
}

.work-center-page .mud-tab {
    color: #cbd5e1 !important;
}

.work-center-page .mud-tab.mud-tab-active {
    color: #f8fafc !important;
}

.work-center-page .platform-detail-head h2,
.work-center-page .platform-detail-head strong,
.work-center-page .platform-meta-grid strong,
.work-center-page .work-center-section-title h2,
.work-center-page .platform-mini-row strong,
.work-center-page .audit-event strong,
.work-center-page .ged-document-row strong,
.work-center-page .ged-preview-head h3 {
    color: #f8fafc !important;
}

.work-center-page .platform-detail-head span,
.work-center-page .platform-meta-grid span,
.work-center-page .platform-mini-row small,
.work-center-page .audit-event span,
.work-center-page .audit-event p,
.work-center-page .ged-document-row small,
.work-center-page .ged-preview-head span,
.work-center-page .platform-table .mud-table-cell {
    color: #cbd5e1 !important;
}

.work-center-page .platform-table .mud-table-head .mud-table-cell {
    background: rgba(2, 6, 23, .54) !important;
    color: #bfdbfe !important;
}

.work-center-page .status-pill {
    border: 1px solid rgba(148, 163, 184, .24) !important;
    background: rgba(30, 41, 59, .85) !important;
    color: #e2e8f0 !important;
}

.work-center-page .status-pill.ok {
    border-color: rgba(34, 197, 94, .45) !important;
    background: rgba(22, 101, 52, .32) !important;
    color: #bbf7d0 !important;
}

.work-center-page .status-pill.warn {
    border-color: rgba(245, 158, 11, .45) !important;
    background: rgba(120, 53, 15, .34) !important;
    color: #fde68a !important;
}

.work-center-page .status-pill.danger {
    border-color: rgba(248, 113, 113, .48) !important;
    background: rgba(127, 29, 29, .36) !important;
    color: #fecaca !important;
}

.work-center-page .status-pill.muted {
    border-color: rgba(148, 163, 184, .28) !important;
    background: rgba(51, 65, 85, .46) !important;
    color: #cbd5e1 !important;
}

.folder-task-row {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
}

.work-task-actions.compact {
    justify-content: flex-end;
}

.folder-timeline {
    padding: .75rem;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 10px;
}

.folder-timeline summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: center;
    cursor: pointer;
    color: #f8fafc;
    font-weight: 800;
    list-style: none;
}

.folder-timeline summary::-webkit-details-marker {
    display: none;
}

.folder-timeline .audit-timeline {
    margin-top: .85rem;
}

.folder-ged-layout {
    display: grid;
    grid-template-columns: minmax(260px, .75fr) minmax(0, 1.25fr);
    gap: 1rem;
}

.folder-ged-list {
    display: grid;
    align-content: start;
    gap: .6rem;
}

.folder-ged-preview {
    min-height: 440px;
    padding: .85rem;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 10px;
}

.work-center-page .ged-document-row {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: center;
    padding: .75rem;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 10px;
    text-align: left;
}

.work-center-page .ged-document-row.selected,
.work-center-page .ged-document-row:hover {
    background: rgba(14, 165, 233, .18) !important;
    border-color: rgba(56, 189, 248, .44) !important;
}

.work-center-page .ged-preview-frame {
    height: 360px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
}

.work-center-page .ged-preview-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #0f172a;
}

@media (max-width: 980px) {
    .folder-ged-layout {
        grid-template-columns: 1fr;
    }

    .folder-task-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .work-task-actions.compact {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}
