/* ── Reset & variables ─────────────────────────────────────────────────────── */
@import url('https://fonts.cdnfonts.com/css/computer-modern');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy:    #1a1a2e;
    --navy2:   #2c2c44;
    --blue:    #1a3a6b;
    --blue-h:  #122d56;
    --teal:    #2a6099;
    --gold:    #cb9b20;
    --green:   #2d6a2d;
    --red:     #8b1a1a;
    --bg:      #fafaf7;
    --bg-alt:  #f2f0ea;
    --border:  #ccc9bf;
    --text:    #111111;
    --muted:   #555550;
    --white:   #ffffff;
    --radius:  2px;
    --shadow:  0 1px 2px rgba(0,0,0,.10);
    --shadow-md: 0 2px 8px rgba(0,0,0,.13);
}

html { font-size: 16px; }

body {
    font-family: 'Computer Modern', 'Times New Roman', Times, serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main { flex: 1; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ────────────────────────────────────────────────────────────────── */
.navbar {
    background: var(--navy);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid var(--navy2);
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    color: var(--white);
    font-weight: normal;
    font-size: 1.2rem;

    letter-spacing: .3px;
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.88rem;
    font-family: 'Computer Modern', 'Times New Roman', Times, serif;
}

.nav-links a { color: #c8c4b8; text-decoration: none; }
.nav-links a:hover { color: var(--white); text-decoration: underline; }

.nav-username {
    color: #94a3b8;
    font-size: 0.85rem;
}

.nav-admin { color: var(--gold) !important; }

.premium-badge {
    background: var(--gold);
    color: var(--navy);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
}

.btn-nav {
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none !important;
}

.btn-premium-nav {
    background: var(--gold);
    color: var(--navy) !important;
}
.btn-premium-nav:hover { background: #fbbf24; }

.btn-register-nav {
    background: var(--blue);
    color: var(--white) !important;
}
.btn-register-nav:hover { background: var(--blue-h); }

.btn-logout-nav {
    background: rgba(255,255,255,.1);
    color: #cbd5e1 !important;
}
.btn-logout-nav:hover { background: rgba(255,255,255,.18); }

/* ── Flash messages ────────────────────────────────────────────────────────── */
.flash-container {
    position: fixed;
    top: 70px;
    right: 1.5rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    transition: opacity .4s;
}

.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem 1.1rem;
    border-radius: var(--radius);
    font-size: .88rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    max-width: 360px;
}

.flash-success { background: #dcfce7; color: #15803d; border-left: 4px solid var(--green); }
.flash-error   { background: #fee2e2; color: #b91c1c; border-left: 4px solid var(--red); }
.flash-info    { background: #e0f2fe; color: #0369a1; border-left: 4px solid var(--teal); }
.flash-warning { background: #fef9c3; color: #854d0e; border-left: 4px solid var(--gold); }

.flash-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: .9rem;
    color: inherit;
    opacity: .6;
    padding: 0;
    line-height: 1;
}
.flash-close:hover { opacity: 1; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: .5rem 1.4rem;
    border-radius: var(--radius);
    font-weight: normal;
    font-size: .9rem;
    font-family: 'Computer Modern', 'Times New Roman', Times, serif;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: background .15s;
    text-align: center;
    letter-spacing: .02em;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--blue); color: var(--white); border-color: var(--blue-h); }
.btn-primary:hover { background: var(--blue-h); color: var(--white); }

.btn-secondary { background: var(--bg-alt); color: var(--muted); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); color: var(--text); }

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}
.btn-outline:hover { background: var(--bg-alt); color: var(--text); }

.btn-full { display: block; width: 100%; }
.btn-lg { padding: .85rem 2rem; font-size: 1rem; }
.btn-sm { padding: .35rem .9rem; font-size: .8rem; }

.btn-disabled { opacity: .5; pointer-events: none; }

.btn-resolve {
    background: var(--green);
    color: var(--white);
    border: none;
    cursor: pointer;
    border-radius: var(--radius);
    padding: .35rem .9rem;
    font-size: .8rem;
    font-weight: 600;
}
.btn-resolve:hover { background: #15803d; }

/* ── Layout helpers ────────────────────────────────────────────────────────── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 2.5rem 0;
}

.section-alt {
    background: var(--bg-alt);
}

.section-title {
    font-size: 1.55rem;
    font-weight: normal;
    font-variant: small-caps;
    letter-spacing: .04em;
    margin-bottom: .75rem;
    color: var(--navy);
    border-bottom: 1px solid var(--border);
    padding-bottom: .35rem;
}

.section-desc {
    color: var(--muted);
    max-width: 680px;
    margin-bottom: 0;
    font-size: 1.02rem;

}

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.hero {
    position: relative;
    overflow: hidden;
    background: var(--navy);
    color: var(--white);
    padding: 5rem 1.5rem 4rem;
    text-align: center;
    border-bottom: 3px double #4a4a6a;
}

.hero-parallax {
    position: absolute;
    top: 0;
    left: 50%;
    opacity: .12;
    pointer-events: none;
    user-select: none;
    transform: translateX(-50%);
    will-change: transform;
}

.hero-inner { max-width: 700px; margin: 0 auto; }

.hero h1 {
    font-size: clamp(1.9rem, 5vw, 2.8rem);
    font-weight: normal;

    line-height: 1.25;
    margin-bottom: 1rem;
    letter-spacing: .02em;
}

.hero-sub {
    font-size: 1.05rem;
    color: #a8a49a;
    margin-bottom: 2.25rem;

}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-actions .btn-outline {
    border-color: rgba(255,255,255,.4);
    color: var(--white);
}
.hero-actions .btn-outline:hover {
    background: rgba(255,255,255,.1);
    color: var(--white);
}

/* ── Feature cards ─────────────────────────────────────────────────────────── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.5rem;
    box-shadow: var(--shadow);
    border-left: 3px solid var(--navy);
}

.feature-icon { font-size: 1.6rem; margin-bottom: .6rem; }
.feature-card h3 { font-size: 1rem; font-weight: normal; font-variant: small-caps; letter-spacing: .04em; margin-bottom: .4rem; }
.feature-card p  { font-size: .9rem; color: var(--muted); line-height: 1.6; }

/* ── Quick access ──────────────────────────────────────────────────────────── */
.quick-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.quick-card {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: box-shadow .15s, transform .15s;
}
.quick-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--blue);
}

.quick-premium { border-color: var(--gold); color: #92400e; }
.quick-premium:hover { color: var(--gold); }
.quick-icon { font-size: 1.4rem; }

/* ── Links section ─────────────────────────────────────────────────────────── */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.link-card {
    display: block;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.3rem;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: border-color .15s;
}
.link-card:hover {
    border-color: var(--blue);
    text-decoration: none;
}

.link-name {
    font-weight: normal;
    font-size: .95rem;

    color: var(--blue);
    margin-bottom: .3rem;
}
.link-desc { font-size: .87rem; color: var(--muted); line-height: 1.55; }

/* ── CTA section ───────────────────────────────────────────────────────────── */
.cta-section {
    background: linear-gradient(135deg, var(--blue) 0%, #1d4ed8 100%);
    color: var(--white);
}

.cta-inner {
    text-align: center;
}

.cta-inner h2 { font-size: 1.9rem; margin-bottom: .5rem; }
.cta-inner p  { color: rgba(255,255,255,.8); margin-bottom: 1.75rem; font-size: 1.05rem; }

.cta-inner .btn-primary {
    background: var(--white);
    color: var(--blue);
}
.cta-inner .btn-primary:hover {
    background: #e0e7ff;
    color: var(--blue-h);
}

/* ── Auth pages ────────────────────────────────────────────────────────────── */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 1rem 4rem;
}

.auth-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-md);
}

.auth-card-wide { max-width: 600px; }

.auth-title {
    font-size: 1.5rem;
    font-weight: normal;
    font-variant: small-caps;
    letter-spacing: .05em;
    margin-bottom: .4rem;
    color: var(--navy);
    border-bottom: 1px solid var(--border);
    padding-bottom: .3rem;
}

.auth-sub {
    color: var(--muted);
    font-size: .9rem;
    margin-bottom: 1.75rem;
}

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .35rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: .55rem .85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .95rem;
    font-family: 'Computer Modern', 'Times New Roman', Times, serif;
    color: var(--text);
    background: var(--white);
    transition: border-color .15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--blue);
}

