/* =========================================================================
   Al Yeldien — "Lecture Hall" admin identity
   Premium courseware, not a SaaS template. Warm paper, scholarly emerald,
   brass reserved for the active/important state, Fraunces serif headings.
   Signature: a notebook-margin hairline down the left edge of every card.
   Override layer, loaded AFTER CoreUI — no markup logic depends on it.
   ========================================================================= */

@font-face {
    font-family: 'Inter';
    src: url('/fonts/inter-var.woff2') format('woff2');
    font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Fraunces';
    src: url('/fonts/fraunces-var.woff2') format('woff2');
    font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
    --ink: #1c1b19;
    --ink-soft: #26221c;
    --paper: #f7f4ee;
    --card: #fffdf9;
    --emerald: #0e7c66;
    --emerald-deep: #0b6353;
    --brass: #c69434;
    --brass-deep: #a9761f;
    --line: #e4ded2;
    --text: #302d27;
    --muted: #857c6c;

    --cui-primary: #0e7c66;
    --cui-primary-rgb: 14, 124, 102;
    --cui-link-color: #0b6353;
    --cui-link-hover-color: #094a3e;
    --cui-body-bg: #f7f4ee;
    --cui-border-radius: 10px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--paper);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
.bg-light, .wrapper.bg-light, .body.bg-light { background: transparent !important; }

h1, h2, h3, h4, h5, .card-title {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    color: var(--ink);
    letter-spacing: -.01em;
}

/* ------------------------------------------------------------------ Sidebar */
.sidebar {
    background: var(--ink) !important;
    border-right: 1px solid rgba(255, 255, 255, .04);
    box-shadow: none;
}
.sidebar-brand {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.sidebar-nav .nav-link {
    color: rgba(247, 244, 238, .6);
    font-weight: 500;
    border-radius: 8px;
    margin: 2px 10px;
    padding: 9px 12px;
    transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.sidebar-nav .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .05);
}
.sidebar-nav .nav-link.active {
    color: #fbf7ee;
    background: rgba(198, 148, 52, .14);
    box-shadow: inset 3px 0 0 var(--brass);      /* brass = "you are here" */
}
.sidebar-nav .nav-link .nav-icon { opacity: .82; color: inherit; }
.sidebar-nav .nav-title {
    color: var(--brass);
    opacity: .7;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 10.5px;
    font-weight: 600;
}

/* ------------------------------------------------------------------- Header */
.header {
    background: rgba(247, 244, 238, .82);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--line);
    box-shadow: none;
}
.header.sticky-top { z-index: 1020; }

/* -------------------------------------------------------------------- Cards
   The signature: a single hairline "notebook margin" inset from the left
   edge, with content set to its right. Everything else stays quiet. */
