@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Cormorant+Garamond:wght@500;600;700&family=Barlow+Condensed:wght@400;600;700;800;900&family=Source+Sans+3:wght@400;600;700&display=swap');

:root {
    --navy-deep: #080f22;
    --navy-dark: #0d1730;
    --navy-mid: #102044;
    --navy-card: #132558;
    --gold: #c9a027;
    --gold-soft: #e0bc5e;
    --gold-bright: #f5d778;
    --white: #ffffff;
    --white-warm: #f2eddf;
    --white-soft: #c8d0e0;
    --line: rgba(201, 160, 39, 0.32);
    --line-bright: rgba(201, 160, 39, 0.65);
    --ok: #2f7e55;
    --error: #8f2f2a;
    --shadow-sm: 0 4px 18px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.6);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Source Sans 3", sans-serif;
    color: var(--white);
    background:
        radial-gradient(ellipse 80% 50% at 10% -10%, rgba(19, 37, 88, 0.9), transparent 55%),
        radial-gradient(ellipse 60% 40% at 90% 5%, rgba(201, 160, 39, 0.06), transparent 45%),
        linear-gradient(175deg, #0a1228 0%, #080f22 50%, #060b18 100%);
}

a {
    color: var(--gold-soft);
    text-decoration: none;
}

a:hover,
a:focus-visible {
    color: var(--gold-bright);
    text-decoration: underline;
}

.topbar {
    width: min(1220px, 94vw);
    margin: 1rem auto 0.9rem;
    padding: 0.95rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(155deg, var(--navy-card), var(--navy-mid));
    box-shadow: var(--shadow-md);
    display: grid;
    gap: 0.7rem;
}

.topbar-main h1 {
    margin: 0;
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    font-size: clamp(1.25rem, 2.4vw, 1.65rem);
}

.topbar-main p {
    margin: 0.25rem 0 0;
    color: var(--white-soft);
}

.admin-menu,
.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.admin-menu a,
.admin-actions a {
    border: 1px solid var(--line);
    background: rgba(201, 160, 39, 0.08);
    border-radius: 999px;
    padding: 0.36rem 0.8rem;
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--white-warm);
}

.admin-menu a.is-active {
    color: #0d1730;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold));
    border-color: var(--gold);
}

.admin-menu a:hover,
.admin-actions a:hover {
    text-decoration: none;
    border-color: var(--line-bright);
    background: rgba(201, 160, 39, 0.2);
}

.admin-shell {
    width: min(1220px, 94vw);
    margin: 0 auto 2rem;
    display: grid;
    gap: 1rem;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
}

.cards article {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(19, 37, 88, 0.55);
    padding: 0.8rem;
    box-shadow: var(--shadow-sm);
}

.cards h2 {
    margin: 0;
    font-family: "Cinzel", serif;
    font-size: 1.4rem;
    color: var(--gold-bright);
}

.cards p {
    margin: 0.22rem 0 0;
    color: var(--white-soft);
}

.panel {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(155deg, var(--navy-card), var(--navy-mid));
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.panel h3 {
    margin: 0.1rem 0 0.9rem;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--gold-soft);
}

.split-cards {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.8rem;
    align-items: start;
}

.panel-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(8, 15, 34, 0.5);
    padding: 0.8rem;
}

.panel-card h4 {
    margin: 0 0 0.65rem;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--gold-soft);
}

.panel-card .table-wrap {
    margin-top: 0.5rem;
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    align-items: start;
}

.grid-form label,
.slots-form label {
    display: grid;
    gap: 0.35rem;
    font-size: 0.94rem;
    color: var(--white-soft);
}

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

input,
select,
textarea,
button {
    font: inherit;
}

input:not([type="checkbox"]),
select,
textarea {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(8, 15, 34, 0.82);
    color: var(--white);
    padding: 0.54rem 0.6rem;
}

input:not([type="checkbox"]):focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(224, 188, 94, 0.35);
    border-color: var(--line-bright);
}

input[type="checkbox"] {
    width: auto;
}

.check-field {
    display: flex !important;
    align-items: center;
    gap: 0.55rem !important;
    min-height: 2.05rem;
    color: var(--white-warm) !important;
    font-weight: 600;
    cursor: pointer;
}

.check-field input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.08rem;
    height: 1.08rem;
    margin: 0;
    border: 1px solid var(--line-bright);
    border-radius: 0.28rem;
    background: rgba(8, 15, 34, 0.9);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    display: inline-grid;
    place-content: center;
    flex: 0 0 1.08rem;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.check-field input[type="checkbox"]::after {
    content: "";
    width: 0.34rem;
    height: 0.6rem;
    border-right: 2px solid #0d1730;
    border-bottom: 2px solid #0d1730;
    transform: rotate(45deg) scale(0);
    transform-origin: center;
    transition: transform 0.16s ease-in-out;
}

.check-field input[type="checkbox"]:checked {
    border-color: var(--gold);
    background: linear-gradient(145deg, var(--gold-bright), var(--gold));
    box-shadow: 0 0 0 3px rgba(201, 160, 39, 0.14);
}

