:root {
    /* Default (Likely Light Mode) */
    --dash-bg: transparent;
    --dash-card-bg: #ffffff;
    --dash-text: #212529;
    --dash-muted: #6c757d;
    --dash-border: #dee2e6;
    --dash-accent-green: #059669;
    --dash-accent-blue: #2563eb;
    --dash-accent-red: #dc2626;
    --dash-accent-yellow: #d97706; /* Light theme darker yellow */
}

/* Dark Mode Overrides */
[data-bs-theme="dark"],
body.dark,
.dark-mode {
    --dash-bg: #1e1e1e;
    --dash-card-bg: #252525;
    --dash-text: #e0e0e0;
    --dash-muted: #a0a0a0;
    --dash-border: #333333;
    --dash-accent-green: #10b981;
    --dash-accent-blue: #3b82f6;
    --dash-accent-red: #ef4444;
    --dash-accent-yellow: #f59e0b; /* Dark theme lighter yellow */
}

.dash-header-title {
    margin-bottom: 0.5rem;
}

.ea-dashboard .content-header-title .title,
.ea-dashboard .dash-header-title .account-name {
    font-size: 2rem !important;
    font-weight: 800;
    margin-bottom: 0;
    color: var(--dash-text);
}

.cooperative-name {
    font-size: 1.1rem !important;
    font-weight: 500;
    margin-top: -2px;
}

.dashboard-container {
    padding-top: 20px;
    padding-bottom: 20px;
    color: var(--dash-text);
    min-height: calc(100vh - 60px);
    /* Fill screen minus approx header */
}

/* Card Styles */
.card {
    background-color: var(--dash-card-bg);
    border: 1px solid var(--dash-border);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--dash-border);
    padding: 0.75rem 1rem;
}

.card-title {
    color: var(--dash-text);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Table Styles - Zebra Striping */
.table {
    color: var(--dash-text);
    border-color: var(--dash-border);
    --bs-table-color: var(--dash-text);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--dash-border);
    --bs-table-striped-bg: rgba(0, 0, 0, 0.02);
    --bs-table-hover-bg: rgba(0, 0, 0, 0.04);
}

/* Adjust striping for dark mode */
[data-bs-theme="dark"] .table,
body.dark .table,
.dark-mode .table {
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-bs-theme="light"]) .table {
        --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
        --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
    }
}

.table th {
    border-bottom-color: var(--dash-border);
    color: var(--dash-muted);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 1rem;
}

.table td {
    border-bottom-color: var(--dash-border);
    padding: 1rem;
    vertical-align: middle;
}

/* KPI Summary Cards */
.kpi-card-base {
    background-color: var(--dash-card-bg);
    border: 1px solid var(--dash-border);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0.25rem 0.375rem rgba(0, 0, 0, 0.05);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    height: 100%;
}

.kpi-card-base:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.5rem 0.75rem rgba(0, 0, 0, 0.1);
    border-color: var(--dash-muted);
}

.kpi-card-base::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0.1875rem;
}

.kpi-card-base.accent-blue::before {
    background-color: var(--dash-accent-blue);
}
.kpi-card-base.accent-green::before {
    background-color: var(--dash-accent-green);
}
.kpi-card-base.accent-red::before {
    background-color: var(--dash-accent-red);
}
.kpi-card-base.accent-yellow::before,
.kpi-card-base.accent-orange::before {
    background-color: var(--dash-accent-yellow);
}

.kpi-card-label {
    font-size: 0.625rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--dash-muted);
    margin-bottom: 0.625rem;
    font-weight: 700;
    height: 1rem;
    display: flex;
    align-items: center;
}

.kpi-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dash-text);
    line-height: 1.1;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.kpi-card-unit {
    font-size: 0.8125rem;
    color: var(--dash-muted);
    opacity: 0.6;
    font-weight: 500;
}

.kpi-split-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--dash-border);
    height: 3.25rem;
    box-sizing: border-box;
}

