:root {
    --brand-primary: #2952e3;
    --brand-dark: #1c2b4a;
    --sidebar-width: 230px;
}

body {
    background-color: #f4f6fb;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}
/* ==================================================================
   Auth pages (login / signup / verify)
   Hero brand panel with mesh-gradient background + a floating
   "bridge" card that overlaps into the form panel, icon-embedded
   inputs, pill CTA, and a step indicator for the signup -> verify
   flow. Palette: deep forest green + warm gold on soft cream.
   ================================================================== */
:root {
    --auth-ink: #0F2A1E;
    --auth-ink-2: #1D4430;
    --auth-gold: #D4A73B;
    --auth-gold-light: #E8C874;
    --auth-gold-dark: #AD8324;
    --auth-paper: #F7F5EE;
    --auth-card: #FFFFFF;
    --auth-text: #1B2420;
    --auth-muted: #6C7A70;
    --auth-border: #E4E1D4;
}

.auth-body {
    min-height: 100vh;
    margin: 0;
    font-family: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--auth-paper);
}

.auth-shell {
    display: flex;
    min-height: 100vh;
}

/* ---------------- Left: hero brand panel ---------------- */
.auth-brand {
    flex: 0 0 46%;
    max-width: 600px;
    background: var(--auth-ink);
    color: #EEF1EC;
    padding: 3.25rem 3.25rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    z-index: 1;
}
/* Mesh-gradient background: layered soft blobs instead of a flat linear fade */
.auth-brand::before {
    content: "";
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(38% 32% at 18% 15%, rgba(232,200,116,0.30) 0%, transparent 70%),
        radial-gradient(45% 40% at 85% 78%, rgba(29,68,48,0.9) 0%, transparent 70%),
        radial-gradient(60% 55% at 60% 100%, rgba(212,167,59,0.14) 0%, transparent 70%),
        linear-gradient(165deg, var(--auth-ink) 0%, var(--auth-ink-2) 100%);
    filter: blur(6px);
    z-index: 0;
}
.auth-brand::after {
    /* fine dot-grid texture on top of the mesh, restrained opacity */
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.07) 1px, transparent 1px);
    background-size: 24px 24px;
    z-index: 0;
    pointer-events: none;
}
.auth-brand-top { position: relative; z-index: 2; }

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--auth-gold-light);
    margin-bottom: 1.6rem;
}
.auth-eyebrow::before {
    content: "";
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--auth-gold);
    box-shadow: 0 0 0 3px rgba(212,167,59,0.25);
}

.auth-brand-logo { max-height: 40px; margin-bottom: 1.6rem; filter: brightness(0) invert(1); }
.auth-brand-icon {
    width: 50px; height: 50px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(135deg, rgba(232,200,116,0.9), rgba(212,167,59,0.55));
    color: var(--auth-ink);
    display: flex; align-items: center; justify-content: center;
    font-size: 21px; margin-bottom: 1.6rem;
}
.auth-brand h1 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 2.3rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.015em;
    margin-bottom: 1rem;
}
.auth-brand p.lede {
    color: #C3CDC5;
    font-size: 0.98rem;
    line-height: 1.65;
    max-width: 380px;
}

/* Feature list -> tactile 2-up tile grid instead of a plain list */
.auth-features {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    padding: 0;
    margin: 2rem 0 0;
    position: relative;
    z-index: 2;
}
.auth-features li {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    font-size: 0.82rem;
    line-height: 1.35;
    color: #D6DED8;
    padding: 0.85rem 0.85rem 0.95rem;
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 12px;
}
.auth-features li:first-child.auth-feature-wide { grid-column: 1 / -1; }
.auth-features li i {
    color: var(--auth-ink);
    font-size: 0.95rem;
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--auth-gold-light);
    border-radius: 7px;
}

