/* ============================================================
   Careers Leader Hub — design system
   Deep-teal + slate, rounded-2xl cards, soft shadows.
   Plain CSS (no Tailwind). Tokens double as the theming contract
   for TXP.ComponentLibrary.CareersHub shared components.
   ============================================================ */

:root {
    /* Core theming contract (consumed by shared components) */
    --chub-primary: #0F766E;        /* deep teal */
    --chub-surface: #FFFFFF;
    --chub-text: #0F172A;           /* slate-900 */
    --chub-accent: #059669;         /* emerald-600 — good */
    --chub-danger: #E11D48;         /* rose-600 — bad */
    --chub-warning: #D97706;        /* amber-600 */
    --chub-radius: 1rem;

    /* Extended palette (site-local) */
    --chub-primary-dark: #115E59;
    --chub-primary-deeper: #134E4A;
    --chub-primary-soft: #F0FDFA;   /* teal-50 */
    --chub-primary-ring: rgba(15, 118, 110, 0.28);
    --chub-bg: #F8FAFC;             /* slate-50 */
    --chub-surface-alt: #F1F5F9;    /* slate-100 */
    --chub-border: #E2E8F0;         /* slate-200 */
    --chub-text-secondary: #334155; /* slate-700 */
    --chub-text-muted: #64748B;     /* slate-500 */
    --chub-text-faint: #94A3B8;     /* slate-400 */
    --chub-accent-soft: #ECFDF5;    /* emerald-50 */
    --chub-danger-soft: #FFF1F2;    /* rose-50 */
    --chub-warning-soft: #FFFBEB;   /* amber-50 */

    --chub-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --chub-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 14px rgba(15, 23, 42, 0.05);
    --chub-shadow-lg: 0 4px 6px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.10);

    --chub-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ---------- Reset / base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--chub-font);
    font-size: 16px;
    line-height: 1.55;
    color: var(--chub-text);
    background: var(--chub-bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 0.5rem; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }
p { margin: 0 0 1rem; }
a { color: var(--chub-primary); }
img { max-width: 100%; }

:focus-visible {
    outline: 3px solid var(--chub-primary-ring);
    outline-offset: 2px;
    border-radius: 4px;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

/* ---------- Layout scaffolding ---------- */

.chub-page { min-height: 100vh; display: flex; flex-direction: column; }
.chub-main { flex: 1 0 auto; }

.chub-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

.chub-narrow { max-width: 760px; }

.chub-muted { color: var(--chub-text-muted); }
.chub-small { font-size: 0.875rem; }

/* ---------- Top navigation ---------- */

.chub-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--chub-border);
}

.chub-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.chub-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--chub-text);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.chub-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--chub-primary) 0%, var(--chub-primary-deeper) 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chub-brand-mark .material-symbols-outlined { font-size: 20px; }

.chub-brand-sub {
    display: block;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--chub-text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chub-nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.chub-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--chub-text-secondary);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    min-height: 44px;
}

.chub-nav-link:hover { background: var(--chub-primary-soft); color: var(--chub-primary-dark); }

.chub-nav-link.active { background: var(--chub-primary-soft); color: var(--chub-primary-dark); }

.chub-nav-link.disabled {
    color: var(--chub-text-faint);
    cursor: default;
    pointer-events: none;
}

.chub-phase-pill {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--chub-surface-alt);
    color: var(--chub-text-muted);
    border: 1px solid var(--chub-border);
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
}

.chub-nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.chub-nav-username {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--chub-text-secondary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hamburger (CSS-only, checkbox hack — works in SSR and interactive) */
.chub-nav-toggle-input { display: none; }

.chub-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--chub-border);
    background: var(--chub-surface);
    color: var(--chub-text-secondary);
    cursor: pointer;
    margin-left: auto;
}

@media (max-width: 767.98px) {
    .chub-nav-inner { flex-wrap: wrap; height: auto; min-height: 64px; padding-top: 0.6rem; padding-bottom: 0.6rem; }
    .chub-nav-toggle { display: inline-flex; }
    .chub-nav-links, .chub-nav-user {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        margin: 0;
        padding: 0.5rem 0;
    }
    .chub-nav-user { border-top: 1px solid var(--chub-border); }
    .chub-nav-toggle-input:checked ~ .chub-nav-links,
    .chub-nav-toggle-input:checked ~ .chub-nav-user { display: flex; }
    .chub-nav-link { border-radius: 12px; }
}

