/* ============================================================
   PORTAL STYLESHEET
   Editorial / refined / serious-academic with warm accents.
   Mobile-first. Designed for slow Nigerian mobile networks.
   ============================================================ */

/* --- 1. CSS variables (overridable per-school via inline <style>) --- */
:root {
    --color-primary:   #0f3a5f;      /* deep navy, school brand */
    --color-secondary: #1a4d7e;
    --color-accent:    #c8862e;      /* saffron / academic gold */
    --color-accent-soft: #f4ecd8;

    --color-bg:        #faf7f2;      /* warm cream */
    --color-bg-elev:   #ffffff;      /* card surfaces */
    --color-bg-subtle: #f1ede5;
    --color-bg-section: #f6f1e8;

    --color-text:      #1a1a1a;
    --color-text-soft: #57534e;
    --color-text-mute: #8b8580;

    --color-border:    #e7e2d6;
    --color-border-strong: #d4cdb9;

    --color-success:   #16a34a;
    --color-error:     #dc2626;
    --color-warning:   #d97706;
    --color-info:      #2563eb;

    --shadow-sm: 0 1px 2px rgba(15, 58, 95, 0.06);
    --shadow-md: 0 4px 12px rgba(15, 58, 95, 0.08);
    --shadow-lg: 0 12px 32px rgba(15, 58, 95, 0.12);

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 12px;

    --font-display: 'Lora', Georgia, 'Times New Roman', serif;
    --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;

    --max-content: 1180px;
    --max-prose:   680px;
    --max-form:    480px;
}

/* --- 2. Resets and base --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    color: var(--color-text);
    background: var(--color-bg);
    /* Subtle grain texture — adds editorial feel without performance cost */
    background-image:
        radial-gradient(circle at 25% 10%, rgba(200, 134, 46, 0.025) 0%, transparent 50%),
        radial-gradient(circle at 75% 80%, rgba(15, 58, 95, 0.018) 0%, transparent 50%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--color-secondary); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--color-primary); }

/* --- 3. Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--color-primary);
    margin: 0 0 0.5em;
    letter-spacing: -0.01em;
    line-height: 1.2;
}
h1 { font-size: 2.25rem; font-weight: 600; }
h2 { font-size: 1.625rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
    display: inline-block;
}
.lead { font-size: 1.125rem; color: var(--color-text-soft); line-height: 1.65; }
.muted { color: var(--color-text-mute); font-size: 0.875rem; }
small { font-size: 0.85em; color: var(--color-text-soft); }
code { font-family: var(--font-mono); font-size: 0.875em; background: var(--color-bg-subtle); padding: 0.1em 0.4em; border-radius: 3px; }

/* --- 4. Layout primitives --- */
.container { width: 100%; max-width: var(--max-content); margin: 0 auto; padding: 0 1.25rem; }
.container-narrow { width: 100%; max-width: var(--max-prose); margin: 0 auto; padding: 0 1.25rem; }
.container-form { width: 100%; max-width: var(--max-form); margin: 0 auto; padding: 0 1.25rem; }

.section { padding: 4rem 0; }
.section-tight { padding: 2.5rem 0; }
.section-bg { background: var(--color-bg-section); }

.stack > * + * { margin-top: 1rem; }
.stack-tight > * + * { margin-top: 0.5rem; }
.stack-loose > * + * { margin-top: 1.75rem; }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.flex { display: flex; gap: 0.75rem; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

.text-center { text-align: center; }
.text-right { text-align: right; }

/* --- 5. Site header --- */
.site-header {
    background: var(--color-bg-elev);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.92);
}
.site-header__inner {
    max-width: var(--max-content);
    margin: 0 auto;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.site-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--color-primary);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.125rem;
    line-height: 1.2;
}
.site-brand img { max-height: 44px; width: auto; }
.site-brand__name { display: flex; flex-direction: column; }
.site-brand__name small { color: var(--color-text-mute); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; }
.site-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.site-nav a {
    color: var(--color-text-soft);
    text-decoration: none;
    padding: 0.5rem 0.875rem;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
}
.site-nav a:hover { color: var(--color-primary); background: var(--color-bg-subtle); }
.site-nav a.is-active { color: var(--color-primary); font-weight: 500; }