.auth-brand-foot {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #8FA093;
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* Glass highlight strip inside the brand panel — sits in normal flow,
   no overlap/floating, reads as part of the panel rather than a
   stray card. */
.auth-highlight {
    position: relative;
    z-index: 2;
    width: 100%;
    margin-top: 1.75rem;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.auth-highlight .auth-highlight-icon {
    flex: 0 0 auto;
    width: 34px; height: 34px; border-radius: 9px;
    background: rgba(212,167,59,0.2);
    color: var(--auth-gold-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.auth-highlight strong {
    display: block;
    font-size: 0.83rem;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 0.15rem;
}
.auth-highlight span {
    font-size: 0.76rem;
    color: #C3CDC5;
    line-height: 1.4;
}

/* ---------------- Right: form panel ---------------- */
.auth-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    position: relative;
    background: radial-gradient(circle at 80% 15%, rgba(212,167,59,0.07) 0%, transparent 42%);
}
.auth-wrapper {
    width: 100%;
    max-width: 424px;
    background: var(--auth-card);
    border: 1px solid var(--auth-border);
    border-radius: 18px;
    padding: 2.5rem 2.35rem;
    box-shadow: 0 24px 50px -20px rgba(15,42,30,0.18);
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--auth-gold-dark);
    background: rgba(212,167,59,0.12);
    border: 1px solid rgba(212,167,59,0.25);
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    margin-bottom: 1.1rem;
}

/* Step indicator: Account -> Verify */
.auth-steps {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}
.auth-steps .step {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--auth-muted);
}
.auth-steps .step .dot {
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--auth-border);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.68rem;
}
.auth-steps .step.done .dot { background: var(--auth-ink); }
.auth-steps .step.active .dot { background: var(--auth-gold-dark); }
.auth-steps .step.active { color: var(--auth-text); }
.auth-steps .line { flex: 1; height: 1px; background: var(--auth-border); }

.auth-wrapper h4 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    color: var(--auth-text);
    font-size: 1.55rem;
}

/* Icon-embedded fields */
.auth-field { margin-bottom: 1rem; }
.auth-field .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--auth-text);
    letter-spacing: 0.01em;
    margin-bottom: 0.35rem;
}
.auth-field-control {
    position: relative;
    display: flex;
    align-items: center;
}
.auth-field-control > i.field-icon {
    position: absolute;
    left: 0.9rem;
    font-size: 0.95rem;
    color: var(--auth-muted);
    pointer-events: none;
}
.auth-field-control .form-control {
    border-color: var(--auth-border);
    border-radius: 10px;
    padding: 0.68rem 0.9rem 0.68rem 2.5rem;
    font-size: 0.95rem;
    background: #FBFAF6;
    width: 100%;
}
.auth-field-control .form-control:focus {
    border-color: var(--auth-gold);
    background: #fff;
    box-shadow: 0 0 0 0.2rem rgba(212,167,59,0.16);
}
.auth-field-control .field-toggle {
    position: absolute;
    right: 0.5rem;
    border: none;
    background: none;
    color: var(--auth-muted);
    padding: 0.4rem 0.5rem;
}
.auth-field-control .field-toggle:hover { color: var(--auth-text); }
.auth-field-control.has-toggle .form-control { padding-right: 2.6rem; }
.auth-field-hint { font-size: 0.76rem; color: var(--auth-muted); margin-top: 0.3rem; }

