:root {
    color-scheme: light;
    --bg: #f5f8fc;
    --surface: #ffffff;
    --ink: #132238;
    --muted: #64748b;
    --line: #d7e2f0;
    --primary: #1d4ed8;
    --primary-dark: #1e3a8a;
    --accent: #2563eb;
    --soft: #eaf2ff;
    --warning: #eff6ff;
    --danger: #fee2e2;
    font-family: Arial, Helvetica, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px clamp(18px, 4vw, 56px);
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.brand {
    color: var(--ink);
    font-size: 20px;
    font-weight: 800;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.top-nav a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--ink);
}

.top-nav a.active,
.top-nav a:hover {
    background: var(--soft);
    text-decoration: none;
}

.section-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px clamp(18px, 4vw, 56px);
    background: #edf4ff;
    border-bottom: 1px solid var(--line);
}

.section-nav a,
.section-nav button {
    min-height: 34px;
    padding: 6px 11px;
    border-radius: 6px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
}

.section-nav a.active,
.section-nav a:hover,
.section-nav button:hover {
    background: white;
    text-decoration: none;
}

.section-nav button {
    border-color: var(--line);
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 56px;
}

.hero {
    min-height: 62vh;
    display: grid;
    align-items: center;
    background:
        linear-gradient(90deg, rgba(30, 64, 175, 0.92), rgba(37, 99, 235, 0.58)),
        url("https://images.unsplash.com/photo-1556761175-b413da4baf72?auto=format&fit=crop&w=1600&q=80") center/cover;
    color: white;
    padding: clamp(32px, 8vw, 90px);
    border-radius: 8px;
}

.hero h1,
.section-heading h1,
.detail-main h1,
.auth-card h1,
.form-page h1 {
    margin: 0 0 14px;
    font-size: clamp(34px, 5vw, 62px);
    line-height: 1.05;
    letter-spacing: 0;
}

.hero p {
    max-width: 650px;
    font-size: 18px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero .eyebrow {
    color: #dbeafe;
}

.coming-soon-page {
    min-height: 62vh;
    display: grid;
    place-content: center;
    gap: 14px;
    text-align: center;
    background: white;
}

.coming-soon-page h1 {
    margin: 0;
    color: #60a5fa;
    font-size: clamp(42px, 8vw, 88px);
    line-height: 1;
    letter-spacing: 0;
}

.coming-soon-page p {
    margin: 0;
    color: #38bdf8;
    font-size: clamp(18px, 3vw, 28px);
    font-weight: 700;
}

.coming-soon-page a {
    color: #38bdf8;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.section-heading,
.confirmation {
    margin-bottom: 28px;
}

.section-heading.compact {
    margin-bottom: 18px;
}

.section-heading p,
.muted {
    color: var(--muted);
    margin-top: 0;
}

.actions,
.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 18px 0;
}

.live-search-bar {
    display: grid;
    grid-template-columns: minmax(240px, 520px) auto;
    gap: 12px;
    align-items: end;
    margin: 0 0 18px;
}

.live-search-bar span,
.filter-count {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.button,
button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 15px;
    border: 1px solid var(--primary);
    border-radius: 6px;
    background: white;
    color: var(--primary);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.button:hover,
button:hover {
    text-decoration: none;
    background: var(--soft);
}

.button.primary,
button.primary {
    background: var(--primary);
    color: white;
}

.button.primary:hover,
button.primary:hover {
    background: var(--primary-dark);
}

button:disabled,
button[disabled],
.button.disabled,
button.disabled {
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
    background: #f3f4f6 !important;
    color: #6b7280 !important;
    border-color: #d1d5db !important;
}

button:disabled:hover,
button[disabled]:hover,
.button.disabled:hover,
button.disabled:hover {
    background: #f3f4f6 !important;
}

.button.ghost {
    border-color: var(--line);
    color: var(--ink);
}

.button.compact,
button.compact {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 13px;
}

.danger-button {
    border-color: #fecaca;
    color: #b91c1c;
}

.danger-button:hover {
    background: #fee2e2;
}

.job-group {
    margin: 28px 0;
}

.job-group h2,
.table-card h2,
.application-panel h2,
.detail-main h2 {
    font-size: 20px;
    margin: 0 0 14px;
}

.job-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.card,
.table-card,
.auth-card,
.application-panel,
.form-page {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
}

.job-card {
    min-height: 310px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
}

.job-card h3 {
    margin: 12px 0 8px;
    font-size: 22px;
}

.status-pill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
    text-transform: capitalize;
}

.meta-list {
    display: grid;
    gap: 8px;
    margin: 0;
}

.meta-list.inline {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 18px 0 24px;
}

.meta-list div {
    min-width: 140px;
}

.meta-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.meta-list dd {
    margin: 0;
    font-weight: 700;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 22px;
    align-items: start;
}

.detail-main {
    min-width: 0;
}

.application-panel {
    position: sticky;
    top: 88px;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    font-weight: 700;
}

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

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

input,
textarea,
select {
    width: 100%;
    min-height: 42px;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: white;
    color: var(--ink);
    font: inherit;
}

textarea {
    resize: vertical;
}

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

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

.alert {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--soft);
    font-weight: 700;
}

