:root {
    --dark: #101928;
    --panel: #ffffff;
    --bg: #eef8f8;
    --text: #102a43;
    --muted: #64748b;
    --brand: #078c8c;
    --brand-blue: #0876d8;
    --border: #d8ebeb;
    --danger: #c2413b;
    --success: #10a66a;
    --shadow: 0 20px 60px rgba(16, 42, 67, 0.12);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(8, 118, 216, 0.12), transparent 30rem),
        var(--bg);
    color: var(--text);
}

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

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

.admin-sidebar {
    background: var(--dark);
    color: white;
    padding: 22px;
    position: sticky;
    top: 0;
    min-height: 100vh;
}

.admin-brand {
    display: grid;
    gap: 4px;
    margin-bottom: 28px;
}

.admin-brand span {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--brand), var(--brand-blue));
    font-weight: 950;
    font-size: 1.5rem;
}

.admin-brand strong {
    font-size: 1.45rem;
    letter-spacing: -0.05em;
}

.admin-brand small {
    color: rgba(255,255,255,0.6);
    font-weight: 800;
}

.admin-sidebar nav {
    display: grid;
    gap: 8px;
}

.admin-sidebar nav a {
    padding: 13px 14px;
    border-radius: 16px;
    color: rgba(255,255,255,0.76);
    font-weight: 850;
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.admin-main {
    padding: 28px;
    min-width: 0;
}

.page-head {
    margin-bottom: 20px;
}

.page-head p {
    margin: 0 0 8px;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 950;
    font-size: 0.78rem;
}

h1,
h2 {
    margin: 0;
    letter-spacing: -0.055em;
    line-height: 1;
}

h1 {
    font-size: clamp(2rem, 5vw, 4rem);
}

h2 {
    font-size: 1.7rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card,
.panel,
.login-card {
    background: rgba(255,255,255,0.94);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-card {
    padding: 22px;
    display: grid;
    gap: 8px;
}

.stat-card span {
    font-size: 2.4rem;
    font-weight: 950;
    color: var(--brand);
}

.stat-card strong {
    color: var(--text);
}

.panel {
    padding: 20px;
    margin-bottom: 20px;
}

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

.panel-head p {
    color: var(--muted);
    margin: 0 0 6px;
    font-weight: 800;
}

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

.flag-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    background: white;
}

.flag-row p {
    margin: 5px 0;
    color: var(--muted);
}

.toggle {
    border: 0;
    border-radius: 999px;
    padding: 11px 16px;
    min-width: 82px;
    cursor: pointer;
    font-weight: 950;
    background: #d7dee7;
    color: #334155;
}

.toggle.on {
    background: linear-gradient(135deg, var(--brand), var(--brand-blue));
    color: white;
}

.premium-pill {
    display: inline-flex;
    border-radius: 999px;
    padding: 6px 9px;
    background: rgba(224, 161, 0, 0.14);
    color: #8a6100;
    font-weight: 900;
    font-size: 0.78rem;
}

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

.table-link-grid a {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: white;
    font-weight: 900;
}

.table-link-grid small {
    color: var(--muted);
}

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

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

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
    font-size: 0.92rem;
}

th {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.small-link {
    color: var(--brand);
    font-weight: 950;
}

.pagination {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    color: var(--muted);
    font-weight: 850;
}

.edit-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 850;
}

label span {
    color: var(--muted);
    font-size: 0.84rem;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    font: inherit;
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(7, 140, 140, 0.12);
}

.locked-field {
    opacity: 0.62;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

button,
.secondary-button {
    min-height: 48px;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 950;
    cursor: pointer;
}

button {
    background: linear-gradient(135deg, var(--brand), var(--brand-blue));
    color: white;
}

.secondary-button {
    background: #eef2f7;
    color: var(--text);
    display: inline-flex;
    align-items: center;
}

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

.notice.success {
    background: rgba(16, 166, 106, 0.12);
    color: var(--success);
}

.notice.error {
    background: rgba(194, 65, 59, 0.12);
    color: var(--danger);
}

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

.login-card {
    width: min(460px, 100%);
    padding: 26px;
}

.login-brand {
    color: var(--text);
}

.form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

@media (max-width: 960px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
        min-height: auto;
    }

    .admin-sidebar nav {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-grid,
    .table-link-grid,
    .edit-form {
        grid-template-columns: 1fr;
    }

    .flag-row {
        display: grid;
    }
}
