/* ==========================================================================
   Thungela Career Pathways – design tokens
   ========================================================================== */
:root {
    --tcp-ink: #2a2320;
    --tcp-ink-2: #3a312d;
    --tcp-ink-soft: #5b504a;
    --tcp-yellow: #fbb72e;
    --tcp-yellow-strong: #e9a213;
    --tcp-yellow-soft: #fff4d9;
    --tcp-cream: #faf7f2;
    --tcp-line: #ebe4da;
    --tcp-muted: #7a6f68;
    --tcp-success: #1f7a52;
    --tcp-radius: 1rem;
    --tcp-radius-sm: .65rem;
    --tcp-shadow: 0 1px 2px rgba(42, 35, 32, .06), 0 6px 20px rgba(42, 35, 32, .07);
    --tcp-shadow-lg: 0 10px 40px rgba(42, 35, 32, .14);
    --tcp-appbar-h: 3.75rem;
    --tcp-bottomnav-h: 4.25rem;
    --bs-body-font-family: "Jost", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-color: var(--tcp-ink);
    --bs-body-bg: var(--tcp-cream);
    --bs-link-color-rgb: 42, 35, 32;
    --bs-primary: var(--tcp-yellow);
    --bs-primary-rgb: 251, 183, 46;
    --bs-border-color: var(--tcp-line);
}

html { scroll-padding-top: calc(var(--tcp-appbar-h) + 1rem); }

body {
    min-height: 100vh;
    font-size: 1rem;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, h5, .display-font { font-weight: 700; letter-spacing: -.01em; }

a { text-decoration: none; }

:focus-visible {
    outline: 3px solid var(--tcp-yellow-strong);
    outline-offset: 2px;
    border-radius: .35rem;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: .5rem;
    z-index: 2000;
    background: var(--tcp-yellow);
    color: var(--tcp-ink);
    padding: .5rem 1rem;
    border-radius: .5rem;
    font-weight: 600;
}
.skip-link:focus { left: .5rem; }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: .75rem; padding: .65rem 1.15rem; }
.btn-sm { border-radius: .6rem; padding: .4rem .8rem; }
.btn-brand {
    --bs-btn-bg: var(--tcp-yellow);
    --bs-btn-border-color: var(--tcp-yellow);
    --bs-btn-color: var(--tcp-ink);
    --bs-btn-hover-bg: var(--tcp-yellow-strong);
    --bs-btn-hover-border-color: var(--tcp-yellow-strong);
    --bs-btn-hover-color: var(--tcp-ink);
    --bs-btn-active-bg: var(--tcp-yellow-strong);
    --bs-btn-active-border-color: var(--tcp-yellow-strong);
    --bs-btn-active-color: var(--tcp-ink);
}
.btn-ink {
    --bs-btn-bg: var(--tcp-ink);
    --bs-btn-border-color: var(--tcp-ink);
    --bs-btn-color: #fff;
    --bs-btn-hover-bg: var(--tcp-ink-2);
    --bs-btn-hover-border-color: var(--tcp-ink-2);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #000;
    --bs-btn-active-color: #fff;
}
.btn-soft {
    --bs-btn-bg: #fff;
    --bs-btn-border-color: var(--tcp-line);
    --bs-btn-color: var(--tcp-ink);
    --bs-btn-hover-bg: var(--tcp-yellow-soft);
    --bs-btn-hover-border-color: var(--tcp-yellow);
    --bs-btn-hover-color: var(--tcp-ink);
    --bs-btn-active-bg: var(--tcp-yellow-soft);
    --bs-btn-active-border-color: var(--tcp-yellow);
}

/* ==========================================================================
   Employee app shell
   ========================================================================== */
.app-bar {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--tcp-appbar-h);
    background: var(--tcp-ink);
    color: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}
