:root {
    color-scheme: light;
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-soft: #eef3f9;
    --text: #172033;
    --muted: #667085;
    --border: #d8e0ea;
    --brand: #2457d6;
    --brand-strong: #173fa8;
    --brand-soft: #e8efff;
    --success: #157347;
    --warning: #9a6700;
    --danger: #b42318;
    --shadow: 0 14px 36px rgba(31, 42, 68, 0.09);
    --radius: 16px;
    --sidebar-width: 284px;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f1726;
    --surface: #182235;
    --surface-soft: #202d43;
    --text: #eef4ff;
    --muted: #aebbd0;
    --border: #33435d;
    --brand: #77aaff;
    --brand-strong: #a4c3ff;
    --brand-soft: #23395f;
    --shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 7.5rem; }
body { margin: 0; min-height: 100vh; font-family: Inter, system-ui, sans-serif; background: var(--bg); color: var(--text); }
body.navigation-open { overflow: hidden; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; }
input, select, textarea { width: 100%; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: .55rem; background: var(--surface); color: var(--text); }
textarea { min-height: 6rem; resize: vertical; }
label { display: grid; gap: .35rem; font-weight: 600; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--surface); padding: .75rem; }
.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.app-frame--guest { grid-column: 1 / -1; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--border); padding: 1.25rem; display: flex; flex-direction: column; gap: 1.25rem; overflow-y: auto; z-index: 30; }
.sidebar__header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.sidebar__close { display: none; flex: 0 0 auto; font-size: 1.35rem; }
.brand { display: flex; align-items: center; gap: .75rem; color: var(--text); text-decoration: none; }
.brand__mark { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: .7rem; background: var(--brand); color: white; font-weight: 800; }
.brand div { display: grid; }
.brand span { color: var(--muted); }
.nav-list { display: grid; gap: 1rem; }
.nav-section { display: grid; gap: .25rem; }
.nav-section__title { padding: 0 .8rem .25rem; color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.nav-item { position: relative; display: flex; align-items: center; gap: .65rem; min-height: 2.65rem; padding: .62rem .8rem; border-radius: .55rem; color: var(--text); text-decoration: none; transition: background .15s ease, color .15s ease, transform .15s ease; }
.nav-item:hover { background: var(--surface-soft); color: var(--brand-strong); transform: translateX(2px); }
.nav-item.is-active { background: var(--brand-soft); color: var(--brand-strong); font-weight: 750; }
.nav-item.is-active::before { content: ""; position: absolute; left: 0; top: .55rem; bottom: .55rem; width: .22rem; border-radius: 999px; background: var(--brand); }
.sidebar__scope { margin-top: auto; display: grid; gap: .25rem; padding: .8rem; border-radius: .55rem; background: var(--surface-soft); }
.sidebar__scope span { color: var(--muted); font-size: .85rem; }
.sidebar-backdrop { display: none; }
.app-frame { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); }
.topbar__identity { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.navigation-toggle { display: none; flex: 0 0 auto; }
.topbar__actions { display: flex; align-items: center; gap: .75rem; }
.user-summary { display: grid; text-decoration: none; color: var(--text); }
.user-summary span { color: var(--muted); font-size: .85rem; }
.eyebrow { margin: 0 0 .2rem; color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.page-title { margin: 0; font-size: 1.5rem; }
.content { padding: 1.5rem; }
.footer { margin-top: auto; display: flex; justify-content: space-between; padding: 1rem 1.5rem; color: var(--muted); border-top: 1px solid var(--border); }
.stack { display: grid; gap: 1rem; }
.panel, .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.panel__header, .card__header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .8rem; }
.panel h2, .card h2 { margin: 0; }
.filter-grid, .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); align-items: end; gap: .8rem; }
.form-grid textarea { grid-column: span 2; }
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin: 0; }
.detail-grid div { padding: .8rem; border-radius: .55rem; background: var(--surface-soft); }
dt { color: var(--muted); font-size: .8rem; font-weight: 700; }
dd { margin: .25rem 0 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .8rem; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; display: grid; gap: .35rem; }
.kpi-card span { color: var(--muted); }
.kpi-card strong { font-size: 1.6rem; }
.button-row { display: flex; flex-wrap: wrap; gap: .7rem; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: .55rem; padding: .7rem 1rem; background: var(--brand); color: white; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--brand-strong); }
.button--secondary { background: var(--surface-soft); color: var(--text); border: 1px solid var(--border); }
.icon-button { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 1px solid var(--border); border-radius: .55rem; background: var(--surface); color: var(--text); cursor: pointer; }
.status-badge { padding: .35rem .6rem; border-radius: 999px; background: var(--surface-soft); }
.status-badge--success { color: var(--success); }
.tag-list, .country-list { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; }
.tag-list li, .country-list li { padding: .45rem .7rem; border-radius: 999px; background: var(--surface-soft); }
.message { padding: .7rem; border-radius: .55rem; background: var(--surface-soft); }
.project-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.workflow-card { display: grid; gap: .8rem; align-content: start; }
.workflow-card .button { justify-self: start; }
.section-gap { margin-top: 1rem; }
.workspace-tabs { scrollbar-width: thin; }
.workspace-tab[aria-current="location"] { background: var(--brand-soft); color: var(--brand-strong); }

@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }
    .navigation-toggle, .sidebar__close { display: inline-grid; }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: min(88vw, var(--sidebar-width)); height: 100vh; border-right: 1px solid var(--border); border-bottom: 0; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 18px 0 44px rgba(10, 23, 48, .24); }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(15, 23, 38, .52); }
    .topbar { padding: .8rem 1rem; }
    .content { padding: 1rem; }
    .form-grid textarea { grid-column: auto; }
    .project-header { align-items: flex-start; flex-direction: column; }
    .user-summary { display: none; }
    .footer { gap: .35rem; flex-direction: column; padding: 1rem; }
}

@media (max-width: 560px) {
    .topbar__actions form { display: none; }
    .page-title { font-size: 1.15rem; }
    .eyebrow { font-size: .65rem; }
}
