:root {
    --sky: #a9caff;
    --blue: #457ae5;
    --royal: #28348a;
    --navy: #0e1a47;
    --gold: #fabb33;
    --red: #d8103a;
    --ink: #07102b;
    --muted: #8ea0ca;
    --panel: rgba(255, 255, 255, 0.08);
    --panel-strong: rgba(255, 255, 255, 0.13);
    --line: rgba(255, 255, 255, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 0%, rgba(69, 122, 229, 0.34), transparent 36rem),
        linear-gradient(135deg, #07102b 0%, var(--navy) 46%, #111938 100%);
    color: #fff;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.login-body {
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 24px;
    width: min(1040px, 100%);
    align-items: stretch;
}

.login-brand,
.login-card,
.panel,
.stat-card,
.sidebar {
    border-radius: 28px;
    background: var(--panel);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(24px);
}

.login-brand {
    min-height: 520px;
    padding: 42px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background:
        linear-gradient(135deg, rgba(14, 26, 71, 0.42), rgba(40, 52, 138, 0.72)),
        radial-gradient(circle at 80% 20%, rgba(250, 187, 51, 0.28), transparent 18rem);
}

.brand-mark {
    width: 82px;
    height: 82px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    margin-bottom: auto;
    background: linear-gradient(160deg, var(--royal), var(--blue));
    color: #fff;
    font-size: 42px;
    font-weight: 900;
    box-shadow: inset 0 -6px 0 var(--gold);
}

.brand-mark.small {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    margin: 0;
    font-size: 25px;
}

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

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

h1 {
    margin-bottom: 10px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1;
}

h2 {
    margin-bottom: 16px;
    font-size: 24px;
}

.login-brand p:last-child {
    max-width: 540px;
    color: #d9e4ff;
    font-size: 18px;
    line-height: 1.55;
}

.login-card {
    padding: 34px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
}

label {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
    font-weight: 800;
}

.inline-check {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 10px;
}

.inline-check input {
    width: auto;
}

input {
    width: 100%;
    border: 0;
    border-radius: 18px;
    padding: 16px 18px;
    background: #eef3ff;
    color: var(--ink);
    font: inherit;
    outline: 2px solid transparent;
}

select {
    border: 0;
    border-radius: 18px;
    padding: 15px 18px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font: inherit;
    font-weight: 900;
    outline: 2px solid transparent;
}

select:focus {
    outline-color: var(--gold);
}

.sync-form {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

input:focus {
    outline-color: var(--blue);
}

button,
.ghost-button,
.small-button {
    border: 0;
    border-radius: 18px;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--gold), #ffd777);
    color: var(--navy);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.ghost-button {
    background: var(--panel-strong);
    color: #fff;
}

.small-button {
    padding: 10px 14px;
    border-radius: 13px;
}

.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.inline-delete-form {
    margin: 0;
}

.danger-icon-button {
    background: rgba(216, 16, 58, 0.14);
    color: var(--red);
}

.danger-icon-button:hover {
    background: rgba(216, 16, 58, 0.24);
}

.hint {
    margin: 16px 0 0;
    color: #5f6b86;
    font-size: 14px;
}

.alert {
    margin-bottom: 18px;
    border-radius: 16px;
    padding: 12px 14px;
    background: rgba(216, 16, 58, 0.12);
    color: var(--red);
    font-weight: 800;
}

.notice {
    margin-bottom: 16px;
    border-radius: 18px;
    padding: 14px 16px;
    font-weight: 800;
}

.notice.success {
    background: rgba(84, 209, 122, 0.16);
    color: #89efaa;
}

.notice.error {
    background: rgba(216, 16, 58, 0.18);
    color: #ff8aa3;
}

.table-wrap {
    overflow-x: auto;
}

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

.datatable-toolbar label {
    width: min(380px, 100%);
    margin: 0;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
}

.datatable-toolbar input {
    border-radius: 14px;
    padding: 11px 13px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.datatable-toolbar span {
    color: var(--muted);
    font-weight: 800;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

th.sortable {
    cursor: pointer;
    user-select: none;
}

th.sortable::after {
    content: "↕";
    margin-left: 6px;
    color: rgba(255,255,255,0.34);
}

th.sortable[data-sort-direction="asc"]::after {
    content: "↑";
    color: var(--gold);
}

th.sortable[data-sort-direction="desc"]::after {
    content: "↓";
    color: var(--gold);
}

.text-cell {
    max-width: 420px;
    white-space: normal;
    line-height: 1.4;
}

.icon-button {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    background: rgba(250, 187, 51, 0.18);
    color: var(--gold);
}

.reward-settings-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.reward-card {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.07);
}

.reward-card strong {
    font-size: 18px;
}

.reward-card label {
    margin: 0;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
}

.reward-card input {
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.reward-settings-form .actions-row {
    grid-column: 1 / -1;
}

.admin-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.admin-modal.is-open {
    display: flex;
}

.admin-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.64);
}

.admin-modal-card {
    position: relative;
    z-index: 1;
    width: min(980px, 100%);
    max-height: min(860px, calc(100vh - 48px));
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 22px;
    background: #0d1843;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
}

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

.admin-modal-head h2 {
    margin: 0;
}

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

.modal-form-grid .wide {
    grid-column: 1 / -1;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.admin-form-grid label {
    margin: 0;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
}

.admin-form-grid input,
.admin-form-grid select {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 11px 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.admin-form-grid .wide,
.admin-form-grid .actions-row {
    grid-column: 1 / -1;
}

.frame-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.frame-admin-card {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 14px;
    background: rgba(255,255,255,0.07);
}

.frame-admin-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 18px;
    background: rgba(0,0,0,0.22);
}

.frame-admin-card label {
    margin-bottom: 10px;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
}

.frame-admin-card input {
    border-radius: 12px;
    padding: 10px 11px;
    font-size: 13px;
}

.frame-admin-card button {
    width: 100%;
    padding: 11px 14px;
    border-radius: 14px;
}

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

.mini-grid label {
    margin-bottom: 0;
}

.frame-admin-card strong,
.frame-admin-card span {
    display: block;
}

.frame-admin-card span {
    margin-top: 4px;
    color: var(--gold);
    font-size: 13px;
    font-weight: 800;
}

.frame-admin-card p {
    margin: 8px 0 0;
    color: var(--muted);
}

.sidebar {
    position: fixed;
    inset: 18px auto 18px 18px;
    width: 260px;
    padding: 18px;
    display: flex;
    flex-direction: column;
}

.side-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 26px;
}

.side-brand strong,
.side-brand span {
    display: block;
}

.side-brand span {
    color: var(--muted);
    font-size: 13px;
}

nav {
    display: grid;
    gap: 8px;
}

nav a,
.logout {
    border-radius: 16px;
    padding: 13px 14px;
    color: #dce6ff;
    font-weight: 800;
}

nav a.active,
nav a:hover,
.logout:hover {
    background: rgba(250, 187, 51, 0.14);
    color: var(--gold);
}

.logout {
    margin-top: auto;
}

.app-shell {
    width: min(1180px, calc(100% - 320px));
    margin-left: 300px;
    padding: 30px 24px 48px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.topbar h1 {
    margin: 0;
    font-size: 38px;
}

.admin-pill {
    border-radius: 999px;
    padding: 12px 16px;
    background: var(--panel-strong);
    color: #dce6ff;
    font-weight: 800;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.stat-card {
    padding: 22px;
}

.stat-card span {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-weight: 800;
}

.stat-card strong {
    font-size: 36px;
}

.stat-card .compact-stat {
    font-size: 24px;
}

.stat-card.accent {
    background: linear-gradient(135deg, rgba(250, 187, 51, 0.88), rgba(255, 216, 119, 0.76));
    color: var(--navy);
}

.stat-card.accent span {
    color: rgba(14, 26, 71, 0.72);
}

.content-grid {
    display: grid;
    grid-template-columns: 1.35fr 0.8fr;
    gap: 16px;
}

.panel {
    padding: 22px;
}

.span-2 {
    grid-column: span 1;
}

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

.panel-head h2 {
    margin: 0;
}

.panel-head a {
    color: var(--gold);
    font-weight: 900;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.module-card {
    color: #fff;
    min-height: 156px;
    border-radius: 24px;
    padding: 18px;
    background: var(--panel-strong);
    transition: transform 0.18s ease, background 0.18s ease;
}

.module-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.18);
}

.module-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    margin-bottom: 14px;
    background: rgba(250, 187, 51, 0.18);
}

.module-card strong,
.module-card p {
    display: block;
}

.module-card p {
    margin: 8px 0 0;
    color: #c9d5f5;
    line-height: 1.45;
}

.list-stack {
    display: grid;
    gap: 12px;
}

.match-row {
    border-radius: 20px;
    padding: 16px;
    background: var(--panel-strong);
}

.match-row span,
.match-row small {
    display: block;
    color: var(--muted);
}

.match-row strong {
    display: block;
    margin: 8px 0;
}

.api-match-row {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    gap: 12px;
    align-items: center;
    border-radius: 22px;
    padding: 14px;
    background: var(--panel-strong);
}

.api-match-row img {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.9);
    padding: 6px;
}

.api-match-row span,
.api-match-row small {
    display: block;
    color: var(--muted);
}

.api-match-row strong {
    display: block;
    margin: 5px 0;
}

.season-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-height: 520px;
    overflow: auto;
    padding-right: 4px;
}