.card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(28, 27, 25, .03), 0 12px 28px rgba(28, 27, 25, .045);
    animation: aly-fade .35s ease both;
}
.card::before {
    content: "";
    position: absolute;
    top: 16px; bottom: 16px; left: 24px;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(169, 118, 31, .5) 10%,
                rgba(169, 118, 31, .5) 90%, transparent);
    pointer-events: none;
}
.card-body { padding: 1.4rem 1.6rem 1.6rem 2.75rem; }
.card-title {
    font-weight: 560;
    font-size: 1.4rem;
    line-height: 1.2;
    margin-bottom: 1.1rem;
    padding-bottom: .7rem;
    border-bottom: 1px solid var(--line);
}
@keyframes aly-fade { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------------------------ Buttons
   Quiet, flat, editorial. Emerald is the primary voice; brass stays for
   state, not chrome. No gradients competing with the signature. */
.btn {
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: .1px;
    padding: .5rem 1rem;
    border: 1px solid transparent;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { border-radius: 7px; padding: .34rem .72rem; }

.btn-primary { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: var(--emerald-deep); border-color: var(--emerald-deep); color: #fff; }
.btn-success { background: #2f7d4f; border-color: #2f7d4f; color: #fff; }
.btn-success:hover { background: #266740; border-color: #266740; color: #fff; }
.btn-info    { background: #3b6ea5; border-color: #3b6ea5; color: #fff; }
.btn-info:hover { background: #315c8a; border-color: #315c8a; color: #fff; }
.btn-warning { background: var(--brass); border-color: var(--brass); color: #2c2210; }
.btn-warning:hover { background: var(--brass-deep); border-color: var(--brass-deep); color: #fff; }
.btn-danger  { background: #b3412c; border-color: #b3412c; color: #fff; }
.btn-danger:hover { background: #97361f; border-color: #97361f; color: #fff; }
.btn-outline-primary { border: 1.5px solid var(--emerald); color: var(--emerald-deep); background: transparent; }
.btn-outline-primary:hover { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.btn-link { color: var(--emerald-deep); font-weight: 600; text-decoration: none; }
.btn-link:hover { color: #094a3e; text-decoration: underline; }
.btn:focus-visible { outline: 3px solid rgba(14, 124, 102, .32); outline-offset: 2px; }
td .btn, td form { margin: 2px 3px 2px 0; }

/* ------------------------------------------------------------------- Tables
   Column heads become brass eyebrows; rules stay hairline. */
.table { --cui-table-bg: transparent; border-collapse: separate; border-spacing: 0; margin-bottom: 0; }
.table > thead th {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: .09em;
    font-weight: 700;
    color: var(--brass-deep);
    background: transparent;
    border-bottom: 1.5px solid var(--line);
    padding: .7rem 1rem;
}
.table > :not(caption) > * > * { padding: .8rem 1rem; border-bottom-color: var(--line); }
.table.table-striped > tbody > tr:nth-of-type(odd) > * { --cui-table-accent-bg: transparent; }
.table > tbody > tr { transition: background .14s ease; }
.table > tbody > tr:hover > * { background: #f3efe7 !important; }
.table td { vertical-align: middle; color: var(--text); }

/* --------------------------------------------------------------- Form fields */
.form-control, .form-select {
    border-radius: 8px;
    border: 1.5px solid var(--line);
    background: #fffdf9;
    color: var(--text);
    padding: .55rem .8rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus, .form-select:focus {
    border-color: var(--emerald);
    box-shadow: 0 0 0 3px rgba(14, 124, 102, .16);
}
.input-group-text {
    background: #f1ece2;
    border: 1.5px solid var(--line);
    border-right: 0;
    color: var(--muted);
    border-radius: 8px 0 0 8px;
}
.input-group > .form-control { border-left: 0; }

/* ---------------------------------------------------- Progress / badges / etc */
.progress { background: #eae4d8; border-radius: 999px; overflow: hidden; height: 10px; }
.progress-bar { background: var(--emerald) !important; color: #fff; font-weight: 600; }
.badge { border-radius: 6px; padding: .36em .6em; font-weight: 600; letter-spacing: .2px; }

.alert { border: 0; border-left: 4px solid transparent; border-radius: 10px; box-shadow: 0 1px 2px rgba(28,27,25,.04); }
.alert-success { background: #edf5ef; color: #1c5138; border-left-color: #2f7d4f; }
.alert-danger  { background: #f8ede9; color: #7c2d1c; border-left-color: #b3412c; }
.alert-warning { background: #f9f2e2; color: #6f5312; border-left-color: var(--brass); }
.alert-info    { background: #eef2f8; color: #274a71; border-left-color: #3b6ea5; }

.page-link {
    border: 1px solid var(--line);
    color: var(--text);
    margin: 0 3px;
    border-radius: 8px !important;
    transition: all .14s ease;
}
.page-link:hover { background: #f3efe7; color: var(--emerald-deep); border-color: var(--emerald); }
.page-item.active .page-link { background: var(--emerald); border-color: var(--emerald); color: #fff; }

a { color: var(--emerald-deep); }
::selection { background: rgba(14, 124, 102, .18); }
.footer { background: transparent; border-top: 1px solid var(--line); color: var(--muted); }

/* Chunked uploader drop-zone */
#dropZone { transition: border-color .16s ease, background .16s ease; }
#dropZone:hover, #dropZone.resumable-dragover {
    border-color: var(--emerald) !important;
    background: rgba(14, 124, 102, .05);
}

/* =====================================================================
   Auth / login (guest layout carries body.auth-page)
   A warm, dim lecture-hall backdrop; the paper card carries the signature.
   ===================================================================== */
body.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(900px 500px at 15% -10%, rgba(198, 148, 52, .16), transparent 60%),
        linear-gradient(160deg, #1c1b19 0%, #24201a 55%, #2b2317 100%);
}
body.auth-page .bg-light { background: transparent !important; }
body.auth-page .card {
    background: var(--card);
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: 14px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .5);
}
body.auth-page .card h1 {
    font-weight: 600;
    font-size: 2rem;
    color: var(--ink);
    margin-bottom: .1rem;
}
body.auth-page .aly-auth-sub {
    color: var(--muted);
    font-size: .95rem;
    margin-bottom: 1.4rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}
body.auth-page .btn-primary { width: 100%; padding: .62rem 1rem; font-size: 1.02rem; }
body.auth-page .col-6 { width: 100%; }
body.auth-page .col-6.text-end { text-align: center !important; margin-top: .4rem; }

/* Quality floor */
@media (prefers-reduced-motion: reduce) {
    .card, .btn, .sidebar-nav .nav-link, .table > tbody > tr { animation: none !important; transition: none !important; }
}