.form-group textarea { resize: vertical; }

.captcha-group label { color: var(--blue); font-weight: 700; }
.captcha-input { max-width: 140px; }

.form-check {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.form-check input { width: auto; }
.check-label { font-weight: 400; font-size: .9rem; }

.form-note { font-size: .82rem; color: var(--muted); margin-bottom: .75rem; }

.required { color: var(--red); }
.hint { font-weight: 400; color: var(--muted); }

/* ── Browse page ───────────────────────────────────────────────────────────── */
.browse-page { padding: 2.5rem 0 4rem; }

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem;
    font-size: .88rem;
    margin-bottom: 1.5rem;
    color: var(--muted);
}

.breadcrumbs a { color: var(--blue); }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { color: #cbd5e1; }
.breadcrumbs .current { color: var(--text); font-weight: 500; }

/* ── File tree ──────────────────────────────────────────────────────────────── */
.tree-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tree-children .tree-list {
    padding-left: 1.5rem;
}

.tree-item {
    border-bottom: 1px solid var(--bg-alt);
}
.tree-item:last-child { border-bottom: none; }

/* Outermost list gets a card border */
.browse-page > .container > .tree-list {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    overflow: hidden;
}

.tree-row {
    display: flex;
    align-items: center;
}

.tree-check,
.check-space {
    display: none;
    flex-shrink: 0;
    width: 1rem;
    margin: 0 .35rem 0 1rem;
}

.tree-check {
    height: 1rem;
    cursor: pointer;
    accent-color: var(--blue);
}

#dl-form.selecting .tree-check,
#dl-form.selecting .check-space {
    display: block;
}