.app-bar .container-app { height: 100%; display: flex; align-items: center; gap: .75rem; }
.app-bar-back {
    width: 2.5rem; height: 2.5rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    flex-shrink: 0;
}
.app-bar-back:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.app-brand { display: flex; align-items: center; gap: .6rem; color: #fff; min-width: 0; }
.app-brand:hover { color: #fff; }
.app-brand img { height: 1.6rem; width: auto; }
.app-brand-divider { width: 1px; height: 1.3rem; background: rgba(255, 255, 255, .25); }
.app-brand-title { font-weight: 500; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .9; }
.app-nav-desktop a {
    color: rgba(255, 255, 255, .78);
    font-weight: 500;
    padding: .45rem .85rem;
    border-radius: .6rem;
}
.app-nav-desktop a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.app-nav-desktop a.active { color: var(--tcp-ink); background: var(--tcp-yellow); }

.container-app { width: 100%; max-width: 1140px; margin: 0 auto; padding-left: 1rem; padding-right: 1rem; }
.container-narrow { max-width: 760px; }

.app-main { padding-bottom: calc(var(--tcp-bottomnav-h) + 1.5rem + env(safe-area-inset-bottom)); }
@media (min-width: 992px) { .app-main { padding-bottom: 3rem; } }

.bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1030;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: calc(var(--tcp-bottomnav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: #fff;
    border-top: 1px solid var(--tcp-line);
    box-shadow: 0 -4px 18px rgba(42, 35, 32, .07);
}
.bottom-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
    color: var(--tcp-muted);
    font-size: .72rem; font-weight: 600;
    position: relative;
}
.bottom-nav a i { font-size: 1.3rem; line-height: 1; }
.bottom-nav a.active { color: var(--tcp-ink); }
.bottom-nav a.active::before {
    content: "";
    position: absolute;
    top: 0; left: 30%; right: 30%;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--tcp-yellow);
}

.app-footer { color: var(--tcp-muted); font-size: .875rem; border-top: 1px solid var(--tcp-line); padding: 1.5rem 0; margin-top: 2rem; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    color: #fff;
    background: var(--tcp-ink) center / cover no-repeat;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(42, 35, 32, .35) 0%, rgba(42, 35, 32, .78) 55%, var(--tcp-ink) 100%);
}
.hero > * { position: relative; }
.hero-home { padding: 3.5rem 0 4.5rem; }
@media (min-width: 992px) { .hero-home { padding: 6rem 0 7rem; } }
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: var(--tcp-yellow);
}
.hero-title { font-size: clamp(2.1rem, 7vw, 3.6rem); line-height: 1.05; margin: .5rem 0 1rem; }
.hero-title span { color: var(--tcp-yellow); }
.hero-lead { font-size: 1.05rem; color: rgba(255, 255, 255, .85); max-width: 34rem; }
.underline-accent { display: block; width: 3.5rem; height: 4px; border-radius: 2px; background: var(--tcp-yellow); margin: 1rem 0; }

.page-header {
    background: var(--tcp-ink);
    color: #fff;
    padding: 1.75rem 0 2.75rem;
    position: relative;
}
.page-header.with-image { background-size: cover; background-position: center; }
.page-header.with-image::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(42, 35, 32, .55), rgba(42, 35, 32, .92));
}
.page-header > * { position: relative; }
.page-header h1 { font-size: clamp(1.6rem, 5.5vw, 2.4rem); margin-bottom: .35rem; }
.page-header p { color: rgba(255, 255, 255, .8); margin-bottom: 0; max-width: 40rem; }
.page-header .breadcrumb { --bs-breadcrumb-divider-color: rgba(255, 255, 255, .5); --bs-breadcrumb-item-active-color: rgba(255, 255, 255, .75); font-size: .85rem; margin-bottom: .75rem; }
.page-header .breadcrumb a { color: var(--tcp-yellow); }

/* Content that overlaps the bottom of a header */
.lift { margin-top: -1.75rem; position: relative; z-index: 2; }

/* ---------- Cards ---------- */
.tcp-card {
    background: #fff;
    border: 1px solid var(--tcp-line);
    border-radius: var(--tcp-radius);
    box-shadow: var(--tcp-shadow);
}
.tcp-card-yellow { background: var(--tcp-yellow); border-color: var(--tcp-yellow); }
.underline-accent.dark { background: var(--tcp-ink); margin-top: .5rem; }
.tcp-card-body { padding: 1.25rem; }
@media (min-width: 768px) { .tcp-card-body { padding: 1.5rem; } }
.tcp-card-link { display: block; color: inherit; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.tcp-card-link:hover { color: inherit; transform: translateY(-2px); box-shadow: var(--tcp-shadow-lg); border-color: var(--tcp-yellow); }

.section-title { font-size: 1.25rem; margin-bottom: .25rem; }
.section-subtitle { color: var(--tcp-muted); font-size: .95rem; margin-bottom: 1rem; }

.icon-circle {
    width: 2.75rem; height: 2.75rem;
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--tcp-yellow-soft);
    color: var(--tcp-ink);
    font-size: 1.2rem;
}
.icon-circle.dark { background: var(--tcp-ink); color: var(--tcp-yellow); border: 2px solid var(--tcp-yellow); }
.icon-circle.sm { width: 2.1rem; height: 2.1rem; font-size: .95rem; }
.icon-circle.lg { width: 4.5rem; height: 4.5rem; font-size: 2rem; }

