:root {
    --enterprise-surface: #ffffff;
    --enterprise-surface-soft: #f6f8fb;
    --enterprise-line: #d9e2ec;
    --enterprise-line-strong: #c7d2e0;
    --enterprise-text: #102235;
    --enterprise-muted: #627387;
    --enterprise-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    --enterprise-shadow-hover: 0 24px 46px rgba(15, 23, 42, 0.12);
    --enterprise-good: #159967;
    --enterprise-watch: #cf8b11;
    --enterprise-risk: #d23f4b;
    --enterprise-focus: #2d75d3;
}

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

.dashboard-shell > .page-header {
    margin-bottom: 0;
}

.dashboard-hero,
.dashboard-shell .page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.dashboard-hero-copy,
.dashboard-shell .module-header-copy {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
}

.dashboard-title,
.dashboard-shell .page-header h2,
.dashboard-shell .module-header-copy h2 {
    margin: 0 !important;
    font-size: clamp(1.2rem, 2vw, 1.55rem) !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em;
    color: var(--enterprise-text) !important;
}

.dashboard-subtitle,
.dashboard-shell .module-subhead {
    margin: 0 !important;
    max-width: 78ch;
    color: var(--enterprise-muted) !important;
    font-size: 0.88rem !important;
    line-height: 1.55;
}

.dashboard-actions,
.dashboard-shell .header-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.dashboard-section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-card,
.dashboard-table-card,
.dashboard-panel-card {
    position: relative;
    min-width: 0;
    padding: 1rem 1.05rem;
    border: 1px solid var(--enterprise-line) !important;
    border-radius: 18px !important;
    background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(246,248,251,0.99)) !important;
    box-shadow: var(--enterprise-shadow) !important;
}

.dashboard-card::before,
.dashboard-table-card::before,
.dashboard-panel-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, rgba(45, 117, 211, 0.9), rgba(69, 150, 235, 0.65));
}

.dashboard-card > h3,
.dashboard-card > h4,
.dashboard-table-card > h3,
.dashboard-table-card > h4,
.dashboard-panel-card > h3,
.dashboard-panel-card > h4 {
    margin: 0 0 0.85rem 0 !important;
    font-size: 0.98rem !important;
    font-weight: 800 !important;
    color: var(--enterprise-text) !important;
    letter-spacing: -0.01em;
}

.dashboard-card-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.dashboard-card-toolbar > h3,
.dashboard-card-toolbar > h4 {
    margin: 0 !important;
}

.dashboard-card-content {
    min-width: 0;
}

.dashboard-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1rem;
}

.dashboard-inline-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 0.18rem 0.58rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #2d75d3, #4ea2ff);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}

.dashboard-control-group {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.dashboard-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

.dashboard-field-compact {
    display: grid;
    gap: 0.28rem;
}

.dashboard-field-compact label {
    font-size: 0.72rem;
    color: var(--enterprise-muted);
    font-weight: 700;
}

.dashboard-field-compact .enterprise-select,
.dashboard-field-compact input,
.dashboard-field-compact select,
.dashboard-field-compact textarea {
    width: 100%;
}

.dashboard-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.screening-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.screening-kpi-card {
    position: relative;
    min-height: 168px;
    padding: 1rem 1.05rem;
    border: 1px solid var(--enterprise-line);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    box-shadow: var(--enterprise-shadow);
}

.screening-kpi-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.55rem;
}

.screening-kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.screening-kpi-icon i {
    width: 18px;
    height: 18px;
}

.screening-kpi-label {
    font-size: 0.78rem;
    color: var(--enterprise-muted);
    font-weight: 700;
}

.screening-kpi-value {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1;
    color: var(--enterprise-text);
}

.screening-kpi-meta {
    margin-top: 0.28rem;
    font-size: 0.74rem;
    font-weight: 700;
}

.screening-kpi-progress {
    margin-top: 0.45rem;
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.screening-kpi-progress-fill {
    height: 100%;
    border-radius: inherit;
}

.screening-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 0.8rem 1rem;
    background: var(--enterprise-surface-soft);
    border: 1px solid var(--enterprise-line);
    border-radius: 14px;
    margin-bottom: 1rem;
}

.screening-filter-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--enterprise-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.screening-filter-label i {
    width: 14px;
    height: 14px;
}

.screening-filter-control {
    font-size: 0.8rem;
    padding: 0.4rem 0.55rem;
    border: 1px solid var(--enterprise-line);
    border-radius: 8px;
    background: #fff;
    color: var(--enterprise-text);
}

