:root {
    --navy: #0f2744;
    --navy-2: #16345c;
    --navy-deep: #0a1a2e;
    --gold: #c9a35a;
    --gold-soft: rgba(201, 163, 90, 0.14);
    --ink: #1a1a1a;
    --muted: #6b655c;
    --line: #e8e2d8;
    --bg: #f3efe8;
    --card: #fffcf7;
    --shadow: 0 10px 28px rgba(15, 39, 68, 0.08);
    --shadow-lg: 0 18px 40px rgba(15, 39, 68, 0.1);
    --radius: 18px;
    --radius-sm: 12px;
}

* { box-sizing: border-box; }
body.admin-body {
    margin: 0;
    font-family: Manrope, "Segoe UI", system-ui, sans-serif;
    background:
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(201, 163, 90, 0.08), transparent 55%),
        var(--bg);
    color: var(--ink);
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}
.admin-body:has(.admin-main.is-centered) {
    grid-template-columns: 1fr;
}
.admin-side {
    background:
        linear-gradient(180deg, rgba(201, 163, 90, 0.08), transparent 28%),
        linear-gradient(180deg, var(--navy-deep), var(--navy-2));
    color: #fff;
    padding: 26px 18px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    min-height: 100vh;
    border-right: 1px solid rgba(201, 163, 90, 0.12);
    box-shadow: 8px 0 32px rgba(8, 13, 24, 0.18);
}
.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    padding: 6px 8px;
}
.admin-brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,.35));
}
.admin-brand span {
    font-family: Cinzel, serif;
    letter-spacing: 0.06em;
    font-size: 0.95rem;
}
.admin-side nav { display: grid; gap: 8px; }
.admin-side nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,.78);
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 14px;
    transition: background .2s, color .2s, transform .15s;
}
.admin-side nav a i { font-size: 1.05rem; width: 1.2em; text-align: center; color: var(--gold); }
.admin-side nav a.is-active,
.admin-side nav a:hover {
    background: rgba(201,163,90,.18);
    color: #fff;
    transform: translateX(2px);
}
.admin-logout { margin-top: auto; }
.admin-logout button {
    width: 100%;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.04);
    color: #fff;
    padding: 12px 14px;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font: inherit;
    font-weight: 600;
}
.admin-logout button:hover { background: rgba(201,163,90,.16); }
.admin-main { padding: 32px 36px 56px; }
.admin-main.is-centered {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 0;
}
.admin-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 26px;
}
.admin-head h1 {
    margin: 0;
    font-family: Cinzel, serif;
    font-size: 1.85rem;
    color: var(--navy);
    letter-spacing: 0.02em;
}
.eyebrow {
    margin: 0 0 6px;
    color: var(--gold);
    font-size: .78rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.eyebrow a { color: inherit; text-decoration: none; }
.muted {
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}
.stat-section { margin-bottom: 22px; }
.stat-section-title {
    margin: 0 0 12px;
    font-size: 0.95rem;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 8px;
}
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.stat-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    box-shadow: var(--shadow);
}
.stat-card span:not(.stat-icon) {
    display: block;
    color: var(--muted);
    font-size: .8rem;
    margin-bottom: 4px;
    font-weight: 600;
}
.stat-card strong {
    font-size: 1.4rem;
    color: var(--navy);
    font-weight: 700;
    letter-spacing: -0.02em;
}
.stat-card small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.78rem;
}
.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(15, 39, 68, 0.08);
    color: var(--navy);
    flex-shrink: 0;
}
.stat-icon.gold {
    background: var(--gold-soft);
    color: #8a6a2c;
}
.stat-icon i { font-size: 1.1rem; line-height: 1; }
.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}
.panel h2, .panel-sub {
    margin: 0 0 16px;
    font-size: 1.02rem;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 8px;
}
.panel-sub { margin-top: 24px; font-size: 0.95rem; }
.split-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.table th {
    color: var(--muted);
    font-weight: 700;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    background: rgba(15, 39, 68, 0.03);
}
.table a, .link-action {
    color: var(--navy);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.link-action:hover { color: #8a6a2c; }
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge-paid { background: #e7f7ec; color: #1f7a3e; }
.badge-pending { background: #fff4df; color: #9a6b12; }
.badge-failed, .badge-cancelled { background: #fdeceb; color: #a12d24; }
.badge-refunded { background: #eceff5; color: #445; }
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.filters select {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 11px 14px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(15,39,68,.04);
}
.btn-line, .btn-gold {
    border: 0;
    border-radius: 12px;
    padding: 11px 16px;
    cursor: pointer;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-line {
    background: #fff;
    border: 1px solid var(--line);
    color: var(--navy);
    box-shadow: 0 4px 12px rgba(15,39,68,.04);
}
.btn-gold { background: var(--gold); color: #1a1408; width: 100%; }
.admin-head .btn-gold,
.admin-head .btn-line { width: auto; text-decoration: none; }

/* DataTables skin */
.dataTables_wrapper {
    margin-top: 4px;
}
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    color: var(--muted);
    font-size: 0.88rem;
    margin: 12px 0;
}
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 14px;
    margin-left: 8px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(15,39,68,.04);
}
.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 6px 10px;
    background: #fff;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 10px !important;
    border: 1px solid transparent !important;
    padding: 4px 10px !important;
    margin: 0 2px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--gold) !important;
    border-color: var(--gold) !important;
    color: #1a1408 !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(15,39,68,.06) !important;
    border-color: var(--line) !important;
    color: var(--navy) !important;
}
table.dataTable thead th { border-bottom: 1px solid var(--line) !important; }
table.dataTable.no-footer { border-bottom: 0 !important; }
table.dataTable tbody tr:hover { background: rgba(201,163,90,.06); }

.dl { display: grid; gap: 12px; margin: 0; }
.dl div {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 39, 68, 0.03);
}
.dl dt { color: var(--muted); margin: 0; font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.dl dd { margin: 0; }
.track-list { list-style: none; margin: 0; padding: 0; }
.track-list li {
    display: flex;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
    background: rgba(15, 39, 68, 0.04);
}
code { font-size: .82rem; word-break: break-all; }

/* —— Admin auth (split desktop / stacked mobile) —— */
body.admin-body.is-login {
    display: block;
    width: 100%;
    margin: 0;
    font-family: Manrope, "Segoe UI", system-ui, sans-serif;
    background: #0a1524;
    color: #efe8d6;
}
body.admin-body.is-login .admin-main,
body.admin-body.is-login .admin-main.is-login-main {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
    place-items: unset;
}
.auth {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
}
.auth-brand {
    position: relative;
    display: grid;
    place-items: center;
    padding: 48px 40px;
    overflow: hidden;
    background:
        radial-gradient(ellipse 80% 55% at 30% 20%, rgba(201, 163, 90, 0.2), transparent 55%),
        linear-gradient(160deg, #0c1a2e 0%, #122844 48%, #0a1524 100%);
}
.auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.28;
    background-image:
        linear-gradient(rgba(201, 163, 90, 0.09) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201, 163, 90, 0.09) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse 70% 70% at 40% 45%, #000 10%, transparent 72%);
    pointer-events: none;
}
.auth-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 320px;
    text-align: left;
}
.auth-crest {
    width: 72px;
    height: 72px;
    object-fit: contain;
    display: block;
    margin-bottom: 22px;
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.35));
}
.auth-mark {
    margin: 0 0 10px;
    font-family: Cinzel, serif;
    letter-spacing: 0.34em;
    font-size: 0.72rem;
    color: #c9a35a;
    font-weight: 600;
}
.auth-title {
    margin: 0 0 10px;
    font-family: Cinzel, serif;
    font-size: clamp(1.85rem, 2.6vw, 2.35rem);
    line-height: 1.15;
    color: #f5ecda;
    font-weight: 600;
}
.auth-tagline {
    margin: 0;
    color: rgba(239, 232, 214, 0.72);
    font-size: 0.95rem;
    line-height: 1.5;
}
.auth-form-pane {
    display: grid;
    place-items: center;
    padding: 40px 28px;
    background:
        radial-gradient(ellipse 70% 50% at 80% 0%, rgba(201, 163, 90, 0.08), transparent 50%),
        #f4f0e8;
    color: #15120e;
}
.auth-form-card {
    width: min(400px, 100%);
}
.auth-form-head {
    margin-bottom: 26px;
}
.auth-form-head h2 {
    margin: 0 0 6px;
    font-family: Cinzel, serif;
    font-size: 1.55rem;
    color: #0f2744;
    font-weight: 600;
}
.auth-form-head p {
    margin: 0;
    color: #6b655c;
    font-size: 0.9rem;
}
.auth-form {
    display: grid;
    gap: 16px;
}
.auth-field {
    display: grid;
    gap: 6px;
}
.auth-field label {
    font-size: 0.78rem;
    font-weight: 650;
    color: #4a433a;
    letter-spacing: 0.01em;
}
.auth-field input {
    width: 100%;
    height: 44px;
    border: 1px solid rgba(15, 39, 68, 0.14);
    border-radius: 10px;
    padding: 0 14px;
    background: #fff;
    color: #15120e;
    font: inherit;
    font-size: 16px; /* iOS: avoid auto-zoom */
    box-shadow: 0 1px 2px rgba(15, 39, 68, 0.04);
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
    appearance: none;
}
.auth-field input::placeholder {
    color: #a39b90;
    font-size: 0.875rem;
}
.auth-field input:focus {
    outline: none;
    border-color: rgba(201, 163, 90, 0.8);
    box-shadow: 0 0 0 3px rgba(201, 163, 90, 0.18);
}
.auth-password {
    position: relative;
}
.auth-password input {
    padding-right: 48px;
}
.auth-toggle {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #7a7368;
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.auth-toggle:hover,
.auth-toggle:focus-visible {
    color: #0f2744;
    background: rgba(15, 39, 68, 0.06);
    outline: none;
}
.auth-toggle svg[hidden] {
    display: none !important;
}
.auth-submit {
    margin-top: 6px;
    height: 48px;
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #d4b06a, #c9a35a 55%, #b8924a);
    color: #1a1408;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(154, 122, 42, 0.28);
    transition: transform .15s ease, box-shadow .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(154, 122, 42, 0.34);
}
.auth-back {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-top: 12px;
    color: #8a6a2c;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
}
.auth-back:hover { text-decoration: underline; }

/* Tablet + phone: stack — form first priority */
@media (max-width: 960px) {
    .auth {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    .auth-brand {
        min-height: 0;
        padding: 20px 20px 18px;
        place-items: start center;
    }
    .auth-brand-inner {
        width: 100%;
        max-width: none;
        display: grid;
        grid-template-columns: 48px 1fr;
        grid-template-areas:
            "crest mark"
            "crest title"
            "crest tag";
        column-gap: 14px;
        row-gap: 2px;
        align-items: center;
        text-align: left;
    }
    .auth-crest {
        grid-area: crest;
        width: 48px;
        height: 48px;
        margin: 0;
    }
    .auth-mark {
        grid-area: mark;
        margin: 0;
        font-size: 0.68rem;
    }
    .auth-title {
        grid-area: title;
        margin: 0;
        font-size: 1.25rem;
    }
    .auth-tagline {
        grid-area: tag;
        font-size: 0.8rem;
        line-height: 1.3;
    }
    .auth-form-pane {
        padding: 24px 20px max(28px, env(safe-area-inset-bottom));
        place-items: start center;
        align-content: start;
    }
    .auth-form-card {
        width: min(420px, 100%);
    }
    .auth-form-head {
        margin-bottom: 20px;
    }
    .auth-form-head h2 {
        font-size: 1.35rem;
    }
}

@media (max-width: 420px) {
    .auth-brand {
        padding: 16px 16px 14px;
    }
    .auth-form-pane {
        padding: 20px 16px max(24px, env(safe-area-inset-bottom));
    }
    .auth-brand-inner {
        grid-template-columns: 40px 1fr;
        column-gap: 12px;
    }
    .auth-crest {
        width: 40px;
        height: 40px;
    }
    .auth-title {
        font-size: 1.15rem;
    }
}
@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-grid.cols-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
    body.admin-body { grid-template-columns: 1fr; }
    .admin-side { min-height: auto; }
    .split-panels { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .stat-grid, .stat-grid.cols-3 { grid-template-columns: 1fr; }
    .admin-main { padding: 18px 14px 36px; }
}

/* News & Blog admin */
.admin-thumb {
    width: 56px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    background: #eee;
}
.admin-thumb.is-empty {
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    color: var(--muted);
}
.badge.is-live { background: #e7f7ec; color: #1f7a3e; }
.badge.is-draft { background: #fff4df; color: #9a6b12; }
.actions {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}
.inline-form { display: inline; margin: 0; }
.link-danger {
    border: 0;
    background: transparent;
    color: #a12d24;
    cursor: pointer;
    padding: 0;
}
.post-form-grid {
    display: grid;
    gap: 24px;
}
@media (min-width: 980px) {
    .post-form-grid { grid-template-columns: 1.5fr 0.7fr; align-items: start; }
}
.post-form label {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}
.post-form label span {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}
.post-form input[type="text"],
.post-form input[type="datetime-local"],
.post-form input[type="file"],
.post-form select,
.post-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    background: #fff;
}
.post-form textarea { resize: vertical; min-height: 120px; }
.post-form-side {
    padding: 18px;
    border-radius: 16px;
    background: #f8f4ec;
    border: 1px solid var(--line);
}
.cover-preview {
    margin: 0 0 14px;
}
.cover-preview img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 8px;
    display: block;
}
.check-inline {
    display: flex !important;
    align-items: center;
    gap: 8px;
    grid-template-columns: none !important;
    font-size: 0.88rem;
}
.form-errors {
    color: #a12d24;
    margin-bottom: 12px;
    font-size: 0.9rem;
}
.post-form-side .btn-gold,
.post-form-side .btn-line {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
    text-decoration: none;
}

.admin-head-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.admin-head-actions .btn-gold,
.admin-head-actions .btn-line {
    width: auto;
}
.member-admin-grid {
    display: grid;
    gap: 16px;
}
@media (min-width: 960px) {
    .member-admin-grid {
        grid-template-columns: 1.1fr 0.9fr;
        align-items: start;
    }
}
.detail-list {
    margin: 0;
    display: grid;
    gap: 12px;
}
.detail-list > div {
    display: grid;
    gap: 4px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}
.detail-list dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}
.detail-list dd {
    margin: 0;
    font-weight: 600;
}
.points-form {
    display: grid;
    gap: 12px;
    margin-top: 8px;
}
.points-form label {
    display: grid;
    gap: 6px;
}
.points-form input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    background: #fff;
}
.is-plus { color: #1f7a45; }
.is-minus { color: #b42318; }
.filters input[type="search"] {
    min-width: 220px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
}
