/* =====================================================================
   STIC Admin — UI styles
   Layered on top of Bootstrap 5. Only adds layout, brand, and the
   things Bootstrap doesn't ship out of the box.
   ===================================================================== */

:root {
    --stic-orange:        #f47b20;
    --stic-orange-dark:   #d36719;
    --stic-ink:           #1f2937;
    --stic-ink-soft:      #4b5563;
    --stic-line:          #e5e7eb;
    --stic-bg:            #f6f7fb;
    --stic-sidebar-bg:    #1f2937;
    --stic-sidebar-fg:    #cbd5e1;
    --stic-sidebar-fg-hl: #ffffff;
    --stic-radius:        10px;
    --stic-shadow:        0 1px 2px rgba(15,23,42,.04), 0 4px 12px rgba(15,23,42,.04);
}

html, body { height: 100%; }
body.admin {
    margin: 0;
    background: var(--stic-bg);
    color: var(--stic-ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ---------- sidebar ---------- */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 240px;
    background: var(--stic-sidebar-bg);
    color: var(--stic-sidebar-fg);
    display: flex;
    flex-direction: column;
    z-index: 30;
}
.brand {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.brand-mark {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: .04em;
    color: var(--stic-orange);
}
.brand-sub {
    font-size: .82rem;
    color: #94a3b8;
    margin-top: .15rem;
}
.nav-list {
    flex: 1;
    overflow-y: auto;
    padding: .75rem .5rem;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .6rem .85rem;
    margin: .15rem 0;
    color: var(--stic-sidebar-fg) !important;
    border-radius: 8px;
    text-decoration: none;
    font-size: .94rem;
    transition: background .15s, color .15s;
}
.nav-link:hover {
    background: rgba(255,255,255,.05);
    color: var(--stic-sidebar-fg-hl) !important;
}
.nav-link.is-active {
    background: var(--stic-orange);
    color: #fff !important;
    font-weight: 600;
}
.nav-link.is-active:hover { background: var(--stic-orange-dark); }
.nav-ic {
    width: 1.4rem;
    text-align: center;
    font-size: 1rem;
    opacity: .9;
}
.sidebar-foot {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.06);
    font-size: .85rem;
}
.who { color: #fff; font-weight: 600; }
.who-sub { color: #94a3b8; font-size: .78rem; margin-bottom: .55rem; }
.logout {
    display: inline-block;
    padding: .35rem .7rem;
    background: transparent;
    border: 1px solid #334155;
    color: #cbd5e1;
    border-radius: 6px;
    text-decoration: none;
    font-size: .82rem;
}
.logout:hover { background: #334155; color: #fff; }

/* ---------- main content ---------- */
.content {
    margin-left: 240px;
    min-height: 100vh;
    padding: 0;
}
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--stic-line);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}
.page-title {
    font-size: 1.25rem;
    margin: 0;
    font-weight: 700;
}
.muted { color: var(--stic-ink-soft); font-size: .9rem; }

.page-body { padding: 1.5rem; }

/* ---------- cards / panels ---------- */
.card {
    border: 1px solid var(--stic-line);
    border-radius: var(--stic-radius);
    box-shadow: var(--stic-shadow);
}
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--stic-line);
    font-weight: 600;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--stic-line);
    border-radius: var(--stic-radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--stic-shadow);
}
.stat-label { font-size: .82rem; color: var(--stic-ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 1.7rem; font-weight: 700; margin-top: .25rem; }
.stat-foot  { font-size: .8rem; color: var(--stic-ink-soft); margin-top: .25rem; }

/* ---------- buttons ---------- */
.btn-primary {
    background: var(--stic-orange);
    border-color: var(--stic-orange);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--stic-orange-dark);
    border-color: var(--stic-orange-dark);
}
.btn-outline-primary {
    color: var(--stic-orange);
    border-color: var(--stic-orange);
}
.btn-outline-primary:hover {
    background: var(--stic-orange);
    border-color: var(--stic-orange);
    color: #fff;
}

/* ---------- tables ---------- */
.table { background: #fff; }
.table thead th {
    background: #f9fafb;
    border-bottom: 1px solid var(--stic-line);
    font-weight: 600;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--stic-ink-soft);
}
.table tbody td { vertical-align: middle; }

.badge-active   { background: #dcfce7; color: #166534; padding: .25rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-inactive { background: #fee2e2; color: #991b1b; padding: .25rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-revoked  { background: #fee2e2; color: #991b1b; padding: .25rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }

/* ---------- login screen ---------- */
.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #fff7f0 0%, #f6f7fb 60%);
    padding: 1.5rem;
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border: 1px solid var(--stic-line);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(15,23,42,.08);
    padding: 2rem;
}
.login-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}
.login-brand .brand-mark {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--stic-orange);
    letter-spacing: .04em;
}
.login-brand .brand-sub {
    color: var(--stic-ink-soft);
    font-size: .9rem;
    margin-top: .15rem;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
    .nav-list {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: .25rem;
        padding: .5rem;
        width: 100%;
    }
    .brand { padding: .85rem 1rem; flex: 1; border-bottom: 0; }
    .sidebar-foot { width: 100%; padding: .75rem 1rem; border-top: 1px solid rgba(255,255,255,.06); }
    .content { margin-left: 0; }
    .topbar { padding: .85rem 1rem; }
    .page-body { padding: 1rem; }
}
