:root {
    color-scheme: dark;
    --background: #160d12;
    --surface: #24151d;
    --surface-raised: #2e1b25;
    --border: #553044;
    --text: #f7eaf0;
    --muted: #c3a9b5;
    --pink: #f04c9b;
    --pink-dark: #c62773;
    --green: #83d8aa;
    font-family: "Jost", Tahoma, sans-serif;
}

* { box-sizing: border-box; }

body {
    min-width: 320px;
    margin: 0;
    background: var(--background);
    color: var(--text);
    line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.admin-shell { min-height: 100vh; }

.login-card {
    width: min(440px, calc(100% - 32px));
    margin: 8vh auto;
    padding: 38px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 24px 80px #0005;
}

.brand {
    color: #ff9dcc;
    font-family: "Bodoni Moda", Georgia, serif;
    font-size: 1.35rem;
    text-decoration: none;
}

.brand strong {
    display: block;
    font: 600 .65rem "Jost", sans-serif;
    letter-spacing: .35em;
}

h1, h2, h3, h4, p { margin-top: 0; }
.login-card h1, .topbar h1 { margin: 22px 0 8px; font: 500 2rem "Bodoni Moda", Georgia, serif; }
.login-card > p, .section-heading p, .faq-card p { color: var(--muted); }

label { display: block; margin: 14px 0 6px; font-weight: 500; }
input, select, textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #180f14;
    color: var(--text);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
    outline: 2px solid var(--pink);
    outline-offset: 2px;
}

.primary {
    padding: 11px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--pink-dark);
    color: white;
    font-weight: 600;
}
.primary:hover { background: var(--pink); }
.login-card .primary { width: 100%; margin-top: 22px; }
.status { min-height: 1.5em; margin: 12px 0 0; color: var(--green); }
.status.error { color: #ff9eaa; }
.notice {
    padding: 12px;
    border: 1px solid #8a6633;
    border-radius: 8px;
    background: #40301b;
    color: #ffe1a3 !important;
}

.dashboard { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1;
    display: flex;
    width: 250px;
    flex-direction: column;
    gap: 8px;
    padding: 26px 18px;
    border-right: 1px solid var(--border);
    background: #1c1117;
}
.sidebar-label, .eyebrow { margin: 0 0 7px; color: var(--pink); font-size: .73rem; font-weight: 600; letter-spacing: .12em; }
.sidebar-label { margin-top: 48px; color: var(--muted); }
.nav-button, .nav-link, .signout {
    display: block;
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    text-align: left;
    text-decoration: none;
}
.nav-button:hover, .nav-button.active { background: var(--surface-raised); color: white; }
.nav-link { margin-top: 8px; }
.nav-link:hover, .signout:hover { color: #ff9dcc; }
.signout { margin-top: auto; }

.workspace { max-width: 1500px; margin-left: 250px; padding: 30px clamp(20px, 4vw, 56px) 60px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.topbar h1 { margin: 0; font-size: 1.7rem; }
.secure-label { padding: 6px 12px; border: 1px solid #3c7958; border-radius: 999px; color: var(--green); font-size: .82rem; }
.dashboard-status { min-height: 1.5em; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 30px 0 20px; }
.section-heading h2 { margin: 0 0 4px; font: 500 1.8rem "Bodoni Moda", Georgia, serif; }
.section-heading p { margin: 0; }
.product-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .75fr); align-items: start; gap: 20px; }
.card { padding: 22px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); }
.card-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-heading h3, .card h3 { margin-bottom: 0; }
.card-heading p { margin: 4px 0 0; color: var(--muted); }
.text-button { border: 0; background: transparent; color: #ff9dcc; }
.product-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #48283a; }
.product-row img { width: 58px; height: 58px; border-radius: 8px; object-fit: cover; background: #160d12; }
.product-row h4 { margin: 0; font-size: .98rem; }
.product-row p { margin: 2px 0 0; color: var(--muted); font-size: .86rem; }
.product-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.small-button { padding: 6px 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-raised); color: var(--text); }
.small-button.danger { color: #ff9eaa; }
.small-button:hover { border-color: var(--pink); }
.product-form h3 { margin-bottom: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checkbox-label { display: flex; align-items: center; gap: 9px; margin: 16px 0; }
.checkbox-label input { width: auto; }
.product-form > .primary, .content-form > .primary, .faq-new > .primary { margin-top: 18px; }
.image-preview { width: 100px; height: 100px; margin-top: 10px; border-radius: 10px; object-fit: cover; }
.content-form { max-width: 850px; }
.content-form h3 { margin-bottom: 20px; }
.faq-card { max-width: 1000px; margin-top: 22px; }
.faq-card > .card-heading { margin-bottom: 6px; }
.faq-card .card-heading p { margin-bottom: 0; }
.faq-row { display: grid; grid-template-columns: 1fr 1.4fr auto; align-items: end; gap: 12px; padding: 14px 0; border-top: 1px solid #48283a; }
.faq-row label { margin-top: 0; }
.faq-row-actions { display: flex; gap: 6px; padding-bottom: 2px; }
.faq-new { max-width: 680px; padding-top: 20px; border-top: 1px solid var(--border); }
.faq-new h4 { margin: 0; }
.empty-state { padding: 22px 8px; color: var(--muted); text-align: center; }

@media (max-width: 980px) {
    .product-layout { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .sidebar { position: static; width: auto; min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; }
    .sidebar .brand { margin-right: auto; }
    .sidebar-label { display: none; }
    .nav-button, .nav-link, .signout { width: auto; margin: 0; padding: 8px 10px; }
    .workspace { margin-left: 0; padding: 22px 16px 42px; }
    .topbar { align-items: flex-start; }
    .secure-label { font-size: .7rem; }
    .section-heading { align-items: flex-start; }
    .product-row { grid-template-columns: 48px minmax(0, 1fr); }
    .product-row img { width: 48px; height: 48px; }
    .product-actions { grid-column: 2; justify-content: flex-start; }
    .faq-row { grid-template-columns: 1fr; }
    .faq-row-actions { padding: 0; }
}
