:root {
    --page-bg: #d0e7e6;
    --surface: #ffffff;
    --surface-soft: #f5fbfb;
    --surface-muted: #e6f4f5;
    --ink: #293681;
    --ink-soft: #33477f;
    --muted: #5d6f91;
    --line: #b8dce5;
    --line-strong: #95ccdd;
    --brand: #4274d9;
    --brand-hover: #293681;
    --brand-soft: #e8f5f8;
    --deep: #293681;
    --success: #247a4d;
    --danger: #b42318;
    --warning-bg: #e8f5f8;
    --shadow-sm: 0 8px 22px rgba(41, 54, 129, 0.08);
    --shadow-md: 0 18px 42px rgba(41, 54, 129, 0.11);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--page-bg);
}

body {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    background: transparent;
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

body::before {
    content: "";
    position: fixed;
    inset: -22vw;
    z-index: 0;
    pointer-events: none;
    background-image: url("../img/itjfu-pattern.png");
    background-repeat: repeat;
    background-size: 230px auto;
    opacity: 0.035;
    transform: rotate(-11deg);
    transform-origin: center;
}

body > nav,
body > main,
body > footer {
    position: relative;
    z-index: 1;
}

a {
    color: var(--deep);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover,
a:focus {
    color: var(--deep);
}

img {
    max-width: 100%;
}

:focus-visible {
    outline: 3px solid rgba(66, 116, 217, 0.42);
    outline-offset: 3px;
}

.page-shell {
    min-height: calc(100vh - 128px);
    padding: 32px 0 56px;
}

.app-navbar {
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.app-brand {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0;
}

.app-brand img {
    display: block;
    width: auto;
    height: 34px;
}

.navbar-toggler {
    min-width: 44px;
    min-height: 44px;
    border-color: var(--line-strong);
    border-radius: var(--radius);
}

.navbar .nav-link {
    min-height: 44px;
    color: var(--muted);
    font-weight: 700;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: var(--ink);
}

.navbar-text {
    color: var(--muted);
}

.hero-section {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    color: var(--ink);
    padding: clamp(28px, 5vw, 56px);
}

.hero-section-new {
    background: var(--surface);
    border-top: 4px solid var(--brand);
}

.hero-glow {
    display: none;
}

.brand-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    padding: 7px 10px;
    text-transform: uppercase;
}

.brand-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--brand);
}

.hero-title {
    max-width: 720px;
    letter-spacing: 0;
}

.hero-lead,
.hero-section .lead {
    max-width: 700px;
    color: var(--ink-soft);
    font-size: clamp(1rem, 1.5vw, 1.125rem);
}

.hero-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-trust span {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    padding: 8px 10px;
}

.hero-panel {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(20px, 3vw, 28px);
}

.hero-panel-new {
    background: #ffffff;
}

.hero-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.status-dot,
.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.hero-number {
    display: block;
    color: var(--deep);
    font-size: clamp(3rem, 8vw, 4rem);
    font-weight: 800;
    line-height: 1;
}

.hero-label {
    display: block;
    margin-top: 8px;
    color: var(--muted);
}

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

.hero-mini-grid div {
    min-width: 0;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
}

.hero-mini-grid strong,
.hero-mini-grid span {
    display: block;
}

.hero-mini-grid strong {
    color: var(--ink);
    font-size: 24px;
    line-height: 1.15;
}

.hero-mini-grid span {
    color: var(--muted);
    font-size: 13px;
}

.quick-search-panel,
.content-panel,
.job-card,
.auth-panel,
.info-tile,
.empty-state {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.quick-search-panel {
    padding: 18px;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.quick-actions a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    color: var(--ink);
    font-weight: 800;
    padding: 10px 12px;
    text-decoration: none;
}

.quick-actions a:hover,
.quick-actions a:focus {
    border-color: var(--deep);
    background: #ffffff;
}

.section-heading {
    max-width: 760px;
    margin-bottom: 18px;
}

.section-kicker {
    display: inline-block;
    color: var(--brand);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.content-panel,
.auth-panel,
.info-tile,
.empty-state,
.job-card {
    padding: clamp(18px, 3vw, 24px);
}

.content-panel-new,
.info-tile,
.job-card {
    height: 100%;
}

.auth-panel {
    max-width: 540px;
    margin: 0 auto;
}

.auth-intro {
    max-width: 680px;
    margin: 0 auto 22px;
    text-align: center;
}

.info-tile-new {
    border-top: 4px solid var(--brand);
}

.info-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-bottom: 16px;
    border-radius: var(--radius);
    background: var(--deep);
    color: #ffffff;
    font-weight: 700;
}

.info-tile p,
.empty-state p {
    color: var(--muted);
    margin-bottom: 0;
}

.job-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}

.job-card h3 {
    line-height: 1.25;
    margin-bottom: 0;
}

.job-card .btn {
    width: fit-content;
    margin-top: auto;
}

