:root {
    --bg: #263674;
    --header: #182045;
    --btn: #1259cd;
    --btn-hover: #0e4cb3;
    --line: #d7dbe3;
    --text: #1c2434;
    --ok: #178a3a;
    --no: #c0392b;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: #fff;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

.page {
    width: min(1320px, calc(100% - 40px));
    margin: 0 auto;
    padding: 22px 0 20px;
}

.top {
    margin-bottom: 14px;
}

.title-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.title-side { justify-self: end; }

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.logo {
    width: 58px;
    height: 58px;
    flex: none;
    border-radius: 50%;
    object-fit: cover;
    background: #10182f;
}

.logo-login {
    display: block;
    width: 88px;
    height: 88px;
    margin: 0 auto 8px;
}

.top h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.title-side {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filters {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.field span {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.field input,
.field select,
.form-card input,
.form-card select {
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: #222;
    font: inherit;
    font-size: 14px;
    padding: 0 12px;
    outline: none;
}

.field input:focus,
.field select:focus,
.form-card input:focus,
.form-card select:focus {
    box-shadow: 0 0 0 3px rgba(18, 89, 205, 0.35);
}

.field input { width: 280px; }
.field select { width: 170px; }
.field.grow { flex: 1; min-width: 220px; }
.field.grow input,
.field.zone select { width: 100%; }
.field.zone { width: 200px; flex: none; }

.field input::placeholder { color: #9aa0aa; }

.news {
    margin: 0 0 14px;
    padding: 14px 16px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 4px solid #e74c3c;
    border-radius: 12px;
    background: #141c3d;
    box-shadow: 0 10px 28px rgba(8, 16, 48, 0.22);
}

.news-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.news-tag {
    flex: none;
    padding: 4px 8px;
    border-radius: 999px;
    background: #c0392b;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.news-top strong {
    flex: 1;
    font-size: 16px;
}

.news p {
    margin: 0 0 6px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    line-height: 1.5;
}

.news-deadline {
    color: #ffd56a;
    font-weight: 800;
}

.news-sign {
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    font-weight: 700;
}

.news-close {
    flex: none;
    height: 30px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.news-close:hover { background: rgba(255, 255, 255, 0.1); }

.table-wrap {
    max-height: calc(100vh - 220px);
    background: #fff;
    overflow: auto;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(8, 16, 48, 0.28);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    color: var(--text);
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--header);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-align: center;
    padding: 12px 14px;
    border-right: 1px solid #2c3a68;
    border-bottom: 1px solid #2c3a68;
    white-space: nowrap;
}

th:last-child { border-right: 0; }

td {
    padding: 11px 14px;
    text-align: center;
    font-size: 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

tbody tr:hover td { background: #eef3fb; }

.nowrap { white-space: nowrap; }

.empty td {
    padding: 10px;
    color: #2a3142;
    background: #fff;
}

.empty td:hover { background: #fff; }

.name {
    text-align: left;
    font-weight: 600;
}

.ispl { font-variant-numeric: tabular-nums; letter-spacing: 0.2px; }

.badge {
    display: inline-block;
    min-width: 128px;
    padding: 5px 10px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.badge.ok { background: var(--ok); }
.badge.no { background: var(--no); }

.result-count {
    margin: 0;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 13px;
    font-weight: 600;
}

.pager {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.pages {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 760px;
}

.page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 32px;
    padding: 0 8px;
    border-radius: 3px;
    background: #1b2d6e;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

a.page-num:hover { background: var(--btn-hover); }

.page-num.on {
    background: #fff;
    color: #182045;
}

.btn,
button.btn {
    display: inline-block;
    min-width: 92px;
    padding: 7px 16px;
    border: 0;
    border-radius: 3px;
    background: var(--btn);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

a.btn:hover,
button.btn:hover { background: var(--btn-hover); }

.btn.off {
    opacity: 0.45;
    cursor: default;
}

.search-btn {
    height: 34px;
    min-width: 88px;
    padding: 0 16px;
}

.btn.ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.45);
}

.btn.danger { background: #c0392b; }
.btn.danger:hover { background: #a93226; }
.btn.small { min-width: 0; padding: 5px 10px; font-size: 13px; }

.row-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.admin-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.admin-bar h1 {
    margin: 0;
    font-size: 28px;
}

.admin-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0 0 14px;
    padding: 12px 12px 12px 16px;
    border: 1px solid #b7e4c7;
    border-left: 5px solid #178a3a;
    border-radius: 10px;
    background: #f3fbf6;
    color: #146c36;
    font-weight: 600;
    box-shadow: 0 10px 24px rgba(8, 16, 48, 0.16);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.flash.err {
    background: #fff6f5;
    color: #a12622;
    border-color: #f5c2c0;
    border-left-color: #c0392b;
}

.flash-close {
    flex: none;
    height: 32px;
    padding: 0 12px;
    border: 1px solid currentColor;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.flash-close:hover { background: rgba(0, 0, 0, 0.06); }

.flash-hide {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}

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

.form-card {
    width: min(460px, 100%);
    background: #fff;
    color: var(--text);
    padding: 28px 26px 24px;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.form-card.wide { width: min(560px, 100%); }

.form-card h1 {
    margin: 0 0 6px;
    color: #182045;
    font-size: 26px;
    text-align: center;
}

.form-card p.hint {
    margin: 0 0 18px;
    text-align: center;
    color: #5c6573;
    font-size: 14px;
}

.form-card label {
    display: block;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 700;
    color: #243049;
}

.form-card input,
.form-card select { width: 100%; margin-top: 6px; }

.form-card .actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.form-card a { color: #1259cd; font-weight: 600; }

.upload-card input[type="file"] {
    width: 100%;
    height: auto;
    margin-top: 6px;
    padding: 10px;
    border: 1px solid #d5dbe6;
    border-radius: 8px;
    background: #f7f9fc;
}

.choices {
    margin: 4px 0 16px;
    padding: 0;
    border: 0;
}

.choices legend {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #243049;
}

.choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
    padding: 12px;
    border: 1px solid #d5dbe6;
    border-radius: 8px;
    background: #f7f9fc;
    cursor: pointer;
}

.choice input { margin-top: 3px; }

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

.choice small {
    margin-top: 2px;
    color: #5c6573;
    font-size: 13px;
    font-weight: 500;
}

.login-card {
    width: min(400px, 100%);
    background: #fff;
    color: var(--text);
    padding: 32px 28px 22px;
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(8, 16, 48, 0.28);
}

.login-brand {
    margin: 0;
    text-align: center;
    color: #5c6b8a;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.login-card h1 {
    margin: 6px 0 22px;
    color: #182045;
    font-size: 26px;
    text-align: center;
}

.login-card label {
    display: block;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 700;
    color: #243049;
}

.login-card input {
    width: 100%;
    height: 42px;
    margin-top: 6px;
    border: 1px solid #d5dbe6;
    border-radius: 8px;
    background: #f7f9fc;
}

.login-card input:focus {
    background: #fff;
    border-color: #1259cd;
    box-shadow: 0 0 0 3px rgba(18, 89, 205, 0.2);
}

.login-error {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fdecea;
    color: #a12622;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.login-submit {
    width: 100%;
    height: 42px;
    margin-top: 4px;
    border-radius: 8px;
}

.login-back {
    display: block;
    margin-top: 16px;
    color: #1259cd;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}

.login-back:hover { text-decoration: underline; }

.foot {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.foot a {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
}

.setup {
    width: min(640px, calc(100% - 32px));
    margin: 40px auto;
    background: #fff;
    color: var(--text);
    padding: 28px;
    border-radius: 4px;
}

.setup h1 { margin-top: 0; color: #182045; }
.setup label { display: block; margin-bottom: 12px; font-weight: 700; }
.setup input { width: 100%; margin-top: 6px; height: 36px; padding: 0 10px; border: 1px solid #cfd5e0; }
.setup .actions { display: flex; gap: 10px; margin-top: 8px; }
.setup code { background: #eef2f8; padding: 1px 5px; }

.admin-body {
    background: var(--bg);
    color: #fff;
}

.admin-top {
    background: #182045;
    color: #fff;
}

.admin-top-inner,
.admin-main {
    width: min(1320px, calc(100% - 40px));
    margin-left: auto;
    margin-right: auto;
}

.admin-top-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
}

.admin-nav { justify-self: end; }

.admin-kicker {
    margin: 0;
    color: rgba(255, 255, 255, 0.68);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
}

.admin-top h1 {
    margin: 2px 0 0;
    font-size: 22px;
    font-weight: 700;
}

.admin-top .logo {
    width: 52px;
    height: 52px;
    justify-self: center;
}

.admin-top .brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #1259cd;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.nav-btn:hover { background: #0e4cb3; }

.nav-btn.ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.28);
}

.nav-btn.ghost:hover { background: rgba(255, 255, 255, 0.08); }

.nav-btn.on {
    background: #fff;
    color: #182045;
}

.admin-main { padding: 20px 0 32px; }

.panel {
    background: transparent;
}

.panel-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 16px 12px;
}

.admin-count {
    margin: 0 0 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.admin-body .filters { flex: 1; }

.admin-body .field input,
.admin-body .field select {
    border: 1px solid #d5dbe6;
    background: #f7f9fc;
}

.admin-body .table-wrap {
    max-height: calc(100vh - 210px);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(8, 16, 48, 0.28);
}

.admin-body tbody tr:nth-child(even) td { background: #f4f7fd; }
.admin-body tbody tr:hover td { background: #e7eefb; }

.admin-body .btn { border-radius: 8px; }

.admin-body .flash { border-radius: 10px; }

.form-panel {
    max-width: 760px;
    padding: 0 22px 18px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(8, 16, 48, 0.28);
    overflow: hidden;
}

.form-panel-head {
    margin: 0 -22px 18px;
    padding: 18px 22px 14px;
    background: var(--header);
    color: #fff;
}

.form-panel-head h2 {
    margin: 0;
    color: #fff;
    font-size: 22px;
}

.form-panel-head p {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}

.form-panel label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #243049;
}

.form-panel input:not([type="radio"]):not([type="file"]),
.form-panel select {
    width: 100%;
    height: 42px;
    margin-top: 6px;
    border: 1px solid #d5dbe6;
    border-radius: 8px;
    background: #f7f9fc;
    color: #1c2434;
    font: inherit;
    font-size: 14px;
    padding: 0 12px;
}

.form-panel input:not([type="radio"]):not([type="file"]):focus,
.form-panel select:focus {
    background: #fff;
    border-color: #1259cd;
    box-shadow: 0 0 0 3px rgba(18, 89, 205, 0.18);
    outline: none;
}

.form-panel .actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
}

.form-panel .actions a {
    color: #1259cd;
    font-weight: 600;
    text-decoration: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(12, 18, 48, 0.62);
}

.modal[hidden] { display: none; }

.modal-card {
    width: min(440px, 100%);
    background: #fff;
    color: #1c2434;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(8, 16, 48, 0.35);
    overflow: hidden;
}

.modal-head {
    padding: 18px 22px 16px;
    background: var(--header);
    color: #fff;
}

.modal-head h2 {
    margin: 0;
    font-size: 20px;
}

.modal-card p {
    margin: 0;
    padding: 18px 22px 8px;
    color: #3c4658;
    font-size: 15px;
    line-height: 1.45;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 22px 20px;
}

.modal-cancel,
.modal-ok {
    height: 38px;
    padding: 0 16px;
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.modal-cancel {
    border: 1px solid #d5dbe6;
    background: #f4f7fb;
    color: #182045;
}

.modal-cancel:hover { background: #e7edf6; }

.modal-ok { border: 0; }

.choice:has(input:checked) {
    border-color: #1259cd;
    background: #e8f0ff;
    box-shadow: inset 3px 0 0 #1259cd;
}

@media (max-width: 860px) {
    .logo { display: none; }
    .title-row {
        display: flex;
        justify-content: space-between;
    }
    .admin-top-inner,
    .panel-bar { flex-direction: column; align-items: flex-start; }
    .admin-top-inner { display: flex; }
    .admin-nav { justify-self: start; }
    .filters { flex-wrap: wrap; }
    .field.grow,
    .field.zone,
    .admin-body .field.zone { width: 100%; }
    .admin-bar { flex-direction: column; align-items: flex-start; }
    .form-grid { grid-template-columns: 1fr; }
    .admin-nav { width: 100%; }
}