.path-code {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 2.6rem; height: 2.6rem;
    border-radius: .75rem;
    background: var(--tcp-ink);
    color: var(--tcp-yellow);
    font-weight: 700;
    font-size: 1.05rem;
}
.path-code.light { background: var(--tcp-yellow); color: var(--tcp-ink); }

.chip {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .25rem .65rem;
    border-radius: 999px;
    font-size: .78rem; font-weight: 600;
    background: var(--tcp-cream);
    border: 1px solid var(--tcp-line);
    color: var(--tcp-ink-soft);
}
.chip-yellow { background: var(--tcp-yellow-soft); border-color: #f6dfa4; color: #7a5300; }
.chip-dark { background: var(--tcp-ink); border-color: var(--tcp-ink); color: #fff; }

.min-w-0 { min-width: 0; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.quick-link {
    display: flex; align-items: center; gap: .9rem;
    padding: 1rem 1.1rem;
    color: var(--tcp-ink);
}
.quick-link .bi-chevron-right { margin-left: auto; color: var(--tcp-muted); }

.callout {
    display: flex; gap: .85rem;
    padding: 1rem 1.1rem;
    border-radius: var(--tcp-radius-sm);
    background: var(--tcp-yellow-soft);
    border: 1px solid #f6dfa4;
    color: #5e4300;
    font-size: .95rem;
}
.callout i { font-size: 1.2rem; color: var(--tcp-yellow-strong); }

/* ==========================================================================
   Career path journey
   ========================================================================== */
.journey { position: relative; padding-left: 0; list-style: none; margin: 0; }
.journey-level { position: relative; padding-left: 3rem; padding-bottom: 1.5rem; }
.journey-level:last-child { padding-bottom: 0; }
.journey-level::before {
    content: "";
    position: absolute;
    left: 1.05rem; top: 2.4rem; bottom: -.1rem;
    width: 3px;
    background: repeating-linear-gradient(180deg, var(--tcp-yellow) 0 8px, transparent 8px 13px);
}
.journey-level:last-child::before { display: none; }
.journey-marker {
    position: absolute; left: 0; top: .1rem;
    width: 2.35rem; height: 2.35rem;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--tcp-ink);
    color: var(--tcp-yellow);
    font-weight: 700;
    border: 3px solid var(--tcp-yellow);
    box-shadow: 0 0 0 4px var(--tcp-cream);
}
.journey-level.is-destination .journey-marker { background: var(--tcp-yellow); color: var(--tcp-ink); }
.journey-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--tcp-muted); margin-bottom: .55rem; padding-top: .45rem; }
.journey-label .chip { text-transform: none; letter-spacing: 0; margin-left: .35rem; }
.journey-options { display: grid; gap: .65rem; }
@media (min-width: 576px) { .journey-options { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); } }

.role-card {
    display: flex; align-items: flex-start; gap: .8rem;
    padding: .85rem .95rem;
    background: #fff;
    border: 1px solid var(--tcp-line);
    border-radius: var(--tcp-radius-sm);
    color: var(--tcp-ink);
    box-shadow: var(--tcp-shadow);
    transition: border-color .15s ease, transform .15s ease;
    min-height: 3.75rem;
}
.role-card:hover { color: var(--tcp-ink); border-color: var(--tcp-yellow); transform: translateY(-1px); }
.role-card .icon-circle { width: 2.4rem; height: 2.4rem; font-size: 1.05rem; }
.role-card-name { font-weight: 600; line-height: 1.25; }
.role-card-note { font-size: .8rem; color: var(--tcp-muted); line-height: 1.3; margin-top: .2rem; }
.role-card .bi-chevron-right { margin-left: auto; align-self: center; color: var(--tcp-muted); }

