:root {
    --bg: #f3f6fb;
    --ink: #172033;
    --muted: #657089;
    --panel: #ffffff;
    --line: #dde4ef;
    --accent: #f7c948;
    --accent-dark: #172033;
    --success: #147a4b;
    --error: #b42318;
    --radius: 8px;
    --shadow: 0 18px 48px rgba(21, 30, 48, 0.10);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 15% 5%, rgba(247, 201, 72, 0.18), transparent 26%),
        linear-gradient(135deg, #f8fbff, #eef3fb);
    letter-spacing: 0;
}

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

a {
    color: inherit;
}

.admin-login {
    min-height: 100vh;
}

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

.login-card {
    width: min(420px, 100%);
    display: grid;
    gap: 16px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow);
}

.login-mark {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    color: var(--accent-dark);
    font-size: 1.45rem;
    font-weight: 900;
    background: linear-gradient(135deg, #fff1a6, var(--accent), #73d6ca);
}

.login-card h1,
.login-card p {
    margin: 0;
}

.login-card p {
    color: var(--muted);
    line-height: 1.5;
}

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

label span {
    font-size: 0.92rem;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
    color: var(--ink);
    background: #fff;
    outline: none;
}

textarea {
    min-height: 96px;
    resize: vertical;
}

input[type="file"] {
    height: auto;
    padding: 10px;
}

input[type="range"] {
    padding: 0;
    accent-color: var(--accent-dark);
}

input:focus,
select:focus,
textarea:focus {
    border-color: #bca03f;
    box-shadow: 0 0 0 4px rgba(247, 201, 72, 0.20);
}

button,
.login-card button {
    min-height: 44px;
    border: 0;
    border-radius: var(--radius);
    padding: 0 18px;
    color: #101827;
    background: var(--accent);
    font-weight: 850;
    cursor: pointer;
}

button:hover,
.login-card button:hover {
    filter: brightness(0.98);
}

.public-link {
    color: var(--muted);
    text-align: center;
    text-decoration: none;
}

.public-link:hover {
    color: var(--ink);
}

.alert {
    padding: 13px 14px;
    border-radius: var(--radius);
    font-weight: 760;
}

.alert.success {
    color: var(--success);
    background: rgba(20, 122, 75, 0.10);
}

.alert.error {
    color: var(--error);
    background: rgba(180, 35, 24, 0.10);
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(18px);
}

.admin-kicker {
    display: block;
    margin-bottom: 4px;
    color: #9b7923;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.admin-topbar h1 {
    margin: 0;
    font-size: 1.35rem;
}

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

.admin-topbar a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    text-decoration: none;
    font-weight: 760;
}

.admin-shell {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 28px;
}

.settings-form {
    display: grid;
    gap: 18px;
}

.panel-section {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.section-heading h2,
.section-heading p {
    margin: 0;
}

.section-heading h2 {
    font-size: 1.15rem;
}

.section-heading p {
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.5;
}

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

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

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

.media-upload {
    display: grid;
    gap: 10px;
    align-content: start;
    font-weight: 750;
}

.preview-box {
    min-height: 150px;
    display: grid;
    place-items: center;
    border: 1px dashed #bbc6d8;
    border-radius: var(--radius);
    background:
        linear-gradient(45deg, rgba(23, 32, 51, 0.04) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(23, 32, 51, 0.04) 25%, transparent 25%),
        #fbfdff;
    background-size: 20px 20px;
}

.preview-box img {
    max-width: 90%;
    max-height: 124px;
    object-fit: contain;
}

.preview-box strong {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff1a6, var(--accent), #73d6ca);
}

.icon-preview {
    min-height: 150px;
}

.icon-preview img {
    width: 82px;
    height: 82px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-weight: 650;
}

.check-row input {
    width: auto;
    min-height: 0;
}

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

.background-item {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.background-item img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.background-item span {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    color: var(--muted);
    font-weight: 650;
}

.background-item input {
    width: auto;
    min-height: 0;
}

.save-bar {
    position: sticky;
    bottom: 0;
    z-index: 9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 -10px 34px rgba(21, 30, 48, 0.08);
    backdrop-filter: blur(18px);
}

.save-bar button {
    min-width: 180px;
}

@media (max-width: 900px) {
    .panel-section {
        grid-template-columns: 1fr;
    }

    .media-grid,
    .background-list {
        grid-column: auto;
    }
}

@media (max-width: 680px) {
    .admin-topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px;
    }

    .admin-shell {
        padding: 16px;
    }

    .panel-section {
        padding: 18px;
    }

    .field-grid,
    .media-grid,
    .background-list {
        grid-template-columns: 1fr;
    }

    .save-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .save-bar button {
        width: 100%;
    }
}