.browse-toolbar {
    display: flex;
    gap: .5rem;
    margin-bottom: .75rem;
}

.tree-toggle {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex: 1;
    min-width: 0;
    padding: .75rem .75rem .75rem 0;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: inherit;
    color: var(--text);
    transition: background .1s;
}
.tree-row:hover { background: var(--bg-alt); }
.tree-row:has(.tree-file-link:hover) { background: #f0f6ff; }

.tree-file-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex: 1;
    min-width: 0;
    padding: .75rem .75rem .75rem 0;
    color: var(--blue);
    text-decoration: none;
}
.tree-file-link:hover { text-decoration: none; }

/* Download bar */
.download-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--navy);
    color: var(--white);
    padding: .8rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 200;
    box-shadow: 0 -2px 16px rgba(0,0,0,.25);
}
.download-bar[hidden] { display: none; }
.dl-info { flex: 1; font-size: .9rem; }
.dl-clear, .dl-track { border-color: rgba(255,255,255,.35); color: var(--white); }
.dl-clear:hover, .dl-track:hover { background: rgba(255,255,255,.1); color: var(--white); }

.tree-arrow {
    display: inline-block;
    flex-shrink: 0;
    width: .55rem;
    height: .55rem;
    border-top:   1.5px solid var(--muted);
    border-right: 1.5px solid var(--muted);
    transform: rotate(45deg);
    transition: transform .15s;
    margin-right: .3rem;
}

.tree-arrow.open { transform: rotate(135deg); }

.file-arrow {
    border-color: var(--border);
    cursor: default;
}

.tree-folder .tree-name { font-weight: 500; }
.tree-file   .tree-name { color: var(--blue); }

.tree-count {
    font-weight: 400;
    font-size: .8em;
    color: var(--muted);
    margin-left: .35rem;
}

.paid-label {
    margin-left: auto;
    font-size: .78rem;
    font-weight: 600;
    color: var(--gold);
}

.owned-label {
    margin-left: auto;
    font-size: .74rem;
    color: var(--muted);
}

.coming-soon-label {
    margin-left: auto;
    font-size: .74rem;
    color: #aaa;
}

.empty { padding: 2rem; color: var(--muted); text-align: center; font-size: .95rem; }

.upgrade-nudge {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    padding: .75rem 1.1rem;
    font-size: .88rem;
    color: #78350f;
    margin-bottom: 1.5rem;
}
.upgrade-nudge a { color: #92400e; font-weight: 700; }

.browse-footer { margin-top: 1.5rem; }

/* ── Upgrade page ──────────────────────────────────────────────────────────── */
.upgrade-page { padding: 3.5rem 0 5rem; }

.upgrade-hero {
    text-align: center;
    margin-bottom: 3rem;
}
.upgrade-hero h1 { font-size: 2rem; margin-bottom: .5rem; color: var(--navy); }
.upgrade-hero p  { color: var(--muted); font-size: 1.05rem; }

.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    max-width: 660px;
    margin: 0 auto 2rem;
}

.plan-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 2rem 1.75rem;
    position: relative;
    box-shadow: var(--shadow);
}