.screening-filter-clear {
    font-size: 0.76rem;
    padding: 0.4rem 0.78rem;
    border: 1px solid var(--enterprise-line);
    border-radius: 8px;
    background: #fff;
    color: var(--enterprise-muted);
    cursor: pointer;
}

.dashboard-search-input {
    width: 220px;
    max-width: 100%;
    padding: 0.55rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--enterprise-line-strong);
    background: #fff;
    color: var(--enterprise-text);
    font-size: 0.85rem;
    outline: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.dashboard-search-input:focus {
    border-color: rgba(45, 117, 211, 0.55);
    box-shadow: 0 0 0 3px rgba(45, 117, 211, 0.12);
}

.dashboard-empty-state {
    padding: 1.4rem;
    border: 1px dashed var(--enterprise-line-strong);
    border-radius: 14px;
    background: var(--enterprise-surface-soft);
    color: var(--enterprise-muted);
    text-align: center;
}

.dashboard-executive-kpis,
.metrics-grid,
.portal-metrics,
.stats-grid,
.finance-kpi-row,
.wh-kpi-row,
.enterprise-metric-grid {
    display: grid;
    gap: 1rem;
    align-items: stretch;
}

.enterprise-kpi-grid,
.dashboard-executive-kpis,
.enterprise-metric-grid,
.metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.enterprise-metric-grid--compact {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    margin-bottom: 1rem;
}

.enterprise-metric-grid--wide {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 1.25rem;
}

.enterprise-kpi-card,
.content .finance-card,
.content .metric-card,
.content .stat-card,
.dashboard-exec-card,
.metrics-grid .metric-card,
.content .kpi-widget,
.content .finance-kpi,
.content .wh-kpi-card,
.content .admin-lab-kpi,
.enterprise-metric-grid > *,
.stats-grid > *,
.finance-kpi-row > *,
.wh-kpi-row > * {
    position: relative;
    min-height: 168px;
    padding: 1.1rem 1.15rem;
    border: 1px solid var(--enterprise-line) !important;
    border-radius: 18px !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 248, 251, 0.98)) !important;
    box-shadow: var(--enterprise-shadow) !important;
    display: grid;
    align-content: start;
    gap: 0.45rem;
    overflow: hidden;
}

.enterprise-kpi-card::before,
.content .finance-card::before,
.content .metric-card::before,
.content .stat-card::before,
.dashboard-exec-card::before,
.metrics-grid .metric-card::before,
.content .kpi-widget::before,
.content .finance-kpi::before,
.content .wh-kpi-card::before,
.content .admin-lab-kpi::before,
.enterprise-metric-grid > *::before,
.stats-grid > *::before,
.finance-kpi-row > *::before,
.wh-kpi-row > *::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, rgba(45, 117, 211, 0.9), rgba(69, 150, 235, 0.65));
}

.enterprise-kpi-card:hover,
.content .finance-card:hover,
.content .metric-card:hover,
.content .stat-card:hover,
.dashboard-exec-card:hover,
.metrics-grid .metric-card:hover,
.content .kpi-widget:hover,
.content .finance-kpi:hover,
.content .wh-kpi-card:hover,
.content .admin-lab-kpi:hover,
.enterprise-metric-grid > *:hover,
.stats-grid > *:hover,
.finance-kpi-row > *:hover,
.wh-kpi-row > *:hover {
    transform: translateY(-2px);
    box-shadow: var(--enterprise-shadow-hover) !important;
}

.enterprise-kpi-card-good::before,
.content .stat-card.success::before {
    background: linear-gradient(90deg, rgba(21, 153, 103, 0.96), rgba(39, 185, 128, 0.7));
}

.enterprise-kpi-card-watch::before,
.content .stat-card.warning::before {
    background: linear-gradient(90deg, rgba(207, 139, 17, 0.96), rgba(241, 180, 52, 0.7));
}

.enterprise-kpi-card-risk::before,
.content .stat-card.danger::before {
    background: linear-gradient(90deg, rgba(210, 63, 75, 0.96), rgba(234, 93, 108, 0.72));
}

.enterprise-kpi-card-focus::before {
    background: linear-gradient(90deg, rgba(45, 117, 211, 0.96), rgba(96, 163, 255, 0.72));
}

