:root {
    color-scheme: light;
    --navy: #0d1738;
    --muted: #67728f;
    --line: #e2e8f2;
    --blue: #0878f9;
    --surface: #ffffff;
    --background: #f5f8fc;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--navy); background: var(--background); }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 22px; border-bottom: 1px solid var(--line); }
.brand__mark { font-size: 32px; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 3px; color: var(--muted); }
.nav { display: grid; gap: 7px; margin-top: 20px; }
.nav__item { min-height: 44px; padding: 0 13px; display: flex; align-items: center; gap: 13px; border-radius: 9px; color: #44516f; }
.nav__item span { width: 20px; text-align: center; font-size: 20px; }
.nav__item--active { color: var(--blue); background: #eaf3ff; font-weight: 600; }
.nav__item--disabled { opacity: .62; cursor: default; }
.sidebar__footer { margin-top: auto; color: var(--muted); font-size: 13px; padding: 12px; }
.main { min-width: 0; }
.topbar { height: 66px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.search { width: min(620px, 70%); height: 40px; padding: 0 14px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--muted); }
.environment { padding: 6px 10px; border-radius: 999px; color: #05603a; background: #e5f7ed; font-size: 12px; text-transform: uppercase; font-weight: 700; }
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.topbar__actions form { margin: 0; }
.current-user { color: #3e4964; font-size: 14px; }
.logout { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: #47536e; background: #fff; cursor: pointer; }
.page { max-width: 1320px; padding: 30px 24px 50px; margin: 0 auto; }
.page__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.eyebrow { margin: 0 0 7px; color: var(--blue); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.03em; }
.page__heading p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); }
.status { flex: 0 0 auto; padding: 9px 12px; border: 1px solid #b9e9cc; border-radius: 9px; color: #087443; background: #edfaf2; font-size: 14px; }
.status i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #1bb568; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 26px; }
.metric { min-height: 116px; padding: 20px; display: flex; align-items: center; gap: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 4px 18px rgba(13, 23, 56, .04); }
.metric > span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; font-size: 22px; }
.metric strong, .metric small { display: block; }
.metric strong { font-size: 28px; }
.metric small { margin-top: 3px; color: var(--muted); }
.metric--red > span { color: #d72d3b; background: #ffe9eb; }
.metric--orange > span { color: #c76a00; background: #fff0dd; }
.metric--blue > span { color: #076ee1; background: #e5f1ff; }
.metric--green > span { color: #09824a; background: #e4f7ec; }
.content-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; margin-top: 14px; }
.panel { padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.panel__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel h2, .panel h3 { margin: 0; }
.panel h2 { font-size: 19px; }
.panel h3 { margin-top: 26px; font-size: 25px; }
.panel p { color: var(--muted); line-height: 1.55; }
.panel__heading > span { color: var(--blue); font-size: 13px; }
.checklist { padding: 0; margin: 18px 0 0; list-style: none; display: grid; gap: 13px; }
.checklist li { display: flex; align-items: center; gap: 10px; }
.checklist span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #087443; background: #e4f7ec; font-size: 13px; font-weight: 700; }
.panel--next { background: linear-gradient(145deg, #fff 55%, #edf5ff); }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 25px; }
.tag-row span { padding: 6px 10px; border-radius: 999px; color: #28578d; background: #e7f1fc; font-size: 12px; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at top left, #e6f2ff, transparent 38%), var(--background); }
.auth-card { width: min(440px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 18px 55px rgba(13, 23, 56, .12); }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand > span { font-size: 38px; }
.auth-brand strong, .auth-brand small { display: block; }
.auth-brand small { margin-top: 3px; color: var(--muted); }
.auth-heading { margin: 30px 0 22px; }
.auth-heading h1 { font-size: 30px; }
.auth-heading p { margin: 8px 0 0; color: var(--muted); }
.auth-error { margin-bottom: 18px; padding: 11px 13px; border: 1px solid #ffc5cb; border-radius: 8px; color: #a71827; background: #fff0f2; font-size: 14px; }
.auth-form { display: grid; gap: 17px; }
.auth-form label { display: grid; gap: 7px; color: #3c4864; font-size: 14px; font-weight: 600; }
.auth-form input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid #ccd6e5; border-radius: 8px; outline: none; font: inherit; }
.auth-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(8, 120, 249, .12); }
.auth-form button { height: 46px; border: 0; border-radius: 8px; color: #fff; background: var(--blue); font: inherit; font-weight: 700; cursor: pointer; }
.page--narrow { max-width: 820px; }
.primary-button { display: inline-flex; min-height: 42px; padding: 0 16px; align-items: center; justify-content: center; border: 0; border-radius: 8px; color: #fff; background: var(--blue); font: inherit; font-weight: 700; cursor: pointer; }
.form-panel { margin-top: 24px; }
.data-form { display: grid; gap: 18px; }
.data-form label { display: grid; gap: 7px; color: #3c4864; font-size: 14px; font-weight: 600; }
.data-form input, .data-form select { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid #ccd6e5; border-radius: 8px; background: #fff; font: inherit; }
.data-form textarea { width: 100%; padding: 11px 12px; border: 1px solid #ccd6e5; border-radius: 8px; resize: vertical; font: inherit; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
.notice, .credentials-box { margin-bottom: 18px; padding: 13px 15px; border-radius: 9px; }
.notice--success { color: #087443; background: #e8f8ef; }
.notice--error { color: #a71827; background: #fff0f2; }
.credentials-box { margin-top: 22px; display: grid; gap: 6px; border: 1px solid #acd1ff; background: #edf6ff; }
.credentials-box code { user-select: all; }
.table-panel { margin-top: 22px; padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th, .data-table td { padding: 15px 17px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table th { color: var(--muted); background: #f8fafd; font-size: 12px; text-transform: uppercase; }
.state-pill { padding: 5px 9px; border-radius: 999px; color: #087443; background: #e5f7ed; font-size: 12px; }
.state-pill--new, .state-pill--assigned { color: #1761ad; background: #e5f1ff; }
.state-pill--in_progress { color: #a15c00; background: #fff0dc; }
.state-pill--on_review { color: #6c3bb7; background: #f0e5ff; }
.state-pill--suspended { color: #8c5200; background: #fff0dc; }
.state-pill--cancelled { color: #667085; background: #edf0f4; }
.table-link, .back-link { color: var(--blue); }
.empty-cell { padding: 34px !important; color: var(--muted); text-align: center; }
.task-header { margin-top: 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.task-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; margin-top: 24px; }
.task-description { min-height: 100px; line-height: 1.65; color: #44516f; }
.section-title { margin-top: 30px !important; }
.timeline { margin-top: 18px; display: flex; gap: 12px; }
.timeline > span { width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 5px #e5f1ff; }
.timeline strong, .timeline small, .task-meta small, .task-meta strong, .task-meta span { display: block; }
.timeline small, .task-meta small, .task-meta span { margin-top: 4px; color: var(--muted); }
.task-meta { display: grid; align-content: start; gap: 0; }
.task-meta > div { padding: 15px 0; border-bottom: 1px solid var(--line); }
.task-meta > div:first-child { padding-top: 0; }
.task-meta > div:last-child { border-bottom: 0; }
.task-notice { margin-top: 18px; margin-bottom: 0; }
.task-actions { display: grid; gap: 10px; }
.task-actions form { display: grid; gap: 7px; }
.task-actions textarea { width: 100%; padding: 8px; border: 1px solid #ccd6e5; border-radius: 7px; resize: vertical; font: inherit; }
.task-action { min-height: 38px; padding: 0 12px; border: 0; border-radius: 7px; color: #fff; background: var(--blue); cursor: pointer; font-weight: 650; }
.task-action--reject, .task-action--cancel { color: #a71827; background: #fff0f2; border: 1px solid #ffc5cb; }
.task-action--reopen { color: #8c5200; background: #fff0dc; }
.timeline p { margin: 5px 0 0; color: #4d5873; }
.deadline-form form { display: grid; gap: 7px; margin-top: 8px; }
.deadline-form input, .deadline-form textarea, .deadline-decisions input { width: 100%; padding: 8px; border: 1px solid #ccd6e5; border-radius: 7px; font: inherit; }
.deadline-history { margin-top: 14px; }
.deadline-request { padding: 14px 0; display: grid; grid-template-columns: 1fr auto; gap: 12px; border-bottom: 1px solid var(--line); }
.deadline-request:last-child { border-bottom: 0; }
.deadline-request span, .deadline-request small { display: block; margin-top: 4px; color: var(--muted); }
.deadline-decisions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.deadline-decisions form { display: flex; gap: 7px; }
.public-form-card { width: min(560px, 100%); }
.auth-form textarea { width: 100%; padding: 11px 12px; border: 1px solid #ccd6e5; border-radius: 8px; resize: vertical; font: inherit; }
.honeypot { position: absolute !important; left: -10000px !important; }
.public-status { padding: 18px; border-radius: 10px; background: #edf6ff; }
.public-status small, .public-status strong, .public-status span { display: block; }
.public-status strong { margin: 6px 0; font-size: 24px; }
.public-status span { color: var(--muted); font-size: 13px; }
.public-replies { margin-top: 22px; }
.public-replies article, .request-message { margin-top: 10px; padding: 13px; border-radius: 9px; background: #f4f7fb; }
.public-replies p, .request-message p { margin: 5px 0; line-height: 1.5; }
.public-replies small, .request-message small { color: var(--muted); }
.request-message--applicant_reply { background: #edf6ff; }
.message-form { margin-top: 18px; }
.message-form select, .link-task-form select { min-height: 38px; padding: 0 8px; border: 1px solid #ccd6e5; border-radius: 7px; background: #fff; }
.linked-task { display: block !important; margin-top: 7px; }
.link-task-form { margin-top: 10px; display: grid; gap: 7px; }
.object-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-top: 24px; }
.object-card { display: flex; gap: 14px; transition: transform .15s ease,box-shadow .15s ease; }
.object-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(13,23,56,.09); }
.object-card__icon { width: 44px;height:44px;display:grid;place-items:center;border-radius:12px;color:#087443;background:#e5f7ed;font-size:22px;flex:0 0 auto; }
.object-card h2 { margin-top:5px; }.object-card p { margin:7px 0;color:var(--muted); }.object-card small { color:var(--muted); }
.work-form { margin-top:28px;padding-top:22px;border-top:1px solid var(--line); }
@media (max-width: 920px) { .object-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }

@media (max-width: 920px) {
    .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
    .sidebar { padding-inline: 10px; }
    .brand { justify-content: center; padding-inline: 0; }
    .brand > span:last-child, .nav__item:not(.nav__item--active)::after, .nav__item { font-size: 0; }
    .nav__item { justify-content: center; padding: 0; }
    .nav__item span { font-size: 20px; }
    .sidebar__footer { display: none; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; z-index: 5; top: auto; bottom: 0; width: 100%; height: 64px; padding: 7px 10px; border: 0; border-top: 1px solid var(--line); }
    .brand, .sidebar__footer { display: none; }
    .nav { grid-template-columns: repeat(6, 1fr); gap: 2px; margin: 0; }
    .nav__item { min-height: 50px; }
    .nav__item:nth-child(n+5) { display: none; }
    .topbar { height: 58px; padding: 0 15px; }
    .search { width: 100%; }
    .environment { display: none; }
    .page { padding: 22px 15px 90px; }
    .page__heading { display: block; }
    .status { display: inline-block; margin-top: 18px; }
    .metric-grid, .content-grid { grid-template-columns: 1fr; }
    .form-grid, .task-grid { grid-template-columns: 1fr; }
    .object-grid { grid-template-columns: 1fr; }
}

