:root {
  --navy-950: #061329;
  --navy-900: #0a1d3f;
  --navy-800: #102b59;
  --blue-600: #2463eb;
  --blue-500: #3978f6;
  --blue-100: #eaf1ff;
  --blue-50: #f4f7ff;
  --ink-950: #0d172a;
  --ink-800: #25324a;
  --ink-600: #516078;
  --ink-500: #6d7b91;
  --line: #e3e9f2;
  --canvas: #f5f7fb;
  --surface: #ffffff;
  --success: #15805f;
  --success-soft: #e7f6f0;
  --warning: #a65f08;
  --warning-soft: #fff3dc;
  --danger: #c23945;
  --danger-soft: #fff0f1;
  --shadow: 0 14px 36px rgba(10, 29, 63, .08);
  --radius: 16px;
  --sidebar-width: 236px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink-950); background: var(--canvas); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.7rem, 3vw, 2.25rem); line-height: 1.15; letter-spacing: -.035em; }
h2 { margin-bottom: 5px; font-size: 1.05rem; line-height: 1.3; }
h3 { margin-bottom: 5px; font-size: .95rem; }
p { color: var(--ink-600); }
.hidden { display: none !important; }
.muted { color: var(--ink-500); }
.eyebrow { display: block; margin-bottom: 8px; color: var(--blue-600); font-size: .72rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }

