:root {
    color-scheme: light;
    --navy: #12243a;
    --green: #087f5b;
    --green-dark: #066548;
    --ink: #1e2b3b;
    --muted: #5d6b7a;
    --line: #e1e8ed;
    --surface: #fff;
    --canvas: #f3f6f5;
    --shadow: 0 12px 34px rgb(18 36 58 / 7%);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: var(--canvas);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.6;
}

a {
    color: var(--green);
    text-underline-offset: .18em;
}

a:hover {
    color: var(--green-dark);
}

:focus-visible {
    outline: 3px solid #63c99d;
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    z-index: 1100;
    top: .5rem;
    left: .5rem;
    padding: .7rem 1rem;
    transform: translateY(-150%);
    border-radius: .65rem;
    background: var(--surface);
    color: var(--navy);
    box-shadow: var(--shadow);
}

.skip-link:focus {
    transform: translateY(0);
}

.topbar {
    background: var(--navy);
    box-shadow: 0 5px 24px rgb(18 36 58 / 12%);
}

.navbar-brand {
    letter-spacing: .035em;
}

.brand-logo {
    max-width: 180px;
    max-height: 40px;
    object-fit: contain;
}

.topbar .nav-link {
    color: rgb(255 255 255 / 82%);
}

.topbar .nav-link:hover,
.topbar .nav-link:focus-visible {
    color: #fff;
}

.topbar .dropdown-toggle {
    text-decoration: none;
}

.dropdown-menu {
    border: 1px solid var(--line);
    border-radius: .8rem;
    box-shadow: var(--shadow);
}

.dropdown-item:active {
    background: var(--green);
}

.hero {
    min-height: 340px;
    border: 1px solid #dce8e2;
    background:
        radial-gradient(ellipse at 90% 10%, rgb(8 127 91 / 10%), transparent 32%),
        linear-gradient(120deg, #fff 0%, #edf7f1 100%);
}

.eyebrow {
    color: var(--green);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .15em;
}

.green {
    color: var(--green);
}

.hero-card,
.panel,
.auth-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.hero-card,
.panel {
    padding: 24px;
}

.panel {
    transition: box-shadow .18s ease, transform .18s ease;
}

.panel:hover {
    box-shadow: 0 16px 38px rgb(18 36 58 / 10%);
}

.metric {
    margin: .25rem 0;
    color: var(--navy);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1.2;
}

.section-title {
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -.04em;
}

.panel h5 {
    font-weight: 750;
}

.form-control,
.form-select {
    min-height: 2.8rem;
    border-color: #d3dde5;
    border-radius: 10px;
    padding: .65rem .85rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #3ba97b;
    box-shadow: 0 0 0 .2rem rgb(8 127 91 / 16%);
}

.btn {
    border-radius: 10px;
    font-weight: 650;
}

.btn-success {
    border-color: var(--green);
    background: var(--green);
}

.btn-success:hover,
.btn-success:focus {
    border-color: var(--green-dark);
    background: var(--green-dark);
}

.auth-card {
    max-width: 520px;
    margin: 20px auto;
    padding: 28px;
}

.editor {
    min-height: 440px;
    resize: vertical;
    line-height: 1.8;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.preserve {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.reference {
    max-height: 320px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f5f8fa;
    padding: 12px;
}

.footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .9rem;
}

.footer a {
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #19a875;
    box-shadow: 0 0 0 5px rgb(25 168 117 / 12%);
}

.table {
    --bs-table-color: var(--ink);
    --bs-table-border-color: var(--line);
}

.table > :not(caption) > * > * {
    padding: .8rem .6rem;
}

details summary {
    cursor: pointer;
    font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

@media (max-width: 767px) {
    .hero {
        min-height: 0;
        padding: 24px !important;
    }

    .panel,
    .auth-card,
    .hero-card {
        padding: 18px;
    }

    .editor {
        min-height: 320px;
    }
}


/* Admin sidebar layout */
.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 1040;
}
.admin-sidebar {
    position: fixed;
    z-index: 1030;
    top: 56px;
    bottom: 0;
    left: 0;
    width: 258px;
    overflow-y: auto;
    padding: 1.1rem 0.65rem;
    background: #182235;
    color: #fff;
    border-right: 1px solid rgba(255,255,255,.12);
}
.admin-sidebar-heading {
    padding: .5rem .85rem .8rem;
    color: #aebbd0;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .1em;
}
.admin-sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin: .12rem 0;
    padding: .72rem .85rem;
    border-radius: .55rem;
    color: #e7edf6;
    overflow-wrap: anywhere;
}
.admin-sidebar-nav .nav-link:hover,
.admin-sidebar-nav .nav-link:focus {
    color: #fff;
    background: rgba(255,255,255,.12);
}
.admin-main-content {
    min-width: 0;
    margin-left: 258px;
    max-width: calc(100% - 258px);
}
.admin-footer {
    margin-left: 258px;
}
@media (min-width: 992px) {
    .admin-sidebar.collapse {
        display: block !important;
    }
}
@media (max-width: 991.98px) {
    .admin-sidebar {
        position: static;
        width: 100%;
        max-height: 65vh;
        border-right: 0;
        border-bottom: 1px solid rgba(255,255,255,.12);
    }
    .admin-main-content {
        margin-left: 0;
        max-width: 100%;
    }
    .admin-footer {
        margin-left: 0;
    }
}

/* Fixed-size Admin Sidebar */
.admin-sidebar {
    position: fixed !important;
    top: 56px;
    bottom: 0;
    left: 0;
    width: 250px !important;
    min-width: 250px;
    max-width: 250px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 10px;
    box-sizing: border-box;
    scrollbar-width: thin;
}

.admin-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.admin-sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    margin: 0;
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: anywhere;
    border-radius: 7px;
    font-size: 14px;
    line-height: 1.4;
}

.admin-sidebar-nav form {
    width: 100%;
    box-sizing: border-box;
}

.admin-sidebar-nav form button {
    min-height: 42px;
}

.admin-main-content {
    margin-left: 250px !important;
    max-width: calc(100% - 250px) !important;
    min-width: 0;
}

.admin-footer {
    margin-left: 250px !important;
}

@media (max-width: 991.98px) {
    .admin-sidebar {
        position: relative !important;
        top: auto;
        bottom: auto;
        width: 100% !important;
        min-width: 0;
        max-width: 100%;
        height: auto;
        max-height: 60vh;
    }

    .admin-main-content {
        margin-left: 0 !important;
        max-width: 100% !important;
    }

    .admin-footer {
        margin-left: 0 !important;
    }
}
