/* Noah Call admin theme. Bootstrap stays underneath for forms/tables; these tokens restyle it. */
:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --ink: #0f172a;
    --ink-2: #475569;
    --ink-muted: #94a3b8;
    --line: #e5e7eb;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-soft: #eff6ff;

    --side-bg: #0f172a;
    --side-ink: #cbd5e1;
    --side-ink-muted: #64748b;
    --side-hover: rgba(255, 255, 255, .06);
    --side-active: rgba(255, 255, 255, .10);
    --side-width: 248px;

    --radius: 10px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);

    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--ink);
    --bs-border-color: var(--line);
    --bs-link-color-rgb: 37, 99, 235;
    --bs-link-hover-color-rgb: 29, 78, 216;
    --bs-primary: var(--accent);
    --bs-primary-rgb: 37, 99, 235;
}

html { font-size: 15px; }
body { background: var(--bg); color: var(--ink); min-height: 100vh; margin: 0; }

.btn-primary {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: var(--accent-hover);
    --bs-btn-hover-border-color: var(--accent-hover);
    --bs-btn-active-bg: var(--accent-hover);
    --bs-btn-active-border-color: var(--accent-hover);
    font-weight: 500;
}
.btn, .form-control { border-radius: 8px; }
.form-control, .form-check-input { background-color: var(--surface); }
.form-control:focus, .form-check-input:focus, .btn:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}
.table { --bs-table-bg: transparent; }

/* ---------------------------------------------------------------- app shell (signed in) */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--side-width);
    display: flex;
    flex-direction: column;
    background: var(--side-bg);
    color: var(--side-ink);
    padding: 1rem .75rem;
    z-index: 1040;
}

.brand {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .375rem .5rem 1.25rem;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.0625rem;
}
.brand:hover { color: #fff; }
.brand small { color: var(--side-ink-muted); font-weight: 500; font-size: .75rem; margin-left: .25rem; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    flex: none;
}

.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.side-heading {
    color: var(--side-ink-muted);
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 1rem .75rem .375rem;
}
.side-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .75rem;
    border-radius: 8px;
    color: var(--side-ink);
    text-decoration: none;
    font-size: .9375rem;
    font-weight: 500;
}
.side-link:hover { background: var(--side-hover); color: #fff; }
.side-link.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.side-link svg, .icon-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}

.side-footer {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .75rem .5rem 0;
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.side-footer form { margin: 0; }
.avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1e293b;
    color: #fff;
    font-weight: 600;
    font-size: .8125rem;
    flex: none;
}
.side-user { flex: 1; min-width: 0; font-size: .8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}
.sidebar .icon-btn:hover { background: var(--side-hover); color: #fff; }

.shell { margin-left: var(--side-width); min-height: 100vh; min-width: 0; display: flex; flex-direction: column; }
.shell .content { flex: 1; width: 100%; }
.content { padding: 2rem; max-width: 1440px; margin: 0 auto; }
.topbar { display: none; }
.sidebar-backdrop { display: none; }

/* Phones and small tablets: the sidebar becomes an off-canvas drawer. */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .45);
        z-index: 1030;
    }
    .shell { margin-left: 0; }
    .topbar {
        display: flex;
        align-items: center;
        gap: .5rem;
        position: sticky;
        top: 0;
        z-index: 1020;
        padding: .5rem 1rem;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
    }
    .topbar .icon-btn:hover { background: var(--bg); }
    .topbar-title { font-weight: 600; }
    .content { padding: 1.25rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar { transition: none; }
}

/* ---------------------------------------------------------------- public pages (signed out) */
.public-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(60rem 30rem at 15% -10%, rgba(37, 99, 235, .10), transparent 60%),
        radial-gradient(50rem 30rem at 110% 110%, rgba(37, 99, 235, .08), transparent 60%),
        var(--bg);
}
.public-main {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
}

.site-footer {
    color: var(--ink-muted);
    font-size: .8125rem;
    text-align: center;
    padding: 1.25rem 1rem;
    border-top: 1px solid var(--line);
}
.public-shell .site-footer { border-top: 0; }

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 2.25rem 2rem;
}
.auth-card .brand-mark { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 1.25rem; }
.auth-card .brand-mark svg { width: 22px; height: 22px; }
.auth-card h1 { font-size: 1.5rem; font-weight: 650; margin: 0 0 .375rem; letter-spacing: -.01em; }
.auth-card .lead-text { color: var(--ink-2); margin: 0 0 1.75rem; }
.auth-card .form-label { font-weight: 500; font-size: .875rem; margin-bottom: .375rem; }
.auth-card .form-control { padding: .625rem .75rem; }
.auth-card .btn-lg { font-size: 1rem; padding: .625rem 1rem; }
.auth-foot { color: var(--ink-muted); font-size: .8125rem; text-align: center; margin: 1.5rem 0 0; }

.welcome { text-align: center; max-width: 480px; }
.welcome .brand-mark { margin-inline: auto; }
.welcome .auth-card { padding: 2.75rem 2.25rem; }

/* ---------------------------------------------------------------- page content */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 600; margin: 0; }
.page-header p { color: var(--ink-2); margin: .25rem 0 0; }

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