.enterprise-kpi-label,
.content .finance-card-label,
.content .stat-label,
.metrics-grid .metric-card span,
.content .kpi-widget .kpi-label,
.content .finance-kpi-label,
.content .wh-kpi-label,
.content .admin-lab-kpi-label {
    display: block;
    color: var(--enterprise-muted) !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.enterprise-kpi-value,
.content .finance-card-value,
.content .stat-value,
.metrics-grid .metric-card strong,
.content .kpi-widget .kpi-value,
.content .finance-kpi-value,
.content .wh-kpi-value,
.content .admin-lab-kpi-value {
    color: var(--enterprise-text) !important;
    font-size: clamp(1.8rem, 2.4vw, 2.35rem) !important;
    line-height: 1;
    letter-spacing: -0.04em;
    font-weight: 800 !important;
    margin-top: 0.2rem;
}

.enterprise-kpi-meta,
.metrics-grid .metric-card p,
.content .kpi-widget .kpi-trend,
.content .finance-kpi-trend,
.content .wh-kpi-trend {
    margin: 0;
    color: var(--enterprise-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.content .kpi-widget .kpi-trend,
.content .finance-kpi-trend,
.content .wh-kpi-trend {
    width: fit-content;
    margin-top: auto;
    padding: 0.28rem 0.58rem !important;
    border-radius: 999px;
    background: #e8eef6 !important;
}

.content .finance-kpi,
.content .wh-kpi-card,
.content .kpi-widget,
.content .admin-lab-kpi {
    display: grid;
    align-content: start;
    gap: 0.45rem;
}

.content .finance-kpi-icon,
.content .wh-kpi-icon {
    width: 42px !important;
    height: 42px !important;
    margin: 0 0 0.4rem 0 !important;
    border-radius: 12px !important;
}

.content .wh-kpi-data {
    display: grid;
    gap: 0.35rem;
}

.content .metric-card,
.metrics-grid .metric-card {
    justify-items: start;
}

.content .metric-card .mc-icon,
.metrics-grid .metric-card .mc-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(45, 117, 211, 0.12);
    color: var(--enterprise-focus);
}

.content .metric-card .mc-label,
.content .metric-card .mc-value,
.content .metric-card .mc-trend,
.content .metric-card .mc-progress,
.content .metric-card .mc-sparkline {
    position: relative;
    z-index: 1;
}

.content .metric-card .mc-progress {
    margin-top: auto;
    height: 8px;
    border-radius: 999px;
    background: #dfe7f1;
    overflow: hidden;
}

.content .metric-card .mc-progress .fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2d75d3, #7db5ff);
}

.enterprise-kpi-progress {
    margin-top: auto;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #dfe7f1;
}

.enterprise-kpi-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2d75d3, #7db5ff);
}

.enterprise-kpi-card-good .enterprise-kpi-progress-fill {
    background: linear-gradient(90deg, #159967, #39d69a);
}

.enterprise-kpi-card-watch .enterprise-kpi-progress-fill {
    background: linear-gradient(90deg, #cf8b11, #f0b03f);
}

.enterprise-kpi-card-risk .enterprise-kpi-progress-fill {
    background: linear-gradient(90deg, #d23f4b, #ef7582);
}

.enterprise-trend-list {
    display: grid;
    gap: 0.75rem;
}

.enterprise-trend-row {
    display: grid;
    gap: 0.45rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--enterprise-line);
    border-radius: 14px;
    background: var(--enterprise-surface-soft);
}

.enterprise-trend-copy {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: baseline;
    flex-wrap: wrap;
}

.enterprise-trend-copy strong {
    color: var(--enterprise-text);
}

.enterprise-trend-copy span {
    color: var(--enterprise-muted);
    font-size: 0.84rem;
}

.enterprise-trend-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #dfe7f1;
}

.enterprise-trend-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2d75d3, #7db5ff);
}

@media (max-width: 720px) {
    .dashboard-hero,
    .dashboard-shell .page-header {
        align-items: stretch;
    }

    .dashboard-actions,
    .dashboard-shell .header-controls {
        justify-content: stretch;
    }

    .dashboard-section-grid,
    .dashboard-list-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-search-input {
        width: 100%;
    }

    .enterprise-kpi-grid,
    .dashboard-executive-kpis,
    .metrics-grid,
    .stats-grid,
    .finance-kpi-row,
    .wh-kpi-row,
    .enterprise-metric-grid {
        grid-template-columns: 1fr;
    }

    .enterprise-kpi-card,
    .content .finance-card,
    .content .metric-card,
    .content .stat-card,
    .dashboard-exec-card,
    .metrics-grid .metric-card,
    .content .kpi-widget,
    .content .finance-kpi,
    .content .wh-kpi-card,
    .content .admin-lab-kpi,
    .enterprise-metric-grid > *,
    .stats-grid > *,
    .finance-kpi-row > *,
    .wh-kpi-row > * {
        min-height: 150px;
    }
}