.plan-premium {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(245,158,11,.15);
}

.plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gold);
    color: var(--navy);
    font-size: .75rem;
    font-weight: 700;
    padding: 3px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

.plan-card h2 { font-size: 1.3rem; margin-bottom: .4rem; }

.plan-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 1.25rem;
}

.plan-features {
    list-style: none;
    margin-bottom: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.plan-features li { font-size: .9rem; color: var(--text); }
.plan-no { color: var(--muted); text-decoration: line-through; opacity: .7; }

.upgrade-note {
    text-align: center;
    color: var(--muted);
    font-size: .87rem;
    max-width: 500px;
    margin: 0 auto;
}

/* ── Admin page ────────────────────────────────────────────────────────────── */
.admin-page { padding: 2.5rem 0 4rem; }
.admin-page h1 { font-size: 1.55rem; font-weight: normal; font-variant: small-caps; letter-spacing: .04em; margin-bottom: 1.5rem; display: flex; align-items: center; gap: .75rem; border-bottom: 1px solid var(--border); padding-bottom: .35rem; }

.count-badge {
    background: var(--blue);
    color: var(--white);
    font-size: .8rem;
    padding: 2px 10px;
    border-radius: 20px;
}

.report-tabs {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.25rem;
}

.tab-btn {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: .45rem 1.1rem;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--muted);
    transition: all .15s;
}
.tab-btn:hover, .tab-btn.active {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    font-size: .86rem;
}

