:root {
  --font-sans: "DM Sans", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Manrope, "DM Sans", system-ui, sans-serif;

  --canvas: #f6f8fc;
  --canvas-elevated: #eef3f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --surface-hover: #f7f9fc;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;

  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --blue-soft: #eaf2ff;
  --blue-softer: #f4f7ff;
  --green: #079669;
  --green-soft: #e7f8f1;
  --amber: #d97706;
  --amber-soft: #fff4db;
  --violet: #7c3aed;
  --violet-soft: #f2edff;
  --danger: #dc2626;
  --danger-soft: #feecec;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-sm: 0 6px 20px rgba(16, 24, 40, .06);
  --shadow-md: 0 18px 48px rgba(16, 24, 40, .09);
  --shadow-blue: 0 12px 26px rgba(37, 99, 235, .22);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --header-bg: rgba(255, 255, 255, .92);
  --overlay: rgba(15, 23, 42, .48);
}

html[data-theme="dark"] {
  --canvas: #0b1019;
  --canvas-elevated: #0f1623;
  --surface: #121a28;
  --surface-2: #161f2e;
  --surface-3: #1b2535;
  --surface-hover: #182334;
  --ink: #f4f7fb;
  --ink-2: #d3dce8;
  --muted: #96a3b5;
  --subtle: #6f7d90;
  --line: #253044;
  --line-strong: #334158;

  --blue: #4f83ff;
  --blue-hover: #6d97ff;
  --blue-soft: rgba(79, 131, 255, .14);
  --blue-softer: rgba(79, 131, 255, .08);
  --green: #31c48d;
  --green-soft: rgba(49, 196, 141, .13);
  --amber: #f3a839;
  --amber-soft: rgba(243, 168, 57, .13);
  --violet: #a980ff;
  --violet-soft: rgba(169, 128, 255, .13);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, .13);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .22);
  --shadow-sm: 0 8px 26px rgba(0, 0, 0, .24);
  --shadow-md: 0 22px 60px rgba(0, 0, 0, .34);
  --shadow-blue: 0 14px 30px rgba(41, 98, 255, .22);
  --header-bg: rgba(11, 16, 25, .9);
  --overlay: rgba(0, 0, 0, .68);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
}

body.menu-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select,
input {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .58;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

::selection {
  background: rgba(37, 99, 235, .2);
}

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .28);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 9999;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--surface);
  font-size: 13px;
  font-weight: 700;
  transform: translateY(-150%);
  transition: transform .18s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand > span:last-child {
  display: grid;
  min-width: 0;
  line-height: 1;
}

.brand strong {
  color: var(--ink);
  font: 800 20px var(--font-display);
  letter-spacing: -.04em;
}

.brand small {
  margin-top: 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-symbol {
  position: relative;
  display: grid;
  flex: none;
  width: 42px;
  height: 42px;
  overflow: hidden;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #0f172a, #25324a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 7px 18px rgba(15, 23, 42, .18);
}

.brand-symbol span {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 5px;
  transform: rotate(45deg);
}

.brand-symbol span:nth-child(2) {
  opacity: .55;
  transform: translate(9px, -8px) rotate(45deg);
}

.brand-symbol span:nth-child(3) {
  opacity: .25;
  transform: translate(-9px, 8px) rotate(45deg);
}

.btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.01em;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary {
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: var(--shadow-blue);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  border-color: var(--blue-hover);
  background: var(--blue-hover);
}

.btn-secondary {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: var(--ink);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.btn-block {
  width: 100%;
}

.icon-button,
.ghost-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-2);
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.icon-button:hover,
.ghost-icon:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: var(--ink);
  transform: translateY(-1px);
}

.ghost-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.theme-toggle {
  width: auto;
  min-width: 42px;
  padding: 0 11px;
  gap: 7px;
}

.theme-label {
  font-size: 12px;
  font-weight: 700;
}

