:root {
  --bg: #0b0d10;
  --surface: #12151a;
  --surface-2: #181c22;
  --surface-3: #20252d;
  --border: #2a3039;
  --border-strong: #3a424d;
  --text: #f4f7f8;
  --muted: #919aa5;
  --muted-2: #69737f;
  --accent: #18ddd2;
  --accent-strong: #04bcb3;
  --accent-soft: rgba(24, 221, 210, 0.1);
  --blue: #5c91ff;
  --green: #57dda1;
  --orange: #ffb647;
  --red: #ff6573;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  --sidebar-width: 252px;
}

:root[data-theme="light"] {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --surface-3: #eef1f4;
  --border: #dce1e6;
  --border-strong: #c6cdd5;
  --text: #161a1f;
  --muted: #626d78;
  --muted-2: #8b949e;
  --accent: #008f89;
  --accent-strong: #007873;
  --accent-soft: rgba(0, 143, 137, 0.09);
  --blue: #3b74dd;
  --green: #168c5b;
  --orange: #b46900;
  --red: #cf3848;
  --shadow: 0 18px 50px rgba(25, 35, 45, 0.12);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[hidden] { display: none !important; }
.mobile-only { display: none !important; }
.muted { color: var(--muted); }
.danger-text { color: var(--red); }

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: var(--bg);
}

