:root {
    color-scheme: light;
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-2: #eef3f6;
    --text: #14202b;
    --muted: #647383;
    --line: #d7e0e8;
    --call: #0f8b5f;
    --put: #c64d4d;
    --accent: #146c94;
    --warning: #a66a00;
    --shadow: 0 12px 34px rgba(20, 32, 43, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
    border-radius: 7px;
    background: var(--accent);
    color: white;
    cursor: pointer;
    font-weight: 800;
    min-height: 40px;
    padding: 0 16px;
}

button.secondary {
    background: var(--surface-2);
    color: var(--text);
}

.dashboard {
    width: min(1480px, calc(100% - 28px));
    margin: 0 auto;
    padding: 22px 0 34px;
}

.topbar,
.control-band,
.summary-grid,
.table-wrap,
.admin-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    border-radius: 8px;
    padding: 18px 20px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.08;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-weight: 700;
}

.status-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
    background: var(--warning);
}

.status-dot.ok {
    background: var(--call);
}

.status-dot.error {
    background: var(--put);
}

.status-dot.loading {
    background: var(--warning);
}

.control-band {
    margin-top: 14px;
    border-radius: 8px;
    padding: 14px;
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}

.updated-box {
    margin-left: auto;
    min-width: 260px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    display: grid;
    gap: 3px;
}

.updated-box span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.updated-box strong {
    font-size: 20px;
    line-height: 1;
}

.tabs {
    display: flex;
    gap: 8px;
}

.tab {
    background: var(--surface-2);
    color: var(--text);
    min-width: 110px;
}

.tab.active {
    background: var(--accent);
    color: #ffffff;
}

.expiry-control {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

select,
input,
textarea {
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #ffffff;
    color: var(--text);
    min-height: 40px;
    padding: 8px 10px;
}

textarea {
    resize: vertical;
    min-height: 130px;
}

.summary-grid {
    margin-top: 14px;
    border-radius: 8px;
    padding: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr 1.35fr 1.35fr;
    gap: 12px;
}

.metric {
    min-height: 104px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 13px;
    display: grid;
    align-content: start;
    gap: 5px;
}

.metric span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.metric strong {
    font-size: 28px;
    line-height: 1;
}

.metric small {
    color: var(--muted);
    font-weight: 700;
}

.best-card {
    background: #f8fbfc;
}

.signal-card {
    background: #f8fbfc;
}

.call-card {
    border-left: 4px solid var(--call);
}

.put-card {
    border-left: 4px solid var(--put);
}

.strike-list,
.signal-list {
    display: grid;
    gap: 6px;
    font-size: 14px;
    line-height: 1.22;
}

.strike-list b {
    display: block;
    font-size: 15px;
}

.signal-row {
    display: grid;
    grid-template-columns: minmax(88px, 1fr) auto auto;
    align-items: center;
    gap: 7px;
    border-bottom: 1px solid rgba(215, 224, 232, 0.8);
    padding-bottom: 6px;
}

.signal-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.signal-row strong {
    font-size: 15px;
}

.signal-row span {
    color: var(--text);
    font-size: 13px;
    text-transform: none;
}

.signal-row em {
    border-radius: 6px;
    background: #e9f0f4;
    color: var(--text);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
    padding: 3px 6px;
}

.signal-row small {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.signal-empty {
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

.table-wrap {
    margin-top: 14px;
    border-radius: 8px;
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1120px;
}

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

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #e9f0f4;
    color: #405161;
    font-size: 12px;
    text-transform: uppercase;
}

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

tbody tr:hover {
    background: #f8fbfc;
}

.atm-row {
    background: #fff9ec;
}

.pill {
    display: inline-flex;
    margin-left: 8px;
    border-radius: 999px;
    background: #ffe2a3;
    color: #6b4700;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 900;
}

.score {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 28px;
    border-radius: 7px;
    color: white;
    font-weight: 900;
}

.score.call {
    background: rgba(15, 139, 95, 0.72);
}

.score.put {
    background: rgba(198, 77, 77, 0.72);
}

.score.lead {
    outline: 2px solid #14202b;
}

.call-text,
.positive {
    color: var(--call);
}

.put-text,
.negative,
.error-text {
    color: var(--put);
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 34px;
}

.admin-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.admin-shell {
    width: min(820px, 100%);
}

.admin-panel {
    border-radius: 8px;
    padding: 22px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 20px;
}

.form-grid {
    display: grid;
    gap: 15px;
}

.form-grid label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.button-row {
    display: flex;
    justify-content: flex-end;
}

.logout-form {
    margin-top: 12px;
}

.notice {
    border-radius: 7px;
    padding: 11px 12px;
    margin-bottom: 14px;
    font-weight: 800;
}

.notice.success {
    background: #e8f7f0;
    color: var(--call);
}

.notice.error {
    background: #fdeeee;
    color: var(--put);
}

.notice.info {
    background: #edf6fb;
    color: var(--accent);
}

.muted {
    color: var(--muted);
    margin: 0;
}

@media (max-width: 820px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .updated-box {
        margin-left: 0;
        min-width: 220px;
    }

    .two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .dashboard {
        width: min(100% - 16px, 1480px);
        padding-top: 8px;
    }

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

    .control-band {
        align-items: stretch;
        flex-direction: column;
    }

    .updated-box {
        min-width: 0;
        width: 100%;
    }

    .tabs {
        width: 100%;
    }

    .tab {
        flex: 1;
        min-width: 0;
    }
}
