:root {
    color-scheme: light;
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: #1b2638;
    background: #f4f7fb;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    --muted: #7b8798;
    --line: #e9edf3;
}

* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    margin: 0;
    background:
        radial-gradient(ellipse at 85% 0, rgba(45, 107, 224, .07), transparent 34rem),
        #f4f7fb;
}

.dashboard {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 48px 0 32px;
}

.page-header,
.section-heading,
.card-topline,
.status-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-header {
    gap: 24px;
    margin-bottom: 30px;
}

.eyebrow {
    margin: 0 0 9px;
    color: #4777d4;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .15em;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
.card-number,
.status-count {
    font-family: 'Segoe UI', system-ui, sans-serif;
}

h1 {
    margin-bottom: 8px;
    font-size: clamp(25px, 3vw, 34px);
    font-weight: 800;
    letter-spacing: -.045em;
}

.page-description,
.section-heading p,
.card-note,
.status-description,
.page-footer {
    color: var(--muted);
}

.page-description {
    margin: 0;
    font-size: 14px;
}

.updated-date {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #69778b;
    font-size: 12px;
    white-space: nowrap;
}

.live-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28b879;
    box-shadow: 0 0 0 4px rgba(40, 184, 121, .12);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.summary-card,
.panel {
    border: 1px solid rgba(229, 234, 242, .9);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(34, 57, 90, .035);
}

.summary-card {
    min-height: 158px;
    padding: 21px 23px;
}

.summary-card-primary {
    background: linear-gradient(135deg, #fff 30%, #f7faff);
}

.card-label {
    color: #657287;
    font-size: 13px;
    font-weight: 600;
}

.card-icon {
    display: grid;
    width: 33px;
    height: 33px;
    place-items: center;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 700;
}

.icon-blue {
    color: #3974dd;
    background: #eaf1ff;
}

.icon-green {
    color: #209766;
    background: #e8f8f0;
}

.icon-red {
    color: #d95d65;
    background: #fff0f0;
}

.card-number {
    margin: 12px 0 3px;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.04em;
}

.card-note {
    margin: 0;
    font-size: 12px;
}

.card-note strong {
    color: #209766;
}

.panel {
    margin-bottom: 22px;
    padding: 25px 27px;
}

.section-heading {
    gap: 18px;
    margin-bottom: 22px;
}

.section-heading h2 {
    margin-bottom: 5px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.025em;
}

.section-heading p {
    margin: 0;
    font-size: 12px;
}

.user-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin: -4px 0 18px;
    color: #657287;
    font-size: 12px;
}

.user-filter select,
.user-filter button {
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid #dfe5ee;
    border-radius: 7px;
    font: inherit;
}

.user-filter select {
    min-width: 190px;
    color: #39465a;
    background: #fff;
}

.user-filter button {
    border-color: #3974dd;
    color: #fff;
    background: #3974dd;
    font-weight: 700;
    cursor: pointer;
}

.section-total,
.period-badge {
    padding: 7px 11px;
    border: 1px solid #edf0f5;
    border-radius: 20px;
    color: #6c788a;
    background: #fafbfd;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 11px;
    overflow: hidden;
}

.status-item {
    min-width: 0;
    padding: 18px 17px 15px;
}

.status-item + .status-item {
    border-left: 1px solid var(--line);
}

.status-title-row {
    justify-content: flex-start;
    gap: 8px;
}

.status-title-row h3 {
    margin: 0;
    color: #39465a;
    font-size: 12px;
    font-weight: 700;
}

.status-dot,
.legend-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-green,
.bar-green {
    background: #35b883;
}

.dot-red,
.bar-red {
    background: #e9767b;
}

.dot-blue,
.bar-blue {
    background: #5887e8;
}

.dot-amber,
.bar-amber {
    background: #eab553;
}

.dot-gray,
.bar-gray {
    background: #aab4c2;
}

.status-description {
    min-height: 30px;
    margin: 9px 0 11px 16px;
    font-size: 11px;
    line-height: 1.45;
}

.status-count {
    margin: 0 0 3px 16px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.04em;
}

.status-green {
    color: #209766;
}

.status-red {
    color: #d85b62;
}

.status-blue {
    color: #4677d3;
}

.status-amber {
    color: #bd8622;
}

.status-gray {
    color: #7b8798;
}

.status-code {
    margin: 0 0 0 16px;
    color: #9aa4b2;
    font-size: 9px;
    letter-spacing: .035em;
}

.daily-panel {
    padding-bottom: 20px;
}

.daily-heading {
    margin-bottom: 12px;
}

.daily-list {
    border-top: 1px solid var(--line);
}

.daily-row {
    display: grid;
    grid-template-columns: 160px minmax(100px, 1fr) minmax(120px, 190px);
    align-items: center;
    gap: 24px;
    min-height: 43px;
    border-bottom: 1px solid #f0f2f6;
}

.daily-header {
    min-height: 36px;
    color: #98a2b1;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.daily-total-heading,
.daily-total {
    text-align: right;
}

.daily-date {
    display: flex;
    align-items: center;
    gap: 11px;
}

.daily-date strong {
    min-width: 38px;
    font-size: 12px;
}

.daily-date small {
    color: #95a0af;
    font-size: 10px;
}

.bar-track {
    display: block;
    width: 100%;
    height: 8px;
    border-radius: 8px;
    background: #f1f3f7;
}

.bar-fill {
    display: flex;
    height: 100%;
    min-width: 0;
    overflow: hidden;
    border-radius: inherit;
    transition: width .3s ease;
}

.bar-fill > span {
    height: 100%;
}

.bar-empty {
    width: 100%;
    background: #f1f3f7;
}

.daily-total {
    color: #39465a;
    font-size: 12px;
    text-align: right;
}

.daily-total strong,
.daily-total small,
.day-detail-link {
    display: block;
}

.daily-total small {
    margin-top: 3px;
    color: #7b8798;
    font-size: 10px;
    font-weight: 500;
}

.day-detail-link,
.back-link {
    color: #4677d3;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.day-detail-link {
    margin-top: 5px;
}

.day-detail-link:hover,
.back-link:hover {
    text-decoration: underline;
}

.back-link {
    display: inline-block;
    margin-bottom: 18px;
}

.amount-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.amount-card {
    padding: 17px 19px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcfe;
}

.amount-value {
    margin: 9px 0 3px;
    color: #209766;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -.035em;
}

.file-list {
    border-top: 1px solid var(--line);
}

.file-item {
    padding: 17px 0;
    border-bottom: 1px solid var(--line);
}

.file-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.file-heading h3 {
    margin-bottom: 4px;
    overflow-wrap: anywhere;
    color: #39465a;
    font-size: 13px;
}

.file-heading p,
.empty-state {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.file-status {
    padding: 5px 8px;
    border-radius: 12px;
    color: #52647c;
    background: #f1f4f8;
    font-size: 9px;
    font-weight: 700;
    white-space: nowrap;
}

.file-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 12px;
    color: #788497;
    font-size: 11px;
}

.file-metrics strong {
    color: #39465a;
}

.file-error-message {
    margin: 12px 0 0;
    padding: 10px 12px;
    border: 1px solid #f4d2d4;
    border-radius: 8px;
    color: #9f3d44;
    background: #fff7f7;
    font-size: 12px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 18px;
    color: var(--muted);
    font-size: 11px;
}

.pagination a {
    color: #4677d3;
    font-weight: 700;
    text-decoration: none;
}

.pagination-disabled {
    color: #b3bdca;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    padding-top: 17px;
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #788497;
    font-size: 10px;
}

.legend-dot {
    width: 7px;
    height: 7px;
}

.page-footer {
    padding: 0 2px;
    font-size: 11px;
}

@media (max-width: 800px) {
    .status-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .status-item:nth-child(4) {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .status-item:nth-child(5) {
        border-left: 1px solid var(--line);
        border-top: 1px solid var(--line);
    }
}

@media (max-width: 620px) {
    .dashboard {
        width: min(100% - 28px, 480px);
        padding-top: 28px;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 15px;
        margin-bottom: 22px;
    }

    .summary-grid {
        grid-template-columns: 1fr;
        gap: 11px;
    }

    .summary-card {
        min-height: 0;
        padding: 17px 19px;
    }

    .card-number {
        margin-top: 8px;
        font-size: 26px;
    }

    .panel {
        padding: 19px 16px;
    }

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

    .status-item + .status-item,
    .status-item:nth-child(3),
    .status-item:nth-child(4),
    .status-item:nth-child(5) {
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .status-description {
        min-height: 0;
    }

    .daily-row {
        grid-template-columns: 48px minmax(50px, 1fr) minmax(95px, 120px);
        gap: 8px;
    }

    .daily-date {
        display: block;
    }

    .daily-date small {
        display: none;
    }

    .daily-heading {
        align-items: flex-start;
    }

    .period-badge {
        padding: 6px 8px;
        font-size: 9px;
    }

    .amount-value {
        font-size: 22px;
    }

    .pagination {
        flex-wrap: wrap;
    }
}