.login-shell {
  width: min(900px, 100%);
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(340px, 1.1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 42px;
  background: #071918;
  border-right: 1px solid rgba(24, 221, 210, 0.2);
}

.login-brand::before {
  content: "∞";
  display: block;
  margin-bottom: auto;
  color: var(--accent);
  font-size: 86px;
  font-weight: 300;
  line-height: 1;
}

.login-brand p { max-width: 230px; margin: 18px 0 0; color: #8ea5a3; line-height: 1.6; }
.login-form { display: flex; flex-direction: column; justify-content: center; gap: 20px; padding: 56px; }

.wordmark { display: inline-flex; flex-direction: column; align-items: flex-start; }
.wordmark span { font-size: 27px; font-weight: 850; line-height: 1; color: #f4ffff; }
.wordmark small { margin-top: 5px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: 1.4px; }
.wordmark.small span { font-size: 20px; }
.wordmark.small small { font-size: 8px; }
:root[data-theme="light"] .wordmark span { color: var(--text); }

.section-heading h1, .section-heading h2 { margin: 4px 0 8px; font-size: 28px; letter-spacing: 0; }
.section-heading p { margin: 0; color: var(--muted); line-height: 1.55; }
.section-heading.compact h1 { font-size: 25px; }
.eyebrow { color: var(--accent) !important; font-size: 11px; font-weight: 800; letter-spacing: 1.2px !important; }

.field { display: grid; gap: 8px; }
.field > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.input-wrap { min-height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); }
.input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-wrap svg { width: 18px; color: var(--muted); }
.input-wrap input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }

.primary-button, .secondary-button, .danger-button, .text-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 750;
}
.primary-button { background: var(--accent); color: #002c29; }
.primary-button:hover { background: var(--accent-strong); color: #fff; }
.secondary-button { border-color: var(--border); background: var(--surface-2); }
.secondary-button:hover { border-color: var(--border-strong); background: var(--surface-3); }
.danger-button { background: rgba(255, 101, 115, 0.1); border-color: rgba(255, 101, 115, 0.32); color: var(--red); }
.text-button { min-height: 32px; padding: 0 9px; background: transparent; color: var(--accent); }
.primary-button svg, .secondary-button svg, .danger-button svg, .text-button svg { width: 17px; height: 17px; }
.login-submit { min-height: 47px; margin-top: 4px; }
.form-error { margin: -6px 0 0; color: var(--red); font-size: 12px; }

.icon-button {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  cursor: pointer;
}
.icon-button:hover { background: var(--surface-3); border-color: var(--border-strong); }
.icon-button svg { width: 18px; height: 18px; }
.icon-button.inline { width: 32px; height: 32px; flex-basis: 32px; border: 0; background: transparent; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 16px 16px; border-right: 1px solid var(--border); background: var(--surface); z-index: 40; }
.sidebar-head { min-height: 56px; display: flex; align-items: flex-start; justify-content: space-between; padding: 4px 10px 20px; }
.main-nav { display: grid; gap: 5px; }
.nav-item {
  width: 100%; min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 12px;
  border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; text-align: left; font-weight: 650;
}
.nav-item:hover { color: var(--text); background: var(--surface-2); }
.nav-item.active { color: var(--text); border-color: rgba(24, 221, 210, 0.2); background: var(--accent-soft); }
.nav-item.active svg { color: var(--accent); }
.nav-item svg { width: 19px; height: 19px; }
.nav-item span { flex: 1; }
.nav-item.danger { color: var(--red); }
.nav-badge { min-width: 22px; height: 20px; display: inline-grid; place-items: center; padding: 0 6px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 10px; }
.nav-badge.warning { background: rgba(255, 182, 71, 0.1); color: var(--orange); }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.connection-state { display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: var(--muted); font-size: 11px; }
.connection-state span:first-child { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.connection-state.online span:first-child { background: var(--green); }
.sidebar-scrim { display: none; }

.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; min-height: 76px; display: flex; align-items: center; gap: 18px; padding: 12px 28px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(18px); z-index: 30; }
.topbar-title { min-width: 170px; }
.topbar-title p { margin: 0 0 3px; color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: 1.2px; }
.topbar-title h2 { margin: 0; font-size: 18px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.global-search { width: min(340px, 30vw); min-height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 11px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.global-search svg { width: 17px; color: var(--muted); }
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); }
.global-search span { color: var(--muted-2); font-size: 10px; }
.user-button { min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 3px 10px 3px 4px; border: 0; border-radius: 6px; background: transparent; cursor: default; text-align: left; }
.user-button > span:first-child { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 850; }
.user-button strong, .user-button small { display: block; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-button strong { font-size: 12px; }
.user-button small { margin-top: 2px; color: var(--muted); font-size: 10px; }

.loading-bar { position: fixed; top: 75px; left: var(--sidebar-width); right: 0; height: 2px; overflow: hidden; z-index: 80; }
.loading-bar span { display: block; width: 30%; height: 100%; background: var(--accent); animation: loading 1s infinite ease-in-out; }
@keyframes loading { from { transform: translateX(-110%); } to { transform: translateX(450%); } }

.page-content { width: min(1540px, 100%); margin: 0 auto; padding: 26px 28px 46px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h1 { margin: 0 0 5px; font-size: 24px; }
.page-head p { margin: 0; color: var(--muted); }
.page-actions { display: flex; align-items: center; gap: 8px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.metric-card { min-height: 116px; padding: 17px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.metric-card-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; font-weight: 700; }
.metric-card-head span:last-child { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.metric-card-head svg { width: 16px; height: 16px; }
.metric-card strong { display: block; margin-top: 12px; font-size: 28px; line-height: 1; }
.metric-card p { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.metric-card.orange .metric-card-head span:last-child { background: rgba(255, 182, 71, 0.1); color: var(--orange); }
.metric-card.green .metric-card-head span:last-child { background: rgba(87, 221, 161, 0.1); color: var(--green); }
.metric-card.blue .metric-card-head span:last-child { background: rgba(92, 145, 255, 0.1); color: var(--blue); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.8fr); gap: 14px; align-items: start; }
.panel { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.panel + .panel { margin-top: 14px; }
.panel-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.panel-head h3 { margin: 0; font-size: 14px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.panel-body { padding: 15px 16px; }
.panel-body.flush { padding: 0; }

.focus-task { display: grid; gap: 12px; padding: 17px; border-left: 3px solid var(--accent); background: var(--surface-2); }
.focus-task .status-row { display: flex; align-items: center; gap: 8px; }
.focus-task h4 { margin: 0; font-size: 18px; }
.focus-task p { margin: 0; color: var(--muted); line-height: 1.5; }
.focus-meta { display: flex; flex-wrap: wrap; gap: 15px; color: var(--muted); font-size: 11px; }
.focus-meta span { display: inline-flex; align-items: center; gap: 6px; }
.focus-meta svg { width: 14px; }

.list { display: grid; }
.list-row { min-height: 62px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; background: var(--surface-3); color: var(--accent); }
.list-icon svg { width: 17px; }
.list-row h4 { margin: 0 0 4px; font-size: 12px; }
.list-row p { margin: 0; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-time { color: var(--muted-2); font-size: 10px; }

.alert-list { display: grid; gap: 8px; }
.alert-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 11px; padding: 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); }
.alert-item > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px; background: rgba(255, 182, 71, 0.1); color: var(--orange); }
.alert-item svg { width: 16px; }
.alert-item h4 { margin: 1px 0 4px; font-size: 12px; }
.alert-item p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.toolbar .search-field { flex: 1; max-width: 420px; }
.search-field { min-height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.search-field:focus-within { border-color: var(--accent); }
.search-field svg { width: 17px; color: var(--muted); }
.search-field input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
.select-control { min-height: 40px; padding: 0 34px 0 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }

.table-shell { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; min-width: 820px; }
.data-table th { height: 42px; padding: 0 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 800; text-align: left; text-transform: uppercase; }
.data-table td { height: 59px; padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface-2); }
.cell-title { max-width: 300px; font-size: 12px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-subtitle { max-width: 300px; margin-top: 4px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-actions { display: flex; justify-content: flex-end; gap: 5px; }
.table-actions .icon-button { width: 32px; height: 32px; flex-basis: 32px; }
.table-actions .icon-button svg { width: 15px; }

.status-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 9px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 750; white-space: nowrap; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.waiting { color: var(--orange); }
.status-badge.active { color: var(--blue); }
.status-badge.done { color: var(--green); }
.status-badge.passive { color: var(--muted); }

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.summary-strip > div { min-width: 0; padding: 16px 18px; border-right: 1px solid var(--border); }
.summary-strip > div:last-child { border-right: 0; }
.summary-strip span, .summary-strip strong { display: block; }
.summary-strip span { margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.summary-strip strong { overflow-wrap: anywhere; font-size: 19px; }
.summary-strip.finance { grid-template-columns: 0.7fr 1fr 1fr; }
.summary-strip.finance strong { font-size: 22px; }

.distribution-list { display: grid; gap: 16px; }
.distribution-row > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.distribution-row span { color: var(--muted); font-size: 11px; font-weight: 700; }
.distribution-row strong { font-size: 12px; }
.progress-track { height: 5px; overflow: hidden; border-radius: 3px; background: var(--surface-3); }
.progress-track > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.plan-card { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.plan-card.disabled { opacity: 0.62; }
.plan-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.plan-card h3 { margin: 7px 0 0; font-size: 20px; }
.plan-price { display: flex; align-items: baseline; gap: 6px; margin-top: 30px; }
.plan-price strong { overflow-wrap: anywhere; font-size: 26px; }
.plan-price span, .plan-card > p { color: var(--muted); }
.plan-card > p { min-height: 42px; margin: 12px 0 22px; font-size: 12px; line-height: 1.55; }
.plan-card dl { display: grid; gap: 0; margin: 0; }
.plan-card dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.plan-card dt { color: var(--muted); font-size: 11px; }
.plan-card dd { margin: 0; font-size: 11px; font-weight: 800; text-align: right; }

.company-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.company-detail-head > div { display: flex; flex-wrap: wrap; gap: 7px; }
.company-detail-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; text-align: right; }
.usage-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.usage-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.usage-grid > div { min-width: 0; padding: 15px; border-right: 1px solid var(--border); }
.usage-grid > div:last-child { border-right: 0; }
.usage-grid span, .usage-grid strong { display: flex; align-items: center; }
.usage-grid span { gap: 6px; color: var(--muted); font-size: 10px; font-weight: 700; }
.usage-grid span svg { width: 14px; color: var(--accent); }
.usage-grid strong { margin-top: 9px; font-size: 22px; }
.detail-section { margin-top: 22px; }
.detail-section > h4 { margin: 0 0 10px; font-size: 12px; }
.money-value { font-size: clamp(19px, 2vw, 28px) !important; }

.empty-state { min-height: 260px; display: grid; place-items: center; padding: 36px; text-align: center; }
.empty-state > div { max-width: 330px; }
.empty-state svg { width: 38px; height: 38px; color: var(--muted-2); }
.empty-state h3 { margin: 14px 0 7px; font-size: 15px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.modal-root, .command-root { position: fixed; inset: 0; display: grid; place-items: center; padding: 22px; background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(7px); z-index: 100; }
.modal { width: min(620px, 100%); max-height: calc(100vh - 44px); overflow: auto; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.modal.wide { width: min(860px, 100%); }
.modal-head { position: sticky; top: 0; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface); z-index: 2; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.modal-body { padding: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--border); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid .full { grid-column: 1 / -1; }
.form-input, .form-select, .form-textarea { width: 100%; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--text); }
.form-input, .form-select { min-height: 42px; padding: 0 11px; }
.form-textarea { min-height: 92px; resize: vertical; padding: 11px; }
.form-note { margin: 0; padding: 11px 12px; border-left: 2px solid var(--accent); background: var(--accent-soft); color: var(--muted); font-size: 11px; line-height: 1.55; }

.confirm-message { color: var(--muted); line-height: 1.6; }
.confirm-message strong { color: var(--text); }

.command-palette { width: min(680px, 100%); max-height: min(650px, calc(100vh - 40px)); overflow: hidden; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.command-input { min-height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.command-input svg { width: 19px; color: var(--muted); }
.command-input input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 15px; }
.command-results { max-height: 520px; overflow: auto; padding: 8px; }
.command-group-title { padding: 10px 9px 5px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.command-item { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; text-align: left; }
.command-item:hover { background: var(--surface-2); }
.command-item span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px; background: var(--surface-3); color: var(--accent); }
.command-item svg { width: 15px; }
.command-item strong, .command-item small { display: block; }
.command-item strong { font-size: 12px; }
.command-item small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.toast-root { position: fixed; top: 16px; right: 16px; display: grid; gap: 8px; z-index: 200; }
.toast { min-width: 280px; max-width: 390px; display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 13px 14px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); animation: toast-in 0.2s ease-out; }
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast strong { display: block; margin-bottom: 3px; font-size: 12px; }
.toast p { margin: 0; color: var(--muted); font-size: 11px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .global-search { width: min(280px, 28vw); }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .mobile-only { display: inline-grid !important; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: min(290px, 88vw); transition: transform 0.2s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; display: block; background: rgba(0, 0, 0, 0.5); opacity: 0; pointer-events: none; transition: opacity 0.2s ease; z-index: 35; }
  .sidebar.open + .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .topbar { padding: 10px 14px; }
  .loading-bar { left: 0; top: 69px; }
  .global-search { display: none; }
  .user-button > span:last-child { display: none; }
  .page-content { padding: 20px 14px 36px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; }
  .page-actions > button { flex: 1; }
  .toolbar { align-items: stretch; flex-wrap: wrap; }
  .toolbar .search-field { min-width: 100%; max-width: none; }
  .toolbar .select-control { flex: 1; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-strip > div:nth-child(2) { border-right: 0; }
  .summary-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .summary-strip.finance { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-strip.finance > div:nth-child(2) { border-right: 1px solid var(--border); }
  .summary-strip.finance > div:nth-child(-n+2) { border-bottom: 0; }
}

@media (max-width: 620px) {
  .login-view { padding: 0; background: var(--bg); }
  .login-shell { min-height: 100vh; display: block; border: 0; border-radius: 0; }
  .login-brand { min-height: 210px; justify-content: flex-end; padding: 28px; border: 0; border-bottom: 1px solid rgba(24, 221, 210, 0.2); }
  .login-brand::before { display: none; }
  .login-form { padding: 34px 24px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { min-height: 108px; padding: 14px; }
  .metric-card strong { font-size: 24px; }
  .topbar-title p { display: none; }
  .topbar-title h2 { font-size: 16px; }
  .topbar-actions .icon-button:nth-of-type(2) { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .modal-root, .command-root { padding: 0; align-items: end; }
  .modal, .modal.wide, .command-palette { width: 100%; max-height: 92vh; border-radius: 8px 8px 0 0; }
  .toast-root { left: 10px; right: 10px; }
  .toast { min-width: 0; max-width: none; }
  .summary-strip.finance { grid-template-columns: 1fr; }
  .summary-strip.finance > div { border-right: 0; border-bottom: 1px solid var(--border); }
  .summary-strip.finance > div:last-child { border-bottom: 0; }
  .plan-grid { grid-template-columns: 1fr; }
  .plan-card > p { min-height: 0; }
  .company-detail-head { display: block; }
  .company-detail-head p { margin-top: 10px; text-align: left; }
  .usage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .usage-grid > div:nth-child(2) { border-right: 0; }
  .usage-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}