.loader {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

.loading .loader {
  display: block;
}

.loading > svg {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.eyebrow svg {
  width: 15px;
  height: 15px;
}

/* Authentication */
.auth-page {
  background:
    radial-gradient(circle at 4% 6%, rgba(37, 99, 235, .1), transparent 29%),
    radial-gradient(circle at 96% 94%, rgba(124, 58, 237, .09), transparent 31%),
    var(--canvas);
}

html[data-theme="dark"] .auth-page {
  background:
    radial-gradient(circle at 4% 6%, rgba(79, 131, 255, .13), transparent 30%),
    radial-gradient(circle at 96% 94%, rgba(169, 128, 255, .09), transparent 34%),
    var(--canvas);
}

.auth-shell {
  display: grid;
  min-height: 100svh;
  padding: 28px;
  place-items: center;
}

.auth-card {
  display: grid;
  width: min(1260px, 100%);
  min-height: min(760px, calc(100svh - 56px));
  grid-template-columns: minmax(430px, .86fr) minmax(600px, 1.14fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.auth-form-side {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 38px 56px 30px;
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.auth-content {
  width: min(430px, 100%);
  margin: auto;
  padding: 44px 0 36px;
}

.auth-copy h1 {
  max-width: 430px;
  margin: 17px 0 0;
  color: var(--ink);
  font: 800 clamp(38px, 4vw, 50px)/1.04 var(--font-display);
  letter-spacing: -.057em;
}

.auth-copy > p {
  max-width: 420px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.68;
}

.auth-form {
  display: grid;
  gap: 17px;
  margin-top: 34px;
}

.field {
  display: grid;
  gap: 7px;
}

.field > span {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
}

.field-shell {
  display: flex;
  height: 50px;
  align-items: center;
  gap: 11px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.field-shell:hover {
  border-color: color-mix(in srgb, var(--line-strong) 70%, var(--ink) 30%);
}

.field-shell:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 14%, transparent);
}

.field-shell.field-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 11%, transparent);
}

.field-shell > svg {
  flex: none;
  color: var(--subtle);
}

.field-shell input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.field-shell input::placeholder {
  color: var(--subtle);
}

.field-action {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
}

.field-action:hover {
  background: var(--surface-3);
  color: var(--ink);
}

.field small {
  min-height: 15px;
  color: var(--danger);
  font-size: 11px;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: -2px;
  font-size: 12px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
}

.check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--blue);
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.link-button:hover {
  text-decoration: underline;
}

.muted-link {
  color: var(--muted);
  font-weight: 600;
}

.auth-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 10px;
}

.auth-trust span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.auth-trust svg {
  width: 13px;
  height: 13px;
  color: var(--green);
}

.auth-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.45;
}

.notice-error {
  border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
  background: var(--danger-soft);
  color: var(--danger);
}

.notice-success {
  border: 1px solid color-mix(in srgb, var(--green) 25%, transparent);
  background: var(--green-soft);
  color: var(--green);
}

.notice-warning {
  border: 1px solid color-mix(in srgb, var(--amber) 25%, transparent);
  background: var(--amber-soft, color-mix(in srgb, var(--amber) 14%, transparent));
  color: var(--amber);
}

.notice[hidden] {
  display: none;
}

.auth-visual {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 46px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .03), transparent 38%),
    linear-gradient(150deg, #0b1324 0%, #101a2f 48%, #171433 100%);
  color: #fff;
}

.auth-visual::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 38px 38px;
  content: "";
  mask-image: linear-gradient(to bottom, #000, transparent 96%);
}

.visual-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(28px);
  pointer-events: none;
}

.orb-one {
  top: 8%;
  right: -18%;
  width: 360px;
  height: 360px;
  background: rgba(37, 99, 235, .27);
}

.orb-two {
  bottom: -20%;
  left: 12%;
  width: 390px;
  height: 390px;
  background: rgba(124, 58, 237, .17);
}

.visual-head,
.ops-preview,
.visual-foot {
  position: relative;
  z-index: 1;
}

.visual-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 26px;
}

.visual-label {
  color: #91a4c4;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
}

.visual-head h2 {
  max-width: 480px;
  margin: 14px 0 0;
  color: #fff;
  font: 700 clamp(28px, 3vw, 39px)/1.12 var(--font-display);
  letter-spacing: -.045em;
}

.live-pill {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: #d5dfed;
  font-size: 10px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.live-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3ddc97;
  box-shadow: 0 0 0 5px rgba(61, 220, 151, .13);
}

.ops-preview {
  width: min(620px, 100%);
  margin: auto;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 24px;
  background: rgba(255, 255, 255, .07);
  box-shadow: 0 26px 70px rgba(0, 0, 0, .28);
  backdrop-filter: blur(16px);
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #a9b7cc;
}

.preview-project {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-project > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(96, 165, 250, .26);
  border-radius: 11px;
  background: rgba(59, 130, 246, .16);
  color: #8ab9ff;
  font-size: 11px;
  font-weight: 800;
}

.preview-project div {
  display: grid;
  gap: 3px;
}

.preview-project small {
  color: #8293ae;
  font-size: 9px;
}

.preview-project strong {
  color: #f5f8fd;
  font-size: 12px;
}

.preview-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 19px;
}

.preview-kpis article {
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 15px;
  background: rgba(6, 13, 25, .34);
}

