:root {
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: #1f2933;
    background: #f3f5f7;
    line-height: 1.5;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
}

.page-shell {
    width: min(960px, calc(100% - 32px));
    margin: 48px auto;
}

.page-header {
    margin-bottom: 28px;
}

.eyebrow {
    margin: 0 0 6px;
    color: #52606d;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    color: #172b4d;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.15;
}

h2 {
    margin: 0 0 22px;
    color: #172b4d;
    font-size: 1.25rem;
}

.intro {
    max-width: 680px;
    margin-top: 12px;
    color: #52606d;
    font-size: 1.05rem;
}

.application-form {
    display: grid;
    gap: 20px;
}

.form-section,
.confirmation-card {
    padding: 28px;
    border: 1px solid #d9e2ec;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 5px 20px rgba(23, 43, 77, 0.05);
}

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

.three-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
    margin-bottom: 18px;
}

.field-grid .field {
    margin-bottom: 0;
}

.field > label {
    display: block;
    margin-bottom: 7px;
    color: #243b53;
    font-size: 0.94rem;
    font-weight: 650;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #bcccdc;
    border-radius: 8px;
    background: #ffffff;
    color: #102a43;
    font: inherit;
}

input,
select {
    min-height: 46px;
    padding: 10px 12px;
}

textarea {
    min-height: 100px;
    padding: 12px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #486581;
    outline: 3px solid rgba(72, 101, 129, 0.16);
}

.checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0;
}

.checkbox-field input {
    width: 18px;
    min-height: 18px;
    margin-top: 3px;
}

.checkbox-field label {
    color: #334e68;
}

.field-error {
    margin: 6px 0 0;
    color: #b42318;
    font-size: 0.9rem;
}

.alert {
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 8px;
}

.alert-error {
    border: 1px solid #f5c2c0;
    background: #fff1f0;
    color: #8a1c16;
}

.submit-row {
    display: flex;
    justify-content: flex-end;
}

.primary-button {
    width: auto;
    min-width: 190px;
    border: 0;
    border-radius: 8px;
    background: #172b4d;
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
}

.primary-button:hover {
    background: #243b53;
}

.confirmation-card {
    max-width: 680px;
    margin: 90px auto;
    text-align: center;
}

.confirmation-card h1 {
    margin-bottom: 18px;
}

.confirmation-card p {
    color: #52606d;
}

.confirmation-icon {
    display: grid;
    width: 62px;
    height: 62px;
    margin: 0 auto 20px;
    place-items: center;
    border-radius: 50%;
    background: #e3f9e5;
    color: #137333;
    font-size: 2rem;
    font-weight: 800;
}

.section-description {
    margin: -10px 0 20px;
    color: #52606d;
}

.field-help {
    margin: -2px 0 8px;
    color: #627d98;
    font-size: 0.9rem;
}

.upload-notice {
    margin-bottom: 22px;
    padding: 14px 16px;
    border: 1px solid #bcccdc;
    border-radius: 8px;
    background: #f0f4f8;
    color: #334e68;
    font-size: 0.92rem;
}

input[type="file"] {
    min-height: auto;
    padding: 12px;
    background: #f8fafc;
}

input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 8px 12px;
    border: 1px solid #9fb3c8;
    border-radius: 6px;
    background: #ffffff;
    color: #243b53;
    cursor: pointer;
    font: inherit;
    font-weight: 650;
}

input[type="file"]::file-selector-button:hover {
    background: #f0f4f8;
}

.alert-success {
    border: 1px solid #a8d5b5;
    background: #edf9f0;
    color: #176b35;
}

.admin-body,
.admin-login-body {
    background: #f3f5f7;
}

.admin-topbar {
    border-bottom: 1px solid #d9e2ec;
    background: #ffffff;
}

.admin-topbar-inner {
    display: flex;
    width: min(1180px, calc(100% - 32px));
    min-height: 68px;
    margin: 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.admin-brand {
    color: #172b4d;
    font-size: 1.05rem;
    font-weight: 800;
    text-decoration: none;
}

.logout-form {
    margin: 0;
}

.secondary-button {
    width: auto;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid #bcccdc;
    border-radius: 7px;
    background: #ffffff;
    color: #243b53;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.secondary-button:hover {
    background: #f0f4f8;
}

.admin-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 40px auto;
}

