:root {
    --ink: #15283a;
    --muted: #647383;
    --line: #dce4ea;
    --surface: #ffffff;
    --background: #f3f6f8;
    --blue: #159bd3;
    --blue-dark: #087bb0;
    --cyan: #6cc5e6;
    --green: #2f9c78;
    --red: #d65b59;
    --amber: #d79b38;
    --shadow: 0 8px 28px rgba(24, 52, 74, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    color: var(--ink);
    background: var(--background);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    margin: 0;
    min-width: 320px;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.login-page {
    min-height: 100vh;
    background:
        linear-gradient(rgba(13, 39, 58, 0.48), rgba(13, 39, 58, 0.7)),
        url("https://skydive.ee/wp-content/uploads/2021/05/DSC5176_2048px.jpg") center / cover fixed;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(420px, 100%);
    padding: 38px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 24px 70px rgba(4, 25, 41, 0.25);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #fff;
    background: var(--blue);
    font-weight: 800;
    letter-spacing: 0;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--blue-dark);
    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
}

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

h1 {
    margin-bottom: 10px;
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.08;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 0;
    font-size: 20px;
    letter-spacing: 0;
}

.login-panel .brand-mark {
    margin-bottom: 24px;
}

.login-copy {
    color: var(--muted);
    line-height: 1.55;
}

.login-form {
    display: grid;
    gap: 10px;
    margin-top: 28px;
}

.login-form label {
    font-size: 13px;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #bdcbd5;
    border-radius: 4px;
    outline: none;
}

.login-form input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(21, 155, 211, 0.14);
}

.login-form button {
    min-height: 46px;
    margin-top: 6px;
    color: #fff;
    background: var(--blue-dark);
    border: 0;
    border-radius: 4px;
    font-weight: 750;
    cursor: pointer;
}

.form-error {
    margin: 0;
    color: var(--red);
    font-size: 13px;
}

.topbar {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding: 10px clamp(18px, 4vw, 48px);
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    text-decoration: none;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 15px;
}

.brand small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.updated-at {
    margin-right: 6px;
    color: var(--muted);
    font-size: 12px;
}

.icon-button {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: var(--ink);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: 20px;
    text-decoration: none;
    cursor: pointer;
}

.icon-button:hover {
    color: var(--blue-dark);
    border-color: #9bcde2;
}

.icon-button.is-loading span {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.dashboard-shell {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 38px clamp(18px, 4vw, 48px) 48px;
}

.page-heading,
.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.page-heading {
    margin-bottom: 24px;
}

.period-label {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 13px;
}

.notice {
    margin-bottom: 18px;
    padding: 12px 14px;
    color: #694816;
    background: #fff5df;
    border-left: 3px solid var(--amber);
    font-size: 13px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.kpi {
    min-width: 0;
    padding: 20px;
    background: var(--surface);
    border-top: 3px solid var(--line);
    box-shadow: var(--shadow);
}

.kpi.is-blue {
    border-top-color: var(--blue);
}

.kpi.is-green {
    border-top-color: var(--green);
}

.kpi-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.kpi-value {
    display: block;
    margin: 10px 0 6px;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    line-height: 1;
}

.kpi-detail {
    min-height: 34px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.delta-positive {
    color: var(--green);
    font-weight: 750;
}

.delta-negative {
    color: var(--red);
    font-weight: 750;
}

.content-band {
    padding: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.content-band + .content-band,
.split-grid,
.split-grid + .content-band {
    margin-top: 20px;
}

.year-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
}

.legend-dot {
    width: 9px;
    height: 9px;
    background: var(--legend-color);
}

.monthly-chart {
    min-height: 280px;
    margin-top: 24px;
    overflow-x: auto;
}

.chart-inner {
    display: grid;
    grid-template-columns: repeat(var(--month-count), minmax(84px, 1fr));
    align-items: end;
    min-width: 650px;
    height: 260px;
    padding-top: 20px;
    border-bottom: 1px solid var(--line);
}

.month-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    gap: 5px;
    height: 100%;
    padding: 0 8px;
    border-left: 1px solid #eef2f5;
}

.bar {
    position: relative;
    min-height: 2px;
    height: var(--bar-height);
    background: var(--bar-color);
    transition: height 0.35s ease;
}

.bar:hover::after {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 7px);
    transform: translateX(-50%);
    padding: 5px 7px;
    color: #fff;
    background: var(--ink);
    border-radius: 3px;
    content: attr(data-label);
    font-size: 11px;
    white-space: nowrap;
}

.month-label {
    grid-column: 1 / -1;
    align-self: end;
    margin: 8px -8px -27px;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.split-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 20px;
}

.split-grid .content-band {
    margin-top: 0;
}

.table-scroll {
    margin-top: 18px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    text-align: right;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
}

th:first-child,
td:first-child {
    padding-left: 0;
    text-align: left;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr.is-current {
    color: var(--blue-dark);
    font-weight: 750;
}

.source-list {
    display: grid;
    gap: 13px;
    margin-top: 20px;
}

.source-row {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) minmax(90px, 2fr) auto;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.source-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress {
    height: 7px;
    background: #edf2f5;
}

.progress span {
    display: block;
    height: 100%;
    width: var(--progress-width);
    background: var(--blue);
}

.source-count {
    font-variant-numeric: tabular-nums;
    font-weight: 750;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.status-item {
    padding: 14px;
    background: #f7f9fa;
    border-left: 3px solid var(--line);
}

.status-item strong,
.status-item span {
    display: block;
}

.status-item strong {
    font-size: 22px;
}

.status-item span {
    margin-top: 4px;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 11px;
}

footer {
    padding: 24px 2px 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
}

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

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

@media (max-width: 680px) {
    .updated-at {
        display: none;
    }

    .dashboard-shell {
        padding-top: 26px;
    }

    .page-heading,
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .page-heading h1 {
        font-size: 31px;
    }

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

    .kpi {
        padding: 16px;
    }

    .content-band {
        padding: 18px;
    }
}

@media (max-width: 420px) {
    .login-panel {
        padding: 28px 22px;
    }

    .brand strong {
        font-size: 13px;
    }

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

    .kpi-detail {
        min-height: 0;
    }
}