.role-group {
    grid-column: 1 / -1;
    border: 2px dashed #f0d38c;
    border-radius: var(--tcp-radius);
    padding: .75rem;
    background: rgba(255, 244, 217, .5);
}
.role-group-title { font-size: .82rem; font-weight: 700; color: #7a5300; margin-bottom: .55rem; display: flex; align-items: center; gap: .4rem; }
.role-group .journey-options { gap: .5rem; }

/* ==========================================================================
   Role detail
   ========================================================================== */
.role-hero {
    background: var(--tcp-yellow);
    color: var(--tcp-ink);
    text-align: center;
    padding: 1.75rem 0 3.5rem;
}
.role-hero .breadcrumb { justify-content: center; font-size: .85rem; --bs-breadcrumb-divider-color: rgba(42, 35, 32, .45); }
.role-hero .breadcrumb a { color: var(--tcp-ink); text-decoration: underline; text-underline-offset: 2px; }
.role-hero h1 { font-size: clamp(1.7rem, 6vw, 2.5rem); margin: .85rem 0 .25rem; }
.role-hero .accent { display: block; width: 2.25rem; height: 3px; background: var(--tcp-ink); margin: .5rem auto 0; border-radius: 2px; }

.level-progress { max-width: 22rem; margin: 1rem auto 0; }
.level-progress .progress { height: .5rem; background: rgba(42, 35, 32, .15); border-radius: 999px; }
.level-progress .progress-bar { background: var(--tcp-ink); border-radius: 999px; }
.level-progress small { font-weight: 600; }

.competency-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
@media (min-width: 768px) { .competency-tiles { grid-template-columns: repeat(4, 1fr); } }
.competency-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
    padding: .9rem .5rem;
    border: 1px solid var(--tcp-line);
    border-radius: var(--tcp-radius-sm);
    background: #fff;
    color: var(--tcp-ink);
    font-weight: 600; font-size: .9rem;
    text-align: center;
    width: 100%;
    transition: all .15s ease;
}
.competency-tile i { font-size: 1.6rem; color: var(--tcp-yellow-strong); }
.competency-tile .count { font-size: .72rem; font-weight: 600; color: var(--tcp-muted); }
.competency-tile:hover { border-color: var(--tcp-yellow); background: var(--tcp-yellow-soft); }
.competency-tile.active { background: var(--tcp-ink); border-color: var(--tcp-ink); color: #fff; box-shadow: var(--tcp-shadow-lg); }
.competency-tile.active i { color: var(--tcp-yellow); }
.competency-tile.active .count { color: rgba(255, 255, 255, .7); }

.competency-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.competency-list li {
    display: flex; gap: .65rem; align-items: flex-start;
    padding: .7rem .85rem;
    border-radius: var(--tcp-radius-sm);
    background: var(--tcp-cream);
    line-height: 1.35;
}
.competency-list li i { color: var(--tcp-success); margin-top: .1rem; }
.competency-prompt { text-align: center; color: var(--tcp-muted); padding: 1.25rem .5rem; }
.competency-prompt i { font-size: 1.75rem; color: var(--tcp-yellow-strong); display: block; margin-bottom: .35rem; }

.purpose-text { font-size: 1.02rem; line-height: 1.6; }

/* ==========================================================================
   Levels of work
   ========================================================================== */
.low-card { display: flex; border-radius: var(--tcp-radius); overflow: hidden; color: #fff; box-shadow: var(--tcp-shadow); }
.low-card-code { flex: 0 0 5.25rem; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(0, 0, 0, .15); font-weight: 700; font-size: 1.15rem; padding: 1rem .5rem; }
.low-card-body { padding: 1rem 1.15rem; flex: 1; }
.low-card-body .meta { font-size: .85rem; opacity: .9; }
.low-1 { background: #5b504a; }
.low-2 { background: #b97a1b; }
.low-3 { background: #3f7fb8; }
.low-4 { background: #b9472f; }
.low-5 { background: #1f6b4a; }
.low-6 { background: var(--tcp-yellow); color: var(--tcp-ink); }

.principle { display: flex; gap: .85rem; align-items: flex-start; }
.principle i { font-size: 1.35rem; color: var(--tcp-yellow-strong); }

/* ---------- Segmented pills ---------- */
.tcp-segmented {
    display: inline-flex; flex-wrap: nowrap; gap: .25rem;
    padding: .3rem; background: #fff;
    border: 1px solid var(--tcp-line); border-radius: 999px; box-shadow: var(--tcp-shadow);
    max-width: 100%; overflow-x: auto;
}
.tcp-segmented .nav-link { border-radius: 999px; color: var(--tcp-ink); font-weight: 600; font-size: .9rem; white-space: nowrap; padding: .5rem 1rem; }
.tcp-segmented .nav-link.active { background: var(--tcp-ink); color: #fff; }
.tcp-segmented .nav-link .badge { font-weight: 600; }

/* ---------- Sub-families ---------- */
.subfamily-card { height: 100%; }
.subfamily-card h3 { font-size: 1.05rem; margin: .85rem 0 .4rem; }
.subfamily-card p { color: var(--tcp-ink-soft); font-size: .93rem; margin: 0; line-height: 1.5; }

/* ---------- Role directory ---------- */
.search-box { position: relative; }
.search-box i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--tcp-muted); }
.search-box input { padding-left: 2.6rem; height: 3.1rem; border-radius: .85rem; border-color: var(--tcp-line); font-size: 1rem; }
.search-box input:focus { border-color: var(--tcp-yellow); box-shadow: 0 0 0 .25rem rgba(251, 183, 46, .25); }
.directory-item { padding: 1rem 1.1rem; }
.directory-item + .directory-item { border-top: 1px solid var(--tcp-line); }
.directory-paths { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.directory-paths a { font-size: .8rem; }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--tcp-muted); }
.empty-state i { font-size: 2.25rem; color: var(--tcp-yellow-strong); display: block; margin-bottom: .5rem; }

/* ==========================================================================
   Admin
   ========================================================================== */
.admin-body { background: #f5f3ef; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 16rem;
    flex-shrink: 0;
    background: var(--tcp-ink);
    color: #fff;
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
}
.admin-sidebar .offcanvas-body { display: flex; flex-direction: column; padding: 0; }
.admin-brand { padding: 1.4rem 1.4rem 1rem; display: flex; flex-direction: column; gap: .35rem; }
.admin-brand img { height: 1.75rem; width: auto; align-self: flex-start; }
.admin-brand small { color: rgba(255, 255, 255, .6); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.admin-nav { padding: .5rem .85rem; display: grid; gap: .2rem; }
.admin-nav-label { color: rgba(255, 255, 255, .45); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 1rem .65rem .35rem; }
.admin-nav a {
    display: flex; align-items: center; gap: .7rem;
    padding: .6rem .75rem;
    border-radius: .65rem;
    color: rgba(255, 255, 255, .78);
    font-weight: 500;
}
.admin-nav a i { font-size: 1.1rem; }
.admin-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.admin-nav a.active { background: var(--tcp-yellow); color: var(--tcp-ink); font-weight: 600; }
.admin-sidebar-footer { margin-top: auto; padding: 1rem 1.4rem; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .85rem; color: rgba(255, 255, 255, .65); }
.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
    position: sticky; top: 0; z-index: 1020;
    background: rgba(245, 243, 239, .9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--tcp-line);
    padding: .75rem 1.5rem;
    display: flex; align-items: center; gap: 1rem;
}
.admin-content { padding: 1.5rem; }
@media (max-width: 991.98px) {
    .admin-sidebar { position: fixed; height: 100%; }
    .admin-content { padding: 1rem; }
    .admin-topbar { padding: .65rem 1rem; }
}
.offcanvas-lg.admin-sidebar { --bs-offcanvas-bg: var(--tcp-ink); --bs-offcanvas-color: #fff; --bs-offcanvas-width: 16rem; }
/* Bootstrap makes offcanvas-lg transparent above the breakpoint. */
@media (min-width: 992px) {
    .offcanvas-lg.admin-sidebar { background-color: var(--tcp-ink) !important; }
}

.admin-page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.admin-page-header h1 { font-size: 1.6rem; margin: 0; }
.admin-page-header p { color: var(--tcp-muted); margin: .25rem 0 0; }
.admin-page-header .breadcrumb { font-size: .82rem; margin-bottom: .35rem; }
.admin-page-header .breadcrumb a { color: var(--tcp-ink-soft); }

.range-switch .btn { padding: .45rem .85rem; font-size: .875rem; }
.range-switch .btn.active { background: var(--tcp-ink); border-color: var(--tcp-ink); color: #fff; }

.kpi-card { padding: 1.1rem 1.2rem; height: 100%; display: flex; flex-direction: column; gap: .35rem; }
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.kpi-label { font-size: .82rem; font-weight: 600; color: var(--tcp-muted); }
.kpi-icon { width: 2.2rem; height: 2.2rem; border-radius: .65rem; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; background: var(--tcp-yellow-soft); color: #8a5d00; }
.kpi-icon.ink { background: var(--tcp-ink); color: var(--tcp-yellow); }
.kpi-icon.green { background: #e3f3eb; color: var(--tcp-success); }
.kpi-icon.blue { background: #e6eff8; color: #2f6aa3; }
.kpi-value { font-size: 1.85rem; font-weight: 700; line-height: 1.1; }
.kpi-foot { font-size: .8rem; color: var(--tcp-muted); }
.kpi-foot .up { color: var(--tcp-success); font-weight: 600; }
.kpi-foot .down { color: #b9472f; font-weight: 600; }

.chart-card { padding: 1.25rem; height: 100%; }
.chart-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.chart-card-header h2 { font-size: 1.05rem; margin: 0; }
.chart-card-header p { font-size: .82rem; color: var(--tcp-muted); margin: .15rem 0 0; }
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 220px; }

.funnel-step + .funnel-step { margin-top: .9rem; }
.funnel-meta { display: flex; justify-content: space-between; font-size: .875rem; margin-bottom: .3rem; }
.funnel-meta strong { font-weight: 600; }
.funnel-bar { height: .7rem; background: #f0ebe3; border-radius: 999px; overflow: hidden; }
.funnel-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--tcp-yellow), var(--tcp-yellow-strong)); border-radius: 999px; }

.rank-list { list-style: none; padding: 0; margin: 0; }
.rank-list li { display: grid; grid-template-columns: 1.75rem 1fr auto; gap: .75rem; align-items: center; padding: .6rem 0; }
.rank-list li + li { border-top: 1px solid var(--tcp-line); }
.rank-no { width: 1.75rem; height: 1.75rem; border-radius: .5rem; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; background: var(--tcp-cream); }
.rank-list li:first-child .rank-no { background: var(--tcp-yellow); }
.rank-name { font-weight: 600; font-size: .92rem; line-height: 1.25; }
.rank-sub { font-size: .78rem; color: var(--tcp-muted); }
.rank-bar { height: .3rem; background: #f0ebe3; border-radius: 999px; margin-top: .35rem; overflow: hidden; }
.rank-bar span { display: block; height: 100%; background: var(--tcp-ink); border-radius: 999px; }
.rank-bar.sector-share { height: .45rem; }
.rank-bar.sector-share span { background: var(--tcp-yellow-strong); }
.rank-value { text-align: right; font-weight: 700; font-size: .95rem; }
.rank-value small { display: block; font-weight: 500; font-size: .74rem; color: var(--tcp-muted); }

.table-modern { margin: 0; --bs-table-bg: transparent; }
.table-modern thead th {
    font-size: .75rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--tcp-muted); font-weight: 700;
    background: #faf8f4;
    border-bottom: 1px solid var(--tcp-line);
    padding: .8rem 1rem;
    white-space: nowrap;
}
.table-modern tbody td { padding: .85rem 1rem; vertical-align: middle; border-color: var(--tcp-line); font-size: .92rem; }
.table-modern.table-hover tbody tr:hover > * { --bs-table-bg-state: #fffaf0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; }
.sortable { cursor: pointer; user-select: none; }
.sortable::after { content: "\F282"; font-family: "bootstrap-icons"; font-size: .7rem; margin-left: .3rem; opacity: .35; }
.sortable.asc::after { content: "\F286"; opacity: 1; }
.sortable.desc::after { content: "\F282"; opacity: 1; }

.filter-bar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--tcp-line); }
.filter-bar .form-control, .filter-bar .form-select { border-radius: .65rem; border-color: var(--tcp-line); }
.filter-bar .search-box input { height: 2.6rem; }

.status-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.status-badge.identified { background: #e3f3eb; color: var(--tcp-success); }
.status-badge.anonymous { background: #eee9e3; color: var(--tcp-ink-soft); }

.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: .55rem; top: .4rem; bottom: .4rem; width: 2px; background: var(--tcp-line); }
.timeline li { position: relative; padding-left: 2rem; padding-bottom: .85rem; }
.timeline li::before { content: ""; position: absolute; left: .2rem; top: .35rem; width: .8rem; height: .8rem; border-radius: 50%; background: #fff; border: 2px solid var(--tcp-yellow-strong); }
.timeline li.tab::before { border-color: var(--tcp-ink-soft); background: var(--tcp-ink-soft); width: .6rem; height: .6rem; left: .3rem; top: .45rem; }
.timeline-time { font-size: .76rem; color: var(--tcp-muted); }
.timeline-label { font-weight: 600; font-size: .92rem; }

.session-card + .session-card { margin-top: 1rem; }
.session-card summary { list-style: none; cursor: pointer; padding: 1rem 1.25rem; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.session-card summary::-webkit-details-marker { display: none; }
.session-card[open] summary { border-bottom: 1px solid var(--tcp-line); }
.session-card summary .bi-chevron-down { margin-left: auto; transition: transform .2s; }
.session-card[open] summary .bi-chevron-down { transform: rotate(180deg); }

.link-preview { background: var(--tcp-cream); border: 1px dashed #d9cfc2; border-radius: .75rem; padding: .85rem 1rem; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
.code-pill { background: var(--tcp-ink); color: var(--tcp-yellow); padding: .1rem .45rem; border-radius: .35rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; }

/* ---------- Sectors ---------- */
.sector-card { overflow: hidden; }
.sector-card-media {
    position: relative;
    height: 9.5rem;
    background: var(--tcp-ink) center / cover no-repeat;
}
.sector-card-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(42, 35, 32, 0) 35%, rgba(42, 35, 32, .7) 100%); }
.sector-card-icon {
    position: absolute; left: 1.25rem; bottom: -1.4rem; z-index: 1;
    width: 3.1rem; height: 3.1rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--tcp-ink); color: var(--tcp-yellow);
    border: 3px solid var(--tcp-yellow);
    font-size: 1.35rem;
}
.sector-card .tcp-card-body { padding-top: 2rem; }
.sector-card-tagline { color: var(--tcp-yellow-strong); font-weight: 600; font-size: .9rem; }
.sector-card-go { font-size: 1.6rem; color: var(--tcp-yellow); transition: transform .15s ease; }
.sector-card:hover .sector-card-go { transform: translateX(3px); }
.sector-card-paths { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .4rem; border-top: 1px solid var(--tcp-line); padding-top: .85rem; }
.sector-card-paths li { display: flex; align-items: center; gap: .6rem; font-size: .88rem; font-weight: 500; min-width: 0; }
.path-code.sm { min-width: 1.9rem; height: 1.9rem; border-radius: .5rem; font-size: .78rem; flex-shrink: 0; }

.hero-sector { padding: 2rem 0 4rem; }
.hero-breadcrumb { --bs-breadcrumb-divider-color: rgba(255, 255, 255, .5); --bs-breadcrumb-item-active-color: rgba(255, 255, 255, .75); font-size: .85rem; margin-bottom: 1.25rem; }
.hero-breadcrumb a { color: var(--tcp-yellow); }
.page-header-eyebrow { display: block; color: var(--tcp-yellow); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .2rem; }

.sector-filter { display: flex; flex-wrap: wrap; gap: .5rem; }
.sector-filter a, .sector-filter button {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .45rem .95rem;
    border-radius: 999px;
    border: 1px solid var(--tcp-line);
    background: #fff;
    color: var(--tcp-ink);
    font-weight: 600; font-size: .9rem;
    box-shadow: var(--tcp-shadow);
    transition: border-color .15s ease, background-color .15s ease;
}
.sector-filter a:hover, .sector-filter button:hover { border-color: var(--tcp-yellow); color: var(--tcp-ink); }
.sector-filter .active { background: var(--tcp-ink); border-color: var(--tcp-ink); color: #fff; }
.sector-filter .active:hover { color: #fff; }
.sector-filter .badge { background: var(--tcp-yellow-soft); color: #7a5300; font-weight: 700; }
.sector-filter .active .badge { background: var(--tcp-yellow); color: var(--tcp-ink); }

/* ---------- Admin login ---------- */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem;
    background: var(--tcp-ink) center / cover no-repeat;
    position: relative;
}
.login-page::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(42, 35, 32, .92), rgba(42, 35, 32, .7)); }
.login-card { position: relative; width: 100%; max-width: 26rem; }
.login-tagline { color: rgba(255, 255, 255, .6); font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.login-card .form-control { height: 3rem; border-radius: .75rem; }
.login-card .form-control:focus { border-color: var(--tcp-yellow); box-shadow: 0 0 0 .25rem rgba(251, 183, 46, .25); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