.admin-page-header {
    display: flex;
    margin-bottom: 26px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.admin-page-description {
    max-width: 700px;
    margin: 10px 0 0;
    color: #52606d;
}

.application-count {
    flex: 0 0 auto;
    padding: 9px 13px;
    border: 1px solid #d9e2ec;
    border-radius: 999px;
    background: #ffffff;
    color: #334e68;
    font-size: 0.9rem;
    font-weight: 700;
}

.table-card,
.detail-card,
.empty-state,
.login-card {
    border: 1px solid #d9e2ec;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 5px 20px rgba(23, 43, 77, 0.05);
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px 18px;
    border-bottom: 1px solid #e4e7eb;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: #52606d;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

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

.data-table tbody tr:hover {
    background: #f8fafc;
}

.table-secondary {
    display: block;
    margin-top: 3px;
    color: #627d98;
    font-size: 0.88rem;
}

.table-action {
    text-align: right;
}

.view-link,
.download-link {
    color: #174ea6;
    font-weight: 700;
    text-decoration: none;
}

.view-link:hover,
.download-link:hover,
.back-link:hover {
    text-decoration: underline;
}

.empty-state {
    padding: 60px 28px;
    text-align: center;
}

.empty-state p {
    color: #627d98;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #334e68;
    font-weight: 700;
    text-decoration: none;
}

.detail-layout {
    display: grid;
    gap: 18px;
}

.detail-card {
    padding: 26px;
}

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

.detail-grid div {
    min-width: 0;
}

.detail-grid dt {
    margin-bottom: 5px;
    color: #627d98;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.detail-grid dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: #243b53;
}

.detail-grid dd a {
    color: #174ea6;
}

.detail-full-width {
    grid-column: 1 / -1;
}

.preserve-lines {
    white-space: pre-wrap;
}

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

.document-item {
    display: flex;
    padding: 14px 16px;
    border: 1px solid #d9e2ec;
    border-radius: 9px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.document-metadata {
    display: block;
    margin-top: 4px;
    color: #627d98;
    font-size: 0.86rem;
}

.login-shell {
    display: grid;
    width: min(480px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 40px 0;
    place-items: center;
}

.login-card {
    width: 100%;
    padding: 32px;
}

.login-card h1 {
    font-size: 2rem;
}

.login-introduction {
    margin: 10px 0 24px;
    color: #52606d;
}

.login-button {
    width: 100%;
    margin-top: 12px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.status-filters {
    display: flex;
    margin-bottom: 22px;
    padding-bottom: 4px;
    overflow-x: auto;
    gap: 8px;
}

.status-filter {
    display: inline-flex;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid #d9e2ec;
    border-radius: 999px;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    color: #334e68;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.status-filter:hover {
    background: #f0f4f8;
}

.status-filter-active {
    border-color: #486581;
    background: #eaf0f6;
    color: #172b4d;
}

.status-filter-count {
    display: inline-grid;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 999px;
    place-items: center;
    background: rgba(23, 43, 77, 0.09);
    font-size: 0.78rem;
}

.status-badge {
    display: inline-flex;
    min-height: 27px;
    padding: 4px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.status-new {
    border-color: #b8c7d9;
    background: #edf2f7;
    color: #334e68;
}

.status-reviewing {
    border-color: #b8cff5;
    background: #edf4ff;
    color: #174ea6;
}

.status-approved {
    border-color: #a8d5b5;
    background: #edf9f0;
    color: #176b35;
}

.status-declined {
    border-color: #f1b7b3;
    background: #fff1f0;
    color: #9b1c15;
}

.status-archived {
    border-color: #d8d2c4;
    background: #f5f3ef;
    color: #5f594d;
}

.review-panel {
    margin-bottom: 18px;
    border-left: 5px solid #486581;
}

.review-panel-header {
    display: flex;
    margin-bottom: 22px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.review-panel-header h2 {
    margin-bottom: 0;
}

.review-form-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(220px, 0.65fr);
    gap: 24px;
}

.status-timestamp {
    padding: 12px 14px;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    background: #f8fafc;
}

.status-timestamp span {
    display: block;
    margin-bottom: 5px;
    color: #627d98;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status-timestamp strong {
    color: #334e68;
    font-size: 0.92rem;
}

.review-submit-row {
    display: flex;
    justify-content: flex-end;
}

.review-submit-row .primary-button {
    width: auto;
    min-width: 160px;
    padding: 11px 18px;
}

.admin-nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-nav-link {
    color: #334e68;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
}

.admin-nav-link:hover {
    text-decoration: underline;
}

.danger-zone {
    border-color: #e7aaa6;
    border-left: 5px solid #b42318;
    background: #fffafa;
}

.danger-eyebrow {
    color: #9b1c15;
}

.danger-zone > p:not(.eyebrow) {
    max-width: 720px;
    color: #6b3430;
}

.delete-form {
    max-width: 520px;
    margin-top: 22px;
}

.danger-button {
    width: auto;
    min-height: 46px;
    padding: 10px 16px;
    border: 0;
    border-radius: 8px;
    background: #b42318;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 750;
}

.danger-button:hover {
    background: #8f1c13;
}

.danger-button:focus {
    outline: 3px solid rgba(180, 35, 24, 0.2);
}

.privacy-introduction {
    margin-top: 14px;
    color: #52606d;
}

.privacy-introduction a,
.consent-summary a,
.confirmation-privacy-link a,
.privacy-page a {
    color: #174ea6;
    font-weight: 700;
}

.consent-summary {
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid #bcccdc;
    border-radius: 8px;
    background: #f0f4f8;
    color: #334e68;
}

.consent-summary p {
    margin: 0;
}

.consent-summary p + p {
    margin-top: 8px;
}

.privacy-page {
    max-width: 900px;
}

.privacy-section {
    margin-bottom: 20px;
}

.privacy-section p,
.privacy-section li {
    color: #334e68;
}

.privacy-section li + li {
    margin-top: 8px;
}

.privacy-version {
    margin-top: 14px;
    color: #627d98;
    font-size: 0.9rem;
}

.privacy-back-link {
    margin: 24px 0 50px;
}

.confirmation-privacy-link {
    margin-top: 26px;
    font-size: 0.92rem;
}

@media (max-width: 720px) {
    .page-shell {
        margin: 24px auto;
    }

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

    .form-section,
    .confirmation-card {
        padding: 20px;
    }

    .submit-row {
        display: block;
    }

    .primary-button {
        width: 100%;
    }

    .admin-page-header {
        display: block;
    }
    
    .application-count {
        display: inline-block;
        margin-top: 16px;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-full-width {
        grid-column: auto;
    }
    
    .document-item {
        align-items: flex-start;
        flex-direction: column;
    }
    .review-panel-header {
        align-items: flex-start;
        flex-direction: column;
    }
    
    .review-form-grid {
        grid-template-columns: 1fr;
    }
    
    .review-submit-row {
        display: block;
    }
    
    .review-submit-row .primary-button {
        width: 100%;
    }

    .admin-topbar-inner {
        align-items: flex-start;
        flex-direction: column;
        padding-top: 14px;
        padding-bottom: 14px;
    }
    
    .admin-nav-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .danger-button {
        width: 100%;
    }
}