.check-field input[type="checkbox"]:checked::after {
    transform: rotate(45deg) scale(1);
}

.check-field input[type="checkbox"]:focus-visible {
    outline: 2px solid rgba(224, 188, 94, 0.45);
    outline-offset: 2px;
}

button {
    border-radius: 10px;
    border: 1px solid var(--line-bright);
    background: linear-gradient(145deg, var(--gold-soft), var(--gold));
    color: #0d1730;
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 0.56rem 0.82rem;
    cursor: pointer;
}

button:hover {
    filter: brightness(1.08);
}

.slots-form {
    display: grid;
    gap: 0.7rem;
}

.slots-form fieldset {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.7rem;
    display: grid;
    gap: 0.55rem;
    background: rgba(8, 15, 34, 0.45);
}

.slots-form legend {
    color: var(--gold-soft);
    font-family: "Barlow Condensed", sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0 0.3rem;
}

.table-wrap {
    margin-top: 1rem;
    overflow-x: auto;
}

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

th,
td {
    border-bottom: 1px solid rgba(201, 160, 39, 0.18);
    padding: 0.6rem 0.45rem;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--gold-soft);
    font-family: "Barlow Condensed", sans-serif;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

td {
    color: var(--white-soft);
}

.muted {
    color: rgba(200, 208, 224, 0.65);
}

.actions {
    display: grid;
    gap: 0.34rem;
    grid-template-columns: 1fr;
}

.actions form {
    margin: 0;
}

.actions a,
.actions button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--line-bright);
    background: linear-gradient(145deg, var(--gold-soft), var(--gold));
    color: #0d1730;
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.78rem;
    line-height: 1;
    padding: 0.42rem 0.58rem;
    text-decoration: none;
}

.actions a:hover,
.actions a:focus-visible,
.actions button:hover {
    filter: brightness(1.08);
    color: #0d1730;
    text-decoration: none;
}

.actions a:focus-visible,
.actions button:focus-visible {
    outline: 2px solid rgba(224, 188, 94, 0.4);
    outline-offset: 2px;
}

.actions .btn-danger {
    border-color: rgba(173, 46, 52, 0.75);
    background: linear-gradient(145deg, #c34a4f, #922b30);
    color: #fff;
}

.actions .btn-danger:hover,
.actions .btn-danger:focus-visible {
    filter: brightness(1.04);
    color: #fff;
}

.preview {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.55rem;
    background: rgba(8, 15, 34, 0.45);
}

.preview p {
    margin: 0 0 0.4rem;
    color: var(--white-soft);
    font-size: 0.9rem;
}

.preview img {
    max-width: 220px;
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.alert {
    border-radius: 12px;
    border: 1px solid var(--line);
    padding: 0.62rem 0.75rem;
    background: rgba(8, 15, 34, 0.5);
}

.alert p {
    margin: 0.2rem 0;
}

.alert.success {
    background: rgba(47, 126, 85, 0.18);
    border-color: rgba(47, 126, 85, 0.55);
}

.alert.error {
    background: rgba(143, 47, 42, 0.2);
    border-color: rgba(143, 47, 42, 0.6);
}

.login-page {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.login-card {
    width: min(480px, 96vw);
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(155deg, var(--navy-card), var(--navy-mid));
    padding: 1.2rem;
    box-shadow: var(--shadow-md);
}

.login-card h1 {
    margin-top: 0;
    font-family: "Barlow Condensed", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.login-card p,
.login-card small {
    color: var(--white-soft);
}

.login-card form {
    display: grid;
    gap: 0.7rem;
}

.rich-editor {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(8, 15, 34, 0.82);
}

.rich-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.55rem;
    border-bottom: 1px solid var(--line);
    background: rgba(201, 160, 39, 0.1);
}

.rich-editor-btn {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(8, 15, 34, 0.75);
    color: var(--white);
    padding: 0.35rem 0.52rem;
    min-width: 2rem;
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 700;
}

.rich-editor-btn:hover {
    background: rgba(201, 160, 39, 0.2);
}

.rich-editor-surface {
    padding: 0.7rem;
    color: var(--white-soft);
    line-height: 1.5;
    outline: none;
}

.rich-editor-surface:empty:before {
    content: attr(data-placeholder);
    color: rgba(200, 208, 224, 0.6);
}

.rich-editor-surface p {
    margin: 0 0 0.6rem;
}

.rich-editor-surface ul,
.rich-editor-surface ol {
    margin: 0.5rem 0 0.7rem 1.2rem;
}

.rich-editor-surface blockquote {
    margin: 0.6rem 0;
    border-left: 3px solid var(--gold);
    padding-left: 0.6rem;
    color: var(--gold-soft);
}

code {
    font-family: Consolas, Monaco, monospace;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.1rem 0.3rem;
    color: var(--gold-soft);
}

@media (max-width: 980px) {
    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 680px) {
    .cards,
    .grid-form {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 0.85rem;
    }

    .admin-menu,
    .admin-actions {
        width: 100%;
    }
}