.kpi-split-dot {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    margin-right: 0.75rem;
    flex-shrink: 0;
}
.kpi-split-title {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--dash-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.kpi-split-body {
    display: flex;
    align-items: stretch;
    flex-grow: 1;
}
.kpi-split-col {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.kpi-split-sep {
    width: 1px;
    background-color: var(--dash-border);
    margin: 0 1.25rem;
    align-self: stretch;
}
.kpi-split-col .kpi-card-value {
    font-size: 1.25rem;
}
.kpi-card-subtext {
    font-size: 0.6875rem;
    color: var(--dash-muted);
    margin-top: 0.5rem;
    height: 1rem;
    line-height: 1.2;
}

.kpi-bank-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(245, 158, 11, 0.1);
    color: var(--dash-accent-yellow);
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(245, 158, 11, 0.15);
    margin-left: auto;
}

/* Chart Containers */
.chart-container {
    position: relative;
    width: 100%;
    min-height: 350px;
}

.pie-chart-container {
    position: relative;
    width: 100%;
    height: 300px;
    /* Specific height for Pie */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Badge Styles */
.badge-ppe {
    display: inline-block;
    line-height: 1.4;
    background-color: rgba(128, 128, 128, 0.1);
    /* Neutral transparent */
    color: var(--dash-text);
    font-weight: 500;
    font-family: monospace;
    padding: 0.4em 0.8em;
    border-radius: 6px;
    border: 1px solid var(--dash-border);
}

.ppe-parent-row .toggle-icon {
    display: inline-block;
    transition: transform 0.2s ease !important;
}

.ppe-parent-row.is-open .toggle-icon {
    transform: rotate(90deg) !important;
}

.ppe-child-row {
    background-color: rgba(128, 128, 128, 0.03) !important;
}

[data-bs-theme="dark"] .ppe-child-row,
body.dark .ppe-child-row,
.dark-mode .ppe-child-row {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

/* Typography Enhancements */
.text-value-positive {
    color: var(--dash-accent-green) !important;
}

.text-value-negative {
    color: var(--dash-accent-red) !important;
}

.text-value-neutral {
    color: var(--dash-accent-blue) !important;
}

.sum-row {
    font-weight: 700;
    background-color: rgba(128, 128, 128, 0.05) !important;
    border-top: 2px solid var(--dash-border);
}

.sum-row td {
    border-bottom: none !important;
}

.sum-row td:first-child {
    border-bottom-left-radius: 12px;
}

.sum-row td:last-child {
    border-bottom-right-radius: 12px;
}

/* Filter Components (Global) */
.dash-filter-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgba(128, 128, 128, 0.1);
    border: 1px solid var(--dash-border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 1px 12px 0;
    height: 42px;
    box-sizing: border-box;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.dash-filter-container:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.dash-filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: transparent;
    border: none;
    color: var(--dash-text);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0 12px;
    cursor: pointer;
    outline: none;
    height: 100%;
    display: flex;
    align-items: center;
    margin: 0;
}

.dash-filter-select:focus {
    background: rgba(128, 128, 128, 0.1);
    border-radius: 4px;
}

.dash-filter-divider {
    color: var(--dash-text);
    opacity: 0.3;
    font-weight: 300;
    user-select: none;
    line-height: 1;
    margin-top: -2px;
}

.dash-filter-dropdown-divider {
    border-color: rgba(255, 255, 255, 0.15);
    opacity: 1;
    margin: 0.25rem 0 !important;
}

.js-company-filter .dash-filter-option {
    cursor: pointer;
    border-radius: 0;
    margin: 0 !important;
    width: 100% !important;
    padding: 0.5rem 1rem !important;
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
    position: relative;
    box-sizing: border-box;
}

.js-company-filter .dash-filter-option:hover:not(:has(input:checked)) {
    background-color: rgba(128, 128, 128, 0.1);
}

.js-company-filter .dash-filter-option:has(input:checked) {
    background-color: rgba(37, 99, 235, 0.1) !important;
    color: var(--dash-accent-blue) !important;
}

/* Full-height vertical accent line on the far-left edge */
.js-company-filter .dash-filter-option:has(input:checked)::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background-color: var(--dash-accent-blue);
}

.js-company-filter .dash-filter-check-container {
    width: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.js-company-filter .dash-filter-check {
    font-size: 0.85rem;
    color: var(--dash-accent-blue);
    opacity: 0;
    transition: opacity 0.15s;
}

.js-company-filter .dash-filter-option:has(input:checked) .dash-filter-check {
    opacity: 1;
}

.js-company-filter .dash-filter-item-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.js-company-filter .dropdown-menu {
    max-width: 350px;
    padding: 0 !important;
    overflow: hidden;
}

.js-company-filter .dropdown-menu li {
    margin: 0 !important;
    padding: 0 !important;
}

.dash-filter-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding-left: 10px;
    padding-right: 4px;
}

.dash-filter-icon {
    color: var(--dash-text);
    opacity: 0.5;
    font-size: 1rem;
}

/* Theme-aware Dropdown Styles */
.dropdown-menu {
    background-color: var(--dash-card-bg);
    border-color: var(--dash-border);
}

.dropdown-item {
    color: var(--dash-text);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(128, 128, 128, 0.1);
    color: var(--dash-text);
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--dash-accent-blue);
    color: #fff;
}

/* ========================================================================= */
/* Reusable Components (formerly in settlement.css) */
/* ========================================================================= */

.dash-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dash-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid var(--dash-border);
    color: var(--dash-muted);
    font-size: 0.95rem;
    gap: 1rem;
}