/* ---------- Buttons ---------- */

.chub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    min-height: 44px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: var(--chub-font);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.chub-btn:active { transform: translateY(1px); }

.chub-btn-primary {
    background: linear-gradient(135deg, var(--chub-primary) 0%, var(--chub-primary-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(15, 118, 110, 0.32);
}

.chub-btn-primary:hover { box-shadow: 0 6px 20px rgba(15, 118, 110, 0.42); }

.chub-btn-secondary {
    background: var(--chub-surface);
    color: var(--chub-primary-dark);
    border-color: var(--chub-border);
    box-shadow: var(--chub-shadow-sm);
}

.chub-btn-secondary:hover { background: var(--chub-primary-soft); border-color: var(--chub-primary); }

.chub-btn-ghost {
    background: transparent;
    color: var(--chub-text-secondary);
}

.chub-btn-ghost:hover { background: var(--chub-surface-alt); }

.chub-btn:disabled, .chub-btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.chub-btn-lg { padding: 0.9rem 1.9rem; font-size: 1.05rem; }
.chub-btn-sm { padding: 0.4rem 0.95rem; min-height: 36px; font-size: 0.85rem; }

/* ---------- Cards ---------- */

.chub-card {
    background: var(--chub-surface);
    border: 1px solid var(--chub-border);
    border-radius: var(--chub-radius);
    box-shadow: var(--chub-shadow);
    padding: 1.5rem;
}

.chub-card-center { text-align: center; padding: 3rem 2rem; }

.chub-card h2 { font-size: 1.2rem; }

.chub-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--chub-text-muted);
    margin: 2rem 0 0.9rem;
}

/* ---------- KPI tiles ---------- */

.chub-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 1023.98px) { .chub-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 479.98px) { .chub-kpi-row { grid-template-columns: 1fr; } }

.chub-kpi {
    background: var(--chub-surface);
    border: 1px solid var(--chub-border);
    border-radius: var(--chub-radius);
    box-shadow: var(--chub-shadow-sm);
    padding: 1.1rem 1.25rem;
    transition: box-shadow 0.15s ease;
}

.chub-kpi:hover { box-shadow: var(--chub-shadow); }

.chub-kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--chub-primary-soft);
    color: var(--chub-primary);
    margin-bottom: 0.6rem;
}

.chub-kpi-icon .material-symbols-outlined { font-size: 20px; }

.chub-kpi-icon.good { background: var(--chub-accent-soft); color: var(--chub-accent); }
.chub-kpi-icon.warn { background: var(--chub-warning-soft); color: var(--chub-warning); }

.chub-kpi-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--chub-text-muted);
    margin: 0;
}

.chub-kpi-value {
    font-size: 1.9rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--chub-text);
    margin: 0.1rem 0 0;
}

.chub-kpi-hint { font-size: 0.75rem; color: var(--chub-text-faint); margin: 0.15rem 0 0; }

/* ---------- Programme tile grid ---------- */

.chub-tile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

@media (max-width: 1023.98px) { .chub-tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639.98px) { .chub-tile-grid { grid-template-columns: 1fr; } }

.chub-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--chub-surface);
    border: 1px solid var(--chub-border);
    border-radius: var(--chub-radius);
    box-shadow: var(--chub-shadow-sm);
    padding: 1.4rem 1.4rem 1.25rem 1.6rem;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.chub-tile::before {
    /* subtle left accent bar */
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, var(--chub-primary) 0%, var(--chub-accent) 100%);
    opacity: 0.85;
}

.chub-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--chub-shadow-lg);
    border-color: var(--chub-primary);
}

.chub-tile.empty::before { background: var(--chub-border); }

.chub-tile-head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 0.9rem; }

.chub-tile-logo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    border: 1px solid var(--chub-border);
    background: #fff;
    object-fit: contain;
    padding: 5px;
    flex-shrink: 0;
}

.chub-tile-logo-fallback {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--chub-primary-soft);
    color: var(--chub-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 800;
    font-size: 1.2rem;
}

