/* =========================================================
   NGSB ADMIN — SHARED DESIGN SYSTEM
   Matches the redesigned public website (redesigned.css)
   ========================================================= */

:root {
    color-scheme: dark;
    --bg: #07140e;
    --surface: #0c2218;
    --surface-2: #123a27;
    --ink: #f3f1e9;
    --muted: #b7c1b8;
    --green: #54a879;
    --green-btn: #286744;
    --green-btn-hover: #347d54;
    --line: rgba(195, 216, 199, .18);
    --nav-ink: #d3dbd3;
    --caption-bg: rgba(7, 20, 14, .92);
    --lightbox-bg: rgba(7, 20, 14, .94);
    --error: #e9a3a3;
    --radius: 14px;
    --radius-lg: 24px;
    --serif: "Cinzel", Georgia, serif;
    --sans: "DM Sans", "Segoe UI", sans-serif;
    --colored: #fff;
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #bfe0c9;
    --surface-2: #a6d1b4;
    --ink: #0e2216;
    --muted: #2c4a38;
    --green: #1f6f43;
    --green-btn: #2e8b57;
    --green-btn-hover: #267549;
    --line: rgba(20, 80, 48, .3);
    --nav-ink: #1f3d2b;
    --caption-bg: rgba(255, 255, 255, .94);
    --lightbox-bg: rgba(255, 255, 255, .96);
    --error: #b42318;
    --colored: #000;
}

* { box-sizing: border-box; margin: 0; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 84px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.65 var(--sans);
    overflow-x: hidden;
    min-height: 100dvh;
    transition: background .3s ease, color .3s ease;
}

img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

h1, h2, h3, h4 {
    font-family: var(--serif);
    font-weight: 600;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
h2 { font-size: clamp(1.7rem, 3.2vw, 2.7rem); }
h3 { font-size: 1.15rem; margin-bottom: .5rem; }
p { color: var(--muted); }

.eyebrow {
    color: var(--green);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.muted { color: var(--muted); }
.accent { color: var(--green); font-weight: 600; }
.center-text { text-align: center; }

/* shared surfaces */
.card, .panel, .notice {
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.panel {
    border-radius: var(--radius-lg);
    padding: 2rem;
}
.panel.center {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.notice {
    background: var(--surface-2);
    color: var(--ink);
    font-size: .92rem;
}

/* buttons */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 11px 24px;
    border: 1px solid var(--green);
    border-radius: var(--radius);
    background: var(--green-btn);
    color: var(--colored);
    font-weight: 700;
    text-align: center;
    transition: background .2s ease, transform .2s ease;
}
.button:hover {
    background: var(--green-btn-hover);
    transform: translateY(-2px);
}
.button.secondary {
    border-color: var(--line);
    background: var(--surface);
}
.button.secondary:hover {
    border-color: var(--green);
    background: var(--surface-2);
}

/* =========================================================
   TOPBAR
   ========================================================= */

#topbar-div-container {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}

#topbar-container,
#main-topbar-div,
#topbar-div {
    width: min(1320px, calc(100% - 24px));
    min-height: 72px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

#topbar-div {
    width: 100%;
    padding: 0;
}

#topbar-name-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    order: 0;
}

#topbar-logo {
    width: 44px;
    height: 44px;
    border: 1px solid var(--green);
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

#topbar-name-label {
    display: block;
    line-height: 1.3;
}
#topbar-name-label strong {
    display: block;
    font-family: var(--serif);
    font-size: .88rem;
    letter-spacing: .04em;
}
#topbar-name-label small {
    display: block;
    color: var(--muted);
    font-size: .66rem;
    letter-spacing: .13em;
}

#topbar-buttons-div {
    display: flex;
    align-items: center;
    gap: 4px;
    order: 1;
    margin-left: auto;
}

.topbar-buttons {
    padding: 8px 14px;
    border-radius: 10px;
    color: var(--nav-ink);
    background: transparent;
    border: none;
    font-size: .86rem;
    font-weight: 600;
    white-space: nowrap;
    transition: color .2s, background .2s;
}
.topbar-buttons:hover { color: var(--green); }
.topbar-buttons.active {
    color: var(--green);
    background: var(--surface);
}

#logout-button {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 16px;
    margin-left: 6px;
    border: 1px solid var(--error);
    border-radius: var(--radius);
    background: transparent;
    color: var(--error);
    font-size: .82rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background .2s, color .2s;
}
#logout-button:hover {
    background: var(--error);
    color: var(--bg);
}

#theme-toggle {
    order: 2;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: transparent;
    font-size: 1.15rem;
    transition: border-color .2s, color .2s;
}
#theme-toggle:hover {
    border-color: var(--green);
    color: var(--green);
}

#menu-toggle {
    order: 3;
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: transparent;
    font-size: 1.3rem;
}

@media (max-width: 900px) {
    #menu-toggle { display: block; }
    #theme-toggle { margin-left: auto; }

    #topbar-buttons-div {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 14px 16px 20px;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
    }
    #topbar-buttons-div.open { display: flex; }

    .topbar-buttons {
        padding: 12px 10px;
        font-size: 1rem;
        text-align: center;
    }
    #logout-button {
        justify-content: center;
        margin: 8px 0 0;
        min-height: 46px;
    }
}

/* =========================================================
   COVERALL TRANSITION OVERLAY
   ========================================================= */

#coverall-div {
    height: 100%;
    width: 100%;
    margin: 0;
    background-color: var(--bg);
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity .5s ease, visibility .5s ease;
    opacity: 0;
    visibility: hidden;
}
#coverall-div.show {
    opacity: 1;
    visibility: visible;
}
#coverall-logo-div {
    height: min(30vh, 55vw);
    width: min(30vh, 55vw);
    background-image: url("logo.png");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    border-radius: 12%;
    border: 2px solid var(--green);
    transition: transform .5s ease;
}

/* =========================================================
   SCROLLBAR
   ========================================================= */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--surface-2);
    border-radius: 8px;
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--green);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--surface-2) var(--bg);
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

@media (hover: none) {
    .button:hover { transform: none; }
}
