/* ============================================================
   SkillActivate — site.css
   Design tokens: indigo-600 accent / slate-900 dark / slate-50 bg
   Bootstrap-class bridge + custom components
   ============================================================ */

/* ── Design tokens ─────────────────────────────────────────── */
:root {
    --brand:       #4f46e5;   /* indigo-600  */
    --brand-dark:  #4338ca;   /* indigo-700  */
    --brand-light: #6366f1;   /* indigo-500  */
    --ink:         #0f172a;   /* slate-900   */
    --muted:       #64748b;   /* slate-500   */
    --line:        #e2e8f0;   /* slate-200   */
    --surface:     #f8fafc;   /* slate-50    */
    --soft-accent: #eef2ff;   /* indigo-50   */
    --accent:      #4f46e5;
    --danger:      #dc2626;
    --success:     #16a34a;
    --warning:     #d97706;
    --info:        #0284c7;
}

/* ── Base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background: var(--surface);
    line-height: 1.6;
}

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

/* ── Glassmorphic navbar helpers ───────────────────────────── */
.glass {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.nav-link {
    color: var(--ink);
    text-decoration: none;
    padding: .375rem .75rem;
    font-size: .875rem;
    font-weight: 500;
    border-radius: .375rem;
    transition: color .15s ease, background .15s ease;
}
.nav-link:hover { color: var(--brand); background: var(--soft-accent); }
.nav-link.active { color: var(--brand); font-weight: 600; }

.gradient-text {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dot-grid {
    background-image: radial-gradient(circle, #e2e8f0 1.5px, transparent 1.5px);
    background-size: 26px 26px;
}

/* ── Bootstrap grid polyfill ───────────────────────────────── */
.container, .container-fluid {
    width: 100%;
    max-width: 1280px;
    margin-inline: auto;
    padding-inline: 1rem;
}
.container-fluid { max-width: none; }

.row {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
}

/* g-* gap helpers */
.g-0  { gap: 0; }
.g-1  { gap: .25rem; }
.g-2  { gap: .5rem; }
.g-3  { gap: .75rem; }
.g-4  { gap: 1rem; }
.g-5  { gap: 1.5rem; }
.gx-0 { column-gap: 0; }
.gx-1 { column-gap: .25rem; }
.gx-2 { column-gap: .5rem; }
.gx-3 { column-gap: .75rem; }
.gx-4 { column-gap: 1rem; }
.gx-5 { column-gap: 1.5rem; }
.gy-0 { row-gap: 0; }
.gy-1 { row-gap: .25rem; }
.gy-2 { row-gap: .5rem; }
.gy-3 { row-gap: .75rem; }
.gy-4 { row-gap: 1rem; }
.gy-5 { row-gap: 1.5rem; }

/* Columns — mobile first (all cols span full width by default) */
[class*="col-"] { grid-column: span 12; }

.col-1  { grid-column: span 1; }
.col-2  { grid-column: span 2; }
.col-3  { grid-column: span 3; }
.col-4  { grid-column: span 4; }
.col-5  { grid-column: span 5; }
.col-6  { grid-column: span 6; }
.col-7  { grid-column: span 7; }
.col-8  { grid-column: span 8; }
.col-9  { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }
.col    { grid-column: span 1; flex: 1; }

/* sm ≥ 576px */
@media (min-width: 576px) {
    .col-sm-1  { grid-column: span 1; }
    .col-sm-2  { grid-column: span 2; }
    .col-sm-3  { grid-column: span 3; }
    .col-sm-4  { grid-column: span 4; }
    .col-sm-5  { grid-column: span 5; }
    .col-sm-6  { grid-column: span 6; }
    .col-sm-7  { grid-column: span 7; }
    .col-sm-8  { grid-column: span 8; }
    .col-sm-9  { grid-column: span 9; }
    .col-sm-10 { grid-column: span 10; }
    .col-sm-11 { grid-column: span 11; }
    .col-sm-12 { grid-column: span 12; }
}

/* md ≥ 768px */
@media (min-width: 768px) {
    .col-md-1  { grid-column: span 1; }
    .col-md-2  { grid-column: span 2; }
    .col-md-3  { grid-column: span 3; }
    .col-md-4  { grid-column: span 4; }
    .col-md-5  { grid-column: span 5; }
    .col-md-6  { grid-column: span 6; }
    .col-md-7  { grid-column: span 7; }
    .col-md-8  { grid-column: span 8; }
    .col-md-9  { grid-column: span 9; }
    .col-md-10 { grid-column: span 10; }
    .col-md-11 { grid-column: span 11; }
    .col-md-12 { grid-column: span 12; }
    .d-md-none  { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-flex  { display: flex !important; }
    .d-md-grid  { display: grid !important; }
}

/* lg ≥ 992px */
@media (min-width: 992px) {
    .col-lg-1  { grid-column: span 1; }
    .col-lg-2  { grid-column: span 2; }
    .col-lg-3  { grid-column: span 3; }
    .col-lg-4  { grid-column: span 4; }
    .col-lg-5  { grid-column: span 5; }
    .col-lg-6  { grid-column: span 6; }
    .col-lg-7  { grid-column: span 7; }
    .col-lg-8  { grid-column: span 8; }
    .col-lg-9  { grid-column: span 9; }
    .col-lg-10 { grid-column: span 10; }
    .col-lg-11 { grid-column: span 11; }
    .col-lg-12 { grid-column: span 12; }
    .d-lg-none  { display: none !important; }
    .d-lg-block { display: block !important; }
    .d-lg-flex  { display: flex !important; }
    .d-lg-grid  { display: grid !important; }
    .flex-lg-row     { flex-direction: row !important; }
    .flex-lg-column  { flex-direction: column !important; }
    .text-lg-end     { text-align: right !important; }
    .text-lg-start   { text-align: left !important; }
    .text-lg-center  { text-align: center !important; }
    .mb-lg-0 { margin-bottom: 0 !important; }
    .mt-lg-0 { margin-top: 0 !important; }
}

/* xl ≥ 1200px */
@media (min-width: 1200px) {
    .col-xl-1  { grid-column: span 1; }
    .col-xl-2  { grid-column: span 2; }
    .col-xl-3  { grid-column: span 3; }
    .col-xl-4  { grid-column: span 4; }
    .col-xl-5  { grid-column: span 5; }
    .col-xl-6  { grid-column: span 6; }
    .col-xl-7  { grid-column: span 7; }
    .col-xl-8  { grid-column: span 8; }
    .col-xl-9  { grid-column: span 9; }
    .col-xl-10 { grid-column: span 10; }
    .col-xl-11 { grid-column: span 11; }
    .col-xl-12 { grid-column: span 12; }
}

/* align-items-start inside row */
.align-items-start   { align-items: start; }
.align-items-center  { align-items: center; }
.align-items-end     { align-items: end; }
.align-items-stretch { align-items: stretch; }

/* ── Bootstrap display utilities ───────────────────────────── */
.d-none   { display: none !important; }
.d-block  { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex   { display: flex !important; }
.d-grid   { display: grid !important; }

/* ── Flex utilities ─────────────────────────────────────────── */
.flex-column  { flex-direction: column !important; }
.flex-row     { flex-direction: row !important; }
.flex-wrap    { flex-wrap: wrap !important; }
.flex-nowrap  { flex-wrap: nowrap !important; }
.flex-fill    { flex: 1 1 auto !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }

.justify-content-start   { justify-content: flex-start !important; }
.justify-content-center  { justify-content: center !important; }
.justify-content-end     { justify-content: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around  { justify-content: space-around !important; }

.gap-0 { gap: 0 !important; }
.gap-1 { gap: .25rem !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: .75rem !important; }
.gap-4 { gap: 1rem !important; }
.gap-5 { gap: 1.5rem !important; }

/* ── Spacing utilities ─────────────────────────────────────── */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: .75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-5 { margin-bottom: 1.5rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: .25rem !important; }
.mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: .75rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mt-5 { margin-top: 1.5rem !important; }

.ms-0 { margin-left: 0 !important; }
.ms-1 { margin-left: .25rem !important; }
.ms-2 { margin-left: .5rem !important; }
.ms-3 { margin-left: .75rem !important; }
.ms-auto { margin-left: auto !important; }

.me-0 { margin-right: 0 !important; }
.me-1 { margin-right: .25rem !important; }
.me-2 { margin-right: .5rem !important; }
.me-3 { margin-right: .75rem !important; }
.me-auto { margin-right: auto !important; }

.mx-auto { margin-inline: auto !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: .25rem !important; }
.p-2 { padding: .5rem !important; }
.p-3 { padding: .75rem !important; }
.p-4 { padding: 1rem !important; }
.p-5 { padding: 1.5rem !important; }

.py-3 { padding-block: .75rem !important; }
.py-4 { padding-block: 1rem !important; }
.py-5 { padding-block: 1.5rem !important; }
.px-3 { padding-inline: .75rem !important; }
.px-4 { padding-inline: 1rem !important; }

/* ── Text utilities ────────────────────────────────────────── */
.text-center  { text-align: center !important; }
.text-start   { text-align: left !important; }
.text-end     { text-align: right !important; }
.text-muted   { color: var(--muted) !important; }
.text-primary { color: var(--brand) !important; }
.text-danger  { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-white   { color: #fff !important; }
.text-dark    { color: var(--ink) !important; }

.fw-bold   { font-weight: 700 !important; }
.fw-600    { font-weight: 600 !important; }
.fw-500    { font-weight: 500 !important; }
.fw-normal { font-weight: 400 !important; }

.small { font-size: .875rem !important; }
.fs-sm { font-size: .875rem !important; }
.fs-xs { font-size: .75rem !important; }

.lh-1 { line-height: 1 !important; }

.w-100 { width: 100% !important; }

/* ── Borders / radius ──────────────────────────────────────── */
.border      { border: 1px solid var(--line) !important; }
.border-0    { border: none !important; }
.rounded     { border-radius: .5rem !important; }
.rounded-lg  { border-radius: .75rem !important; }
.rounded-pill { border-radius: 9999px !important; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    padding: .5rem 1rem;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.4;
    border-radius: .5rem;
    border: 1.5px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
    white-space: nowrap;
    user-select: none;
}
.btn:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }
.btn-lg { padding: .65rem 1.4rem; font-size: 1rem; }

.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

.btn-secondary {
    background: #f1f5f9;
    border-color: var(--line);
    color: var(--ink);
}
.btn-secondary:hover {
    background: #e2e8f0;
    color: var(--ink);
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.btn-success:hover { background: #15803d; border-color: #15803d; color: #fff; }

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }

.btn-warning {
    background: var(--warning);
    border-color: var(--warning);
    color: #fff;
}
.btn-warning:hover { background: #b45309; border-color: #b45309; color: #fff; }

.btn-outline-primary {
    background: transparent;
    border-color: var(--brand);
    color: var(--brand);
}
.btn-outline-primary:hover, .btn-outline-primary:focus {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.btn-outline-secondary {
    background: transparent;
    border-color: var(--line);
    color: var(--muted);
}
.btn-outline-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--ink);
}

.btn-outline-danger {
    background: transparent;
    border-color: var(--danger);
    color: var(--danger);
}
.btn-outline-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-outline-success {
    background: transparent;
    border-color: var(--success);
    color: var(--success);
}
.btn-outline-success:hover {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.btn-light {
    background: #fff;
    border-color: var(--line);
    color: var(--ink);
}
.btn-light:hover { background: var(--surface); color: var(--ink); }

.btn-dark {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}
.btn-dark:hover { background: #1e293b; color: #fff; }

.btn-link {
    background: transparent;
    border-color: transparent;
    color: var(--brand);
    padding-inline: 0;
    text-decoration: underline;
}
.btn-link:hover { color: var(--brand-dark); }

/* Ghost brand */
.btn-ghost-brand {
    background: transparent;
    border-color: transparent;
    color: var(--brand);
}
.btn-ghost-brand:hover { color: var(--brand-dark); text-decoration: underline; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: .25rem .55rem;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 9999px;
    white-space: nowrap;
}
.bg-primary   { background: var(--brand)   !important; color: #fff !important; }
.bg-secondary { background: #94a3b8        !important; color: #fff !important; }
.bg-success   { background: var(--success) !important; color: #fff !important; }
.bg-danger    { background: var(--danger)  !important; color: #fff !important; }
.bg-warning   { background: var(--warning) !important; color: #fff !important; }
.bg-info      { background: var(--info)    !important; color: #fff !important; }
.bg-dark      { background: var(--ink)     !important; color: #fff !important; }
.bg-light     { background: #f1f5f9        !important; color: var(--ink) !important; }
.bg-white     { background: #fff           !important; color: var(--ink) !important; }
.text-bg-primary   { background: var(--brand)   !important; color: #fff !important; }
.text-bg-secondary { background: #94a3b8        !important; color: #fff !important; }
.text-bg-success   { background: var(--success) !important; color: #fff !important; }
.text-bg-danger    { background: var(--danger)  !important; color: #fff !important; }
.text-bg-warning   { background: var(--warning) !important; color: #fff !important; }
.text-bg-info      { background: var(--info)    !important; color: #fff !important; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
    padding: .875rem 1rem;
    border-radius: .5rem;
    border: 1px solid transparent;
    margin-bottom: 1rem;
    font-size: .875rem;
}
.alert-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-info    { background: #f0f9ff; border-color: #bae6fd; color: #075985; }
.alert-primary { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: .75rem;
    overflow: hidden;
}
.card-body { padding: 1.25rem; }
.card-header {
    padding: .875rem 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    font-weight: 600;
}
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: .5rem; }
.card-text  { color: var(--muted); }

/* ── Forms ──────────────────────────────────────────────────── */
.form-label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: .375rem;
}

.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: .5rem .75rem;
    font-size: .9rem;
    font-family: inherit;
    line-height: 1.5;
    color: var(--ink);
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: .5rem;
    transition: border-color .15s ease, box-shadow .15s ease;
    appearance: none;
    -webkit-appearance: none;
}
.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
}
.form-control::placeholder { color: #94a3b8; }
.form-control:disabled,
.form-select:disabled {
    background: var(--surface);
    color: var(--muted);
    cursor: not-allowed;
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right .65rem center;
    background-size: 14px;
    padding-right: 2.25rem;
}

textarea.form-control { resize: vertical; min-height: 100px; }

.form-control-sm { padding: .3rem .6rem; font-size: .8rem; }
.form-control-lg { padding: .65rem .9rem; font-size: 1rem; }

.form-text {
    display: block;
    margin-top: .3rem;
    font-size: .8rem;
    color: var(--muted);
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding-left: 0;
}
.form-check-input {
    width: 1rem;
    height: 1rem;
    margin-top: .2rem;
    flex-shrink: 0;
    accent-color: var(--brand);
    border: 1.5px solid var(--line);
    border-radius: .25rem;
    cursor: pointer;
}
.form-check-label {
    font-size: .875rem;
    color: var(--ink);
    cursor: pointer;
}

.invalid-feedback {
    display: block;
    font-size: .8rem;
    color: var(--danger);
    margin-top: .25rem;
}
.is-invalid .form-control,
.is-invalid .form-select,
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--danger);
}
.is-invalid .form-control:focus,
.is-invalid .form-select:focus,
.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .15);
}

/* Django error list */
.errorlist {
    list-style: none;
    padding: 0;
    margin: 0 0 .35rem;
}
.errorlist li {
    font-size: .8rem;
    color: var(--danger);
}

/* ── Tables ─────────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.table th {
    padding: .65rem .9rem;
    background: var(--surface);
    color: var(--muted);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}
.table td {
    padding: .75rem .9rem;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover td { background: var(--soft-accent); }
.table-sm th, .table-sm td { padding: .4rem .7rem; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: .25rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    height: 2.2rem;
    padding: 0 .5rem;
    font-size: .875rem;
    border-radius: .375rem;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.page-link:hover { background: var(--soft-accent); border-color: var(--brand); color: var(--brand); }
.page-item.active .page-link {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.page-item.disabled .page-link {
    color: #cbd5e1;
    pointer-events: none;
    background: var(--surface);
}

/* ── Lists ──────────────────────────────────────────────────── */
.list-unstyled { list-style: none; padding: 0; margin: 0; }
.list-group {
    border: 1px solid var(--line);
    border-radius: .5rem;
    overflow: hidden;
}
.list-group-item {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--line);
    background: #fff;
}
.list-group-item:last-child { border-bottom: none; }
.list-group-item-action { cursor: pointer; text-decoration: none; color: var(--ink); display: block; }
.list-group-item-action:hover { background: var(--surface); }

/* ── Headings / typography ──────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--ink);
}
.display-6 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; }
.lead { color: var(--muted); font-size: 1.1rem; }
.h5 { font-size: 1.05rem; font-weight: 700; }

/* ── Divider ────────────────────────────────────────────────── */
hr { border: none; border-top: 1px solid var(--line); margin-block: 1.5rem; }

/* ── Page layout ─────────────────────────────────────────────── */
.page-section { padding: 4rem 0; }
.page-section.compact-page { padding: 3rem 0; }

.compact-page h1 {
    font-size: clamp(2rem, 4vw, 3.25rem);
}

.section-kicker {
    margin-bottom: .75rem;
    color: var(--brand);
    font-weight: 700;
    text-transform: uppercase;
    font-size: .8rem;
    letter-spacing: .08em;
}

.section-heading { max-width: 760px; margin-bottom: 1.5rem; }
.section-heading h2 { font-size: clamp(1.8rem, 3vw, 2.7rem); line-height: 1.12; }
.section-heading.compact h2 { font-size: 1.45rem; }

/* ── Panels ─────────────────────────────────────────────────── */
.detail-panel,
.form-panel,
.filter-bar,
.empty-state {
    border: 1px solid var(--line);
    border-radius: .75rem;
    background: #fff;
    padding: 1.25rem;
}

.stat-panel,
.hero-console {
    border: 1px solid var(--line);
    border-radius: .75rem;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}

.hero-console { padding: 1.25rem; }

.console-topline {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
}
.console-topline strong { color: var(--brand); }

.stat-panel { display: grid; gap: 0; }
.stat-panel > div {
    padding: 1.25rem;
    border-bottom: 1px solid var(--line);
}
.stat-panel > div:last-child { border-bottom: 0; }
.stat-panel strong, .stat-panel span { display: block; }
.stat-panel span { color: var(--muted); }

.form-panel { padding: 1.5rem; }

.required-mark  { color: var(--danger); font-weight: 800; margin-left: .2rem; }
.required-note  { color: var(--muted); font-size: .9rem; }

/* ── Metric grid ─────────────────────────────────────────────── */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem;
    padding: 1rem 0;
}
.metric-grid div {
    border: 1px solid var(--line);
    border-radius: .5rem;
    padding: 1rem;
    background: var(--surface);
}
.metric-grid strong {
    display: block;
    font-size: 2rem;
    line-height: 1;
    color: var(--ink);
}
.metric-grid span { display: block; color: var(--muted); }

/* ── Workflow list ───────────────────────────────────────────── */
.workflow-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.workflow-list span {
    border-radius: 9999px;
    padding: .35rem .7rem;
    background: var(--soft-accent);
    color: var(--brand);
    font-weight: 700;
    font-size: .85rem;
}

/* ── Feature grid ────────────────────────────────────────────── */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.feature-tile {
    display: flex;
    flex-direction: column;
    min-height: 220px;
    border: 1px solid var(--line);
    border-radius: .75rem;
    padding: 1.25rem;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.feature-tile:hover {
    transform: translateY(-3px);
    border-color: rgba(79, 70, 229, .35);
    box-shadow: 0 16px 34px rgba(15, 23, 42, .10);
    color: var(--ink);
}
.feature-tile p { margin-bottom: 0; color: var(--muted); }
.feature-tile h3 { font-size: 1.05rem; }

.feature-tile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: .625rem;
    margin-bottom: 1.1rem;
    background: var(--soft-accent);
    color: var(--brand);
    font-size: 1.25rem;
    transition: background .16s ease, transform .16s ease;
}
.feature-tile:hover .feature-tile-icon {
    background: rgba(79, 70, 229, .18);
    transform: scale(1.08);
}

.feature-tile-arrow {
    display: block;
    margin-top: auto;
    padding-top: .75rem;
    color: var(--brand);
    font-size: .9rem;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity .16s ease, transform .16s ease;
}
.feature-tile:hover .feature-tile-arrow { opacity: 1; transform: translateX(0); }

/* ── Mini list ───────────────────────────────────────────────── */
.mini-list { display: grid; gap: .75rem; }
.mini-list a {
    display: block;
    border: 1px solid var(--line);
    border-radius: .5rem;
    padding: 1rem;
    color: var(--ink);
    text-decoration: none;
    background: #fff;
    transition: border-color .15s ease;
}
.mini-list a:hover { border-color: rgba(79, 70, 229, .35); color: var(--ink); }
.mini-list strong, .mini-list span { display: block; }
.mini-list span { color: var(--muted); font-size: .9rem; }

/* ── Content section (home bands) ───────────────────────────── */
.content-section { padding: 5rem 0; }
.content-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.1rem;
}
.content-view-all {
    font-size: .85rem;
    color: var(--brand);
    text-decoration: none;
    white-space: nowrap;
    font-weight: 600;
}
.content-view-all:hover { color: var(--brand-dark); text-decoration: underline; }

.content-card-list { display: grid; gap: .65rem; }
.content-card {
    border: 1px solid var(--line);
    border-radius: .5rem;
    padding: .9rem 1rem;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .85rem;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.content-card:hover {
    border-color: rgba(79, 70, 229, .4);
    box-shadow: 0 6px 18px rgba(15, 23, 42, .07);
    transform: translateX(3px);
    color: var(--ink);
}
.content-card-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .5rem;
    background: var(--soft-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--brand);
    font-size: 1rem;
}

/* ── CTA band ────────────────────────────────────────────────── */
.cta-band {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    position: relative;
    overflow: hidden;
}
.cta-band::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,.08) 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    pointer-events: none;
}
.cta-band-heading { color: #fff; font-size: clamp(1.8rem, 3.5vw, 2.8rem); margin-bottom: .75rem; }
.cta-band-lead { color: rgba(255,255,255,.75); max-width: 520px; margin-inline: auto; margin-bottom: 2rem; }
.cta-btn-primary {
    background: #fff;
    color: var(--brand);
    font-weight: 600;
    border: 2px solid #fff;
}
.cta-btn-primary:hover { background: var(--soft-accent); color: var(--brand-dark); }
.cta-btn-outline {
    color: #fff;
    border: 2px solid rgba(255,255,255,.5);
    background: transparent;
}
.cta-btn-outline:hover { background: rgba(255,255,255,.12); border-color: #fff; color: #fff; }

/* ── Home bands ──────────────────────────────────────────────── */
.home-band { padding: 4rem 0; background: var(--surface); }
.home-hero, .hero-section {
    padding: 5.5rem 0 4.5rem;
    background: linear-gradient(135deg,
        rgba(79, 70, 229, .08) 0%,
        rgba(99, 102, 241, .05) 50%,
        rgba(248, 250, 252, 1) 100%);
}
.home-hero, .hero-section {
    position: relative;
    overflow: hidden;
}
.home-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(79, 70, 229, .12) 1.5px, transparent 1.5px);
    background-size: 28px 28px;
    pointer-events: none;
}
.home-hero h1, .hero-section h1, .page-section h1 {
    max-width: 820px;
    font-size: clamp(2.25rem, 5vw, 4rem);
    line-height: 1.05;
}
.home-hero .lead { max-width: 680px; }

.hero-highlight { color: var(--brand); }
.hero-live-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .8rem;
    font-weight: 700;
    color: var(--brand);
}
.hero-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand);
    animation: pulse-dot 1.8s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .4; transform: scale(.7); }
}

/* ── Journal list ────────────────────────────────────────────── */
.journal-list { display: grid; gap: 1rem; }
.journal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--line);
    border-radius: .75rem;
    padding: 1.25rem;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.journal-row:hover {
    border-color: rgba(79, 70, 229, .35);
    box-shadow: 0 4px 16px rgba(15, 23, 42, .06);
}
.journal-row h2 a { color: var(--ink); text-decoration: none; }
.journal-row h2 a:hover { color: var(--brand); }

.journal-meta {
    margin-bottom: .35rem;
    color: var(--brand);
    font-size: .85rem;
    font-weight: 700;
}

.identifier-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    color: var(--muted);
    font-size: .9rem;
}
.identifier-list span {
    border: 1px solid var(--line);
    border-radius: 9999px;
    padding: .25rem .65rem;
}

/* ── Detail panel extras ─────────────────────────────────────── */
.detail-panel dl { margin-bottom: 0; }
.detail-panel dt { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.detail-panel dd { margin-bottom: 1rem; }

/* ── Editorial grid ──────────────────────────────────────────── */
.editorial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.editorial-card { border: 1px solid var(--line); border-radius: .5rem; padding: 1rem; background: #fff; }

/* ── Article rows ────────────────────────────────────────────── */
.article-authors { color: var(--muted); }
.article-row { align-items: flex-start; }

/* ── Keywords ────────────────────────────────────────────────── */
.keyword-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.keyword-list span {
    border: 1px solid var(--line);
    border-radius: 9999px;
    padding: .35rem .7rem;
    background: var(--soft-accent);
    color: var(--brand);
    font-size: .875rem;
}

/* ── Citation ────────────────────────────────────────────────── */
.citation-box {
    border-left: 4px solid var(--brand);
    background: var(--surface);
    padding: 1rem;
    border-radius: 0 .5rem .5rem 0;
}

/* ── Pagination wrap ─────────────────────────────────────────── */
.pagination-wrap { display: flex; justify-content: center; margin-top: 1.5rem; }

/* ── Membership grid ─────────────────────────────────────────── */
.membership-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.membership-card { border: 1px solid var(--line); border-radius: .75rem; padding: 1.25rem; background: #fff; }
.membership-price { color: var(--brand); font-weight: 700; }

/* ── Archives ────────────────────────────────────────────────── */
.archive-link-band, .archive-volume, .archive-issue, .archive-article {
    border: 1px solid var(--line);
    border-radius: .75rem;
    background: #fff;
}
.archive-link-band {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
}
.archive-list { display: grid; gap: 1rem; }
.archive-volume { overflow: hidden; }
.archive-volume-header, .archive-issue-header { padding: 1.25rem; background: var(--surface); }
.archive-issues { display: grid; gap: 1rem; padding: 1rem; }
.archive-issue { overflow: hidden; }
.archive-articles { display: grid; gap: .75rem; padding: 1rem; }
.archive-article { padding: 1rem; }
.archive-article a { color: var(--ink); text-decoration: none; }
.archive-article a:hover { color: var(--brand); }

/* ── Plain list ──────────────────────────────────────────────── */
.plain-list { padding-left: 1.1rem; }

/* ── Error pages ─────────────────────────────────────────────── */
.error-page { min-height: 60vh; display: flex; align-items: center; }
.error-code {
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 800;
    line-height: 1;
    color: var(--brand);
    opacity: .15;
}

/* ── Staff components ────────────────────────────────────────── */
.staff-action-card, .staff-module {
    display: block;
    border: 1px solid var(--line);
    border-radius: .75rem;
    background: #fff;
    box-shadow: 0 4px 16px rgba(15, 23, 42, .06);
}
.staff-action-card {
    min-height: 124px;
    padding: 1.25rem;
    color: var(--ink);
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.staff-action-card:hover, .staff-module-row:hover {
    border-color: rgba(79, 70, 229, .4);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .10);
}
.staff-action-card:hover { transform: translateY(-2px); color: var(--ink); }

.staff-action-count, .staff-action-label { display: block; }
.staff-action-count { font-size: 2.25rem; font-weight: 800; line-height: 1; color: var(--brand); }
.staff-action-label { margin-top: .75rem; color: var(--muted); font-weight: 700; }

.staff-module { padding: 1.25rem; }
.staff-module-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: .5rem;
    background: var(--soft-accent);
    color: var(--brand);
    font-size: 1.25rem;
}
.staff-module-list { display: grid; gap: .65rem; margin-top: 1.25rem; }
.staff-module-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: .5rem;
    padding: .85rem 1rem;
    color: var(--ink);
    text-decoration: none;
    background: var(--surface);
    transition: border-color .15s ease, background .15s ease;
}
.staff-module-row span { color: var(--muted); }
.staff-module-row:hover { background: var(--soft-accent); border-color: rgba(79, 70, 229, .3); color: var(--ink); }

.staff-inline-list { display: grid; gap: .75rem; }
.staff-inline-row {
    border: 1px solid var(--line);
    border-radius: .5rem;
    padding: 1rem;
    background: var(--surface);
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer { color: var(--muted); background: #0f172a; }
.footer-link { color: #94a3b8; text-decoration: none; font-size: .875rem; }
.footer-link:hover { color: #fff !important; }

/* ── Responsive overrides ─────────────────────────────────────── */
@media (max-width: 767.98px) {
    .journal-row { align-items: stretch; flex-direction: column; }
    .journal-row .btn { width: 100%; }
    .archive-link-band { align-items: stretch; flex-direction: column; }
}
@media (max-width: 991.98px) {
    .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
    .feature-grid, .metric-grid { grid-template-columns: 1fr; }
}

/* ── Misc helpers ────────────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}
.overflow-hidden { overflow: hidden; }
.position-relative { position: relative; }
.cursor-pointer { cursor: pointer; }
.text-decoration-none { text-decoration: none !important; }
.text-nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Missing Bootstrap utilities ─────────────────────────────── */

/* Font-weight aliases */
.fw-medium   { font-weight: 500 !important; }
.fw-semibold { font-weight: 600 !important; }

/* Text transform */
.text-uppercase  { text-transform: uppercase !important; }
.text-lowercase  { text-transform: lowercase !important; }
.text-capitalize { text-transform: capitalize !important; }

/* Height utilities */
.h-100 { height: 100% !important; }
.h-75  { height: 75% !important; }
.h-50  { height: 50% !important; }
.h-25  { height: 25% !important; }
.min-vh-100 { min-height: 100vh !important; }

/* Vertical align (for table cells and inline) */
.align-middle { vertical-align: middle !important; }
.align-top    { vertical-align: top !important; }
.align-bottom { vertical-align: bottom !important; }

/* Table head light */
.table-light th { background: var(--surface); }
thead.table-light th { background: var(--surface); }

/* Heading CSS classes (Bootstrap uses these as class names on non-heading elements) */
.h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; line-height: 1.1; }
.h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 700; line-height: 1.15; }
.h3 { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.h4 { font-size: 1.3rem; font-weight: 700; line-height: 1.25; }
.h5 { font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.h6 { font-size: .875rem; font-weight: 700; line-height: 1.4; }

/* Bootstrap font-size utilities (fs-*) */
.fs-1 { font-size: 2.5rem !important; }
.fs-2 { font-size: 2rem !important; }
.fs-3 { font-size: 1.75rem !important; }
.fs-4 { font-size: 1.5rem !important; }
.fs-5 { font-size: 1.25rem !important; }
.fs-6 { font-size: 1rem !important; }

/* Responsive justify-content */
@media (min-width: 992px) {
    .justify-content-lg-end    { justify-content: flex-end !important; }
    .justify-content-lg-center { justify-content: center !important; }
    .justify-content-lg-start  { justify-content: flex-start !important; }
    .align-items-lg-end        { align-items: flex-end !important; }
    .align-items-lg-center     { align-items: center !important; }
    .align-items-lg-start      { align-items: flex-start !important; }
    .d-lg-flex  { display: flex !important; }
    .d-lg-none  { display: none !important; }
    .d-lg-block { display: block !important; }
}
@media (min-width: 768px) {
    .justify-content-md-end    { justify-content: flex-end !important; }
    .justify-content-md-center { justify-content: center !important; }
    .align-items-md-end        { align-items: flex-end !important; }
    .d-md-flex  { display: flex !important; }
    .d-md-none  { display: none !important; }
    .d-md-block { display: block !important; }
}

/* col-auto */
.col-auto { grid-column: auto; width: auto; }

/* Overflow */
.overflow-auto   { overflow: auto !important; }
.overflow-x-auto { overflow-x: auto !important; }

/* Text utilities */
.text-break { word-break: break-word !important; overflow-wrap: break-word !important; }
.lh-sm  { line-height: 1.25 !important; }
.lh-lg  { line-height: 1.75 !important; }

/* line-clamp */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Opacity */
.opacity-75 { opacity: .75 !important; }
.opacity-50 { opacity: .5 !important; }
.opacity-25 { opacity: .25 !important; }

/* Position */
.position-absolute { position: absolute !important; }
.position-fixed    { position: fixed !important; }
.top-0    { top: 0 !important; }
.end-0    { right: 0 !important; }
.start-0  { left: 0 !important; }
.bottom-0 { bottom: 0 !important; }

/* Background colour utilities */
.bg-transparent { background: transparent !important; }
.bg-surface     { background: var(--surface) !important; }

/* Flex-basis for equal-width columns */
.flex-equal > * { flex: 1 1 0; min-width: 0; }

/* Code/pre */
code {
    font-family: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
    font-size: .875em;
    background: var(--soft-accent);
    color: var(--brand);
    padding: .1em .35em;
    border-radius: .25rem;
}
pre {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: .5rem;
    padding: 1rem;
    overflow-x: auto;
    font-size: .875rem;
}

/* ── Pagination sm ───────────────────────────────────────────── */
.pagination-sm .page-link {
    min-width: 1.9rem;
    height: 1.9rem;
    font-size: .8rem;
    border-radius: .3rem;
}


/* ── Shadow utilities ────────────────────────────────────────── */
.shadow-sm  { box-shadow: 0 1px 4px rgba(15,23,42,.08), 0 2px 8px rgba(15,23,42,.04) !important; }
.shadow     { box-shadow: 0 4px 12px rgba(15,23,42,.10), 0 2px 6px rgba(15,23,42,.06) !important; }
.shadow-lg  { box-shadow: 0 10px 30px rgba(15,23,42,.12), 0 4px 12px rgba(15,23,42,.06) !important; }
.shadow-none { box-shadow: none !important; }

/* ── Border subtle (Bootstrap 5.3) ───────────────────────────── */
.border-danger-subtle  { border-color: #fecaca !important; }
.border-warning-subtle { border-color: #fde68a !important; }
.border-success-subtle { border-color: #bbf7d0 !important; }
.border-info-subtle    { border-color: #bae6fd !important; }
.border-primary-subtle { border-color: #c7d2fe !important; }

/* ── h3 CSS class ────────────────────────────────────────────── */
.h3 { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }

/* ── Dismissible alert ────────────────────────────────────────── */
.alert-dismissible { position: relative; padding-right: 3rem; }
.btn-close {
    position: absolute;
    top: .625rem;
    right: .625rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    background: transparent;
    color: currentColor;
    opacity: .6;
    cursor: pointer;
    border-radius: .25rem;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}
.btn-close::before { content: '×'; font-size: 1.3rem; }
.btn-close:hover { opacity: 1; }

/* ── Border colour utilities ─────────────────────────────────── */
.border-primary { border-color: var(--brand) !important; }
.border-secondary { border-color: #94a3b8 !important; }
.border-success { border-color: var(--success) !important; }
.border-danger  { border-color: var(--danger) !important; }
.border-warning { border-color: var(--warning) !important; }
.border-info    { border-color: var(--info) !important; }

/* ── bg-opacity-* (Bootstrap compat) ────────────────────────── */
.bg-warning.bg-opacity-10  { background: rgba(217, 119, 6, .1) !important; }
.bg-danger.bg-opacity-10   { background: rgba(220, 38, 38, .1) !important; }
.bg-success.bg-opacity-10  { background: rgba(22, 163, 74, .1) !important; }
.bg-primary.bg-opacity-10  { background: rgba(79, 70, 229, .1) !important; }
.bg-info.bg-opacity-10     { background: rgba(2, 132, 199, .1) !important; }

/* Bootstrap Icon font — loaded via base.html CDN; just ensure bi classes don't break */
[class^="bi-"]::before, [class*=" bi-"]::before { display: inline-block; }