.alert.error {
    background: var(--danger);
    border-color: #fecaca;
}

.alert.success {
    background: #dbeafe;
    border-color: #93c5fd;
}

.empty-state {
    padding: 24px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: white;
    color: var(--muted);
    font-weight: 700;
}

.hidden {
    display: none !important;
}

.auth-card {
    width: min(460px, 100%);
    margin: 48px auto;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat-card {
    display: grid;
    gap: 4px;
    min-height: 112px;
    align-content: center;
    padding: 18px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-weight: 800;
}

.stat-card span {
    color: var(--primary);
    font-size: 36px;
    line-height: 1;
}

.table-card {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

td span {
    color: var(--muted);
    font-size: 13px;
}

.row-actions {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
}

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

.row-edit-form {
    display: contents;
}

.row-actions button {
    min-height: 32px;
    padding: 4px 8px;
    font-size: 12px;
}

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

.inline-form,
.filters {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 16px;
}

.filters {
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) minmax(160px, 220px) auto auto auto;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 22px 0;
}

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

.document-list a {
    display: grid;
    gap: 2px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: white;
}

.document-list span {
    color: var(--muted);
}

.check-row {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-weight: 700;
}

.check-row input {
    width: auto;
    min-height: auto;
}

.timeline {
    display: grid;
    gap: 14px;
    padding-left: 22px;
}

.timeline li::marker {
    color: var(--primary);
}

.timeline span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 880px) {
    .site-header,
    .detail-layout,
    .split-layout,
    .info-grid,
    .live-search-bar,
    .filters {
        grid-template-columns: 1fr;
    }

    .site-header {
        display: grid;
    }

    .application-panel {
        position: static;
    }

    .filters,
    .inline-form {
        grid-template-columns: 1fr;
    }

    .toolbar,
    .actions {
        align-items: stretch;
    }

    .toolbar .button,
    .actions .button {
        flex: 1 1 180px;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 15px;
    }

    .site-header {
        position: static;
        gap: 12px;
        padding: 14px 12px;
    }

    .brand {
        font-size: 18px;
    }

    .top-nav,
    .section-nav {
        gap: 6px;
    }

    .top-nav a,
    .section-nav a,
    .section-nav button {
        flex: 1 1 auto;
        justify-content: center;
        min-height: 40px;
    }

    .section-nav {
        padding: 8px 11px;
    }

    .page-shell {
        width: min(100% - 22px, 1180px);
        padding-top: 20px;
        padding-bottom: 36px;
    }

    .hero {
        min-height: 56vh;
        padding: 26px 20px;
    }

    .two-col,
    .three-col {
        grid-template-columns: 1fr;
    }

    .hero h1,
    .section-heading h1,
    .detail-main h1,
    .auth-card h1,
    .form-page h1 {
        font-size: 32px;
    }

    .card,
    .table-card,
    .auth-card,
    .application-panel,
    .form-page {
        padding: 16px;
    }

    .job-grid,
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .job-card {
        min-height: 0;
    }

    .meta-list.inline {
        display: grid;
    }

    .table-card {
        overflow-x: visible;
    }

    table {
        min-width: 0;
    }

    thead {
        display: none;
    }

    tbody,
    tr,
    td {
        display: block;
        width: 100%;
    }

    tr {
        margin-bottom: 14px;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: white;
    }

    td {
        display: grid;
        grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        padding: 9px 0;
        border-bottom: 1px solid var(--line);
        overflow-wrap: anywhere;
    }

    td:last-child {
        border-bottom: 0;
    }

    td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
        text-transform: uppercase;
    }

    td[colspan] {
        display: block;
    }

    td[colspan]::before {
        content: "";
        display: none;
    }

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

    .row-actions form,
    .row-actions button,
    .row-actions .button {
        width: 100%;
    }

    .filters .button,
    .filters button,
    .inline-form button,
    .form-stack button {
        width: 100%;
    }

    .document-list a {
        overflow-wrap: anywhere;
    }
}