.season-list div {
    border-radius: 18px;
    padding: 14px;
    background: var(--panel-strong);
}

.season-list strong,
.season-list span {
    display: block;
}

.event-list {
    display: grid;
    gap: 10px;
    max-height: 620px;
    overflow: auto;
    padding-right: 4px;
}

.event-list div {
    border-radius: 18px;
    padding: 14px;
    background: var(--panel-strong);
}

.event-list span,
.event-list small {
    display: block;
    color: var(--muted);
}

.event-list strong {
    display: block;
    margin: 6px 0;
}

.season-list span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.mt-16 {
    margin-top: 16px;
}

.news-list {
    display: grid;
    gap: 14px;
}

.news-list article {
    display: grid;
    grid-template-columns: 138px 1fr;
    gap: 16px;
    align-items: center;
    border-radius: 22px;
    padding: 12px;
    background: var(--panel-strong);
}

.news-list img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 18px;
}

.news-list span {
    color: var(--gold);
    font-size: 12px;
    font-weight: 900;
}

.news-list strong {
    display: block;
    margin: 6px 0;
    font-size: 18px;
}

.news-list p {
    margin: 0;
    color: #c9d5f5;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    color: var(--gold);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.status {
    display: inline-flex;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 900;
}

.status.on {
    background: rgba(84, 209, 122, 0.15);
    color: #75e39b;
}

