:root {
    --fm-ink: #1f2937;
    --fm-navy: #1f2937;
    --fm-navy-deep: #111827;
    --fm-slate: #667085;
    --fm-line: #e6e8ee;
    --fm-bg: #f5f7fb;
    --fm-surface: #ffffff;
    --fm-green: #8dc63e;
    --fm-green-dark: #669d27;
    --fm-lime: #c3dc29;
    --fm-orange: #f59e0b;
    --fm-blue: #2f6fdb;
    --fm-amber: #d88a13;
    --fm-red: #c43a31;
    --fm-focus: #2563eb;
    --fm-shadow: 0 12px 32px rgba(18, 43, 75, .08);
    --fm-radius: 18px;
    --fm-radius-sm: 10px;
    font-family: "Poppins", "Segoe UI", Arial, sans-serif;
    color: var(--fm-ink);
    background: var(--fm-bg);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { min-height: 100vh; margin: 0; background: var(--fm-bg); }
a { color: inherit; }
button, input, select { font: inherit; }
button:disabled { cursor: not-allowed; opacity: .62; }
:focus-visible { outline: 3px solid var(--fm-focus); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; clip: rect(0, 0, 0, 0); overflow: hidden; }

/* Authentication */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(20rem, 1fr) minmax(25rem, 36rem); }
.auth-brand { padding: clamp(2.5rem, 6vw, 6rem); color: var(--fm-ink); background: radial-gradient(circle at 15% 15%, rgba(195,220,41,.28), transparent 34%), radial-gradient(circle at 88% 22%, rgba(245,158,11,.18), transparent 30%), linear-gradient(145deg, #ffffff, #f6f9ee); display: flex; flex-direction: column; justify-content: space-between; }
.auth-syncro-logo { display: block; width: 8.5rem; height: auto; margin-bottom: 1.5rem; }
.brand-mark { display: inline-grid; place-items: center; width: 3rem; height: 3rem; flex: 0 0 3rem; border-radius: 12px; color: #183153; background: linear-gradient(135deg, #a1d85f, var(--fm-green)); font-weight: 900; letter-spacing: .03em; box-shadow: inset 0 1px rgba(255,255,255,.4); }
.auth-brand h1 { max-width: 12ch; margin: 1.5rem 0 1rem; font-size: clamp(2.7rem, 5vw, 5rem); line-height: .98; }
.auth-brand p { max-width: 42rem; color: var(--fm-slate); line-height: 1.7; }
.auth-panel { display: grid; place-items: center; padding: 2rem; background: var(--fm-surface); }
.auth-card { width: min(100%, 28rem); }
.eyebrow { margin: 0 0 .45rem; color: var(--fm-green-dark); font-size: .72rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.auth-card h2 { margin: .35rem 0; color: var(--fm-ink); font-size: 2rem; }
.muted { color: var(--fm-slate); line-height: 1.6; }
.field { margin-top: 1.15rem; }
.field label { display: block; margin-bottom: .45rem; font-weight: 750; }
input, select { width: 100%; min-height: 3rem; border: 1px solid #cfd8e5; border-radius: var(--fm-radius-sm); padding: .72rem .85rem; color: var(--fm-ink); background: #fff; }
input:focus, select:focus { border-color: var(--fm-focus); box-shadow: 0 0 0 3px rgba(37,99,235,.12); outline: none; }
.button { min-height: 2.8rem; border: 0; border-radius: var(--fm-radius-sm); padding: .7rem 1rem; color: #162942; background: var(--fm-green); font-weight: 850; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.auth-card .button { width: 100%; margin-top: 1.5rem; }
.alert { margin: 1rem 0; padding: .85rem 1rem; border-left: .3rem solid var(--fm-red); background: #fff1f0; color: #7a271a; }
.security-note { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--fm-line); color: var(--fm-slate); font-size: .86rem; line-height: 1.55; }

/* Portal shell */
.portal-shell { min-height: 100vh; display: grid; grid-template-columns: 16.5rem minmax(0, 1fr); }
.portal-sidebar { position: sticky; top: 0; height: 100vh; padding: 1.35rem 1rem; color: var(--fm-ink); border-right: 1px solid var(--fm-line); background: #fff; display: flex; flex-direction: column; box-shadow: 10px 0 30px rgba(15,23,42,.035); }
.portal-brand { display: flex; align-items: center; gap: .8rem; padding: .1rem .5rem 1.25rem; color: var(--fm-ink); text-decoration: none; }
.syncro-product-logo { width: 3.2rem; height: 3.2rem; object-fit: contain; flex: 0 0 3.2rem; }
.portal-brand strong, .portal-brand small { display: block; }
.portal-brand strong { font-size: .95rem; line-height: 1.2; }
.portal-brand small { color: var(--fm-slate); font-weight: 650; letter-spacing: .02em; }
.tenant-chip { display: flex; align-items: center; gap: .7rem; margin: .3rem .25rem 1.3rem; padding: .8rem; border: 1px solid color-mix(in srgb, var(--fm-orange) 20%, var(--fm-line)); border-radius: 12px; background: color-mix(in srgb, var(--fm-orange) 6%, #fff); }
.tenant-chip > span:last-child { min-width: 0; }
.tenant-chip strong, .tenant-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-chip small { margin-bottom: .2rem; color: var(--fm-slate); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
.tenant-chip strong { color: var(--fm-ink); font-size: .83rem; }
.tenant-initial { display: grid; place-items: center; width: 2rem; height: 2rem; flex: 0 0 2rem; border-radius: 8px; color: #4a3210; background: #fff0ce; font-weight: 900; }
.portal-nav { flex: 1; }
.nav-label { margin: 1.1rem .7rem .4rem; color: #98a2b3; font-size: .65rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.portal-nav a { display: flex; align-items: center; gap: .75rem; min-height: 2.75rem; margin: .18rem 0; padding: .6rem .7rem; border-radius: 10px; color: #475467; text-decoration: none; font-size: .9rem; font-weight: 700; }
.portal-nav a:hover { color: #5f3400; background: color-mix(in srgb, var(--fm-orange) 9%, #fff); }
.portal-nav a.is-active { color: #5f3400; background: color-mix(in srgb, var(--fm-orange) 16%, #fff); box-shadow: inset 3px 0 var(--fm-orange); }
.nav-icon { display: grid; place-items: center; width: 1.45rem; height: 1.45rem; color: #98a2b3; font-weight: 900; }
.is-active .nav-icon { color: var(--fm-orange); }
.sidebar-footer { display: flex; align-items: center; gap: .7rem; margin: 1rem .3rem 0; padding: .85rem .7rem 0; border-top: 1px solid var(--fm-line); }
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer strong { color: var(--fm-ink); font-size: .75rem; }
.sidebar-footer small { margin-top: .2rem; color: var(--fm-slate); font-size: .7rem; }
.connection-dot { width: .58rem; height: .58rem; border-radius: 99px; background: var(--fm-green); box-shadow: 0 0 0 4px rgba(127,189,50,.13); }

.portal-main { min-width: 0; }
.portal-topbar { min-height: 6rem; display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 1.25rem clamp(1.4rem, 3vw, 2.5rem); border-bottom: 1px solid var(--fm-line); background: rgba(255,255,255,.92); backdrop-filter: blur(14px); }
.portal-topbar h1 { margin: 0; font-size: clamp(1.55rem, 3vw, 2rem); letter-spacing: -.025em; }
.account-menu { display: flex; align-items: center; gap: .7rem; }
.account-menu strong, .account-menu small { display: block; }
.account-menu strong { font-size: .82rem; }
.account-menu small { margin-top: .15rem; color: var(--fm-slate); font-size: .72rem; }
.account-avatar { display: grid; place-items: center; width: 2.45rem; height: 2.45rem; border-radius: 99px; color: var(--fm-navy); background: #e7f2d9; font-weight: 900; }
.text-button { border: 0; padding: .5rem; color: var(--fm-slate); background: transparent; font-size: .76rem; font-weight: 750; cursor: pointer; }
.text-button:hover { color: var(--fm-red); }
.portal-content { padding: clamp(1.4rem, 3vw, 2.5rem); }
.preview-banner { margin: 0 0 1rem; padding: .8rem 1rem; border: 1px solid #bdd8fa; border-radius: var(--fm-radius-sm); color: #174f91; background: #eef6ff; font-size: .9rem; }

/* Shared content */
.welcome-panel { position: relative; overflow: hidden; display: flex; justify-content: space-between; gap: 2rem; padding: clamp(1.35rem, 3vw, 2rem); border: 1px solid color-mix(in srgb, var(--fm-green) 24%, var(--fm-line)); border-radius: var(--fm-radius); color: var(--fm-ink); background: radial-gradient(circle at 85% 20%, rgba(245,158,11,.15), transparent 35%), linear-gradient(120deg, #fff, #f6faec); box-shadow: var(--fm-shadow); }
.welcome-panel::after { content: ""; position: absolute; width: 14rem; height: 14rem; right: 9rem; bottom: -9rem; border-radius: 99rem; background: rgba(195,220,41,.18); }
.welcome-panel h2 { margin: .65rem 0 .35rem; font-size: clamp(1.45rem, 3vw, 2rem); }
.welcome-panel p { max-width: 43rem; margin: 0; color: var(--fm-slate); line-height: 1.55; }
.status-pill { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .55rem; border-radius: 99rem; font-size: .73rem; font-weight: 850; }
.status-pill span { width: .45rem; height: .45rem; border-radius: 99rem; background: currentColor; }
.status-green { color: #3f6c15; background: rgba(141,198,62,.17); }
.welcome-date { position: relative; z-index: 1; display: grid; place-items: center; align-content: center; min-width: 7rem; border-left: 1px solid rgba(31,41,55,.12); }
.welcome-date strong { font-size: 2.2rem; line-height: 1; }
.welcome-date span { margin-top: .3rem; color: var(--fm-slate); font-size: .73rem; text-transform: uppercase; letter-spacing: .1em; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 1.15rem 0; }
.metric-card { display: flex; align-items: center; gap: 1rem; min-height: 8.5rem; padding: 1.15rem; border: 1px solid var(--fm-line); border-radius: 15px; background: #fff; box-shadow: 0 6px 22px rgba(18,43,75,.05); }
.metric-card p, .metric-card small { margin: 0; color: var(--fm-slate); }
.metric-card p { font-size: .78rem; font-weight: 750; }
.metric-card strong { display: block; margin: .18rem 0; font-size: 2rem; letter-spacing: -.04em; }
.metric-card small { font-size: .7rem; }
.metric-icon { display: grid; place-items: center; width: 2.85rem; height: 2.85rem; flex: 0 0 2.85rem; border-radius: 11px; font-weight: 900; }
.metric-blue .metric-icon { color: #245fba; background: #e8f1ff; }
.metric-green .metric-icon { color: #588c1e; background: #edf8e2; }
.metric-amber .metric-icon { color: #ae6c0c; background: #fff4df; }
.metric-red .metric-icon { color: #a53129; background: #fff0ee; }

.content-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(17rem, .8fr); gap: 1rem; }
.panel { border: 1px solid var(--fm-line); border-radius: var(--fm-radius); background: #fff; box-shadow: 0 7px 24px rgba(18,43,75,.045); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.3rem; border-bottom: 1px solid var(--fm-line); }
.panel-heading h2 { margin: 0; font-size: 1.05rem; }
.panel-link { color: var(--fm-green-dark); font-size: .76rem; font-weight: 800; text-decoration: none; }
.activity-list { padding: .25rem 1.2rem; }
.activity-row { display: grid; grid-template-columns: 1rem minmax(11rem, 1fr) auto auto; align-items: center; gap: .75rem; min-height: 4.2rem; border-bottom: 1px solid #eef2f6; }
.activity-row:last-child { border-bottom: 0; }
.result-dot { width: .65rem; height: .65rem; border-radius: 99rem; }
.result-green { color: #367d25; background: #daf2d4; }
.result-amber { color: #9a5b02; background: #ffe6b8; }
.result-red { color: #9b2b23; background: #ffd8d4; }
.result-unknown { color: #596579; background: #e7ebf0; }
.result-dot.result-green { background: #5eaf45; }
.result-dot.result-amber { background: #e89a23; }
.result-dot.result-red { background: #d64d43; }
.result-dot.result-unknown { background: #8491a3; }
.activity-person strong, .activity-person small { display: block; }
.activity-person strong { font-size: .84rem; }
.activity-person small { margin-top: .18rem; color: var(--fm-slate); font-size: .7rem; }
.activity-row time { color: var(--fm-slate); font-size: .72rem; white-space: nowrap; }
.direction-tag { display: inline-flex; padding: .3rem .5rem; border-radius: 7px; color: #36526f; background: #eef4f9; font-size: .68rem; font-weight: 800; }

.setup-list { list-style: none; margin: 0; padding: .8rem 1.2rem 1.2rem; }
.setup-list li { position: relative; display: flex; gap: .8rem; padding: .65rem 0; }
.setup-list li:not(:last-child)::after { content: ""; position: absolute; left: .8rem; top: 2.35rem; bottom: -.35rem; width: 1px; background: #dfe6ee; }
.setup-list li > span { position: relative; z-index: 1; display: grid; place-items: center; width: 1.65rem; height: 1.65rem; flex: 0 0 1.65rem; border-radius: 99rem; color: #66758a; background: #edf1f5; font-size: .7rem; font-weight: 900; }
.setup-list li.is-complete > span { color: #fff; background: var(--fm-green); }
.setup-list strong, .setup-list small { display: block; }
.setup-list strong { font-size: .8rem; }
.setup-list small { margin-top: .15rem; color: var(--fm-slate); font-size: .68rem; line-height: 1.35; }

.page-intro { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.1rem; }
.page-intro h2 { margin: 0; font-size: 1.25rem; }
.page-intro p { max-width: 48rem; margin: .35rem 0 0; color: var(--fm-slate); line-height: 1.55; }
.button-compact { min-height: 2.55rem; padding-inline: 1.1rem; white-space: nowrap; }
.button-muted { width: 100%; color: #647286; background: #edf1f5; }
.filter-bar { display: flex; align-items: center; gap: .65rem; margin-bottom: 1rem; padding: .7rem; border: 1px solid var(--fm-line); border-radius: 13px; background: #fff; }
.filter-bar .search-field { flex: 1; }
.filter-bar input, .filter-bar select { min-height: 2.65rem; }
.filter-bar select { min-width: 11rem; }
.button-filter { min-height: 2.65rem; padding-inline: 1.2rem; }
.table-panel { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.data-table th { padding: .8rem 1rem; color: #7b8798; background: #f8fafc; text-align: left; font-size: .65rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: .85rem 1rem; border-top: 1px solid #edf1f5; vertical-align: middle; }
.data-table tbody tr:hover { background: #fbfcfd; }
.person-cell { display: flex; align-items: center; gap: .65rem; min-width: 12rem; }
.person-cell > span { display: grid; place-items: center; width: 2rem; height: 2rem; flex: 0 0 2rem; border-radius: 8px; color: #2c536f; background: #e9f1f7; font-weight: 900; }
.person-cell strong, .person-cell small, .cell-subtitle { display: block; }
.person-cell small, .cell-subtitle { margin-top: .15rem; color: var(--fm-slate); font-size: .68rem; }
.mini-status, .result-badge, .locked-label, .preview-label { display: inline-flex; align-items: center; width: fit-content; padding: .28rem .5rem; border-radius: 99rem; color: #647286; background: #edf1f5; font-size: .65rem; font-weight: 850; white-space: nowrap; }
.mini-status.is-good { color: #397524; background: #e5f4dd; }
.result-badge.result-green { color: #33721f; background: #e2f3da; }
.result-badge.result-amber { color: #925602; background: #fff0d2; }
.result-badge.result-red { color: #992d25; background: #ffe2df; }
.result-badge.result-unknown { color: #5f6876; background: #e9edf2; }
.locked-label { color: #36526f; background: #e9f1f7; }
.locked-label::before { content: "•"; margin-right: .35rem; color: var(--fm-green-dark); }
.preview-label { color: #805410; background: #fff0d2; }
.empty-state { display: grid; place-items: center; min-height: 17rem; padding: 2rem; text-align: center; }
.empty-state > span { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 99rem; color: #60768c; background: #eaf0f5; font-weight: 900; }
.empty-state h3 { margin: .8rem 0 .25rem; }
.empty-state p { max-width: 30rem; margin: 0; color: var(--fm-slate); font-size: .82rem; line-height: 1.55; }

.alert-list { display: grid; gap: .8rem; }
.alert-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border: 1px solid var(--fm-line); border-left-width: 4px; border-radius: 13px; background: #fff; }
.alert-card.alert-red { border-left-color: var(--fm-red); }
.alert-card.alert-amber { border-left-color: var(--fm-amber); }
.alert-card.alert-unknown { border-left-color: #8894a5; }
.alert-symbol { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 9px; color: #36526f; background: #edf2f6; font-weight: 900; }
.alert-red .alert-symbol { color: #9b2b23; background: #ffe5e2; }
.alert-amber .alert-symbol { color: #985b04; background: #fff0d4; }
.alert-copy > div { display: flex; align-items: center; gap: .6rem; }
.alert-copy time, .alert-copy small { color: var(--fm-slate); font-size: .68rem; }
.alert-copy h2 { margin: .35rem 0 .15rem; font-size: .95rem; }
.alert-copy p { margin: 0 0 .2rem; color: var(--fm-slate); font-size: .75rem; }
.alert-card > a { color: var(--fm-green-dark); font-size: .72rem; font-weight: 800; text-decoration: none; }

.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.report-card { display: flex; gap: 1rem; padding: 1.25rem; border: 1px solid var(--fm-line); border-radius: var(--fm-radius); background: #fff; box-shadow: 0 6px 20px rgba(18,43,75,.04); }
.report-card h2 { margin: .05rem 0 .35rem; font-size: 1rem; }
.report-card p { margin: 0 0 .65rem; color: var(--fm-slate); font-size: .78rem; line-height: 1.55; }
.report-card div > span { color: #8a6b35; font-size: .67rem; font-weight: 800; }
.report-icon { display: grid; place-items: center; width: 2.8rem; height: 2.8rem; flex: 0 0 2.8rem; border-radius: 10px; font-weight: 900; }
.report-green { color: #4f7e1c; background: #edf7e3; }
.report-amber { color: #9b6109; background: #fff0d4; }
.report-blue { color: #2d61a8; background: #e8f1ff; }
.report-slate { color: #5f6d80; background: #edf1f5; }
.information-banner { margin-top: 1rem; padding: 1rem 1.2rem; border: 1px solid #d9e4ef; border-radius: 13px; background: #f4f9fd; }
.information-banner strong { font-size: .82rem; }
.information-banner p { margin: .3rem 0 0; color: var(--fm-slate); font-size: .75rem; line-height: 1.55; }

/* Workforce administration */
.flash { margin: 0 0 1rem; padding: .85rem 1rem; border: 1px solid; border-radius: var(--fm-radius-sm); font-size: .86rem; font-weight: 700; }
.flash-success { color: #315f1f; border-color: #bedbab; background: #edf8e6; }
.flash-error { color: #842c25; border-color: #efb7b1; background: #fff0ee; }
.table-action, .secondary-link, .setup-link { color: var(--fm-green-dark); font-weight: 800; text-decoration: none; }
.table-action:hover, .secondary-link:hover, .setup-link:hover { text-decoration: underline; }
.worker-form-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(17rem, .7fr); gap: 1rem; align-items: start; }
.form-panel form { padding: 0 1.3rem 1.3rem; }
.form-fields { display: grid; gap: .2rem; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field-help, .field-error { display: block; margin-top: .38rem; font-size: .7rem; line-height: 1.45; }
.field-help { color: var(--fm-slate); }
.field-error { color: #9b2b23; font-weight: 750; }
.form-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--fm-line); }
.context-copy { padding: 1.2rem 1.3rem; }
.context-copy p { margin: .8rem 0 0; color: var(--fm-slate); font-size: .76rem; line-height: 1.55; }
.consequence-form { margin: 0 1.3rem 1.3rem; padding-top: 1rem; border-top: 1px solid var(--fm-line); }
.consequence-form small { display: block; margin-top: .6rem; color: var(--fm-slate); font-size: .68rem; line-height: 1.45; }
.danger-button { min-height: 2.65rem; border: 1px solid #e6a8a2; border-radius: var(--fm-radius-sm); padding: .65rem .9rem; color: #8e2f28; background: #fff4f2; font-weight: 850; cursor: pointer; }
.danger-button:hover { background: #ffe8e5; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.settings-wide { grid-column: 1 / -1; }
.settings-card { overflow: hidden; }
.details-list { margin: 0; padding: .45rem 1.3rem 1.2rem; }
.details-list > div { display: grid; grid-template-columns: minmax(8rem, .7fr) 1fr; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid #edf1f5; }
.details-list > div:last-child { border-bottom: 0; }
.details-list dt { color: var(--fm-slate); font-size: .72rem; }
.details-list dd { margin: 0; font-size: .78rem; font-weight: 750; }
.security-summary { display: flex; gap: .8rem; padding: 1.2rem 1.3rem .3rem; }
.security-summary > span { display: grid; place-items: center; width: 2rem; height: 2rem; flex: 0 0 2rem; border-radius: 99rem; color: #fff; background: var(--fm-green); font-weight: 900; }
.security-summary strong { font-size: .8rem; }
.security-summary p { margin: .3rem 0 0; color: var(--fm-slate); font-size: .72rem; line-height: 1.5; }
.settings-card > .button-muted { width: calc(100% - 2.6rem); margin: .9rem 1.3rem 1.3rem; }
.scope-list { padding: .45rem 1.3rem 1rem; }
.scope-list > div { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid #edf1f5; }
.scope-list > div:last-child { border-bottom: 0; }
.scope-list > div > span:nth-child(2) { flex: 1; }
.scope-list strong, .scope-list small { display: block; }
.scope-list strong { font-size: .8rem; }
.scope-list small { margin-top: .15rem; color: var(--fm-slate); font-size: .68rem; }
.scope-icon { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; color: #3d6685; background: #e9f1f7; font-weight: 900; }

@media (max-width: 1080px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { min-height: 16rem; }
    .portal-shell { grid-template-columns: 1fr; }
    .portal-sidebar { position: static; height: auto; }
    .portal-nav { display: grid; grid-template-columns: repeat(2, 1fr); }
    .nav-label, .sidebar-footer, .tenant-chip { display: none; }
    .portal-topbar { align-items: flex-start; }
    .account-menu > span:nth-child(2) { display: none; }
    .welcome-date { display: none; }
    .metric-grid, .report-grid, .settings-grid { grid-template-columns: 1fr; }
    .settings-wide { grid-column: auto; }
    .filter-bar { align-items: stretch; flex-direction: column; }
    .filter-bar select { width: 100%; }
    .page-intro { align-items: flex-start; flex-direction: column; }
    .worker-form-grid, .form-row { grid-template-columns: 1fr; }
    .alert-card { grid-template-columns: auto 1fr; }
    .alert-card > a { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; }
}

/* Native PHP forms use the same spacing and table tokens as the existing portal. */
.panel > form { padding: 1.25rem; max-width: 48rem; }
.panel > .muted, .panel > h2, .panel > p { margin: 1.25rem; }
.panel > .button { margin: 0 1.25rem 1.25rem; }
.native-mobile-nav { display: none; }
@media (max-width: 980px) {
    .native-mobile-nav { display: flex; flex-wrap: wrap; gap: 1rem; padding: 1rem; background: white; border-bottom: 1px solid var(--fm-line); }
}