.chub-tile-title { font-size: 1.02rem; font-weight: 800; margin: 0; letter-spacing: -0.01em; }
.chub-tile-employer { font-size: 0.8rem; color: var(--chub-text-muted); margin: 0.1rem 0 0; }

.chub-chip-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.25rem 0 0.9rem; }

.chub-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    background: var(--chub-surface-alt);
    color: var(--chub-text-secondary);
}

.chub-chip.primary { background: var(--chub-primary-soft); color: var(--chub-primary-dark); }
.chub-chip.good { background: var(--chub-accent-soft); color: #047857; }
.chub-chip.warn { background: var(--chub-warning-soft); color: #B45309; }
.chub-chip.bad { background: var(--chub-danger-soft); color: #BE123C; }

.chub-tile-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--chub-text-faint);
}

.chub-tile-empty-note { font-size: 0.85rem; color: var(--chub-text-muted); margin: 0 0 0.4rem; }
.chub-tile-empty-hint { font-size: 0.75rem; color: var(--chub-text-faint); font-style: italic; margin: 0; }

/* ---------- Status timeline (Pending page) ---------- */

.chub-timeline { list-style: none; margin: 0; padding: 0; }

.chub-timeline li {
    position: relative;
    display: flex;
    gap: 1rem;
    padding: 0 0 1.9rem 0;
}

.chub-timeline li:last-child { padding-bottom: 0; }

.chub-timeline li::before {
    content: "";
    position: absolute;
    left: 19px;
    top: 40px;
    bottom: 0;
    width: 2px;
    background: var(--chub-border);
}

.chub-timeline li:last-child::before { display: none; }

.chub-timeline-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--chub-surface-alt);
    color: var(--chub-text-faint);
    border: 2px solid var(--chub-border);
    z-index: 1;
}

.chub-timeline-dot .material-symbols-outlined { font-size: 20px; }

.chub-timeline li.done .chub-timeline-dot {
    background: var(--chub-accent-soft);
    color: var(--chub-accent);
    border-color: var(--chub-accent);
}

.chub-timeline li.active .chub-timeline-dot {
    background: var(--chub-warning-soft);
    color: var(--chub-warning);
    border-color: var(--chub-warning);
}

.chub-timeline li.bad .chub-timeline-dot {
    background: var(--chub-danger-soft);
    color: var(--chub-danger);
    border-color: var(--chub-danger);
}

.chub-timeline-body { padding-top: 0.25rem; min-width: 0; flex: 1; }
.chub-timeline-title { font-weight: 800; font-size: 0.98rem; margin: 0; }
.chub-timeline-meta { font-size: 0.83rem; color: var(--chub-text-muted); margin: 0.2rem 0 0; }

/* ---------- Status badges ---------- */