/* Pill CTA button with directional icon motion */
.auth-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--auth-ink);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.auth-btn i { transition: transform 0.15s ease; }
.auth-btn:hover, .auth-btn:focus {
    background: var(--auth-gold-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px -8px rgba(173,131,36,0.55);
}
.auth-btn:hover i { transform: translateX(3px); }

.auth-wrapper a { color: var(--auth-gold-dark); font-weight: 600; text-decoration: none; }
.auth-wrapper a:hover { text-decoration: underline; }

.auth-icon {
    width: 58px; height: 58px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(135deg, rgba(212,167,59,0.22), rgba(212,167,59,0.08));
    color: var(--auth-gold-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; margin: 0 auto;
}
.auth-logo { max-height: 48px; }

/* OTP input styled like a stamped reference code */
.otp-input {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 1.6rem;
    letter-spacing: 0.55em;
    text-indent: 0.55em;
    font-weight: 600;
    color: var(--auth-text);
    border: 2px solid var(--auth-border);
    border-radius: 10px;
    background: #FBFAF6;
    width: 100%;
    padding: 0.6rem 0.9rem;
}
.otp-input:focus {
    border-color: var(--auth-gold);
    background: #fff;
    box-shadow: 0 0 0 0.2rem rgba(212,167,59,0.16);
    outline: none;
}

@media (max-width: 900px) {
    .auth-shell { flex-direction: column; }
    .auth-brand {
        flex: 0 0 auto;
        max-width: none;
        padding: 1.75rem 1.5rem;
        min-height: 0;
    }
    .auth-brand-logo, .auth-brand-icon { margin-bottom: 1rem; }
    .auth-eyebrow { margin-bottom: 0.9rem; }
    .auth-brand h1 { font-size: 1.4rem; margin-bottom: 0.4rem; }
    .auth-brand p.lede { font-size: 0.88rem; }
    .auth-features { display: none; }
    .auth-brand-foot { display: none; }
    .auth-highlight { display: none; }
    .auth-form-side { padding: 2rem 1.25rem; background: none; }
    .auth-wrapper { box-shadow: none; border: none; padding: 0; max-width: none; }
}
/* ---------------- App shell ---------------- */
.app-navbar {
    background: #fff;
    border-bottom: 1px solid #e6e9f0;
    padding: 0.6rem 1rem;
    position: sticky; top: 0; z-index: 1030;
}
.app-navbar .container-fluid { flex-wrap: nowrap; }
.app-navbar #sidebarToggle { flex-shrink: 0; }
.app-navbar .navbar-brand {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 0.5rem;
}
.app-navbar .ms-auto { flex-shrink: 0; }
.app-shell { display: flex; min-height: calc(100vh - 56px); }

.app-sidebar {
    width: var(--sidebar-width);
    background: #fff;
    border-right: 1px solid #e6e9f0;
    flex-shrink: 0;
}
.app-sidebar .nav-link {
    color: #4a5568;
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    margin-bottom: 2px;
    font-size: 0.94rem;
}
.app-sidebar .nav-link i { width: 20px; display: inline-block; }
.app-sidebar .nav-link:hover { background: #f1f4fb; color: var(--brand-primary); }
.app-sidebar .nav-link.active { background: var(--brand-primary); color: #fff; }

.app-content { flex-grow: 1; padding: 1.5rem; min-width: 0; max-width: 100%; overflow-x: hidden; }

/* ---------------- Page header rows (title + action buttons) ---------------- */
.page-header-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    row-gap: 0.6rem;
    column-gap: 0.75rem;
}
.page-header-row > .page-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Pagination shouldn't overflow narrow screens */
.pagination { flex-wrap: wrap; row-gap: 0.35rem; }

/* ---------------- Dashboard stat cards ---------------- */
.stat-card { border-radius: 14px; }
.stat-icon {
    width: 42px; height: 42px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; margin-bottom: 10px;
}
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--brand-dark); }
.stat-label { color: #8a94a6; font-size: 0.85rem; }

/* ---------------- Responsive table -> card layout ---------------- */
@media (max-width: 767.98px) {
    .app-sidebar {
        position: fixed; left: -260px; top: 56px; bottom: 0;
        z-index: 1040; transition: left 0.2s ease; box-shadow: 2px 0 10px rgba(0,0,0,0.08);
    }
    .app-sidebar.show { left: 0; }
    .app-content { padding: 1rem; }

    table.responsive-stack thead { display: none; }
    table.responsive-stack, table.responsive-stack tbody, table.responsive-stack tr, table.responsive-stack td {
        display: block; width: 100%;
    }
    table.responsive-stack tr { margin-bottom: 12px; border: 1px solid #e6e9f0; border-radius: 10px; padding: 8px; }
    table.responsive-stack td {
        text-align: right; padding: 6px 10px; border: none;
        position: relative; padding-left: 45%;
    }
    table.responsive-stack td::before {
        content: attr(data-label);
        position: absolute; left: 10px; width: 40%;
        text-align: left; font-weight: 600; color: #4a5568;
    }
    table.responsive-stack td:empty,
    table.responsive-stack td[data-label=""] { display: none; }
    table.responsive-stack td.text-end { text-align: right; }
    table.responsive-stack td.text-truncate {
        max-width: none !important;
        white-space: normal !important;
        text-overflow: clip;
    }

    /* Stat cards: keep numbers readable on narrow phones */
    .stat-value { font-size: 1.35rem; }
    .stat-icon { width: 36px; height: 36px; font-size: 17px; }

    /* Cards and forms shouldn't force horizontal scroll */
    .card { max-width: 100%; }
}

/* ---------------- Print styles ---------------- */
@media print {
    .app-navbar, .app-sidebar, .no-print, .btn, nav { display: none !important; }
    .app-content { padding: 0 !important; }
    body { background: #fff !important; }
}
