:root {
    --herz-ink: #07111f;
    --herz-navy: #0a1628;
    --herz-steel: #1e344f;
    --herz-gold: #f36b21;
    --herz-gold-soft: #ffb184;
    --herz-paper: #f6f4f1;
    --herz-line: rgba(7, 17, 31, .1);
    --herz-shadow: 0 18px 48px rgba(7, 17, 31, .1);
}

body {
    background:
        linear-gradient(180deg, #0a1628 0, #0a1628 168px, var(--herz-paper) 168px, var(--herz-paper) 100%);
    color: #101828;
}

.app-shell {
    min-height: calc(100vh - 58px);
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    min-height: 72px;
    background: rgba(7, 17, 31, .96);
    border-bottom: 1px solid rgba(255, 177, 132, .18);
    box-shadow: 0 18px 36px rgba(0, 0, 0, .18);
    backdrop-filter: blur(14px);
}

.navbar .container-fluid {
    gap: 16px;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.app-brand:hover {
    color: #fff;
}

.app-brand span:last-child {
    display: grid;
    line-height: 1.05;
}

.app-brand strong {
    letter-spacing: .08em;
    font-weight: 900;
}

.app-brand small {
    color: rgba(255, 255, 255, .62);
    font-size: .72rem;
    font-weight: 700;
}

.brand-logo {
    width: 106px;
    height: 42px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    padding: 3px 6px;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 177, 132, .55);
    border-radius: 8px;
    color: #0a1628;
    background: linear-gradient(135deg, var(--herz-gold-soft), var(--herz-gold));
    font-weight: 950;
}

.main-nav {
    flex: 1;
}

.nav-pill {
    color: rgba(255, 255, 255, .76);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: .92rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-pill:hover,
.nav-pill.is-active {
    color: #fff;
    background: rgba(243, 107, 33, .18);
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
    background:
        linear-gradient(135deg, rgba(8, 23, 45, .92), rgba(8, 23, 45, .76)),
        radial-gradient(circle at 80% 20%, rgba(243, 107, 33, .28), transparent 30%);
}

.public-register {
    min-height: calc(100vh - 58px);
    display: grid;
    grid-template-columns: minmax(280px, .82fr) minmax(320px, 1fr);
    gap: 28px;
    align-items: center;
    padding: 42px clamp(18px, 5vw, 72px);
    background:
        linear-gradient(135deg, rgba(8, 23, 45, .95), rgba(8, 23, 45, .78)),
        linear-gradient(45deg, rgba(243, 107, 33, .2), transparent 42%);
}

.public-register__intro {
    color: #fff;
}

.public-register__logo {
    width: min(220px, 62vw);
    height: auto;
    margin-bottom: 22px;
    border-radius: 8px;
    background: #fff;
    padding: 8px 12px;
}

.public-register__intro h1 {
    max-width: 720px;
    margin: 0 0 12px;
    font-size: clamp(2rem, 5vw, 4.2rem);
    font-weight: 900;
    line-height: 1;
}

.public-register__intro p:last-child {
    max-width: 560px;
    color: rgba(255, 255, 255, .78);
    font-size: 1.08rem;
}

.public-register__card {
    max-width: 760px;
}

.auth-card {
    width: min(100%, 460px);
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .22);
}

.install-card {
    width: min(100%, 820px);
}

.eyebrow {
    color: var(--herz-gold);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.btn-primary {
    --bs-btn-bg: var(--herz-gold);
    --bs-btn-border-color: var(--herz-gold);
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #d95713;
    --bs-btn-hover-border-color: #d95713;
    font-weight: 850;
}

.metric-card,
.panel {
    background: #fff;
    border: 1px solid var(--herz-line);
    border-radius: 8px;
    box-shadow: var(--herz-shadow);
}

.metric-card {
    position: relative;
    overflow: hidden;
    padding: 22px;
    display: block;
    min-height: 128px;
    color: inherit;
    text-decoration: none;
    transition: transform .16s ease, box-shadow .16s ease;
}

.metric-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--herz-gold), rgba(243, 107, 33, 0));
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(8, 23, 45, .1);
}

.metric-card span {
    display: block;
    color: #667085;
    font-weight: 700;
}

.metric-card strong {
    display: block;
    margin-top: 12px;
    color: var(--herz-ink);
    font-size: 2rem;
    line-height: 1;
}

.metric-card em {
    position: absolute;
    right: 18px;
    bottom: 16px;
    color: #b9470f;
    font-size: .78rem;
    font-style: normal;
    font-weight: 850;
}

.panel {
    padding: 24px;
}

