:root {
    --bg: #f3f5f8;
    --panel: #ffffff;
    --line: #d7dee8;
    --line-strong: #b7c2d3;
    --text: #162433;
    --muted: #5f6e81;
    --accent: #0b67d1;
    --accent-soft: #e8f2ff;
    --good: #12774b;
    --warn: #9c5e0f;
    --bad: #b1251a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: linear-gradient(180deg, #f8fafd 0%, var(--bg) 100%);
    color: var(--text);
    font-family: "Segoe UI", "Inter", ui-sans-serif, system-ui, sans-serif;
    font-size: 15px;
}

button,
input,
select {
    font: inherit;
}

.shell {
    width: min(1540px, calc(100% - 28px));
    margin: 0 auto;
    padding: 20px 0 34px;
}

.topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}

h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.1;
}

h2 {
    margin: 0 0 10px;
    font-size: 17px;
}

p {
    margin: 6px 0 0;
    color: var(--muted);
}

.summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.intro {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    padding: 12px;
    margin-bottom: 12px;
}

.intro .tagline {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
}

.intro p {
    margin: 0 0 8px;
}

.intro ol {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
}

.subscriptionPanel {
    display: grid;
    grid-template-columns: minmax(260px, 360px) auto 1fr;
    align-items: end;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    padding: 13px;
    margin-bottom: 12px;
}

.subscriptionPanel p {
    align-self: center;
    margin-top: 0;
}

.subscriptionPanel label {
    display: grid;
    gap: 6px;
}

.subscriptionPanel label span {
    color: var(--muted);
    font-size: 12px;
}

.subscriptionPanel small {
    color: var(--muted);
    font-size: 12px;
}

input,
select,
button {
    min-height: 38px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: var(--panel);
    color: var(--text);
}

input,
select {
    width: 100%;
    padding: 0 10px;
}

button {
    padding: 0 12px;
    cursor: pointer;
}

button:hover {
    border-color: var(--accent);
}

button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.workspace {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    margin-bottom: 12px;
}

.filters {
    position: sticky;
    top: 10px;
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    padding: 12px;
}

.filters label {
    display: grid;
    gap: 6px;
}

.filters label span,
.filters .fieldTitle,
.filters small {
    color: var(--muted);
    font-size: 12px;
}

.districtField {
    display: grid;
    gap: 7px;
    padding-top: 2px;
}

.districtChips {
    display: grid;
    gap: 4px;
    max-height: 260px;
    overflow: auto;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.districtOption {
    display: grid;
    grid-template-columns: 18px 1fr;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
}

.districtOption:hover {
    background: #eef4ff;
}

.districtOption input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

.districtOption span {
    color: #234163;
    font-size: 14px;
}

.districtActions,
.selectionActions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.actionGroup {
    border-top: 1px solid var(--line);
    padding-top: 8px;
}

.selectionActions {
    grid-template-columns: 1fr;
    gap: 7px;
}

.selectionButtons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.subscriptions {
    margin-bottom: 12px;
}

.subscriptionList {
    display: grid;
    gap: 8px;
}

.subscriptionItem {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 10px 12px;
}

.subscriptionEmail {
    font-weight: 650;
}

.subscriptionMeta {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

.danger {
    border-color: #efbab6;
    color: var(--bad);
}

.tableWrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
}

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

th,
td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

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

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

tbody tr.available {
    background: #f1fbf6;
}

tbody tr.error {
    background: #fff8ef;
}

.notifyCol {
    width: 74px;
}

.notifyCell {
    text-align: center;
}

.notifyCell input {
    width: 20px;
    height: 20px;
    min-height: 20px;
}

.stationName {
    font-weight: 650;
}

.stationMeta {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

.date {
    font-weight: 700;
}

.empty {
    color: var(--muted);
}

.times,
.dates {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 430px;
}

.times span,
.dates span {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    border-radius: 5px;
    padding: 3px 8px;
    background: var(--accent-soft);
    color: #174d8f;
}

.rowCheckButton {
    min-height: 30px;
    padding: 0 10px;
    font-size: 13px;
}

.statusOk {
    color: var(--good);
    font-weight: 650;
}

.statusWait {
    color: var(--muted);
}

.statusError {
    color: var(--warn);
    font-weight: 650;
}

.emptyRow {
    text-align: center;
    color: var(--muted);
    padding: 18px 12px;
}

.disclaimer {
    margin-top: 12px;
    padding: 0;
}

.disclaimer p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 1120px) {
    .workspace {
        grid-template-columns: 1fr;
    }

    .filters {
        position: static;
    }
}

@media (max-width: 900px) {
    .shell {
        width: min(100% - 16px, 1540px);
        padding-top: 12px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .summary {
        justify-content: flex-start;
    }

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

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