.job-card.is-expired {
    background: var(--surface-muted);
    opacity: 0.86;
}

.empty-state-new {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.search-bar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
}

.form-label {
    color: var(--ink);
    font-weight: 700;
}

.form-control,
.form-select {
    min-height: 44px;
    border-color: var(--line);
    border-radius: var(--radius);
}

textarea.form-control {
    min-height: 120px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 0.2rem rgba(66, 116, 217, 0.18);
}

.form-text {
    min-height: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: var(--radius);
    font-weight: 800;
    text-decoration: none;
}

.btn-sm {
    min-height: 38px;
}

.btn-warning {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
}

.btn-warning:hover,
.btn-warning:focus {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
    color: #ffffff;
}

.btn-dark {
    background: var(--deep);
    border-color: var(--deep);
}

.btn-outline-dark,
.btn-outline-light {
    border-color: var(--deep);
    color: var(--ink);
    background: transparent;
}

.btn-outline-dark:hover,
.btn-outline-dark:focus,
.btn-outline-light:hover,
.btn-outline-light:focus {
    background: var(--deep);
    border-color: var(--deep);
    color: #ffffff;
}

.btn-outline-danger {
    border-color: #d79a94;
    color: var(--danger);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    background: var(--danger);
    border-color: var(--danger);
    color: #ffffff;
}

.btn:disabled,
.btn.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.badge.text-bg-secondary {
    background: var(--surface-muted) !important;
    color: var(--ink) !important;
    border: 1px solid var(--line);
}

.application-item {
    border-bottom: 1px solid var(--line);
    padding: 16px 0;
}

.application-item:first-of-type {
    padding-top: 0;
}

.application-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.reply-box {
    background: var(--brand-soft);
    border-left: 4px solid var(--brand);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 12px;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    padding: 8px 12px;
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.category-chip:hover,
.category-chip:focus {
    border-color: var(--deep);
    color: var(--deep);
    background: #ffffff;
}

.company-row {
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
}

.company-row:first-of-type {
    padding-top: 0;
}

.company-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.company-row p {
    color: var(--muted);
    margin: 4px 0 0;
}

.company-row-new strong {
    color: var(--ink);
}

.dark-mini-panel {
    background: var(--deep);
    border-color: var(--deep);
    color: #ffffff;
}

.dark-mini-panel .section-kicker,
.dark-mini-panel p {
    color: #d0e7e6;
}

.dark-mini-panel .company-row {
    border-color: rgba(255, 255, 255, 0.16);
}

.dark-mini-panel .company-row-new strong {
    color: #ffffff;
}

.cta-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-radius: var(--radius);
    background: var(--deep);
    border: 1px solid var(--deep);
    color: #ffffff;
    padding: clamp(20px, 3vw, 26px);
}

.cta-band-new {
    background: #ffffff;
    border-color: var(--line);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.cta-band p,
.cta-band-new p {
    color: var(--muted);
}

.admin-row {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(180px, 1.4fr) auto auto;
    gap: 8px;
    margin-bottom: 10px;
}

.category-help {
    margin: -4px 0 12px;
}

.table-responsive {
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    padding: 0.9rem;
    border-bottom-color: var(--line);
}

.table thead th {
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.alert {
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.auto-dismiss-alert {
    transition: opacity 250ms ease, transform 250ms ease;
}

.auto-dismiss-alert:not(.show) {
    opacity: 0;
    transform: translateY(-6px);
}

.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 24px 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-size: 14px;
}

.footer-inner img {
    display: block;
    width: auto;
    height: 28px;
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        padding: 14px 0 4px;
    }

    .navbar .d-flex {
        align-items: flex-start;
        flex-wrap: wrap;
        margin-top: 8px;
    }

    .quick-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 767.98px) {
    .page-shell {
        padding: 20px 0 40px;
    }

    .app-brand img {
        height: 30px;
    }

    .hero-section {
        padding: 24px 18px;
    }

    .hero-mini-grid {
        grid-template-columns: 1fr;
    }

    .hero-trust span,
    .quick-actions a {
        width: 100%;
    }

    .quick-actions,
    .empty-state-new,
    .cta-band,
    .footer-inner {
        align-items: stretch;
        flex-direction: column;
    }

    .empty-state-new .btn,
    .cta-band .btn {
        width: 100%;
    }

    .auth-intro {
        text-align: left;
    }

    .admin-row {
        grid-template-columns: 1fr;
        padding-bottom: 14px;
        border-bottom: 1px solid var(--line);
    }

    .admin-row .btn {
        width: 100%;
    }

    .table {
        min-width: 680px;
    }
}

@media (max-width: 420px) {
    .container {
        padding-right: 14px;
        padding-left: 14px;
    }

    .content-panel,
    .auth-panel,
    .info-tile,
    .empty-state,
    .job-card,
    .quick-search-panel {
        padding: 16px;
    }

    .display-5 {
        font-size: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
