/* MyFanTools workspace */
:root {
  color-scheme: light;
  --bg: #fbfcfa;
  --surface: #fff;
  --panel: #fff;
  --surface-soft: #f7faf8;
  --line: #e4e9e6;
  --line-strong: #d6dfd9;
  --txt: #122033;
  --dim: #687589;
  --green: #073e2f;
  --green-deep: #063226;
  --green-mid: #075d43;
  --mint: #e7f7ef;
  --mint-strong: #c5ecd7;
  --good: #08784e;
  --warn: #a45b04;
  --bad: #b63d37;
  --accent: var(--green-mid);
  --shadow: 0 8px 26px rgba(25, 43, 38, .035), 0 1px 2px rgba(25, 43, 38, .025);
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; background: var(--bg); color: var(--txt); font: 14px/1.5 "Segoe UI", Inter, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: var(--green-mid); text-decoration: none; }
a:hover { color: var(--green-deep); text-decoration: underline; }
:focus-visible { outline: 3px solid #63bd93; outline-offset: 2px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; z-index: 100; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border-radius: 7px; background: var(--green); color: #fff; font-weight: 700; }
.skip-link:focus { position: fixed; top: 12px; left: 12px; width: auto; height: auto; padding: 10px 14px; clip-path: none; overflow: visible; color: #fff; }
svg.icon, .icon svg, .icon { width: 20px; height: 20px; flex: none; }
.dim { color: var(--dim); }
.small, small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.right { text-align: right; }
.err, td.bad { color: var(--bad); font-weight: 600; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--txt); line-height: 1.2; letter-spacing: -.025em; }
h2 { font-size: 21px; margin: 30px 0 14px; }
h3 { font-size: 17px; margin: 23px 0 12px; }

/* App shell */
body.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; min-width: 0; height: 100vh; padding: 16px 13px 20px; background: #fff; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 13px; min-height: 51px; padding: 0 11px; color: #092d23; font-weight: 750; font-size: 20px; letter-spacing: -.055em; white-space: nowrap; }
.brand:hover { color: #092d23; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 9px; background: linear-gradient(145deg, #062d23, #145540); color: #fff; font-size: 22px; font-weight: 750; letter-spacing: -.06em; box-shadow: 0 3px 8px rgba(6, 55, 40, .13); }
.brand-name { display: block; }
.nav-label, .eyebrow { color: #748195; font-size: 11px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.nav-label { padding: 0 12px; margin: 30px 0 12px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-nav a { display: flex; align-items: center; gap: 17px; min-height: 50px; padding: 0 17px; border-radius: 9px; color: #46566c; font-size: 15px; font-weight: 500; text-decoration: none; transition: background .15s ease, color .15s ease; }
.side-nav a:hover { background: #f1f7f3; color: var(--green); }
.side-nav a.on, .side-nav a[aria-current="page"] { background: var(--mint); color: var(--green); }
.side-nav a.on .icon, .side-nav a[aria-current="page"] .icon { color: var(--green); }
.sidebar-bottom { display: flex; align-items: center; gap: 11px; margin-top: auto; padding: 17px 10px 0; min-width: 0; }
.avatar { display: grid; place-items: center; flex: none; width: 43px; height: 43px; border-radius: 50%; background: linear-gradient(145deg, #174b39, #477c63); color: #fff; font-size: 12px; font-weight: 700; }
.sidebar-bottom > div, .account-text, .accounttext { min-width: 0; flex: 1; line-height: 1.3; }
.sidebar-bottom > div strong, .account-text strong, .accounttext strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.sidebar-bottom > div small, .account-text small, .accounttext small { display: block; color: var(--dim); }
.logout { display: grid; place-items: center; flex: none; width: 36px; height: 36px; color: #526176; border-radius: 7px; }
.logout:hover { background: var(--surface-soft); text-decoration: none; }
.logout .icon { width: 17px; height: 17px; }
.workspace { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 63px; padding: 12px 30px 0; }
.breadcrumb { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--dim); font-size: 14px; }
.breadcrumb a { color: var(--dim); }
.breadcrumb strong, .breadcrumb span:last-child { color: var(--green-deep); }
.mobile-logout { display: none; }
.topbar-tag { color: #627386; font-size: 12px; }
.workspace main, main#main-content { width: 100%; max-width: 1600px; min-width: 0; margin: 0 auto; padding: 9px 30px 38px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin: 0 0 23px; }
.page-heading .eyebrow { display: none; }
.page-heading h1 { margin: 0 0 3px; font-size: clamp(28px, 2.6vw, 38px); font-weight: 750; letter-spacing: -.045em; }
.page-description { margin: 0; color: var(--dim); font-size: clamp(15px, 1.35vw, 20px); }
.page-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.app-footer { color: #8a96a1; font-size: 12px; padding: 5px 30px 25px; text-align: right; }

/* Shared controls and panels */
.button, button, .btn-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; padding: 9px 16px; border: 1px solid var(--green); border-radius: 8px; background: var(--green); color: #fff; font-size: 13px; font-weight: 650; line-height: 1.2; text-decoration: none; box-shadow: 0 1px 2px rgba(6, 50, 38, .08); transition: background .15s ease, border-color .15s ease, box-shadow .15s ease; }
.button:hover, button:hover, .btn-link:hover { background: var(--green-deep); border-color: var(--green-deep); color: #fff; text-decoration: none; }
.button.secondary, button.secondary, button.ghost, .btn-link, .page-actions .button { background: #fff; color: var(--txt); border-color: var(--line-strong); }
.button.secondary:hover, button.secondary:hover, button.ghost:hover, .btn-link:hover, .page-actions .button:hover { background: #f5f9f6; color: var(--green); border-color: #b8d7c5; }
button.danger, .button.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
button.danger:hover, .button.danger:hover { background: #982e2a; border-color: #982e2a; }
.button.small, button.small, .btn-link.small { min-height: 36px; padding: 7px 12px; font-size: 12px; }
.button .icon, button .icon { width: 17px; height: 17px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea { max-width: 100%; min-height: 42px; padding: 9px 12px; color: var(--txt); background: #fff; border: 1px solid var(--line-strong); border-radius: 7px; outline: none; box-shadow: 0 1px 2px rgba(26, 47, 39, .025); }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus, select:focus, textarea:focus { border-color: #5cba88; box-shadow: 0 0 0 3px rgba(65, 168, 112, .16); }
input::placeholder, textarea::placeholder { color: #8995a4; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--green-mid); cursor: pointer; }
textarea { width: 100%; min-height: 110px; resize: vertical; }
label { color: #3e4d5b; }
.panel, .settings-card, .stat, .metric { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.panel { min-width: 0; padding: 26px 27px; }
.panel h2 { margin: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.flash { margin: 0 0 20px; padding: 13px 17px; border: 1px solid #bae4cb; border-radius: 9px; background: #effaf2; color: #145938; }
.flash.warn { border-color: #f4d59f; background: #fff8e9; color: #805010; }
.flash a { font-weight: 650; }
.notice { display: flex; align-items: center; gap: 17px; min-height: 77px; padding: 16px 22px; margin-bottom: 20px; border: 1px solid #f2d9a2; border-radius: 9px; background: #fff9eb; color: #3e3426; }
.notice-icon { display: grid; place-items: center; flex: none; color: #96510a; }
.notice-icon .icon, .notice-icon svg { width: 28px; height: 28px; }
.notice strong { display: block; color: #65380c; font-size: 15px; }
.notice p { margin: 0; color: #656661; font-size: 14px; }
.notice-warm { background: linear-gradient(90deg, #fff9eb, #fff7e5); }
.mode-banner { margin: 3px 0 20px; padding: 13px 17px; border: 1px solid #d8e8dc; border-radius: 9px; background: #f3faf4; color: #28533b; }
.mode-banner.live { border-color: #f0c8bb; background: #fff3ee; color: #873c32; }
.mode-banner code, .locked code { padding: 2px 5px; border-radius: 4px; background: rgba(7, 62, 47, .07); font-family: var(--mono); }

/* Fleet overview */
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 0 0 21px; }
.metric { display: flex; align-items: flex-start; gap: 18px; min-width: 0; min-height: 121px; padding: 19px 19px; }
.metric-icon { display: grid; place-items: center; flex: none; width: 54px; height: 54px; border-radius: 14px; background: var(--mint); color: #007d55; }
.metric-icon .icon, .metric-icon svg { width: 26px; height: 26px; }
.metric > div:last-child { min-width: 0; padding-top: 6px; }
.metric-label { display: block; margin-bottom: 7px; color: #647187; font-size: 14px; }
.metric-value { display: block; color: var(--txt); font-size: 31px; font-weight: 750; line-height: 1.15; letter-spacing: -.05em; white-space: nowrap; }
.metric:first-child .metric-value, .metric:nth-child(3) .metric-value { color: var(--green); }
.metric-value small { color: #6b788a; font-size: .68em; font-weight: 600; letter-spacing: -.025em; }
.metric-caption { display: block; margin-top: 5px; color: var(--dim); font-size: 12px; }
.overview-grid { display: grid; grid-template-columns: 1.42fr 1fr; gap: 19px; margin: 0 0 20px; }
.overview-grid > .panel { min-height: 255px; }
.draft-card { display: flex; flex-direction: column; align-items: flex-start; }
.draft-card .eyebrow { display: block; margin-bottom: 11px; }
.draft-card h2 { font-size: 21px; font-weight: 740; }
.draft-card .panel-heading { width: 100%; }
.draft-card p { margin: 12px 0; color: var(--dim); font-size: 15px; }
.draft-card .button { margin-top: auto; padding-inline: 20px; }
.draft-card .pill { flex: none; }
.readiness-card h2 { margin: 0 0 20px; font-size: 20px; }
.readiness-list { display: flex; flex-direction: column; gap: 17px; padding: 0; margin: 0; list-style: none; }
.readiness-list li { display: flex; align-items: flex-start; gap: 16px; }
.readiness-list li > .icon, .readiness-list li > svg { width: 26px; height: 26px; margin-top: 2px; color: #19324a; }
.readiness-list li:first-child > .icon, .readiness-list li:first-child > svg { color: var(--good); }
.readiness-list strong { display: block; font-size: 14px; font-weight: 700; }
.readiness-list small { display: block; color: var(--dim); font-size: 13px; }
.domain-panel { padding: 0; overflow: hidden; }
.panel-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; padding: 17px 26px; }
.panel-toolbar h2 { margin: 0; font-size: 20px; }
.panel-toolbar p { margin: 4px 0 0; }
.table-tools { display: flex; align-items: center; gap: 11px; }
.table-tools input { min-width: 210px; }
.table-tools select { min-width: 130px; }
.table-scroll { width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; }
main#main-content > .table-scroll { margin: 14px 0 22px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow); }
.table-scroll > table { min-width: 620px; }

/* Tables, including older admin pages */
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 12px 15px; border-bottom: 1px solid #ebeeed; text-align: left; vertical-align: middle; overflow-wrap: anywhere; }
th { background: #f9faf9; color: #697589; font-size: 11px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
tbody tr:hover { background: #fbfdfb; }
tbody tr:last-child td { border-bottom: 0; }
.domain-panel th:first-child, .domain-panel td:first-child { padding-left: 26px; }
.domain-panel th:last-child, .domain-panel td:last-child { padding-right: 26px; }
.domain-name { display: block; color: var(--txt); font-weight: 550; overflow-wrap: anywhere; }
.domain-detail { display: block; margin-top: 2px; color: var(--dim); font-size: 12px; }
.ctrl { white-space: nowrap; }
form.inline { display: inline-flex; align-items: center; margin: 2px 5px 2px 0; }
td .button.small, td button.small, td .btn-link.small, td .row-controls summary { min-height: 36px; }
td select, td input:not([type="checkbox"]):not([type="hidden"]) { min-height: 36px; padding: 6px 9px; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 65px; padding: 12px 26px; border-top: 1px solid var(--line); color: var(--dim); font-size: 13px; }
.pagination { display: flex; gap: 7px; }
.pagination a, .pagination button, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 33px; min-height: 33px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #677488; font-size: 12px; text-decoration: none; }
.pagination .current, .pagination .on, .pagination [aria-current="page"] { border-color: #a8e2c1; background: var(--mint); color: var(--green); }
.pagination button:hover, .pagination a:hover { border-color: #a8e2c1; background: #f3faf5; }
.pill { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 5px 10px; border-radius: 999px; background: #eef2f4; color: #657082; font-size: 12px; font-weight: 600; line-height: 1.15; white-space: nowrap; }
.pill::before { content: ""; display: block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.active, .pill.sent, .pill.available, .pill.registered, .pill.done { background: #e2f7e9; color: #086c42; }
.pill.draft, .pill.aging, .pill.queued, .pill.preview_ok, .pill.evt { background: #e9f2f8; color: #216482; }
.pill.paused, .pill.pending_check, .pill.unavailable, .pill.skipped { background: #fff3df; color: #96600c; }
.pill.burned, .pill.failed, .pill.hard_bounce, .pill.complaint, .pill.error { background: #ffebea; color: #b13b34; }
.pill.unsubscribe, .pill.suppressed, .pill.manual, .pill.list_hygiene { background: #edf1f2; color: #667787; }

/* Domain actions and older pages */
.row-controls { position: relative; min-width: 94px; }
.row-controls > summary { display: inline-flex; align-items: center; justify-content: center; min-width: 92px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: var(--txt); font-size: 12px; font-weight: 650; cursor: pointer; list-style: none; }
.row-controls > summary::-webkit-details-marker { display: none; }
.row-controls > summary:hover { background: #f5f9f6; border-color: #b8d7c5; }
.row-controls[open] > summary { border-color: #82cda1; }
.manage-body { display: grid; gap: 11px; min-width: 240px; padding: 16px; margin-top: 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 15px 35px rgba(12, 35, 26, .12); }
.manage-body label { display: flex; flex-direction: column; gap: 5px; color: var(--dim); font-size: 12px; font-weight: 600; }
.manage-body select, .manage-body input { width: 100%; }
.manage-body form { display: flex; flex-direction: column; gap: 8px; }
.manage-body button { align-self: flex-start; }
.advanced-panel, details.adder { margin: 17px 0 26px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow); }
.advanced-panel > summary, details.adder > summary { color: var(--green); font-weight: 700; cursor: pointer; }
.advanced-panel[open] > summary, details.adder[open] > summary { padding-bottom: 11px; }
.advanced-panel form, details.adder form, form.rec-add { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 10px; }
.advanced-panel input, details.adder input, form.rec-add input { flex: 1 1 150px; }
.empty-state { padding: 40px 24px; border: 1px dashed var(--line-strong); border-radius: 9px; background: #fff; text-align: center; color: var(--dim); }
.empty-state h2, .empty-state h3 { margin: 0 0 8px; }
.stat-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 2px 0 24px; }
.stat { flex: 1 1 145px; min-width: 140px; padding: 17px 19px; }
.stat .num { display: block; color: var(--txt); font-size: 27px; font-weight: 750; line-height: 1.12; letter-spacing: -.04em; }
.stat .lbl { display: block; margin-top: 6px; color: var(--dim); font-size: 12px; }
.stat.warn .num { color: var(--bad); }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0; }
.bar button { min-height: 38px; padding: 7px 12px; }
.bar .inline { margin: 0; }
table.tmpl { width: auto; max-width: 100%; font-size: 12px; }
table.tmpl td, table.tmpl th { padding: 8px 12px; }
#orders td:nth-child(2).mono, #orders td:nth-child(3).dim { white-space: nowrap; }
.locked { max-width: 560px; margin: 45px auto; padding: 35px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.locked-icon { margin-bottom: 8px; font-size: 33px; }
.locked h2 { margin: 0 0 10px; }

/* Settings, modal, login */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .82fr); gap: 20px; align-items: start; margin-top: 18px; }
.settings-card { min-width: 0; padding: 24px 27px; }
.settings-card h2 { margin: 0 0 6px; }
.settings-card p.lead { margin-bottom: 20px; }
.settings-card label { display: block; margin: 15px 0 6px; color: #526174; font-size: 12px; font-weight: 700; }
.settings-card input:not([type="hidden"]), .settings-card textarea { width: 100%; }
.settings-actions { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; margin-top: 22px; }
.preview-frame { min-height: 200px; padding: 23px; border: 1px solid var(--line); border-radius: 9px; background: #fbfbfa; color: #344050; }
.preview-frame .msg { margin: 0 0 16px; }
.preview-frame hr { border: 0; border-top: 1px solid var(--line); margin: 0 0 13px; }
.preview-frame .foot { color: #647187; font-size: 12px; line-height: 1.6; }
.modal-overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(9, 29, 24, .48); }
.modal { width: min(100%, 440px); padding: 25px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 22px 80px rgba(5, 30, 22, .18); }
.modal h3 { margin: 0 0 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.login-box { width: min(360px, calc(100% - 32px)); margin: min(16vh, 130px) auto 40px; padding: 30px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.login-box h1 { margin: 0 0 20px; font-size: 24px; }
.login-box form { display: flex; flex-direction: column; gap: 12px; }
.login-box input, .login-box button { width: 100%; }

/* Campaign editor */
.campaign-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, .82fr); gap: 20px; align-items: start; }
.campaign-layout > * { min-width: 0; }
.campaign-layout h2 { margin-top: 0; }
.campaign-layout .panel + .panel { margin-top: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; min-width: 0; gap: 6px; }
.field > label, label.field { color: #526174; font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; }
.field textarea { min-height: 150px; }
.field.full, .field.wide { grid-column: 1 / -1; }
.message-preview { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.message-preview iframe { display: block; width: 100%; min-height: 440px; border: 0; background: #fff; }
.campaign-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.campaign-layout { margin-bottom: 20px; }
main > .panel { margin-bottom: 20px; }
.submission-panel .field { margin-top: 15px; }
.submission-panel form + p { margin-top: 16px; }
.panel > .panel-heading { margin-bottom: 16px; }
.draft-card > .panel-heading { margin-bottom: 0; }
.message-preview > .field { padding: 14px 18px 0; }

/* #region CAMPAIGN TEMPLATE */
.template-picker { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; margin: 0.75rem 1rem 0; }
.template-picker .field { flex: 1 1 16rem; }
.template-picker .button { margin-bottom: 0.15rem; }
/* #endregion */
.message-preview > p { padding: 12px 18px 0; }
.message-preview > details { margin: 12px; }
.message-plaintext { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 12px; }
details.adder .form-grid, details.adder .field, details.adder form > p { flex-basis: 100%; width: 100%; }
details.adder .field input { flex: initial; }
.login-box > .brand-mark { margin-bottom: 22px; }
.login-box > .eyebrow { margin-bottom: 6px; }
.login-box h1 { margin-bottom: 8px; }
.submission-panel { border-color: #cde5d4; background: linear-gradient(155deg, #fff, #f6fbf7); }
.submission-panel h2 { margin: 0 0 8px; }
.submission-panel p:last-child { margin-bottom: 0; }
.campaign-list-row td { padding-block: 15px; }
.campaign-list-row a:not(.button) { color: var(--txt); font-weight: 650; }
.campaign-list-row a:not(.button):hover { color: var(--green-mid); }

@media (max-width: 1180px) {
  .metric-grid { gap: 12px; }
  .metric { gap: 12px; padding: 16px; }
  .metric-icon { width: 45px; height: 45px; }
  .metric-value { font-size: 27px; }
  .overview-grid { grid-template-columns: 1.15fr 1fr; }
  .campaign-layout { grid-template-columns: minmax(0, 1fr) minmax(270px, .7fr); }
}
@media (max-width: 980px) {
  body.app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 11px 18px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { min-height: 42px; padding: 0; font-size: 19px; }
  .brand-mark { width: 37px; height: 37px; font-size: 20px; }
  .nav-label, .sidebar-bottom { display: none; }
  .mobile-logout { display: inline-flex; align-items: center; min-height: 40px; font-size: 12px; }
  .side-nav { flex-direction: row; gap: 4px; margin-top: 9px; overflow-x: auto; scrollbar-width: thin; }
  .side-nav a { flex: none; gap: 7px; min-height: 40px; padding: 7px 12px; font-size: 13px; white-space: nowrap; }
  .side-nav a .icon { width: 17px; height: 17px; }
  .topbar { min-height: 50px; padding: 10px 20px 0; }
  .workspace main, main#main-content { padding: 9px 20px 32px; }
  .app-footer { padding-inline: 20px; }
}
@media (max-width: 760px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid, .settings-grid, .campaign-layout { grid-template-columns: 1fr; }
  .overview-grid > .panel { min-height: 0; }
  .panel-toolbar { align-items: stretch; flex-direction: column; }
  .table-tools > * { flex: 1 1 0; min-width: 0 !important; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 29px; }
  .page-description { font-size: 15px; }
}
@media (max-width: 540px) {
  .sidebar { padding-inline: 13px; }
  .topbar { padding-inline: 16px; }
  .workspace main, main#main-content { padding: 10px 16px 28px; }
  .app-footer { padding-inline: 16px; }
  .topbar-tag { display: none; }
  .page-heading { flex-direction: column; gap: 12px; }
  .page-actions { justify-content: flex-start; }
  .metric-grid { gap: 9px; }
  .metric { min-height: 100px; gap: 10px; padding: 13px; flex-direction: column; }
  .metric-icon { width: 36px; height: 36px; border-radius: 9px; }
  .metric-icon svg, .metric-icon .icon { width: 19px; height: 19px; }
  .metric > div:last-child { padding-top: 0; }
  .metric-label { margin-bottom: 5px; font-size: 11px; line-height: 1.25; }
  .metric-value { font-size: 23px; }
  .metric-caption { font-size: 11px; }
  .panel { padding: 20px; }
  .notice { align-items: flex-start; padding: 15px; }
  .panel-toolbar { padding: 17px 20px; }
  .table-tools { flex-direction: column; align-items: stretch; }
  .table-tools > * { width: 100%; }
  .table-footer { padding: 12px 20px; }
  .table-footer { flex-wrap: wrap; }
  .settings-card { padding: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .bar button { flex: 1 1 auto; }
  .stat { min-width: 125px; }
}