.chub-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.chub-badge.good { background: var(--chub-accent-soft); color: #047857; }
.chub-badge.warn { background: var(--chub-warning-soft); color: #B45309; }
.chub-badge.primary { background: #EFF6FF; color: #1D4ED8; }
.chub-badge.bad { background: var(--chub-danger-soft); color: #BE123C; }
.chub-badge.neutral { background: var(--chub-surface-alt); color: var(--chub-text-muted); }

/* ---------- Forms ---------- */

.chub-field { margin-bottom: 1.35rem; }

.chub-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--chub-text-secondary);
    margin-bottom: 0.4rem;
}

.chub-label .req { color: var(--chub-danger); }

.chub-input, .chub-select, .chub-textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    min-height: 44px;
    font-family: var(--chub-font);
    font-size: 0.95rem;
    color: var(--chub-text);
    background: var(--chub-surface);
    border: 1px solid var(--chub-border);
    border-radius: 12px;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.chub-input:focus, .chub-select:focus, .chub-textarea:focus {
    outline: none;
    border-color: var(--chub-primary);
    box-shadow: 0 0 0 3px var(--chub-primary-ring);
}

.chub-input.invalid { border-color: var(--chub-danger); background: var(--chub-danger-soft); }

.chub-help { font-size: 0.8rem; color: var(--chub-text-muted); margin: 0.35rem 0 0; }
.chub-error-text { font-size: 0.82rem; color: var(--chub-danger); font-weight: 600; margin: 0.35rem 0 0; }

.chub-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.92rem;
}

.chub-checkbox-row input[type="checkbox"] {
    width: 19px;
    height: 19px;
    margin-top: 0.15rem;
    accent-color: var(--chub-primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* File upload dropzone */
.chub-upload {
    border: 2px dashed var(--chub-border);
    border-radius: var(--chub-radius);
    background: var(--chub-bg);
    padding: 1.4rem;
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.chub-upload:hover { border-color: var(--chub-primary); background: var(--chub-primary-soft); }

.chub-upload input[type="file"] { width: 100%; cursor: pointer; }

/* ---------- Alerts / banners ---------- */

.chub-alert {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    border-radius: var(--chub-radius);
    padding: 1rem 1.2rem;
    font-size: 0.92rem;
    margin-bottom: 1.25rem;
}

.chub-alert .material-symbols-outlined { font-size: 22px; flex-shrink: 0; margin-top: 0.05rem; }

.chub-alert.info { background: var(--chub-primary-soft); color: var(--chub-primary-deeper); border: 1px solid #99F6E4; }
.chub-alert.good { background: var(--chub-accent-soft); color: #065F46; border: 1px solid #A7F3D0; }
.chub-alert.warn { background: var(--chub-warning-soft); color: #92400E; border: 1px solid #FDE68A; }
.chub-alert.bad { background: var(--chub-danger-soft); color: #9F1239; border: 1px solid #FECDD3; }

/* ---------- Skeleton loaders ---------- */

@keyframes chub-shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.chub-skeleton {
    border-radius: 10px;
    background: linear-gradient(90deg, var(--chub-surface-alt) 25%, #E9EEF5 37%, var(--chub-surface-alt) 63%);
    background-size: 800px 100%;
    animation: chub-shimmer 1.4s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .chub-skeleton { animation: none; }
    html { scroll-behavior: auto; }
}

/* ---------- Empty states ---------- */

.chub-empty-icon {
    font-size: 44px !important;
    color: var(--chub-text-faint);
    background: var(--chub-surface-alt);
    border-radius: 50%;
    padding: 0.9rem;
    margin-bottom: 1rem;
    display: inline-flex;
}

/* ---------- Landing page ---------- */

.chub-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(1000px 480px at 85% -10%, rgba(5, 150, 105, 0.35) 0%, transparent 60%),
        radial-gradient(800px 500px at -10% 110%, rgba(13, 148, 136, 0.45) 0%, transparent 55%),
        linear-gradient(135deg, #134E4A 0%, #0F766E 55%, #115E59 100%);
    color: #fff;
    padding: 5.5rem 1.25rem 6rem;
}

.chub-hero::after {
    /* dot-grid texture */
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1.6px);
    background-size: 26px 26px;
    pointer-events: none;
}

.chub-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.chub-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #99F6E4;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    margin-bottom: 1.4rem;
}

.chub-hero h1 {
    font-size: clamp(2.1rem, 5.4vw, 3.6rem);
    font-weight: 900;
    letter-spacing: -0.035em;
    line-height: 1.08;
    margin: 0 auto 1.1rem;
    max-width: 820px;
}

.chub-hero h1 .hl { color: #5EEAD4; }

.chub-hero-sub {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: rgba(255, 255, 255, 0.85);
    max-width: 640px;
    margin: 0 auto 2.2rem;
}

.chub-hero-ctas { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }

.chub-btn-hero {
    background: #fff;
    color: var(--chub-primary-deeper);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.25);
}

.chub-btn-hero:hover { background: #F0FDFA; }

.chub-btn-hero-ghost {
    background: transparent;
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.55);
}

.chub-btn-hero-ghost:hover { background: rgba(255, 255, 255, 0.1); border-color: #fff; }

.chub-features {
    max-width: 1200px;
    margin: -3.2rem auto 0;
    padding: 0 1.25rem;
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

@media (max-width: 1023.98px) { .chub-features { grid-template-columns: 1fr; margin-top: -2.4rem; } }

.chub-feature {
    background: var(--chub-surface);
    border: 1px solid var(--chub-border);
    border-radius: var(--chub-radius);
    box-shadow: var(--chub-shadow-lg);
    padding: 1.75rem;
}

.chub-feature-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--chub-primary-soft);
    color: var(--chub-primary);
    margin-bottom: 1rem;
}

.chub-feature h3 { font-size: 1.08rem; }
.chub-feature p { font-size: 0.92rem; color: var(--chub-text-muted); margin: 0; }

.chub-safeguarding {
    max-width: 1200px;
    margin: 3rem auto 0;
    padding: 0 1.25rem;
}

.chub-safeguarding-inner {
    display: flex;
    align-items: flex-start;
    gap: 1.1rem;
    background: var(--chub-primary-soft);
    border: 1px solid #99F6E4;
    border-radius: var(--chub-radius);
    padding: 1.5rem 1.75rem;
}

.chub-safeguarding-inner .material-symbols-outlined {
    font-size: 30px;
    color: var(--chub-primary);
    flex-shrink: 0;
}

.chub-safeguarding-inner h3 { font-size: 1rem; margin-bottom: 0.3rem; color: var(--chub-primary-deeper); }
.chub-safeguarding-inner p { font-size: 0.9rem; color: var(--chub-text-secondary); margin: 0; }

.chub-cta-band {
    max-width: 1200px;
    margin: 3.5rem auto 4.5rem;
    padding: 0 1.25rem;
    text-align: center;
}

/* ---------- Footer ---------- */

.chub-footer {
    border-top: 1px solid var(--chub-border);
    background: var(--chub-surface);
    padding: 1.75rem 1.25rem;
    margin-top: auto;
}

.chub-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: var(--chub-text-muted);
}

.chub-footer a { color: var(--chub-text-muted); text-decoration: none; margin-left: 1.1rem; }
.chub-footer a:hover { color: var(--chub-primary); text-decoration: underline; }

/* ---------- Page headers ---------- */

.chub-page-head { margin-bottom: 1.75rem; }
.chub-page-head h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
.chub-page-head .chub-sub { color: var(--chub-text-muted); font-size: 0.95rem; margin: 0; }

.chub-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--chub-text-muted);
    text-decoration: none;
    margin-bottom: 0.9rem;
}

.chub-back-link:hover { color: var(--chub-primary); }

/* ---------- Utility ---------- */

.chub-flex-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.chub-mt-1 { margin-top: 0.5rem; }
.chub-mt-2 { margin-top: 1rem; }
.chub-mt-3 { margin-top: 1.5rem; }
.chub-mb-2 { margin-bottom: 1rem; }
.chub-mb-3 { margin-bottom: 1.5rem; }

.chub-link-btn {
    background: none;
    border: none;
    padding: 0;
    font-family: var(--chub-font);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--chub-primary);
    text-decoration: underline;
    cursor: pointer;
}

/* ---------- Data tables (collapse to cards on mobile) ---------- */

.chub-table-wrap { overflow-x: auto; }

.chub-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.chub-table th {
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--chub-text-muted);
    padding: 0.6rem 0.9rem;
    border-bottom: 2px solid var(--chub-border);
    white-space: nowrap;
}

.chub-table td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--chub-border);
    vertical-align: middle;
}