.status.off {
    background: rgba(255, 255, 255, 0.12);
    color: var(--muted);
}

.toolbar,
.actions-row,
.card-head {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.admin-card {
    display: grid;
    gap: 12px;
    border-radius: 24px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
}

.admin-card h3,
.admin-card p {
    margin: 0;
}

.admin-card p {
    color: var(--muted);
}

.card-head {
    justify-content: space-between;
}

.answers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.answers-list span {
    border-radius: 999px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.answers-list span.correct {
    background: rgba(250, 187, 51, 0.18);
    color: var(--gold);
}

.quiz-admin-form {
    display: grid;
    gap: 10px;
}

.quiz-create-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.quiz-admin-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.quiz-create-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.quiz-create-form .wide {
    grid-column: 1 / -1;
}

.quiz-admin-form input,
.quiz-admin-form select,
.quiz-admin-form textarea,
.quiz-create-form input,
.quiz-create-form select,
.quiz-create-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.quiz-admin-form textarea,
.quiz-create-form textarea {
    resize: vertical;
    min-height: 96px;
}

.cron-command-list {
    display: grid;
    gap: 14px;
}

.cron-command-list.compact {
    gap: 10px;
}

.cron-command-list div {
    display: grid;
    gap: 8px;
}

.cron-command-list span,
.muted-copy {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.cron-command-list code,
.table-wrap code {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.22);
    color: var(--gold);
    white-space: nowrap;
}

@media (max-width: 980px) {
    .login-shell,
    .content-grid,
    .stats-grid,
    .module-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        width: auto;
        margin: 14px;
    }

    .app-shell {
        width: 100%;
        margin: 0;
        padding-top: 0;
    }
}