/* --- 6. Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--color-primary);
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: background 120ms ease, transform 80ms ease, box-shadow 120ms ease;
    min-height: 44px;          /* touch target */
}
.btn:hover { background: var(--color-secondary); color: white; box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled { opacity: 0.5; pointer-events: none; }

.btn--accent { background: var(--color-accent); }
.btn--accent:hover { background: #b3741e; }
.btn--ghost {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-border-strong);
}
.btn--ghost:hover { background: var(--color-bg-subtle); color: var(--color-primary); }
.btn--text {
    background: transparent;
    color: var(--color-secondary);
    padding: 0.5rem 0.75rem;
    min-height: auto;
}
.btn--text:hover { background: transparent; color: var(--color-primary); text-decoration: underline; }
.btn--lg { padding: 1rem 2rem; font-size: 1rem; }
.btn--sm { padding: 0.5rem 1rem; font-size: 0.875rem; min-height: 36px; }
.btn--block { display: flex; width: 100%; }

/* --- 7. Forms --- */
.field { margin-bottom: 1.25rem; }
.field__label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 0.4rem;
}
.field__label .req { color: var(--color-error); }
.field__hint { font-size: 0.8rem; color: var(--color-text-mute); margin-top: 0.4rem; }
.field__error { font-size: 0.8rem; color: var(--color-error); margin-top: 0.4rem; }

.input, .select, .textarea {
    width: 100%;
    padding: 0.75rem 0.9rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-text);
    background: var(--color-bg-elev);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    transition: border-color 120ms ease, box-shadow 120ms ease;
    -webkit-appearance: none;
    appearance: none;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(15, 58, 95, 0.12);
}
.input--has-error, .select--has-error, .textarea--has-error {
    border-color: var(--color-error);
}
.input--has-error:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2357534e' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    padding-right: 2.5rem;
}

.field-row { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 600px) {
    .field-row--2 { grid-template-columns: 1fr 1fr; }
    .field-row--3 { grid-template-columns: 1fr 1fr 1fr; }
}

/* Honeypot — visually hidden but accessible to bots */
.honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* --- 8. Cards --- */
.card {
    background: var(--color-bg-elev);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}
.card--padded { padding: 2.25rem; }
.card--accent { border-top: 4px solid var(--color-accent); }

/* --- 9. Alerts (flash messages) --- */
.alert {
    padding: 0.875rem 1.125rem;
    border-radius: var(--radius-sm);
    border-left: 4px solid;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}
.alert--success { background: #ecfdf5; border-color: var(--color-success); color: #14532d; }
.alert--error   { background: #fef2f2; border-color: var(--color-error);   color: #7f1d1d; }
.alert--warning { background: #fffbeb; border-color: var(--color-warning); color: #78350f; }
.alert--info    { background: #eff6ff; border-color: var(--color-info);    color: #1e3a8a; }

/* --- 10. Hero (landing page) --- */
.hero {
    padding: 4rem 0 5rem;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at top right, rgba(200, 134, 46, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at bottom left, rgba(15, 58, 95, 0.05) 0%, transparent 60%);
    z-index: -1;
}
.hero__layout {
    display: grid;
    gap: 3rem;
    align-items: center;
}
@media (min-width: 800px) {
    .hero { padding: 6rem 0 7rem; }
    .hero__layout { grid-template-columns: 1fr 1fr; gap: 5rem; }
}
.hero h1 {
    font-size: 2.5rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
}
@media (min-width: 800px) {
    .hero h1 { font-size: 3.5rem; }
}
.hero__lead { font-size: 1.15rem; color: var(--color-text-soft); margin-bottom: 2rem; max-width: 32em; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero__visual {
    background: var(--color-bg-elev);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    position: relative;
}
.hero__visual::after {
    content: '';
    position: absolute;
    top: -1.25rem; right: -1.25rem;
    width: 5rem; height: 5rem;
    background: var(--color-accent);
    border-radius: var(--radius-md);
    z-index: -1;
}

/* --- 11. Auth/apply pages --- */
.auth-page {
    min-height: calc(100vh - 200px);
    padding: 3rem 1.25rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--color-bg-elev);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-md);
}
@media (min-width: 600px) {
    .auth-card { padding: 3rem 2.75rem; }
}
.auth-card h1 { font-size: 1.625rem; margin-bottom: 0.5rem; }
.auth-card__lead { color: var(--color-text-soft); margin-bottom: 2rem; font-size: 0.95rem; }
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--color-text-soft);
    font-size: 0.9rem;
}
.auth-footer a { color: var(--color-primary); text-decoration: none; font-weight: 500; }
.auth-footer a:hover { text-decoration: underline; }

/* --- 12. Step indicator (apply wizard) --- */
.steps {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    list-style: none;
    padding: 0;
    overflow-x: auto;
}
.steps__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-mute);
    font-size: 0.85rem;
    flex-shrink: 0;
}
.steps__num {
    display: inline-flex;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--color-bg-subtle);
    color: var(--color-text-mute);
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 500;
    flex-shrink: 0;
}
.steps__item.is-current .steps__num { background: var(--color-primary); color: white; }
.steps__item.is-current { color: var(--color-primary); font-weight: 500; }
.steps__item.is-done .steps__num { background: var(--color-success); color: white; }
.steps__item.is-done { color: var(--color-text); }
.steps__divider { color: var(--color-border); flex-shrink: 0; }