.preview-kpis span,
.preview-kpis small {
  display: block;
  color: #8fa0b9;
  font-size: 9px;
}

.preview-kpis strong {
  display: block;
  margin: 8px 0 6px;
  color: #fff;
  font: 700 24px var(--font-display);
  letter-spacing: -.04em;
}

.preview-kpis small {
  display: flex;
  align-items: center;
  gap: 4px;
}

.preview-kpis small svg {
  width: 12px;
  height: 12px;
}

.preview-kpis .positive {
  color: #5ee0a3;
}

.preview-kpis .warning {
  color: #f9bd5c;
}

.preview-chart-card {
  margin-top: 10px;
  padding: 14px 15px 7px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 15px;
  background: rgba(6, 13, 25, .34);
}

.preview-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: #91a0b7;
  font-size: 10px;
}

.preview-chart-head strong {
  color: #fff;
  font: 700 17px var(--font-display);
}

.preview-chart-card svg {
  width: 100%;
  height: 150px;
}

.preview-grid line {
  stroke: rgba(255, 255, 255, .06);
}

.preview-area.blue-area { fill: url(#areaBlue); }
.preview-area.green-area { fill: url(#areaGreen); }
.preview-line { fill: none; stroke-width: 3; stroke-linecap: round; }
.preview-line.blue-line { stroke: #60a5fa; }
.preview-line.green-line { stroke: #34d399; }

.preview-alert {
  display: grid;
  grid-template-columns: 36px 1fr 20px;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(249, 168, 55, .19);
  border-radius: 14px;
  background: rgba(249, 168, 55, .08);
}

.preview-alert > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: rgba(249, 168, 55, .14);
  color: #f3b34f;
}

.preview-alert div {
  display: grid;
  gap: 2px;
}

.preview-alert strong {
  color: #f5f8fd;
  font-size: 11px;
}

.preview-alert small {
  color: #8fa0b9;
  font-size: 9px;
}

.preview-alert > svg {
  color: #8fa0b9;
}

.visual-foot {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: auto;
  padding-top: 22px;
}

.avatar-stack {
  display: flex;
  padding-left: 8px;
}

.avatar-stack span {
  display: grid;
  width: 31px;
  height: 31px;
  margin-left: -8px;
  place-items: center;
  border: 2px solid #101a2f;
  border-radius: 50%;
  background: #23314b;
  color: #dce5f1;
  font-size: 8px;
  font-weight: 800;
}

.avatar-stack span:nth-child(2) { background: #344a68; }
.avatar-stack span:nth-child(3) { background: #2f3959; }

.visual-foot p {
  display: grid;
  gap: 2px;
  margin: 0;
}

.visual-foot strong {
  color: #edf3fb;
  font-size: 11px;
}

.visual-foot small {
  color: #8fa0b9;
  font-size: 9px;
}

/* Workspace */
.workspace-page {
  padding-bottom: env(safe-area-inset-bottom);
  background:
    radial-gradient(circle at 100% 0, rgba(37, 99, 235, .045), transparent 25%),
    var(--canvas);
}

.workspace-header {
  position: sticky;
  z-index: 60;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(18px) saturate(150%);
}

.header-row {
  width: min(1480px, 100%);
  margin: auto;
  padding-inline: 28px;
}

.header-primary {
  display: flex;
  height: 70px;
  align-items: center;
  gap: 24px;
}

.brand-compact {
  padding-right: 24px;
  border-right: 1px solid var(--line);
}

.brand-compact .brand-symbol {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.brand-compact .brand-symbol span {
  width: 16px;
  height: 16px;
}

.project-switcher {
  display: flex;
  min-width: 300px;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
  transition: border-color .18s ease, background .18s ease;
}

.project-switcher:hover,
.project-switcher[aria-expanded="true"] {
  border-color: var(--line);
  background: var(--surface);
}

.project-dot {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.project-cm {
  background: var(--violet-soft);
  color: var(--violet);
}

.project-switcher > span:nth-child(2) {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.project-switcher small {
  color: var(--muted);
  font-size: 9px;
}

.project-switcher strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-switcher > svg {
  width: 16px;
  color: var(--subtle);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.global-search {
  display: flex;
  width: min(340px, 28vw);
  height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.global-search:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 12%, transparent);
}

.global-search svg {
  flex: none;
  color: var(--subtle);
}

.global-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}

.global-search input::placeholder {
  color: var(--subtle);
}

.global-search kbd {
  flex: none;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--subtle);
  font-size: 9px;
}

.notification-button {
  position: relative;
}

.alert-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: #ef4444;
}

.user-chip {
  display: flex;
  height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 6px 0 4px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
}

.user-chip:hover {
  border-color: var(--line);
  background: var(--surface);
}

.user-chip > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: var(--ink);
  color: var(--surface);
  font-size: 11px;
  font-weight: 800;
}

html[data-theme="dark"] .user-chip > span {
  background: #e8eef8;
  color: #101828;
}

.user-chip b {
  font-size: 11px;
}

.user-chip > svg {
  width: 15px;
  color: var(--subtle);
}

.app-nav {
  display: flex;
  height: 50px;
  align-items: flex-end;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.app-nav::-webkit-scrollbar {
  display: none;
}

.app-nav a {
  position: relative;
  display: flex;
  height: 42px;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border-radius: 10px 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease;
}

.app-nav a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.app-nav a.active {
  background: var(--blue-softer);
  color: var(--blue);
}

.app-nav a.active::after {
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 2px;
  border-radius: 99px 99px 0 0;
  background: var(--blue);
  content: "";
}

.app-nav b {
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 9px;
}

.workspace-main {
  width: min(1480px, 100%);
  margin: auto;
  padding: 32px 28px 64px;
}

.command-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
}

.page-heading h1 {
  margin: 8px 0 7px;
  color: var(--ink);
  font: 800 clamp(30px, 3vw, 38px)/1.08 var(--font-display);
  letter-spacing: -.048em;
}

.page-heading > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.command-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.select-pill {
  display: flex;
  height: 44px;
  min-width: 170px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.select-pill:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 12%, transparent);
}

.select-pill svg {
  flex: none;
  color: var(--muted);
}

.select-pill select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin-top: 26px;
}

.status-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.status-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.status-card::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 90px;
  height: 90px;
  border-radius: 0 0 0 100%;
  background: color-mix(in srgb, var(--status-color) 7%, transparent);
  content: "";
  pointer-events: none;
}

.status-blue { --status-color: var(--blue); }
.status-green { --status-color: var(--green); }
.status-amber { --status-color: var(--amber); }
.status-violet { --status-color: var(--violet); }

.status-card-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-card-head small {
  color: var(--status-color);
  font-size: 9px;
  font-weight: 800;
}

.status-icon {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--status-color) 12%, transparent);
  color: var(--status-color);
}

.status-icon svg {
  width: 17px;
  height: 17px;
}

.status-card-value {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-top: 15px;
}

.status-card-value > div {
  display: grid;
  gap: 4px;
}

.status-card-value span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.status-card-value strong {
  color: var(--ink);
  font: 800 30px var(--font-display);
  letter-spacing: -.045em;
}

.sparkline {
  width: 88px;
  height: 32px;
  overflow: visible;
}

.sparkline path {
  fill: none;
  stroke: var(--status-color);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.7;
}

.status-card > p {
  position: relative;
  z-index: 1;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.status-card > p b {
  color: var(--ink-2);
}

.operations-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(330px, .72fr);
  gap: 14px;
  margin-top: 14px;
}

.panel {
  min-width: 0;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.section-label {
  color: var(--blue);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .14em;
}

.panel-heading h2 {
  margin: 4px 0 5px;
  color: var(--ink);
  font: 700 19px var(--font-display);
  letter-spacing: -.03em;
}

.panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.panel-flow {
  min-height: 420px;
}

.chart-legend {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 10px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot.blue { background: var(--blue); }
.dot.green { background: var(--green); }

.flow-summary {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto;
  align-items: end;
  gap: 18px;
  margin-top: 21px;
}

.flow-summary > div:first-child {
  display: grid;
  gap: 2px;
}

.flow-summary strong {
  color: var(--ink);
  font: 800 34px var(--font-display);
  letter-spacing: -.045em;
}

.flow-summary span {
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
}

.flow-summary em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
}

.goal-progress {
  display: grid;
  gap: 7px;
  align-self: center;
}

.goal-progress > div {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.goal-progress > div span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #7b9dff);
}

.goal-progress small {
  color: var(--muted);
  font-size: 9px;
}

.line-chart {
  height: 265px;
  margin-top: 4px;
  padding-top: 4px;
}

.line-chart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.grid-lines line {
  stroke: var(--line);
  stroke-width: 1;
}

.area-orders { fill: url(#ordersFill); }
.area-delivered { fill: url(#deliveredFill); }

.series {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.series-orders { stroke: var(--blue); }
.series-delivered { stroke: var(--green); }

.dots circle {
  stroke: var(--surface);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
  transition: r .15s ease;
}

.chart-point:hover circle,
.chart-point:focus circle {
  r: 7;
}

.orders-dots circle { fill: var(--blue); }
.delivered-dots circle { fill: var(--green); }

.axis-labels text {
  fill: var(--subtle);
  font-size: 10px;
  text-anchor: middle;
}

.priority-score {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2);
}

.score-ring {
  position: relative;
  display: grid;
  width: 62px;
  height: 62px;
  flex: none;
  align-content: center;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--blue) 0 72%, var(--surface-3) 72%);
}

.score-ring::before {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--surface);
  content: "";
}

.score-ring strong,
.score-ring span {
  position: relative;
  z-index: 1;
}

.score-ring strong {
  color: var(--ink);
  font: 800 19px var(--font-display);
  line-height: 1;
}

.score-ring span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.priority-score b {
  color: var(--ink-2);
  font-size: 12px;
}

.priority-score p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.priority-list {
  display: grid;
  margin: 10px 0;
}

.priority-item {
  display: grid;
  grid-template-columns: 36px 1fr auto 15px;
  align-items: center;
  gap: 9px;
  padding: 12px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: background .16s ease, padding .16s ease;
}

.priority-item:hover {
  margin-inline: -7px;
  padding-inline: 9px;
  border-radius: 11px;
  background: var(--surface-hover);
}

.priority-item:last-child {
  border-bottom: 0;
}

.priority-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--amber-soft);
  color: var(--amber);
}

.priority-icon svg {
  width: 16px;
  height: 16px;
}

.priority-item > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.priority-item strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority-item small {
  color: var(--muted);
  font-size: 9px;
}

.priority-item > svg {
  width: 14px;
  color: var(--subtle);
}

.risk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.risk-high {
  background: var(--danger-soft);
  color: var(--danger);
}

.risk-medium {
  background: var(--amber-soft);
  color: var(--amber);
}

.city-panel,
.pulse-panel {
  min-height: 305px;
}

.city-performance {
  display: grid;
  gap: 6px;
  margin-top: 17px;
}

.city-row {
  display: grid;
  grid-template-columns: 26px 110px 1fr 38px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 6px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.city-row:hover {
  background: var(--surface-hover);
}

.city-rank {
  color: var(--subtle);
  font-size: 9px;
  font-weight: 800;
}

.city-meta {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.city-meta strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-meta small {
  color: var(--muted);
  font-size: 9px;
}

.city-meter {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.city-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #7698f7);
}

.city-row > b {
  color: var(--ink-2);
  font-size: 10px;
  text-align: right;
}

.pulse-panel .panel-heading a {
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
}

.timeline {
  display: grid;
  gap: 4px;
  margin-top: 16px;
}

.timeline > div {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  transition: background .16s ease;
}

.timeline > div:hover {
  background: var(--surface-hover);
}

.timeline-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
}

.timeline-icon svg {
  width: 16px;
  height: 16px;
}

.timeline-icon.green { background: var(--green-soft); color: var(--green); }
.timeline-icon.blue { background: var(--blue-soft); color: var(--blue); }
.timeline-icon.amber { background: var(--amber-soft); color: var(--amber); }

.timeline p {
  display: grid;
  min-width: 0;
  gap: 3px;
  margin: 0;
}

.timeline strong {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline small,
.timeline time {
  color: var(--muted);
  font-size: 8px;
}

.orders-table-panel {
  margin-top: 14px;
  padding: 0;
  overflow: hidden;
  scroll-margin-top: 135px;
}

.table-heading {
  padding: 21px;
}

.table-tools {
  display: flex;
  align-items: center;
  gap: 9px;
}

.table-tools label {
  display: flex;
  width: 230px;
  height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.table-tools label:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 12%, transparent);
}

.table-tools label svg {
  flex: none;
  color: var(--subtle);
}

.table-tools input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

th {
  padding: 12px 21px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  text-align: left;
  text-transform: uppercase;
}

td {
  padding: 14px 21px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 11px;
}

tbody tr {
  transition: background .15s ease;
}

tbody tr:hover {
  background: var(--surface-hover);
}

td:first-child {
  display: grid;
  gap: 3px;
}

td:first-child strong,
td:nth-child(5) strong {
  color: var(--ink);
}

td:first-child small {
  color: var(--muted);
  font-size: 9px;
}

.row-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border: 0;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 9px;
  font-weight: 800;
}

.row-action:hover {
  background: var(--blue);
  color: #fff;
}

.row-action svg {
  width: 12px;
  height: 12px;
}

.empty-row {
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 21px;
  color: var(--muted);
  font-size: 10px;
}

.table-footer > div {
  display: flex;
  gap: 5px;
}

.table-footer button {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 10px;
}

.table-footer button.current {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.popover {
  position: fixed;
  z-index: 100;
  width: 340px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.popover[hidden] {
  display: none;
}

.popover-label {
  padding: 12px 14px 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.project-option {
  display: grid;
  grid-template-columns: 34px 1fr 16px;
  align-items: center;
  gap: 10px;
  width: calc(100% - 12px);
  margin: 3px 6px;
  padding: 9px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.project-option:hover,
.project-option.active {
  background: var(--surface-2);
}

.project-option > span:nth-child(2) {
  display: grid;
  gap: 2px;
}

.project-option strong {
  font-size: 11px;
}

.project-option small {
  color: var(--muted);
  font-size: 9px;
}

.project-option > svg {
  width: 14px;
  color: var(--blue);
}

.popover-footer {
  padding: 8px;
  border-top: 1px solid var(--line);
}

.popover-footer button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 7px;
  padding: 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
}

.popover-footer button:hover {
  background: var(--blue-soft);
}

.toast {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 13px;
  background: #101828;
  box-shadow: var(--shadow-md);
  color: #fff;
  font-size: 11px;
  opacity: 0;
  transform: translateY(70px);
  transition: opacity .22s ease, transform .22s ease;
  /* Bug réel trouvé le 24/07/2026 : sans ceci, ce bloc reste cliquable même
     invisible (opacity:0 n'empêche pas les clics) et intercepte tout ce qui
     se trouve dessous dans le coin bas-droit — notamment le bouton "Plus"
     de la navigation mobile, qui semblait alors ne "réagir à rien". */
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.toast svg {
  color: #5ee0a3;
}

.mobile-only,
.mobile-menu,
.mobile-bottom-nav {
  display: none;
}

/* Tablet */
@media (max-width: 1180px) {
  .auth-card {
    grid-template-columns: minmax(390px, .9fr) minmax(510px, 1.1fr);
  }

  .auth-form-side {
    padding-inline: 42px;
  }

  .auth-visual {
    padding: 38px;
  }

  .global-search {
    width: min(260px, 24vw);
  }

  .theme-label,
  .user-chip b,
  .user-chip > svg {
    display: none;
  }

  .theme-toggle {
    width: 42px;
    padding: 0;
  }

  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .operations-grid {
    grid-template-columns: 1fr;
  }

  .panel-flow {
    min-height: 400px;
  }
}

@media (max-width: 980px) {
  .auth-shell {
    padding: 20px;
  }

  .auth-card {
    min-height: calc(100svh - 40px);
    grid-template-columns: 1fr;
  }

  .auth-form-side {
    min-height: calc(100svh - 40px);
  }

  .auth-visual {
    display: none;
  }

  .brand-compact > span:last-child {
    display: none;
  }

  .brand-compact {
    padding-right: 16px;
  }

  .project-switcher {
    min-width: 230px;
  }

  .global-search {
    display: none;
  }

  .command-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .command-actions {
    width: 100%;
  }

  .select-pill {
    flex: 1;
  }
}

/* Mobile */
@media (max-width: 760px) {
  /* Bug réel signalé par l'utilisateur : sur iOS, Safari zoome
     automatiquement toute la page dès qu'un champ de saisie de moins de
     16px reçoit le focus (ex : taper le mot de passe) — laissant une barre
     de défilement horizontale après dézoom manuel. Un premier correctif
     avait seulement ciblé .field-shell input et .global-search input ;
     l'utilisateur a signalé le 01/08/2026 que ça zoomait encore ailleurs
     (barre de recherche des commandes, filtres de période...) — tout champ
     de saisie textuel de l'appli n'était pas forcément dans l'un de ces
     deux conteneurs. Règle désormais universelle plutôt que par
     allow-list de conteneurs, pour ne plus jamais avoir à y repenser à
     chaque nouveau champ ajouté. Ce correctif ne change rien visuellement
     ailleurs qu'en dessous de 760px. */
  /* !important nécessaire : de nombreux styles de composants plus
     spécifiques (ex. .select-pill select, .field-shell input) fixent leur
     propre font-size réduit pour ce même breakpoint — sans !important, la
     spécificité CSS leur aurait redonné la main et le zoom serait
     réapparu ailleurs à la prochaine page non couverte, exactement le bug
     qu'on corrige. Le zoom mobile ne doit jamais dépendre de l'exhaustivité
     d'une liste de sélecteurs. */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
  select,
  textarea {
    font-size: 16px !important;
  }

  .auth-shell {
    display: block;
    min-height: 100svh;
    padding: 0;
  }

  .auth-card {
    min-height: 100svh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .auth-form-side {
    min-height: 100svh;
    padding: max(22px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  }

  .auth-header .brand strong {
    font-size: 18px;
  }

  .auth-header .brand-symbol {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .auth-content {
    width: 100%;
    padding: 54px 0 34px;
  }

  .auth-copy h1 {
    max-width: 360px;
    font-size: clamp(34px, 11vw, 43px);
  }

  .auth-copy > p {
    font-size: 14px;
  }

  .auth-form {
    margin-top: 30px;
  }

  .auth-options {
    align-items: flex-start;
  }

  .auth-trust {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .auth-trust span:last-child {
    grid-column: 1 / -1;
  }

  .auth-footer {
    margin-top: auto;
  }

  .workspace-page {
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
  }

  .workspace-header {
    border-bottom: 1px solid var(--line);
  }

  .header-row {
    padding-inline: 14px;
  }

  .header-primary {
    height: 62px;
    gap: 9px;
  }

  .mobile-only {
    display: inline-grid;
  }

  .brand-compact {
    padding-right: 0;
    border-right: 0;
  }

  .brand-compact .brand-symbol {
    width: 35px;
    height: 35px;
    border-radius: 11px;
  }

  .project-switcher {
    min-width: 0;
    flex: 1;
    padding: 5px 7px;
  }

  .project-dot {
    width: 31px;
    height: 31px;
  }

  .project-switcher small {
    display: none;
  }

  .project-switcher strong {
    max-width: 150px;
    font-size: 11px;
  }

  .header-tools {
    margin-left: 0;
  }

  .header-tools .theme-toggle,
  .header-tools .notification-button {
    width: 38px;
    height: 38px;
  }

  .user-chip,
  .desktop-nav {
    display: none;
  }

  .workspace-main {
    padding: 23px 14px 28px;
  }

  .page-heading .eyebrow {
    font-size: 8px;
  }

  .page-heading h1 {
    margin-top: 7px;
    font-size: 29px;
  }

  .page-heading > p {
    max-width: 330px;
    font-size: 11px;
    line-height: 1.55;
  }

  .command-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .select-pill {
    min-width: 0;
    height: 42px;
    padding-inline: 9px;
  }

  .select-pill select {
    font-size: 10px;
  }

  .command-actions .btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .status-strip {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 20px;
  }

  .status-card {
    min-height: 150px;
    padding: 14px;
    border-radius: 15px;
  }

  .status-card::after {
    width: 70px;
    height: 70px;
  }

  .status-icon {
    width: 31px;
    height: 31px;
    border-radius: 9px;
  }

  .status-card-head small {
    font-size: 8px;
  }

  .status-card-value {
    align-items: flex-start;
    margin-top: 13px;
  }

  .status-card-value span {
    font-size: 8px;
  }

  .status-card-value strong {
    font-size: 25px;
  }

  .sparkline {
    display: none;
  }

  .status-card > p {
    font-size: 8px;
    line-height: 1.4;
  }

  .operations-grid {
    gap: 10px;
    margin-top: 10px;
  }

  .panel {
    padding: 16px;
    border-radius: 16px;
  }

  .panel-heading {
    gap: 12px;
  }

  .panel-heading h2 {
    font-size: 17px;
  }

  .panel-heading p {
    font-size: 10px;
  }

  .panel-flow {
    min-height: 365px;
  }

  .panel-flow .panel-heading {
    flex-direction: column;
  }

  .chart-legend {
    align-self: flex-start;
  }

  .flow-summary {
    grid-template-columns: auto 1fr;
    gap: 12px;
  }

  .flow-summary strong {
    font-size: 30px;
  }

  .goal-progress {
    min-width: 0;
  }

  .flow-summary em {
    display: none;
  }

  .line-chart {
    height: 220px;
    margin-top: 12px;
  }

  .axis-labels text {
    font-size: 8px;
  }

  .priority-panel .panel-heading,
  .city-panel .panel-heading,
  .pulse-panel .panel-heading {
    align-items: center;
  }

  .priority-score {
    padding: 12px;
  }

  .priority-item {
    grid-template-columns: 34px 1fr auto;
  }

  .priority-item > svg {
    display: none;
  }

  .city-panel,
  .pulse-panel {
    min-height: 0;
  }

  .city-row {
    grid-template-columns: 22px 92px 1fr 34px;
    gap: 8px;
    padding-inline: 2px;
  }

  .timeline > div {
    grid-template-columns: 34px 1fr;
  }

  .timeline time {
    display: none;
  }

  .orders-table-panel {
    overflow: visible;
    margin-top: 10px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .table-heading {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
  }

  .table-heading {
    flex-direction: column;
  }

  .table-tools {
    width: 100%;
  }

  .table-tools label {
    width: 100%;
    flex: 1;
  }

  .table-tools .btn {
    width: 42px;
    min-width: 42px;
    padding: 0;
  }

  .table-tools .btn span {
    display: none;
  }

  .table-wrap {
    overflow: visible;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 9px;
    margin-top: 9px;
  }

  tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface);
    box-shadow: var(--shadow-xs);
  }

  tbody tr:hover {
    background: var(--surface);
  }

  td,
  td:first-child {
    display: grid;
    gap: 3px;
    padding: 0;
    border: 0;
    font-size: 10px;
  }

  td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
  }

  td:first-child,
  td:nth-child(4),
  td:last-child {
    grid-column: 1 / -1;
  }

  td:first-child {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
  }

  td:last-child {
    padding-top: 2px;
  }

  .row-action {
    width: 100%;
    min-height: 37px;
    justify-content: center;
  }

  .empty-row {
    display: block;
    padding: 28px;
    text-align: center;
  }

  .empty-row::before {
    display: none;
  }

  .table-footer {
    margin-top: 9px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
  }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 80;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 7px 8px max(7px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: 0 -8px 26px rgba(16, 24, 40, .07);
    backdrop-filter: blur(18px);
  }

  .mobile-bottom-nav a,
  .mobile-bottom-nav button {
    position: relative;
    display: grid;
    min-height: 48px;
    place-items: center;
    align-content: center;
    gap: 3px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--muted);
    font-size: 8px;
    font-weight: 700;
  }

  .mobile-bottom-nav a.active {
    background: var(--blue-soft);
    color: var(--blue);
  }

  .mobile-bottom-nav svg {
    width: 18px;
    height: 18px;
  }

  .mobile-bottom-nav b {
    position: absolute;
    top: 3px;
    left: calc(50% + 6px);
    min-width: 17px;
    padding: 2px 4px;
    border: 2px solid var(--surface);
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 6px;
  }

  .mobile-menu {
    position: fixed;
    z-index: 120;
    inset: 0;
    display: block;
    visibility: hidden;
    opacity: 0;
    transition: visibility .22s ease, opacity .22s ease;
  }

  .mobile-menu.open {
    visibility: visible;
    opacity: 1;
  }

  .mobile-menu-backdrop {
    position: absolute;
    inset: 0;
    background: var(--overlay);
    opacity: 0;
    transition: opacity .22s ease;
  }

  .mobile-menu.open .mobile-menu-backdrop {
    opacity: 1;
  }

  .mobile-menu-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(330px, 88vw);
    padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
    border-right: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    transform: translateX(-104%);
    transition: transform .24s cubic-bezier(.2, .8, .2, 1);
  }

  .mobile-menu.open .mobile-menu-panel {
    transform: translateX(0);
  }

  .mobile-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2px 14px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
  }

  .mobile-menu nav {
    display: grid;
    gap: 4px;
    margin-top: 12px;
  }

  .mobile-menu nav a {
    display: grid;
    grid-template-columns: 20px 1fr auto;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 12px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .mobile-menu nav a:hover,
  .mobile-menu nav a.active {
    background: var(--blue-soft);
    color: var(--blue);
  }

  .mobile-menu nav b {
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 8px;
  }

  .mobile-user-card {
    position: absolute;
    right: 14px;
    bottom: max(18px, env(safe-area-inset-bottom));
    left: 14px;
    display: grid;
    grid-template-columns: 36px 1fr 18px;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-2);
  }

  .mobile-user-card > span {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 11px;
    background: var(--ink);
    color: var(--surface);
    font-size: 11px;
    font-weight: 800;
  }

  .mobile-user-card div {
    display: grid;
    min-width: 0;
    gap: 2px;
  }

  .mobile-user-card strong {
    font-size: 10px;
  }

  .mobile-user-card small {
    overflow: hidden;
    color: var(--muted);
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-user-card > svg {
    width: 16px;
    color: var(--muted);
  }

  .popover {
    display: none !important;
  }

  .toast {
    right: 14px;
    bottom: calc(80px + env(safe-area-inset-bottom));
    left: 14px;
    justify-content: center;
  }
}

@media (max-width: 390px) {
  .header-row {
    padding-inline: 10px;
  }

  .header-primary {
    gap: 7px;
  }

  .brand-compact {
    display: none;
  }

  .project-switcher strong {
    max-width: 132px;
  }

  .workspace-main {
    padding-inline: 11px;
  }

  .status-strip {
    gap: 7px;
  }

  .status-card {
    padding: 12px;
  }

  .status-card-value strong {
    font-size: 23px;
  }

  .city-row {
    grid-template-columns: 20px 82px 1fr 32px;
  }
}

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