.chub-table tbody tr:last-child td { border-bottom: none; }

.chub-table tbody tr.clickable { cursor: pointer; transition: background 0.12s ease; }
.chub-table tbody tr.clickable:hover { background: var(--chub-primary-soft); }

.chub-td-primary { font-weight: 700; color: var(--chub-text); }
.chub-td-sub { font-size: 0.8rem; color: var(--chub-text-muted); }

@media (max-width: 767.98px) {
    .chub-table thead { display: none; }
    .chub-table, .chub-table tbody, .chub-table tr, .chub-table td { display: block; width: 100%; }
    .chub-table tr {
        border: 1px solid var(--chub-border);
        border-radius: 12px;
        margin-bottom: 0.8rem;
        background: var(--chub-surface);
        padding: 0.4rem 0;
    }
    .chub-table td { border-bottom: none; padding: 0.35rem 1rem; }
    .chub-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.65rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.07em;
        color: var(--chub-text-faint);
        margin-bottom: 0.1rem;
    }
}

/* ---------- Icon-only buttons ---------- */

.chub-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--chub-border);
    background: var(--chub-surface);
    color: var(--chub-text-secondary);
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.chub-icon-btn:hover { background: var(--chub-primary-soft); color: var(--chub-primary-dark); border-color: var(--chub-primary); }
.chub-icon-btn.danger:hover { background: var(--chub-danger-soft); color: var(--chub-danger); border-color: var(--chub-danger); }
.chub-icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.chub-icon-btn .material-symbols-outlined { font-size: 19px; }