/* --- 13. Footer --- */
.site-footer {
    background: var(--color-primary);
    color: rgba(255, 255, 255, 0.75);
    padding: 3rem 0 2rem;
    margin-top: 5rem;
    font-size: 0.9rem;
    line-height: 1.6;
}
.site-footer h4 { color: white; font-family: var(--font-display); margin-bottom: 0.75rem; font-size: 1rem; }
.site-footer a { color: rgba(255, 255, 255, 0.85); text-decoration: none; }
.site-footer a:hover { color: white; text-decoration: underline; }
.site-footer__cols { display: grid; gap: 2rem; margin-bottom: 2rem; }
@media (min-width: 700px) {
    .site-footer__cols { grid-template-columns: 2fr 1fr 1fr; }
}
.site-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 1.5rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.825rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* --- 14. Misc utilities --- */
.divider {
    height: 1px;
    background: var(--color-border);
    margin: 2rem 0;
    border: 0;
}
.divider-text {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-text-mute);
    font-size: 0.85rem;
    margin: 1.5rem 0;
}
.divider-text::before, .divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.badge {
    display: inline-block;
    padding: 0.2em 0.6em;
    background: var(--color-bg-subtle);
    color: var(--color-text-soft);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge--accent { background: var(--color-accent-soft); color: #7c4a06; }
.badge--success { background: #d1fae5; color: #065f46; }

/* --- 15. Page hero (less prominent than landing hero) --- */
.page-hero {
    padding: 3rem 0 2rem;
    background: var(--color-bg-section);
    border-bottom: 1px solid var(--color-border);
}

/* --- 16. Animations: subtle, restrained --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp 350ms ease-out backwards; }
.animate-in-1 { animation-delay: 50ms; }
.animate-in-2 { animation-delay: 150ms; }
.animate-in-3 { animation-delay: 250ms; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- 17. Print: clean receipts/letters --- */
@media print {
    .site-header, .site-footer, .no-print { display: none !important; }
    body { background: white; color: black; }
    .card { box-shadow: none; border: 1px solid #ccc; }
}

/* ============================================================
   ADMIN SIDEBAR LAYOUT
   ============================================================ */

/* Shell: sidebar + main content side by side */
.admin-shell {
    display: flex;
    min-height: calc(100vh - 65px); /* below sticky header */
}

/* Sidebar */
.admin-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--color-primary);
    color: rgba(255,255,255,0.85);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 65px;           /* height of site-header */
    height: calc(100vh - 65px);
    overflow-y: auto;
    z-index: 40;
}
.admin-sidebar__section {
    padding: 1.25rem 0 0.5rem;
}
.admin-sidebar__label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.45);
    padding: 0 1.25rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}
.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.25rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: background 100ms, color 100ms, border-color 100ms;
}
.admin-sidebar a:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}
.admin-sidebar a.is-active {
    background: rgba(255,255,255,0.12);
    color: white;
    border-left-color: var(--color-accent);
    font-weight: 500;
}
.admin-sidebar__divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 0.5rem 1.25rem;
}
.admin-sidebar__bottom {
    margin-top: auto;
    padding: 1rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Main content area beside the sidebar */
.admin-content {
    flex: 1;
    min-width: 0;
    overflow-x: hidden;
}

/* ── Mobile admin sidebar — hamburger + slide-in drawer ── */
.admin-hamburger {
    display: none;
    position: fixed;
    top: 14px;
    right: 1rem;
    z-index: 200;
    background: var(--color-primary);
    border: none;
    border-radius: 6px;
    width: 42px;
    height: 42px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    transition: background .15s;
}
.admin-hamburger:hover { background: var(--color-secondary); }
.admin-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: transform .25s, opacity .25s;
    transform-origin: center;
}
/* Animate to X when open */
.admin-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.admin-hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.admin-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Dark overlay behind the drawer */
.admin-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 150;
    opacity: 0;
    transition: opacity .25s;
}
.admin-overlay.is-visible {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    /* Show hamburger button */
    .admin-hamburger { display: flex; }

    /* Shell: no longer flex row */
    .admin-shell { display: block; }

    /* Sidebar becomes a fixed off-canvas drawer */
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 272px;
        height: 100vh;
        z-index: 160;
        overflow-y: auto;
        overflow-x: hidden;
        transition: left .28s cubic-bezier(.4,0,.2,1);
        box-shadow: 4px 0 24px rgba(0,0,0,.25);
        /* reset the flex-direction:row from old code */
        flex-direction: column;
    }
    .admin-sidebar.is-open { left: 0; }

    /* Restore section layout inside drawer */
    .admin-sidebar__section {
        padding: 1.25rem 0 0.5rem;
        display: block;
    }
    .admin-sidebar__label { display: block; }
    .admin-sidebar a {
        padding: 0.65rem 1.25rem;
        white-space: normal;
        border-left: 3px solid transparent;
        border-bottom: none;
    }
    .admin-sidebar a.is-active {
        border-left-color: var(--color-accent);
        border-bottom: none;
    }
    .admin-sidebar__divider { display: block; }
    .admin-sidebar__bottom { display: block; }

    /* Content fills full width */
    .admin-content { width: 100%; }

    /* Push header sign-out link left so hamburger doesn't overlap it */
    .site-nav { margin-right: 3rem; }
}