.dash-list-item > span:first-child {
    flex: 1 1 auto;
    word-break: break-word;
}

.dash-list-item > span:last-child {
    flex: 0 0 auto;
    text-align: right;
}

.dash-list-item:last-child {
    border-bottom: none;
}

.dash-badge {
    background-color: rgba(
        128,
        128,
        128,
        0.1
    ); /* Shares styling with badge-ppe */
    color: var(--dash-text);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Mode Toggle Switch (Specific override for sizing/spacing) */
.mode-toggle-container {
    white-space: nowrap;
    margin: 0;
    padding: 0;
}

.mode-toggle-input {
    width: 2.5em;
    height: 1.25em;
    cursor: pointer;
    margin-right: 0.5rem;
    margin-top: 0;
    margin-left: 0;
}

.mode-toggle-label {
    cursor: pointer;
    color: var(--dash-text);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1;
    padding-top: 1px;
}

/* ========================================================================= */
/* Utilities */
/* ========================================================================= */

.dash-filter-wrapper {
    gap: 1rem;
}

.dropdown-menu-scrollable {
    max-height: 300px;
    overflow-y: auto;
}

/* Text Value Formatters */
.val-text {
    font-family:
        ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 1rem;
    white-space: nowrap;
}

.val-text.val-lg {
    font-size: 1.1rem;
}

.text-value-white {
    color: var(--dash-text) !important;
}

/* Reusing existing text-value-positive, -negative from typography section above */

/* Settlement Tabs */
.settlement-tabs {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.settlement-tab {
    color: #6c757d;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #333;
    transition: all 0.2s;
}
.settlement-tab:hover {
    color: #a9a9a9;
}
.settlement-tab.active {
    color: #38bdf8 !important;
    border-bottom-color: #38bdf8 !important;
}
.settlement-filters {
    margin-bottom: 2rem;
    justify-content: flex-end;
}

@import "easyadmin-buttons-DeOQntc.css";

.archive-coverage-status-btn {
    line-height: 1;
    text-decoration: none;
}

.archive-coverage-status-btn:hover,
.archive-coverage-status-btn:focus {
    text-decoration: none;
}

.archive-coverage-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 4px;
    border-radius: 50%;
    box-sizing: border-box;
}

.archive-coverage-status i {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
}

.archive-coverage-status--ok {
    color: #52b788;
    background: #1a3a2e;
    border: 0.5px solid #2d6a4f;
}

.archive-coverage-status--warning {
    color: #c9a84c;
    background: #2e2510;
    border: 0.5px solid #5a4510;
}

.storage-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
}

.storage-inline-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.storage-inline-icon {
    color: #38bdf8;
    font-size: 1.25rem;
}

.storage-inline-title {
    color: #ddd;
    font-size: 14px;
    font-weight: 500;
}

.storage-inline-subtitle {
    color: #555;
    font-size: 11px;
}

.storage-inline-right {
    text-align: right;
}

.storage-inline-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 20px;
    font-weight: 600;
    color: #38bdf8;
    line-height: 1.2;
}

.storage-inline-unit {
    color: #444;
    font-size: 11px;
    text-align: right;
}

.storage-inline-pill {
    display: inline-block;
    margin-top: 4px;
    background: #1a1a1a;
    border: 0.5px solid #333;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 11px;
    color: #555;
}

.storage-progress-track {
    height: 4px;
    background: #1a1a1f;
    border-radius: 2px;
    overflow: hidden;
    margin: 0 1.25rem 1.25rem 1.25rem;
}

.storage-progress-fill {
    height: 100%;
    background: #38bdf8;
    border-radius: 2px;
    transition: width 0.4s ease;
    min-width: 0;
}

.dash-list-item.dash-list-separator {
    border-top: 0.5px solid #333;
    padding-top: 10px;
    margin-top: 2px;
}

.text-value-orange {
    color: #fb923c !important;
}

.text-value-sum-green {
    color: #4ade80 !important;
    font-size: 1.15rem;
}

.text-value-sum-red {
    color: #f87171 !important;
    font-size: 1.15rem;
}