/* ---------- Join codes ---------- */

.chub-code-row {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex-wrap: wrap;
    padding: 1rem 0;
    border-bottom: 1px solid var(--chub-border);
}

.chub-code-row:last-child { border-bottom: none; }

.chub-code {
    font-family: 'Cascadia Code', 'SF Mono', Consolas, monospace;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: var(--chub-primary-deeper);
    background: var(--chub-primary-soft);
    border: 1px dashed var(--chub-primary);
    border-radius: 12px;
    padding: 0.35rem 0.8rem 0.35rem 1rem;
    white-space: nowrap;
}

.chub-code.inactive {
    color: var(--chub-text-faint);
    background: var(--chub-surface-alt);
    border-color: var(--chub-border);
    text-decoration: line-through;
}

.chub-code-meta { flex: 1; min-width: 180px; }
.chub-code-meta p { margin: 0; }

.chub-code-actions { display: flex; align-items: center; gap: 0.45rem; }

.chub-qr {
    width: 110px;
    height: 110px;
    border: 1px solid var(--chub-border);
    border-radius: 12px;
    padding: 6px;
    background: #fff;
    image-rendering: pixelated;
}

.chub-qr-lg { width: 180px; height: 180px; }

/* ---------- Playlist ---------- */

.chub-playlist-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.65rem 0.4rem;
    border-bottom: 1px solid var(--chub-border);
    flex-wrap: wrap;
}

.chub-playlist-row:last-child { border-bottom: none; }

.chub-playlist-order { display: flex; flex-direction: column; gap: 2px; }

.chub-playlist-order .chub-icon-btn { width: 26px; height: 22px; border-radius: 6px; }
.chub-playlist-order .chub-icon-btn .material-symbols-outlined { font-size: 15px; }

.chub-playlist-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--chub-border);
    background: #fff;
    object-fit: contain;
    padding: 3px;
    flex-shrink: 0;
}

.chub-playlist-title { flex: 1; min-width: 140px; font-weight: 700; font-size: 0.92rem; }

.chub-toggle-row {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--chub-text-secondary);
    cursor: pointer;
    white-space: nowrap;
}

.chub-toggle-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--chub-primary); cursor: pointer; }

/* ---------- Skill bars (learner detail) ---------- */

.chub-skillbar { margin-bottom: 1rem; }
.chub-skillbar:last-child { margin-bottom: 0; }

.chub-skillbar-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.3rem;
}

.chub-skillbar-name { font-size: 0.9rem; font-weight: 700; color: var(--chub-text); }
.chub-skillbar-meta { font-size: 0.75rem; color: var(--chub-text-muted); white-space: nowrap; }

.chub-skillbar-track {
    height: 12px;
    border-radius: 999px;
    background: var(--chub-surface-alt);
    overflow: hidden;
}

.chub-skillbar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--chub-primary) 0%, var(--chub-accent) 100%);
    min-width: 6px;
    transition: width 0.4s ease;
}

.chub-skillbar-fill.low { background: linear-gradient(90deg, var(--chub-warning) 0%, #F59E0B 100%); }

/* ---------- Inline panels & misc ---------- */

.chub-panel {
    background: var(--chub-bg);
    border: 1px solid var(--chub-border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.chub-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 639.98px) { .chub-form-grid { grid-template-columns: 1fr; } }

.chub-row-list { list-style: none; margin: 0; padding: 0; }

.chub-search-box { position: relative; max-width: 340px; flex: 1; }
.chub-search-box .material-symbols-outlined {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--chub-text-faint);
    font-size: 20px;
    pointer-events: none;
}
.chub-search-box .chub-input { padding-left: 2.5rem; }

.chub-logo-sm {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--chub-border);
    background: #fff;
    object-fit: contain;
    padding: 3px;
    flex-shrink: 0;
}

.chub-logo-fallback-sm {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--chub-primary-soft);
    color: var(--chub-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 800;
    font-size: 1rem;
}

.chub-list-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--chub-border);
    flex-wrap: wrap;
}

.chub-list-row:last-child { border-bottom: none; }
