:root {
    --ink: #181716;
    --muted: #6f6b65;
    --paper: #f5f3ef;
    --surface: #ffffff;
    --line: #e7e2da;
    --gold: #ad7f2b;
    --gold-dark: #805b18;
    --gold-soft: #f5ead4;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { color: var(--ink); background: var(--paper); }
button, input, select, textarea { font: inherit; }
button, a { transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid rgba(173,127,43,.22);
    outline-offset: 2px;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(20,19,18,.96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(214,173,91,.65);
    color: #d7ad5a;
    font: 700 12px/1 Georgia, serif;
    letter-spacing: .08em;
    transform: rotate(45deg);
}
.brand-mark span { transform: rotate(-45deg); }
.admin-shell { max-width: 1480px; margin: 0 auto; }
.page-eyebrow { color: var(--gold-dark); letter-spacing: .16em; text-transform: uppercase; font-weight: 800; font-size: 11px; }
.admin-layout { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 26px; padding: 0 16px; }
.admin-sidebar {
    position: sticky; top: 91px; align-self: start; height: calc(100vh - 112px);
    display: flex; flex-direction: column; padding: 18px 12px;
    background: #1b1a18; color: white; border: 1px solid #302e2a; border-radius: 18px;
    box-shadow: 0 18px 45px rgba(26,22,17,.12);
}
.sidebar-heading { padding: 4px 12px 14px; color: #88837a; font-size: 10px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.sidebar-nav { display: grid; gap: 5px; }
.sidebar-link { width: 100%; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 12px; color: #aaa69f; text-align: left; border-radius: 10px; font-size: 14px; font-weight: 700; }
.sidebar-link:hover { color: white; background: rgba(255,255,255,.055); }
.sidebar-link.active { color: white; background: linear-gradient(100deg,rgba(173,127,43,.34),rgba(173,127,43,.12)); box-shadow: inset 3px 0 var(--gold); }
.nav-icon { color: #c39a4a; font-size: 18px; text-align: center; }
.nav-badge { min-width: 22px; padding: 2px 6px; border-radius: 999px; background: #b78326; color: white; font-size: 10px; text-align: center; }
.sidebar-foot { margin-top: auto; display: flex; align-items: flex-start; gap: 9px; padding: 14px 10px 4px; border-top: 1px solid #302e2a; color: #bcb8b0; font-size: 11px; }
.sidebar-foot strong,.sidebar-foot small { display: block; }
.sidebar-foot small { color: #77736d; margin-top: 2px; line-height: 1.35; }
.status-dot { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 4px; background: #32a85d; border-radius: 50%; box-shadow: 0 0 0 4px rgba(50,168,93,.12); }
.admin-content { min-width: 0; }
.admin-section { display: none !important; animation: section-in .22s ease both; }
.admin-section.active { display: block !important; }
.admin-section.active#overview { display: grid !important; }
@keyframes section-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.menu-toggle { display: none; width: 40px; height: 40px; border: 1px solid #44413d; border-radius: 9px; color: white; font-size: 19px; }
.sidebar-backdrop { display: none; }
.admin-card { border-color: var(--line) !important; border-radius: 16px !important; box-shadow: 0 8px 30px rgba(32,27,20,.045) !important; }
.admin-card:hover { box-shadow: 0 12px 34px rgba(32,27,20,.075) !important; }
.stat-card { position: relative; overflow: hidden; min-height: 132px; }
.stat-card::after { content: ''; position: absolute; right: -26px; bottom: -32px; width: 92px; height: 92px; border: 18px solid var(--gold-soft); border-radius: 50%; }
.section-anchor { scroll-margin-top: 135px; }
.section-head { background: linear-gradient(180deg,#fff,#fdfcf9); }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #fcfaf6 !important; }
th { letter-spacing: .07em; }
.action-primary, .gold-bg { background: var(--gold) !important; }
.action-primary:hover, .gold-bg:hover { background: var(--gold-dark) !important; transform: translateY(-1px); }
.gold-text { color: var(--gold) !important; }
.gold-border { border-color: var(--gold) !important; }
.empty-state { padding: 40px 20px !important; color: #8a857e; }
.login-backdrop {
    background:
      radial-gradient(circle at 18% 18%, rgba(173,127,43,.18), transparent 30%),
      radial-gradient(circle at 88% 84%, rgba(173,127,43,.11), transparent 28%),
      #121110;
}
.login-panel { box-shadow: 0 28px 90px rgba(0,0,0,.48); }
.field-control { transition: border .18s ease, box-shadow .18s ease, background .18s ease; }
.field-control:focus { border-color: #c49338 !important; box-shadow: 0 0 0 4px rgba(173,127,43,.13); }
.form-help { color: #8a857e; font-size: 12px; margin-top: 6px; }

@media (max-width: 900px) {
    .admin-layout { display: block; padding: 0; }
    .menu-toggle { display: inline-grid; place-items: center; }
    .admin-topbar #adminName { display: none; }
    .admin-sidebar { position: fixed; z-index: 60; top: 0; left: 0; height: 100vh; width: min(82vw,290px); border-radius: 0 18px 18px 0; transform: translateX(-105%); transition: transform .24s ease; }
    .sidebar-open .admin-sidebar { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.52); backdrop-filter: blur(2px); }
    .sidebar-open .sidebar-backdrop { display: block; }
    .sidebar-open { overflow: hidden; }
}

@media (max-width: 700px) {
    .admin-topbar .admin-label { display: none; }
    .section-head { align-items: flex-start !important; gap: 14px; }
    .section-head button, .section-head a { flex: 0 0 auto; }
}