.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; z-index: 40; display: flex; flex-direction: column; height: 100vh; padding: 22px 14px 16px; color: #d8e4f8; background: var(--navy-950); border-right: 1px solid rgba(255,255,255,.06); }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 0 7px 24px; color: #fff; text-decoration: none; }
.brand-mark { display: inline-grid; flex: 0 0 auto; place-items: center; width: 36px; height: 36px; color: var(--navy-950); background: #fff; border-radius: 11px; font-weight: 800; box-shadow: 0 8px 20px rgba(0,0,0,.16); }
.brand-mark.large { width: 48px; height: 48px; border-radius: 14px; font-size: 1.25rem; }
.brand-copy { display: grid; line-height: 1.15; }
.brand-copy strong { font-size: 1.06rem; }
.brand-copy small { margin-top: 4px; color: #95a9ca; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-nav { display: grid; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 10px 11px; color: #9eb1d0; border-radius: 10px; text-decoration: none; transition: background .15s ease, color .15s ease; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-link.active { color: #fff; background: linear-gradient(135deg, var(--blue-600), var(--blue-500)); box-shadow: 0 8px 20px rgba(36,99,235,.28); }
.nav-icon, [data-icon] { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.nav-icon svg, [data-icon] svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-spacer { flex: 1; min-height: 20px; }
.sidebar-section-label { padding: 0 11px 7px; color: #647b9f; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.sidebar-profile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; margin-top: 16px; padding: 14px 7px 0; border-top: 1px solid rgba(255,255,255,.1); }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; color: #fff; background: var(--navy-800); border-radius: 50%; font-size: .72rem; font-weight: 800; }
.avatar.large { width: 54px; height: 54px; font-size: 1rem; }
.profile-copy { display: grid; min-width: 0; line-height: 1.2; }
.profile-copy strong { overflow: hidden; color: #fff; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy small { margin-top: 3px; color: #8196b8; font-size: .68rem; text-transform: capitalize; }
.main-shell { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; height: 68px; padding: 0 28px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.topbar-title, .topbar-actions { display: flex; align-items: center; gap: 10px; }
.environment-pill, .status-pill { display: inline-flex; align-items: center; justify-content: center; width: max-content; padding: 4px 8px; color: var(--ink-600); background: #eef2f8; border-radius: 999px; font-size: .7rem; font-weight: 700; }
.status-pill.success { color: var(--success); background: var(--success-soft); }
.status-pill.warning { color: var(--warning); background: var(--warning-soft); }
.status-pill.danger { color: var(--danger); background: var(--danger-soft); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; color: inherit; background: transparent; border: 0; border-radius: 9px; cursor: pointer; }
.icon-button:hover { background: rgba(255,255,255,.08); }
.topbar .icon-button:hover { background: var(--blue-50); }
.mobile-menu { display: none; }
.page-content { width: min(1500px, 100%); margin: 0 auto; padding: 30px 32px 48px; }
.narrow-content { width: min(880px, 100%); }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.page-heading p { margin-bottom: 0; }
.dashboard-heading { margin-bottom: 18px; }
.back-row { margin-bottom: 18px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 10px; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button-primary { color: #fff; background: var(--blue-600); box-shadow: 0 7px 16px rgba(36,99,235,.18); }
.button-primary:hover:not(:disabled) { background: #1e55cd; }
.button-secondary { color: var(--ink-800); background: var(--surface); border-color: var(--line); }
.button-secondary:hover:not(:disabled) { background: var(--blue-50); border-color: #cbd8ef; }
.button-danger { color: var(--danger); background: var(--surface); border-color: #f1c7cb; }
.button-danger:hover:not(:disabled) { background: var(--danger-soft); }
.button-block { width: 100%; }
.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--blue-600); font-size: .86rem; font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.panel { min-width: 0; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-heading h2, .panel-heading p { margin-bottom: 0; }
.panel-heading p { margin-top: 3px; font-size: .82rem; }
.loading-panel, .empty-state { padding: 50px 20px; color: var(--ink-500); text-align: center; background: var(--surface); border: 1px dashed #cdd7e6; border-radius: var(--radius); }
.alert { padding: 11px 13px; border-radius: 10px; font-size: .86rem; }
.alert-danger { color: var(--danger); background: var(--danger-soft); border: 1px solid #f5ccd0; }
.alert-warning { color: var(--warning); background: var(--warning-soft); border: 1px solid #efd5a4; }

.range-panel { display: grid; gap: 13px; margin-bottom: 20px; padding: 13px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(10,29,63,.05); }
.range-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.range-button { padding: 7px 11px; color: var(--ink-600); background: transparent; border: 1px solid transparent; border-radius: 9px; font-size: .8rem; font-weight: 700; cursor: pointer; }
.range-button:hover { background: var(--blue-50); }
.range-button.active { color: #fff; background: var(--navy-900); }
.custom-range { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.range-summary { display: flex; align-items: center; gap: 8px; color: var(--ink-600); font-size: .8rem; }
.range-summary strong { color: var(--ink-950); }
.range-summary span:last-child { margin-left: auto; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { position: relative; min-width: 0; padding: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(10,29,63,.055); }
.metric-card::after { position: absolute; right: -24px; bottom: -26px; width: 82px; height: 82px; content: ""; background: var(--blue-50); border-radius: 50%; }
.metric-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-600); font-size: .8rem; font-weight: 650; }
.metric-value { margin: 8px 0 3px; font-size: clamp(1.45rem, 2.4vw, 2rem); font-weight: 780; letter-spacing: -.04em; }
.metric-context { color: var(--ink-500); font-size: .75rem; }
.trend-positive { color: var(--success); }
.trend-negative { color: var(--danger); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); gap: 18px; align-items: start; }
.dashboard-side-stack { display: grid; gap: 18px; min-width: 0; }
.wide-panel { grid-column: 1; }
.chart-panel { min-height: 348px; }
.chart { min-height: 230px; }
.chart svg { display: block; width: 100%; height: 230px; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--ink-500); font-size: 10px; }
.chart .completed-bar { fill: var(--blue-600); }
.chart .failed-bar { fill: #e8878e; }
.chart-legend { display: flex; gap: 15px; color: var(--ink-500); font-size: .75rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; }
.legend-dot.completed { background: var(--blue-600); }
.legend-dot.failed { background: #e8878e; }
.duration-panel { min-height: 330px; }
.duration-chart { min-height: 220px; }
.duration-chart svg { height: 220px; }
.duration-chart .duration-line { fill: none; stroke: var(--blue-600); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.duration-chart .duration-point { fill: var(--surface); stroke: var(--blue-600); stroke-width: 3; vector-effect: non-scaling-stroke; }
.country-panel .panel-heading { margin-bottom: 12px; }
.country-visual { display: grid; grid-template-columns: minmax(110px, .8fr) minmax(120px, 1.2fr); align-items: center; gap: 14px; }
.country-donut { display: block; width: min(132px, 100%); margin: 0 auto; overflow: visible; }
.country-ring, .country-segment { fill: none; stroke-width: 18; }
.country-ring { stroke: #edf1f6; }
.country-segment { transform: rotate(-90deg); transform-origin: 60px 60px; }
.country-segment-0 { stroke: var(--blue-600); }
.country-segment-1 { stroke: #7658d6; }
.country-segment-2 { stroke: #1b9a74; }
.country-segment-3 { stroke: #d68b28; }
.country-segment-4 { stroke: #d75d73; }
.country-segment-5 { stroke: #617897; }
.country-total { fill: var(--ink-950); font-size: 18px; font-weight: 800; }
.country-total-label { fill: var(--ink-500); font-size: 8px; }
.country-legend { display: grid; gap: 8px; min-width: 0; }
.country-row { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; }
.country-row > span:nth-child(2), .country-row > span:last-child { display: grid; min-width: 0; }
.country-row > span:last-child { text-align: right; }
.country-row strong, .country-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.country-row strong { font-size: .78rem; }
.country-row small { color: var(--ink-500); font-size: .68rem; }
.country-swatch { width: 9px; height: 9px; border-radius: 3px; background: var(--blue-600); }
.country-swatch-1 { background: #7658d6; }
.country-swatch-2 { background: #1b9a74; }
.country-swatch-3 { background: #d68b28; }
.country-swatch-4 { background: #d75d73; }
.country-swatch-5 { background: #617897; }
.compact-empty { padding: 24px 12px; }
.movement-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.movement-item { padding: 13px; background: var(--canvas); border-radius: 11px; }
.movement-item span { display: block; color: var(--ink-600); font-size: .76rem; }
.movement-item strong { display: block; margin-top: 5px; font-size: 1.35rem; }
.progress-list, .plan-list, .activity-list { display: grid; gap: 14px; }
.progress-item { display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 10px; }
.progress-track { height: 7px; overflow: hidden; background: #edf1f6; border-radius: 999px; }
.progress-fill { display: block; height: 100%; background: var(--blue-600); border-radius: inherit; }
.plan-row, .activity-row, .detail-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.plan-row:last-child, .activity-row:last-child, .detail-row:last-child { padding-bottom: 0; border-bottom: 0; }
.plan-copy, .activity-copy { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.activity-copy span:last-child { min-width: 0; }
.activity-copy strong, .activity-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-copy small { color: var(--ink-500); }
.attention-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.attention-item { padding: 13px; background: var(--canvas); border-radius: 11px; }
.attention-item strong { display: block; margin-top: 4px; font-size: 1.45rem; }

.filter-bar { display: flex; align-items: end; gap: 12px; margin-bottom: 18px; padding: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.field { display: grid; gap: 6px; color: var(--ink-700); font-size: .78rem; font-weight: 700; }
.field.grow { flex: 1; min-width: 230px; }
.field.compact { min-width: 160px; }
.field input, .field select, .field textarea { width: 100%; min-height: 42px; padding: 9px 11px; color: var(--ink-950); background: var(--surface); border: 1px solid #ccd6e5; border-radius: 9px; outline: 0; }
.field textarea { min-height: 100px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(36,99,235,.12); }
.field small { color: var(--ink-500); font-weight: 500; }
.stack-form { display: grid; gap: 16px; }
.table-panel { padding: 0; overflow: hidden; }
.table-panel .panel-heading { padding: 20px 20px 0; }
.responsive-table { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 14px; color: var(--ink-500); background: #fafbfd; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .7rem; font-weight: 750; letter-spacing: .04em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcff; }
.account-cell, .user-cell { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.table-avatar { display: inline-grid; flex: 0 0 auto; place-items: center; width: 35px; height: 35px; color: var(--navy-800); background: var(--blue-100); border-radius: 10px; font-size: .7rem; font-weight: 800; }
.cell-main { display: grid; line-height: 1.25; }
.cell-main small { margin-top: 3px; color: var(--ink-500); }
.table-action { padding: 6px 8px; color: var(--blue-600); background: transparent; border: 0; border-radius: 7px; font-size: .78rem; font-weight: 750; cursor: pointer; white-space: nowrap; }
.table-action:hover { background: var(--blue-50); }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); }
.pagination button { min-width: 34px; height: 34px; padding: 0 9px; color: var(--ink-600); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.pagination button.active { color: #fff; background: var(--navy-900); border-color: var(--navy-900); }

.account-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.account-identity, .account-title-row, .hero-actions, .pill-row { display: flex; align-items: center; gap: 10px; }
.account-logo { display: inline-grid; flex: 0 0 auto; place-items: center; width: 60px; height: 60px; color: #fff; background: linear-gradient(145deg, var(--navy-900), var(--blue-600)); border-radius: 17px; font-size: 1.08rem; font-weight: 800; box-shadow: 0 10px 24px rgba(10,29,63,.2); }
.account-title-row h1 { margin: 0; }
.account-identity p { margin: 3px 0 7px; }
.pill-row { flex-wrap: wrap; }
.detail-tabs { display: flex; gap: 4px; margin-bottom: 18px; padding: 5px; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.detail-tabs button { flex: 0 0 auto; padding: 8px 11px; color: var(--ink-600); background: transparent; border: 0; border-radius: 8px; font-weight: 700; cursor: pointer; }
.detail-tabs button.active { color: #fff; background: var(--navy-900); }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.detail-section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.detail-list { display: grid; gap: 11px; }
.detail-row .label { color: var(--ink-500); }
.admin-actions { position: sticky; top: 86px; }
.action-list { display: grid; gap: 8px; }
.action-list .button { justify-content: flex-start; width: 100%; }
.restricted-actions { display: grid; gap: 8px; margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.restricted-actions h3 { margin-bottom: 3px; }
.locked-note { margin: 14px 0 0; padding: 10px; color: var(--warning); background: var(--warning-soft); border-radius: 9px; font-size: .76rem; }
.notes-list { display: grid; gap: 11px; }
.note-card { padding: 13px; background: var(--canvas); border-radius: 11px; }
.note-card p { margin: 7px 0; color: var(--ink-800); white-space: pre-wrap; }
.note-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-500); font-size: .72rem; }
.profile-card { margin-bottom: 18px; }
.profile-summary { display: flex; align-items: center; gap: 14px; }
.profile-summary h2, .profile-summary p { margin-bottom: 0; }

.action-dialog { width: min(540px, calc(100% - 28px)); padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 70px rgba(5,18,41,.25); }
.action-dialog::backdrop { background: rgba(6,19,41,.55); backdrop-filter: blur(3px); }
.action-dialog form { padding: 22px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-head h2 { margin-bottom: 5px; font-size: 1.2rem; }
.dialog-head p { margin-bottom: 0; }
.dialog-fields { display: grid; gap: 14px; margin-top: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.toast-region { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; gap: 8px; width: min(360px, calc(100% - 36px)); }
.toast { padding: 12px 14px; color: #fff; background: var(--navy-900); border-radius: 10px; box-shadow: 0 14px 32px rgba(5,18,41,.22); animation: toast-in .18s ease-out; }
.toast.error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.login-page { min-height: 100vh; background: var(--navy-950); }
.login-shell { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); min-height: 100vh; }
.login-brand-panel { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(30px, 6vw, 80px); color: #fff; background: radial-gradient(circle at 15% 10%, rgba(57,120,246,.28), transparent 30%), linear-gradient(145deg, var(--navy-950), var(--navy-900)); }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand > span:last-child { display: grid; }
.login-brand strong { font-size: 1.15rem; }
.login-brand small { color: #95a9ca; text-transform: uppercase; letter-spacing: .08em; }
.login-message { max-width: 600px; margin: 70px 0; }
.login-message h1 { max-width: 520px; font-size: clamp(2.3rem, 5vw, 4.5rem); letter-spacing: -.055em; }
.login-message p, .login-security { color: #aebed8; }
.login-form-panel { display: grid; place-items: center; padding: 28px; background: var(--canvas); }
.login-form { display: grid; gap: 18px; width: min(430px, 100%); padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 60px rgba(5,18,41,.14); }
.login-form h2 { margin-bottom: 4px; font-size: 1.8rem; }
.login-form p { margin-bottom: 0; }
.error-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: var(--canvas); }
.error-card { display: grid; justify-items: start; width: min(520px, 100%); padding: 34px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.error-card .brand-mark { margin-bottom: 26px; color: #fff; background: var(--navy-900); }
.error-card small { margin-top: 24px; color: var(--ink-500); }
.sidebar-overlay { display: none; }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) minmax(260px, .75fr); }
  .country-visual { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: minmax(0, 1fr) 250px; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: min(var(--sidebar-width), calc(100% - 56px)); transition: transform .2s ease; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 35; display: block; visibility: hidden; background: rgba(6,19,41,.55); opacity: 0; transition: opacity .2s ease, visibility .2s ease; }
  body.sidebar-open .sidebar-overlay { visibility: visible; opacity: 1; }
  .mobile-menu { display: inline-flex; }
  .topbar { padding: 0 18px; }
  .page-content { padding: 24px 20px 42px; }
  .dashboard-grid, .detail-layout { grid-template-columns: 1fr; }
  .country-visual { grid-template-columns: minmax(120px, .7fr) minmax(150px, 1.3fr); }
  .wide-panel { grid-column: auto; }
  .admin-actions { position: static; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand-panel { display: none; }
  .login-form-panel { min-height: 100vh; }
}

@media (max-width: 680px) {
  body { font-size: 14px; }
  .topbar-title .environment-pill, .topbar-actions .status-pill { display: none; }
  .page-content { padding: 20px 14px 36px; }
  .page-heading, .account-hero { display: grid; }
  .page-heading .button, .hero-actions .button { width: 100%; }
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .account-identity { align-items: flex-start; }
  .account-title-row { align-items: flex-start; flex-wrap: wrap; }
  .metric-grid { grid-template-columns: 1fr; gap: 10px; }
  .metric-card { padding: 15px; }
  .filter-bar { display: grid; }
  .field.grow, .field.compact { min-width: 0; }
  .custom-range { display: grid; grid-template-columns: 1fr; }
  .custom-range .button { width: 100%; }
  .range-summary { flex-wrap: wrap; }
  .range-summary span:last-child { width: 100%; margin-left: 26px; }
  .range-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .range-button { text-align: left; }
  .detail-section-grid { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .table-panel { padding: 0; }
  .table-panel .panel-heading { padding: 16px 16px 0; }
  .responsive-table { overflow: visible; }
  .responsive-table table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table thead { display: none; }
  .responsive-table tr { padding: 13px 16px; border-bottom: 1px solid var(--line); }
  .responsive-table td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; text-align: right; }
  .responsive-table td::before { color: var(--ink-500); content: attr(data-label); font-size: .74rem; font-weight: 700; text-align: left; }
  .responsive-table td:first-child { display: block; padding-bottom: 9px; text-align: left; }
  .responsive-table td:first-child::before { display: none; }
  .table-action { padding-right: 0; }
  .pagination { justify-content: center; }
  .chart-panel { min-height: 320px; }
  .chart { min-height: 200px; }
  .chart svg { height: 200px; }
  .duration-chart, .duration-chart svg { min-height: 200px; height: 200px; }
  .country-visual { grid-template-columns: 1fr; }
  .attention-grid { grid-template-columns: 1fr; }
  .movement-grid { grid-template-columns: 1fr; }
  .action-dialog form { padding: 18px; }
  .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .login-form-panel { padding: 16px; }
  .login-form { padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