.dashboard-shell {
    display: grid;
    gap: 18px;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, .52fr);
    gap: 18px;
    align-items: stretch;
    padding: clamp(22px, 4vw, 42px);
    color: #fff;
    background:
        linear-gradient(135deg, rgba(7, 17, 31, .98), rgba(30, 52, 79, .94)),
        linear-gradient(45deg, rgba(243, 107, 33, .2), transparent 52%);
    border: 1px solid rgba(255, 177, 132, .26);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .22);
}

.dashboard-hero h1 {
    max-width: 880px;
    margin: 0;
    font-size: clamp(2rem, 4.2vw, 4.4rem);
    font-weight: 950;
    line-height: .98;
}

.dashboard-hero p {
    max-width: 780px;
    margin: 16px 0 0;
    color: rgba(255, 255, 255, .76);
    font-size: 1.02rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.release-panel {
    display: grid;
    align-content: end;
    min-height: 260px;
    padding: 22px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
}

.release-panel span {
    color: var(--herz-gold-soft);
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.release-panel strong {
    display: block;
    margin-top: 8px;
    color: #fff;
    font-size: 1.35rem;
    line-height: 1.1;
}

.release-panel p {
    margin-top: 12px;
    font-size: .95rem;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, .68fr);
    gap: 18px;
    align-items: start;
}

.command-panel,
.quality-panel {
    min-height: 100%;
}

.action-grid-premium {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.action-grid-premium a {
    min-height: 118px;
    padding: 16px;
    background:
        linear-gradient(180deg, #fff, rgba(245, 243, 238, .82));
}

.action-grid-premium strong,
.action-grid-premium span {
    display: block;
}

.action-grid-premium strong {
    color: var(--herz-ink);
    font-size: .98rem;
}

.action-grid-premium span {
    margin-top: 8px;
    color: #667085;
    font-size: .86rem;
    font-weight: 650;
    line-height: 1.35;
}

.quality-list {
    display: grid;
    gap: 10px;
}

.quality-list div {
    padding: 14px;
    border: 1px solid rgba(7, 17, 31, .1);
    border-radius: 8px;
    background: rgba(245, 243, 238, .72);
}

.quality-list strong,
.quality-list span {
    display: block;
}

.quality-list strong {
    color: var(--herz-ink);
    font-weight: 900;
}

.quality-list span {
    margin-top: 4px;
    color: #667085;
    font-size: .9rem;
}

.panel-title {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-title h2,
.panel h2 {
    color: var(--herz-ink);
    font-size: 1.08rem;
    font-weight: 850;
    margin: 0;
}

.page-heading {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 24px;
}

.page-heading h1 {
    margin: 0 0 4px;
    color: var(--herz-ink);
    font-weight: 800;
}

.page-heading p:last-child {
    max-width: 760px;
    margin: 0;
    color: #667085;
}

.form-grid {
    display: grid;
    gap: 14px;
}

.split-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.form-grid label {
    color: #344054;
    font-weight: 700;
}

.form-grid .form-control,
.form-grid .form-select {
    margin-top: 6px;
}

.check-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.toolbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.compact-toolbar {
    grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
}

.distance-search {
    margin-top: -4px;
    padding: 14px;
    border: 1px solid rgba(243, 107, 33, .16);
    border-radius: 8px;
    background: rgba(243, 107, 33, .06);
}

.global-search input {
    width: min(30vw, 260px);
    border: 1px solid rgba(8, 23, 45, .12);
    border-radius: 8px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, .76);
    color: var(--herz-ink);
}

.record-link {
    color: var(--herz-ink);
    font-weight: 850;
    text-decoration: none;
}

.record-link:hover {
    color: #d95713;
}

.record-header {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    padding: 28px;
    margin-bottom: 18px;
    color: #fff;
    background:
        linear-gradient(135deg, #08172d 0%, #122845 68%, #0b182a 100%);
    border: 1px solid rgba(243, 107, 33, .35);
    border-radius: 8px;
    box-shadow: 0 18px 46px rgba(8, 23, 45, .18);
}

.record-header h1 {
    margin: 0 0 6px;
    font-size: clamp(1.6rem, 2.6vw, 2.5rem);
    font-weight: 900;
}

.record-header p:last-child {
    margin: 0;
    color: rgba(255, 255, 255, .76);
}

.record-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stat-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.stat-strip > div {
    padding: 16px;
    background: #fff;
    border: 1px solid rgba(8, 23, 45, .08);
    border-radius: 8px;
}

.stat-strip span {
    display: block;
    color: #667085;
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.stat-strip strong {
    display: block;
    margin-top: 6px;
    color: var(--herz-ink);
    font-size: 1.2rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, .9fr);
    gap: 16px;
    align-items: start;
}

.side-stack {
    display: grid;
    gap: 16px;
}

.weekday-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.weekday-row label {
    border: 1px solid rgba(8, 23, 45, .12);
    border-radius: 8px;
    padding: 7px 9px;
    background: rgba(244, 241, 234, .55);
    font-size: .82rem;
}

.mini-list {
    display: grid;
    gap: 10px;
}

.mini-list a,
.mini-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(8, 23, 45, .1);
    border-radius: 8px;
    color: var(--herz-ink);
    text-decoration: none;
    background: rgba(244, 241, 234, .46);
}

.mini-list span,
.mini-list-item span {
    display: block;
    color: #667085;
    font-size: .86rem;
}

.timeline {
    display: grid;
    gap: 10px;
}

.timeline > div {
    padding: 12px 14px;
    border-left: 3px solid var(--herz-gold);
    background: rgba(244, 241, 234, .52);
    border-radius: 0 8px 8px 0;
}

.form-section {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(7, 17, 31, .09);
    border-radius: 8px;
    background: linear-gradient(180deg, #fff, rgba(246, 244, 241, .72));
}

.form-section h3 {
    margin: 0;
    color: var(--herz-ink);
    font-size: .95rem;
    font-weight: 900;
}

.candidate-intake-form .split-fields {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.selected-record {
    display: grid;
    gap: 2px;
    padding: 14px;
    border: 1px solid rgba(243, 107, 33, .22);
    border-radius: 8px;
    background: rgba(243, 107, 33, .08);
}

.selected-record span {
    color: #b9470f;
    font-size: .74rem;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.selected-record strong {
    color: var(--herz-ink);
    font-size: 1rem;
}

.selected-record small {
    color: #667085;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.calculated-hours {
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 9px 12px;
    border: 1px solid rgba(243, 107, 33, .2);
    border-radius: 8px;
    color: #8f3b10;
    background: rgba(243, 107, 33, .08);
    font-weight: 800;
}

.timeline strong,
.timeline span {
    display: block;
}

.timeline span {
    color: #475467;
    margin-top: 4px;
}

.danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-color: rgba(180, 35, 24, .22);
}

.danger-zone p:last-child {
    margin-bottom: 0;
    color: #667085;
}

.form-hint {
    margin: 10px 0 14px;
    color: #667085;
    font-size: .9rem;
}

.pipeline-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.pipeline-strip a {
    display: block;
    padding: 14px;
    color: var(--herz-ink);
    text-decoration: none;
    background: #fff;
    border: 1px solid rgba(8, 23, 45, .08);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(8, 23, 45, .05);
}

.pipeline-strip a:hover,
.pipeline-strip a.is-active {
    border-color: rgba(243, 107, 33, .65);
    background: rgba(243, 107, 33, .12);
}

.pipeline-strip span,
.pipeline-strip strong {
    display: block;
}

.pipeline-strip span {
    color: #667085;
    font-size: .76rem;
    font-weight: 850;
    text-transform: uppercase;
}

.pipeline-strip strong {
    margin-top: 6px;
    font-size: 1.4rem;
    line-height: 1;
}

.pipeline-board {
    display: grid;
    grid-template-columns: repeat(7, minmax(110px, 1fr));
    gap: 10px;
}

.pipeline-board a {
    min-height: 84px;
    padding: 14px;
    border: 1px solid rgba(8, 23, 45, .09);
    border-radius: 8px;
    background: #fff;
    color: var(--herz-ink);
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(8, 23, 45, .05);
}

.pipeline-board a.is-active,
.pipeline-board a:hover {
    border-color: rgba(243, 107, 33, .65);
    background: rgba(243, 107, 33, .12);
}

.pipeline-board span,
.pipeline-board strong {
    display: block;
}

.pipeline-board span {
    color: #667085;
    font-size: .78rem;
    font-weight: 850;
    text-transform: uppercase;
}

.pipeline-board strong {
    margin-top: 8px;
    font-size: 1.55rem;
}

.pipeline-table td {
    vertical-align: top;
}

.inline-actions {
    display: grid;
    gap: 8px;
    min-width: 380px;
}

.inline-actions form {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.inline-actions .form-select-sm {
    width: auto;
    min-width: 126px;
}

.inline-actions .form-control-sm {
    width: auto;
    min-width: 116px;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    color: #667085;
}

.pagination-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: #667085;
}

.empty-state {
    color: #667085;
    margin: 0;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.module-card,
.search-results a {
    display: block;
    padding: 18px;
    border: 1px solid rgba(8, 23, 45, .08);
    border-radius: 8px;
    background: #fff;
    color: var(--herz-ink);
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(8, 23, 45, .05);
}

.module-card span,
.search-results strong {
    display: block;
    font-weight: 900;
}

.module-card p,
.search-results small {
    display: block;
    margin: 8px 0 0;
    color: #667085;
}

.search-results {
    display: grid;
    gap: 10px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.action-grid a,
.action-grid span {
    display: block;
    border: 1px solid rgba(8, 23, 45, .1);
    border-radius: 8px;
    padding: 14px 16px;
    color: var(--herz-ink);
    background: rgba(244, 241, 234, .58);
    font-weight: 800;
    text-decoration: none;
}

.action-grid a:hover {
    border-color: rgba(243, 107, 33, .72);
    background: rgba(243, 107, 33, .12);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 8px;
    padding: 4px 10px;
    color: var(--herz-ink);
    background: rgba(243, 107, 33, .18);
    font-size: .82rem;
    font-weight: 800;
}

.table > :not(caption) > * > * {
    padding: .9rem .75rem;
}

.table thead th {
    color: #667085;
    font-size: .78rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

[data-bs-theme="dark"] body,
body[data-theme="dark"] {
    background: #07101f;
    color: #f8fafc;
}

[data-bs-theme="dark"] .metric-card,
[data-bs-theme="dark"] .panel,
[data-bs-theme="dark"] .navbar {
    background: #0d1b31 !important;
    color: #f8fafc;
    border-color: rgba(255, 255, 255, .12);
}

[data-bs-theme="dark"] .metric-card strong {
    color: #fff;
}

[data-bs-theme="dark"] .nav-pill,
[data-bs-theme="dark"] .app-brand,
[data-bs-theme="dark"] .page-heading h1,
[data-bs-theme="dark"] .action-grid a,
[data-bs-theme="dark"] .action-grid span,
[data-bs-theme="dark"] .form-grid label,
[data-bs-theme="dark"] .panel h2,
[data-bs-theme="dark"] .panel-title h2,
[data-bs-theme="dark"] .record-link,
[data-bs-theme="dark"] .stat-strip strong,
[data-bs-theme="dark"] .pipeline-strip a,
[data-bs-theme="dark"] .pipeline-board a,
[data-bs-theme="dark"] .module-card,
[data-bs-theme="dark"] .search-results a,
[data-bs-theme="dark"] .quality-list strong,
[data-bs-theme="dark"] .action-grid-premium strong {
    color: #f8fafc;
}

[data-bs-theme="dark"] .stat-strip > div,
[data-bs-theme="dark"] .pipeline-strip a,
[data-bs-theme="dark"] .pipeline-board a,
[data-bs-theme="dark"] .module-card,
[data-bs-theme="dark"] .search-results a {
    background: #0d1b31;
    border-color: rgba(255, 255, 255, .12);
}

[data-bs-theme="dark"] .timeline > div,
[data-bs-theme="dark"] .mini-list a,
[data-bs-theme="dark"] .mini-list-item,
[data-bs-theme="dark"] .weekday-row label,
[data-bs-theme="dark"] .quality-list div,
[data-bs-theme="dark"] .action-grid-premium a,
[data-bs-theme="dark"] .form-section,
[data-bs-theme="dark"] .selected-record,
[data-bs-theme="dark"] .calculated-hours,
[data-bs-theme="dark"] .distance-search {
    background: rgba(255, 255, 255, .05);
    border-color: rgba(255, 255, 255, .12);
}

[data-bs-theme="dark"] .global-search input {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .16);
    color: #f8fafc;
}

@media (max-width: 991.98px) {
    .main-nav {
        order: 3;
        flex-basis: 100%;
    }

    .toolbar,
    .compact-toolbar,
    .detail-grid,
    .stat-strip,
    .pipeline-board,
    .dashboard-hero,
    .dashboard-grid,
    .kpi-grid,
    .action-grid-premium {
        grid-template-columns: 1fr;
    }

    .global-search {
        order: 2;
        flex-basis: 100%;
    }

    .global-search input {
        width: 100%;
    }

    .danger-zone,
    .mini-list-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .inline-actions {
        min-width: 0;
    }

    .public-register {
        grid-template-columns: 1fr;
    }

    .app-topbar {
        position: static;
    }

    .dashboard-hero h1 {
        font-size: clamp(2rem, 10vw, 3.3rem);
    }

    .release-panel {
        min-height: 0;
    }
}

@media (max-width: 575.98px) {
    .split-fields {
        grid-template-columns: 1fr;
    }

    .panel,
    .record-header {
        padding: 18px;
    }

    .inline-actions form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .inline-actions .form-select-sm,
    .inline-actions .form-control-sm {
        width: 100%;
    }
}