.report-table th {
    background: var(--bg-alt);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.report-table td {
    padding: .8rem 1rem;
    border-bottom: 1px solid var(--bg-alt);
    vertical-align: top;
}

.report-table tr:last-child td { border-bottom: none; }
.report-table tr:hover td { background: #f8fafc; }

.desc-cell { max-width: 240px; white-space: pre-wrap; word-break: break-word; }
.path-cell { font-family: monospace; font-size: .8rem; color: var(--muted); }
.date-cell { white-space: nowrap; color: var(--muted); }

.type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: .76rem;
    font-weight: 600;
    text-transform: capitalize;
    background: #e0e7ff;
    color: #3730a3;
}
.type-badge.type-bug             { background: #fee2e2; color: var(--red); }
.type-badge.type-paper_error     { background: #fff7ed; color: #c2410c; }
.type-badge.type-missing_paper   { background: #f0fdf4; color: #15803d; }

.status-badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: .76rem;
    font-weight: 600;
}
.status-open     { background: #fee2e2; color: var(--red); }
.status-resolved { background: #dcfce7; color: var(--green); }

.text-muted { color: var(--muted); }
.empty-state { color: var(--muted); padding: 2rem 0; text-align: center; }

/* ── Error pages ────────────────────────────────────────────────────────────── */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 3rem 1.5rem;
}

.error-code {
    font-size: clamp(5rem, 20vw, 10rem);
    font-weight: normal;
    color: var(--navy);
    line-height: 1;
    letter-spacing: -.02em;
    opacity: .15;
}

.error-msg {
    margin: 1rem 0 2rem;
    color: var(--muted);
    font-size: 1.1rem;
}

/* ── Admin nav tabs ─────────────────────────────────────────────────────────── */
.admin-nav-tabs {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.25rem;
}
.tab-link {
    padding: .45rem 1.1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: .85rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    transition: all .15s;
}
.tab-link:hover { background: var(--bg-alt); text-decoration: none; }
.tab-link-active {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}

/* ── User management table ──────────────────────────────────────────────────── */
.user-table .action-cell { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }

.btn-toggle-off {
    background: var(--bg-alt);
    color: var(--muted);
    border: 1px solid var(--border);
}
.btn-toggle-off:hover { background: var(--border); }

.btn-outline-sm {
    background: var(--white);
    border: 1.5px solid var(--border);
    color: var(--text);
    padding: .25rem .7rem;
    font-size: .78rem;
    border-radius: var(--radius);
    cursor: pointer;
}
.btn-outline-sm:hover { background: var(--bg-alt); }

.btn-primary-sm {
    background: var(--blue);
    border: 1.5px solid var(--blue);
    color: var(--white);
    padding: .25rem .7rem;
    font-size: .78rem;
    border-radius: var(--radius);
    cursor: pointer;
}
.btn-primary-sm:hover { background: var(--blue-h); }

.btn-danger-sm {
    background: #fee2e2;
    border: 1.5px solid #fca5a5;
    color: var(--red);
    padding: .25rem .7rem;
    font-size: .78rem;
    border-radius: var(--radius);
    cursor: pointer;
}
.btn-danger-sm:hover { background: #fca5a5; }

.btn-action-link {
    background: none;
    border: none;
    padding: 0;
    font-size: .85rem;
    font-family: inherit;
    cursor: pointer;
    color: var(--blue);
    text-decoration: none;
}
.btn-action-link:hover { text-decoration: underline; }
.btn-action-danger { color: var(--red); }

.inline-panel td { background: var(--bg-alt) !important; padding: .75rem 1rem !important; }
.inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .75rem;
}
.inline-form label {
    display: flex;
    flex-direction: column;
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
    gap: .25rem;
}
.inline-form input {
    padding: .35rem .6rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: .85rem;
    font-family: inherit;
    background: var(--white);
    color: var(--text);
    width: 200px;
}

/* ── Admin section blocks ───────────────────────────────────────────────────── */
.admin-section {
    margin-bottom: 2.5rem;
    padding: 1.25rem 1.5rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.admin-section-title {
    font-size: 1rem;
    font-weight: normal;
    font-variant: small-caps;
    letter-spacing: .04em;
    color: var(--muted);
    margin-bottom: 1rem;
    padding-bottom: .35rem;
    border-bottom: 1px solid var(--border);
}
.admin-hint { font-size: .82rem; color: var(--muted); margin-bottom: .75rem; }
.admin-hint code { background: var(--bg-alt); padding: 1px 5px; border-radius: 3px; font-size: .8rem; }
.inline-form-wide { flex-wrap: wrap; gap: .75rem; }
.back-link { font-size: .85rem; color: var(--muted); margin-right: .5rem; text-decoration: none; }
.back-link:hover { color: var(--blue); }

/* ── Pack tags (users table) ────────────────────────────────────────────────── */
.pack-cell { max-width: 200px; }
.pack-tag {
    display: inline-block;
    background: #e0e7ff;
    color: #3730a3;
    font-size: .72rem;
    padding: 2px 7px;
    border-radius: 6px;
    margin: 1px 2px;
}

/* ── Shop / pack cards ───────────────────────────────────────────────────────── */
.packs-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pack-desc { font-size: .88rem; color: var(--muted); margin: .5rem 0 .75rem; }
.pack-contents { margin-top: .75rem; }
.owned-badge { background: var(--green); }

/* ── Footer ────────────────────────────────────────────────────────────────── */
footer {
    background: var(--navy);
    color: #9a9690;
    padding: 2rem 1.5rem;
    margin-top: auto;
    border-top: 2px solid var(--navy2);

}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-left strong { color: var(--white); font-size: .95rem; }
.footer-left p { font-size: .82rem; margin-top: .25rem; }

.footer-links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: .4rem 0;
}
.footer-links a {
    color: #94a3b8;
    font-size: .85rem;
    padding: 0 .9rem;
    border-left: 1px solid #4a4a5a;
}
.footer-links a:first-child { border-left: none; padding-left: 0; }
.footer-links a:hover { color: var(--white); text-decoration: none; }

.footer-right { font-size: .82rem; }

/* ── Hamburger button (hidden on desktop) ───────────────────────────────────── */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 .25rem;
    line-height: 1;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .nav-toggle { display: block; }

    .nav-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--navy);
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: .5rem 0;
        border-top: 1px solid var(--navy2);
        box-shadow: 0 4px 12px rgba(0,0,0,.3);
        z-index: 99;
    }
    .nav-links.open { display: flex; }

    .nav-links a,
    .nav-links .btn-nav,
    .nav-links .nav-username {
        width: 100%;
        padding: .65rem 1.5rem;
        border-radius: 0;
        font-size: .9rem;
        box-sizing: border-box;
        display: block;
    }
    .nav-links .nav-username {
        color: #94a3b8;
        font-size: .85rem;
    }
    .nav-links .btn-nav {
        border: none;
        text-align: left;
    }

    .download-bar {
        flex-wrap: wrap;
        padding: .65rem 1rem;
        gap: .5rem;
    }
    .dl-info {
        width: 100%;
        flex: none;
    }

    .hero { padding: 3.5rem 1rem 3rem; }
    .plan-grid { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; gap: 1.25rem; }
    .report-table { font-size: .78rem; }
    .report-table th, .report-table td { padding: .6rem .7rem; }
}