/* ============================================================
   MOBILE POLISH (Batch 15)
   ============================================================ */

/* Touch targets — minimum 44px for all interactive elements */
@media (max-width: 768px) {
  .btn                { min-height: 44px; padding: 0.7rem 1.1rem; }
  .btn--sm            { min-height: 38px; }
  .input, .select, .textarea { min-height: 44px; font-size: 16px; /* prevents iOS zoom */ }

  /* Stack grids on mobile */
  .grid-2, .grid-3    { grid-template-columns: 1fr !important; }
  .field-row--2,
  .field-row--3       { grid-template-columns: 1fr !important; }

  /* Full-width cards on mobile */
  .auth-card          { margin: 1rem; border-radius: var(--radius-sm); }

  /* Tighter page heroes */
  .page-hero          { padding: 1.5rem 0 1rem; }
  .page-hero h1       { font-size: 1.6rem; }

  /* Container padding */
  .container          { padding-left: 1rem; padding-right: 1rem; }

  /* Tables — horizontal scroll */
  .card table         { min-width: 500px; }

  /* Exam take page */
  .question-area      { padding: 1rem !important; }
  .question-text      { font-size: 1rem !important; }

  /* Transcript */
  .card tfoot         { display: none; }
}

/* Student portal bottom nav on mobile */
@media (max-width: 640px) {
  .student-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--color-primary);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    z-index: 50;
    box-shadow: 0 -2px 8px rgba(0,0,0,.15);
  }
  .student-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    min-width: 56px;
    text-align: center;
  }
  .student-bottom-nav a.is-active,
  .student-bottom-nav a:hover { color: white; }
  .student-bottom-nav .nav-icon { font-size: 1.25rem; line-height: 1; }
  /* Add bottom padding to content so it doesn't hide behind nav */
  body.has-bottom-nav main { padding-bottom: 5rem; }
}

/* Floating "back to top" button */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  z-index: 30;
  transition: opacity .2s;
}
.back-to-top.visible { display: flex; }

/* Print improvements */
@media print {
  .admin-sidebar, .site-header, .site-footer,
  .no-print, .btn, .btn--ghost, .btn--text { display: none !important; }
  body { background: white; font-size: 11pt; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; page-break-inside: avoid; }
  .page-hero { padding: 0.5rem 0 !important; }
  .container { max-width: 100% !important; padding: 0 !important; }
  a[href]:after { content: none !important; }
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* Skip to content link for screen readers */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--color-primary);
  color: white;
  padding: .5rem 1rem;
  border-radius: 0 0 4px 4px;
  z-index: 200;
  font-size: .875rem;
  transition: top .1s;
}
.skip-link:focus { top: 0; }

/* ── SweetAlert2 portal theme ─────────────────────────────────────── */
.swal2-popup { border-radius: var(--radius-md) !important; font-family: var(--font-sans) !important; }
.swal2-title { font-family: var(--font-display) !important; font-size: 1.25rem !important; color: var(--color-text) !important; }
.swal2-html-container { color: var(--color-text-soft) !important; font-size: 0.9rem !important; }
.swal2-actions { gap: 0.75rem !important; }
.swal2-confirm.btn { min-width: 110px; }
.swal2-cancel.btn--ghost { min-width: 90px; }
/* Toast tweaks */
.swal2-container.swal2-top-end { z-index: 9999 !important; }
.swal2-toast { box-shadow: 0 4px 16px rgba(0,0,0,.12) !important; }
