:root {
  --ink: #172126;
  --muted: #647176;
  --line: #dce2e0;
  --surface: #ffffff;
  --canvas: #f4f6f5;
  --nav: #172428;
  --nav-muted: #a9b8b9;
  --primary: #087f68;
  --primary-dark: #056552;
  --primary-soft: #e5f5f0;
  --amber: #b76500;
  --amber-soft: #fff2d9;
  --red: #b4232c;
  --red-soft: #fdebed;
  --blue: #246a9b;
  --blue-soft: #e9f3fa;
  --shadow: 0 12px 30px rgba(22, 33, 38, 0.08);
  --radius: 6px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 14px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: 0; }
button, input, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
svg { width: 18px; height: 18px; stroke-width: 1.8; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: 30px; line-height: 1.18; letter-spacing: 0; }
h2 { margin-bottom: 3px; font-size: 16px; line-height: 1.3; letter-spacing: 0; }
h3 { margin-bottom: 5px; font-size: 15px; letter-spacing: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; z-index: 20; display: flex; flex-direction: column; width: 232px; height: 100vh; padding: 24px 14px 16px; color: #fff; background: var(--nav); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.sidebar .brand { padding: 0 10px 26px; }
.brand-mark { display: inline-grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; color: #fff; background: var(--primary); border-radius: 5px; font-size: 18px; font-weight: 750; }
.brand span:last-child { display: flex; flex-direction: column; }
.brand strong { font-size: 16px; line-height: 1.2; }
.brand small { color: var(--nav-muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0; }
.nav-list { display: grid; gap: 4px; }
.nav-list a { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 11px; color: var(--nav-muted); border-radius: 5px; text-decoration: none; font-weight: 600; transition: background .16s, color .16s; }
.nav-list a:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-list a.active { color: #fff; background: rgba(12, 154, 126, .2); box-shadow: inset 3px 0 0 #21b994; }
.nav-list svg { width: 19px; }
.sidebar-footer { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; padding: 15px 5px 0; border-top: 1px solid rgba(255,255,255,.09); }
.user-summary, .person { display: flex; align-items: center; gap: 9px; min-width: 0; }
.user-summary > span:last-child, .person > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.user-summary strong, .person strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.user-summary small { color: var(--nav-muted); font-size: 11px; }
.person small { display: block; max-width: 220px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: inline-grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; color: #176b5b; background: #dff1ec; border-radius: 50%; font-size: 12px; font-weight: 750; }
.avatar.small { width: 28px; height: 28px; flex-basis: 28px; }
.sidebar .avatar { color: #d9fff3; background: rgba(31,184,145,.18); }
.workspace { min-width: 0; }
.mobile-header { display: none; }
.main-content { width: min(100%, 1540px); margin: 0 auto; padding: 34px 38px 64px; }
.sidebar-scrim { display: none; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.page-header.compact { margin-bottom: 21px; }
.page-header p:not(.eyebrow) { margin-bottom: 0; color: var(--muted); }
.eyebrow { margin-bottom: 5px; color: var(--primary); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: 0; }
.title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.title-row .eyebrow { margin: 0; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; color: var(--muted); font-size: 13px; font-weight: 650; text-decoration: none; }
.back-link:hover { color: var(--ink); }

.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 5px; cursor: pointer; font-weight: 700; text-decoration: none; transition: background .15s, border-color .15s, box-shadow .15s, transform .15s; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--primary); border-color: var(--primary); box-shadow: 0 3px 8px rgba(8,127,104,.18); }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { color: var(--ink); background: #fff; border-color: #cfd8d5; }
.button.secondary:hover { border-color: #9eaaa6; background: #f8faf9; }
.button.danger { color: #fff; background: var(--red); border-color: var(--red); }
.button.danger:hover { background: #941c24; }
.button.compact-button { min-height: 34px; padding: 0 10px; font-size: 12px; }
.button.full { width: 100%; }
.icon-button { display: inline-grid; width: 34px; height: 34px; flex: 0 0 34px; padding: 0; place-items: center; border: 0; border-radius: 5px; cursor: pointer; }
.icon-button.ghost { color: var(--muted); background: transparent; }
.icon-button.ghost:hover { color: var(--ink); background: rgba(100,113,118,.1); }
.icon-button.danger-ghost { color: var(--red); background: var(--red-soft); }
.icon-button.danger-ghost:hover { background: #f7d8dc; }
.sidebar .icon-button.ghost { color: var(--nav-muted); }
.sidebar .icon-button.ghost:hover { color: #fff; background: rgba(255,255,255,.08); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.metric { display: flex; min-height: 100px; align-items: center; gap: 14px; padding: 19px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.metric-icon { display: inline-grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 5px; }
.metric-icon.neutral { color: #536167; background: #eef1f0; }
.metric-icon.amber { color: var(--amber); background: var(--amber-soft); }
.metric-icon.green { color: var(--primary); background: var(--primary-soft); }
.metric-icon.red { color: var(--red); background: var(--red-soft); }
.metric p { margin-bottom: 2px; color: var(--muted); font-size: 12px; }
.metric strong { font-size: 23px; line-height: 1.15; }

.table-panel, .upload-panel, .form-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.table-toolbar { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 17px; border-bottom: 1px solid var(--line); }
.table-toolbar p, .section-heading p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.filters { display: flex; align-items: center; gap: 8px; }
.search-field, .input-with-icon { position: relative; display: flex; align-items: center; }
.search-field svg, .input-with-icon > svg { position: absolute; left: 11px; width: 16px; color: #7b878b; pointer-events: none; }
.search-field input { width: 205px; padding-left: 34px; }
input, select { min-height: 39px; padding: 8px 10px; color: var(--ink); background: #fff; border: 1px solid #cfd8d5; border-radius: 4px; outline: none; }
input::placeholder { color: #98a2a5; }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(8,127,104,.12); }
.input-with-icon input { width: 100%; padding-left: 36px; }
.password-toggle { position: absolute; right: 5px; display: inline-grid; width: 32px; height: 32px; padding: 0; place-items: center; color: var(--muted); background: transparent; border: 0; cursor: pointer; }
.password-toggle + * { display: none; }
.password-toggle svg { width: 17px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { height: 42px; padding: 8px 13px; color: #687579; background: #f8faf9; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 750; text-align: left; text-transform: uppercase; letter-spacing: 0; white-space: nowrap; }
td { height: 58px; padding: 10px 13px; border-bottom: 1px solid #e9eeec; font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcfc; }
.dense-table td { height: 50px; white-space: nowrap; }
.dense-table th:first-child, .dense-table td:first-child { width: 44px; color: var(--muted); text-align: center; }
.batch-link { color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 750; text-decoration: none; }
.batch-link:hover { color: var(--primary); text-decoration: underline; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.primary-cell { white-space: nowrap; }
.progress-cell { display: flex; align-items: center; gap: 8px; }
.progress-track { width: 72px; height: 5px; overflow: hidden; background: #e8eceb; border-radius: 3px; }
.progress-track span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.progress-cell small { width: 34px; color: var(--muted); font-size: 10px; }
.status { display: inline-flex; min-width: 84px; min-height: 26px; align-items: center; justify-content: center; gap: 6px; padding: 3px 8px; border-radius: 13px; font-size: 11px; font-weight: 750; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pending { color: var(--amber); background: var(--amber-soft); }
.status-approved { color: var(--blue); background: var(--blue-soft); }
.status-processing { color: #7354a3; background: #f1eafa; }
.status-done, .status-success { color: #08725e; background: var(--primary-soft); }
.status-partial, .status-failed { color: var(--red); background: var(--red-soft); }
.role-badge { display: inline-flex; min-width: 70px; justify-content: center; padding: 4px 9px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.role-admin { color: #7354a3; background: #f1eafa; }
.role-uploader { color: #356373; background: #e8f2f5; }
.failed-row td { background: #fffafb; }
.duplicate-row td { background: #fffcf5; }
.disabled-row td { color: #7c878a; background: #fafbfb; }
.duplicate-detail { display: block; max-width: 280px; margin-top: 3px; color: var(--amber); font-family: Inter, ui-sans-serif, sans-serif; font-size: 10px; white-space: normal; }
.remarks { display: flex; max-width: 240px; flex-direction: column; overflow: hidden; text-overflow: ellipsis; }
.remarks small { color: var(--muted); }
.remarks .error-text { color: var(--red); white-space: normal; }
.processed-at { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.empty-state { display: grid; min-height: 275px; place-items: center; align-content: center; padding: 30px; color: var(--muted); text-align: center; }
.empty-state > svg { width: 35px; height: 35px; margin-bottom: 11px; color: #8d9a9c; }
.empty-state h3 { color: var(--ink); }
.empty-state p { margin: 0; }

.steps { display: flex; width: min(560px, 100%); align-items: center; margin-bottom: 20px; }
.step { display: flex; align-items: center; gap: 7px; color: #889396; font-size: 12px; font-weight: 650; white-space: nowrap; }
.step b { display: inline-grid; width: 25px; height: 25px; place-items: center; background: #e2e7e5; border-radius: 50%; font-size: 11px; }
.step.active { color: var(--ink); }
.step.active b { color: #fff; background: var(--primary); }
.step-line { width: 55px; height: 1px; margin: 0 10px; background: #ccd5d2; }
.step-line.active { background: var(--primary); }
.upload-panel { padding: 22px; }
.dropzone { display: grid; min-height: 290px; place-items: center; align-content: center; padding: 35px; background: #f9fbfa; border: 1.5px dashed #aab7b3; border-radius: 5px; cursor: pointer; text-align: center; transition: border .15s, background .15s; }
.dropzone:hover, .dropzone.dragging { background: #f1faf7; border-color: var(--primary); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-icon { display: inline-grid; width: 56px; height: 56px; margin-bottom: 15px; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 50%; }
.drop-icon svg { width: 27px; height: 27px; }
.dropzone strong { margin-bottom: 4px; font-size: 16px; }
.dropzone > span:last-child { color: var(--muted); font-size: 12px; }
.upload-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 18px; }
.upload-actions > span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.upload-actions > span svg { color: var(--primary); }
.format-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 16px; padding: 16px 3px; }
.format-panel h2 { font-size: 14px; }
.format-panel p { margin: 0; color: var(--muted); font-size: 12px; }
.column-list { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.column-list code { padding: 4px 7px; color: #46555a; background: #e8edeb; border-radius: 3px; font-size: 10px; }
.file-title { display: flex; align-items: center; gap: 10px; }
.file-title > svg { width: 26px; height: 26px; color: var(--primary); }
.file-title span { display: flex; flex-direction: column; }
.file-title small { color: var(--muted); }
.validation-ok { display: inline-flex; align-items: center; gap: 7px; color: var(--primary); font-size: 12px; font-weight: 700; }
.validation-warning { display: inline-flex; align-items: center; gap: 7px; color: var(--amber); font-size: 12px; font-weight: 700; }
.duplicate-notice, .deleted-banner { display: flex; align-items: center; gap: 11px; padding: 12px 17px; color: #6f4705; background: var(--amber-soft); border-bottom: 1px solid #f0d59e; }
.duplicate-notice p { margin: 1px 0 0; font-size: 12px; }
.acknowledge { display: flex; align-items: center; gap: 8px; margin-left: auto; color: #475459; font-size: 12px; font-weight: 650; }
.acknowledge input { min-height: 0; }
.preview-scroll { max-height: calc(100vh - 350px); }
.preview-panel thead { position: sticky; top: 0; z-index: 1; }
.panel-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 17px; border-top: 1px solid var(--line); }

.admin-layout { display: grid; grid-template-columns: minmax(275px, 340px) minmax(0, 1fr); align-items: start; gap: 16px; }
.form-panel { padding: 20px; }
.section-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 19px; }
.section-icon { display: inline-grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 5px; }
.form-stack { display: grid; gap: 15px; }
.field { display: grid; gap: 6px; }
.field > span:first-child { color: #3d4a4e; font-size: 12px; font-weight: 700; }
.field > span:first-child small { color: var(--muted); font-weight: 500; }
.field > input, .field > select { width: 100%; }
.users-panel .person { min-width: 190px; }
.row-actions, .header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.row-actions form, .header-actions form { margin: 0; }
.account-state { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; }
.account-state::before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: ""; }
.account-state.active { color: var(--primary); }
.account-state.disabled { color: var(--red); }

.security-panel, .audit-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.security-panel { width: min(800px, 100%); padding: 24px; }
.method-switch { display: inline-flex; min-height: 42px; margin-bottom: 25px; padding: 3px; background: #eef2f0; border: 1px solid var(--line); border-radius: 5px; }
.method-switch a { display: inline-flex; align-items: center; gap: 7px; padding: 0 13px; color: var(--muted); border-radius: 3px; text-decoration: none; font-size: 12px; font-weight: 700; }
.method-switch a.active { color: var(--ink); background: #fff; box-shadow: 0 1px 3px rgba(23,33,38,.1); }
.security-state { display: flex; align-items: center; gap: 13px; margin-bottom: 24px; }
.security-state p { margin: 0; color: var(--muted); }
.security-state.enabled .section-icon { color: var(--primary); }
.two-factor-setup { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; gap: 28px; }
.qr-frame { display: grid; aspect-ratio: 1; place-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.qr-frame img { display: block; width: 100%; height: 100%; }
.setup-details { display: grid; gap: 22px; }
.field-label { display: block; margin-bottom: 6px; color: #3d4a4e; font-size: 12px; font-weight: 700; }
.secret-code { display: block; overflow-wrap: anywhere; padding: 10px 12px; background: #eef2f0; border-radius: 4px; font-size: 12px; }
.security-form { max-width: 440px; }
.otp-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; letter-spacing: 0; }
.email-code-state { display: flex; max-width: 440px; align-items: center; gap: 11px; margin-bottom: 17px; padding: 12px 14px; color: #185e50; background: var(--primary-soft); border: 1px solid #c6e6dc; border-radius: 5px; }
.email-code-state > svg { flex: 0 0 20px; }
.email-code-state div { display: flex; flex-direction: column; }
.email-code-state span { color: #4e6d66; font-size: 12px; }
.resend-form { margin-top: 12px; }
.text-button { padding: 2px 0; color: var(--primary); background: transparent; border: 0; cursor: pointer; font-size: 12px; font-weight: 700; }
.text-button:hover { text-decoration: underline; }
.deleted-banner { margin: -8px 0 20px; border: 1px solid #f0d59e; border-radius: var(--radius); }
.deleted-banner div { display: flex; flex-direction: column; }
.deleted-banner span { font-size: 12px; }
.audit-panel { margin-top: 20px; }
.audit-timeline { display: grid; margin: 0; padding: 8px 18px 14px; list-style: none; }
.audit-timeline li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px 0; border-bottom: 1px solid #edf0ef; }
.audit-timeline li:last-child { border-bottom: 0; }
.audit-dot { width: 8px; height: 8px; margin-top: 6px; background: var(--primary); border-radius: 50%; }
.audit-timeline p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.audit-timeline time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.audit-action { font-weight: 700; white-space: nowrap; }
.audit-details { max-width: 380px; overflow: hidden; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.pagination { display: flex; min-height: 52px; align-items: center; justify-content: center; gap: 14px; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; }

.modal { width: min(440px, calc(100% - 28px)); padding: 0; color: var(--ink); background: #fff; border: 0; border-radius: 7px; box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(13, 24, 28, .55); backdrop-filter: blur(2px); }
.modal form { padding: 24px; }
.modal h2 { margin-bottom: 6px; font-size: 20px; }
.modal p { margin-bottom: 19px; color: var(--muted); }
.modal-icon { display: inline-grid; width: 44px; height: 44px; margin-bottom: 15px; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 50%; }
.modal-icon.danger-icon { color: var(--red); background: var(--red-soft); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 21px; }

.flash-stack { position: fixed; top: 16px; right: 18px; z-index: 50; display: grid; width: min(430px, calc(100% - 36px)); gap: 7px; }
.flash { display: flex; min-height: 48px; align-items: center; gap: 10px; padding: 9px 10px 9px 14px; color: #334044; background: #fff; border: 1px solid var(--line); border-left-width: 4px; border-radius: 5px; box-shadow: var(--shadow); }
.flash > span { flex: 1; }
.flash-success { border-left-color: var(--primary); }
.flash-success > svg { color: var(--primary); }
.flash-error { border-left-color: var(--red); }
.flash-error > svg { color: var(--red); }
.flash-warning { border-left-color: var(--amber); }
.flash-warning > svg { color: var(--amber); }

.auth-page { min-height: 100vh; color: var(--ink); background: #eef2f0; }
.login-shell { display: grid; min-height: 100vh; place-items: center; align-content: center; padding: 28px; }
.login-panel { width: min(410px, 100%); padding: 33px 34px 35px; background: #fff; border: 1px solid #dbe2df; border-radius: 7px; box-shadow: 0 20px 50px rgba(23,36,40,.1); }
.login-brand { margin-bottom: 34px; }
.login-brand small { color: var(--muted); }
.login-heading { margin-bottom: 24px; }
.login-heading h1 { font-size: 25px; }
.login-heading p { margin: 0; color: var(--muted); }
.login-panel .button { margin-top: 5px; }
.login-footnote { margin: 18px 0 0; color: #738083; font-size: 11px; }
.login-flashes { position: fixed; top: 18px; left: 50%; z-index: 10; width: min(410px, calc(100% - 36px)); transform: translateX(-50%); }
.login-flashes .flash { border-left-color: var(--red); }
.error-page { display: grid; min-height: 65vh; place-items: center; align-content: center; text-align: center; }
.error-page > span { color: var(--primary); font-size: 58px; font-weight: 800; }
.error-page h1 { max-width: 520px; margin: 5px 0 24px; font-size: 22px; }
.auth-error { min-height: 100vh; }

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

@media (max-width: 780px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; width: 250px; padding-top: 20px; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 15; background: rgba(15,27,31,.45); }
  body.nav-open .sidebar-scrim { display: block; }
  .mobile-header { position: sticky; top: 0; z-index: 10; display: flex; height: 58px; align-items: center; justify-content: space-between; padding: 0 16px; background: rgba(255,255,255,.95); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
  .mobile-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
  .mobile-brand .brand-mark { width: 28px; height: 28px; flex-basis: 28px; font-size: 14px; }
  .main-content { padding: 25px 17px 45px; }
  .page-header { align-items: flex-start; }
  h1 { font-size: 26px; }
  .filters { width: 100%; }
  .search-field { flex: 1; }
  .search-field input { width: 100%; }
  .table-toolbar { align-items: flex-start; flex-direction: column; }
  .table-toolbar > .filters { padding-top: 2px; }
  .format-panel { align-items: flex-start; flex-direction: column; }
  .column-list { justify-content: flex-start; }
  .preview-scroll { max-height: none; }
  .two-factor-setup { grid-template-columns: 1fr; }
  .qr-frame { width: min(220px, 100%); }
  .method-switch { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .method-switch a { justify-content: center; padding: 8px; text-align: center; }
}

@media (max-width: 560px) {
  .page-header { align-items: stretch; flex-direction: column; gap: 15px; }
  .page-header .button { align-self: flex-start; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { min-height: 84px; gap: 9px; padding: 13px 11px; }
  .metric-icon { width: 35px; height: 35px; flex-basis: 35px; }
  .metric strong { font-size: 19px; }
  .batch-metrics .metric-icon { display: none; }
  .upload-panel { padding: 12px; }
  .dropzone { min-height: 235px; padding: 24px 15px; }
  .upload-actions { align-items: stretch; flex-direction: column; }
  .upload-actions .button { width: 100%; }
  .step { font-size: 0; }
  .step b { font-size: 11px; }
  .step-line { flex: 1; width: auto; }
  .panel-footer { align-items: stretch; flex-direction: column-reverse; }
  .panel-footer form, .panel-footer .button { width: 100%; }
  .filters { align-items: stretch; flex-direction: column; }
  .login-shell { padding: 18px; }
  .login-panel { padding: 27px 22px 29px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .button { width: 100%; }
  .header-actions { flex-wrap: wrap; justify-content: flex-start; }
  .audit-timeline li { grid-template-columns: 12px minmax(0, 1fr); }
  .audit-timeline time { grid-column: 2; }
}
