:root {
  --bg: #080b10;
  --panel: #111720;
  --panel-2: #18212d;
  --ink: #f4f7fb;
  --muted: #8e9aaa;
  --line: #263241;
  --line-strong: #c8d4df;
  --accent: #b7ff3c;
  --accent-2: #62d9ff;
  --ok: #72f2bd;
  --warn: #ffc857;
  --danger: #ff5c72;
  --surface-soft: rgba(17, 23, 32, 0.76);
  --surface-glass: rgba(17, 23, 32, 0.84);
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(rgba(98, 217, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(98, 217, 255, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes loaderSweep {
  0% { transform: translateX(-110%); }
  55%, 100% { transform: translateX(220%); }
}

@keyframes loaderPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@keyframes shimmer {
  from { background-position: 180% 0; }
  to { background-position: -180% 0; }
}

.boot-loader {
  display: grid;
  place-content: center;
  gap: 12px;
  width: 100%;
  min-height: 100vh;
  padding: 24px;
  background: var(--bg);
  text-align: center;
}

.boot-loader strong,
.global-loader strong {
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 950;
  line-height: 0.9;
}

.boot-loader > span,
.global-loader .loader-track {
  position: relative;
  display: block;
  width: min(260px, 70vw);
  height: 3px;
  overflow: hidden;
  background: var(--line);
}

.boot-loader i,
.global-loader i {
  position: absolute;
  inset: 0;
  background: var(--accent);
  animation: loaderSweep 1.25s ease-in-out infinite;
}

.boot-loader small,
.global-loader small {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: loaderPulse 1.25s ease-in-out infinite;
}

.global-loader {
  position: fixed;
  inset: 0 0 auto;
  z-index: 200;
  height: 3px;
  overflow: hidden;
  pointer-events: none;
  background: rgba(244, 247, 251, 0.12);
  opacity: 0;
  visibility: hidden;
  transition: opacity 130ms ease, visibility 130ms ease, background 180ms ease;
}

.global-loader.visible {
  opacity: 1;
  visibility: visible;
}

.global-loader > div {
  display: none;
  justify-items: center;
  gap: 12px;
  width: min(420px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid rgba(244, 247, 251, 0.22);
  border-top-color: var(--accent);
  border-radius: 8px;
  background: rgba(17, 23, 32, 0.9);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.55), 0 0 34px rgba(183, 255, 60, 0.1);
  backdrop-filter: blur(24px) saturate(1.15);
}

.global-loader::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 32%;
  height: 3px;
  content: "";
  background: var(--accent);
  box-shadow: 0 0 18px rgba(183, 255, 60, 0.65);
  animation: loaderSweep 1.1s ease-in-out infinite;
}

.global-loader.navigation,
.global-loader.expanded {
  inset: 0;
  display: grid;
  place-items: center;
  height: auto;
  padding: 20px;
  overflow: visible;
  pointer-events: auto;
  background: rgba(8, 11, 16, 0.78);
  backdrop-filter: blur(8px);
}

.global-loader.navigation > div,
.global-loader.expanded > div {
  display: grid;
  animation: modalIn 180ms ease both;
}

.global-loader.navigation::after,
.global-loader.expanded::after {
  display: none;
}

.loader-code {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
}

.loader-code b {
  padding: 3px 5px;
  background: var(--accent);
  color: white;
}

.global-loader .loader-track {
  width: min(320px, 70vw);
}

.canvas-card img {
  background: var(--panel);
}

.canvas-card img.loading {
  background: linear-gradient(90deg, var(--panel) 20%, var(--panel-2) 45%, var(--panel) 70%) 0 0 / 220% 100%;
  animation: shimmer 1.5s linear infinite;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

a {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.offline-notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 300;
  max-width: min(360px, calc(100vw - 36px));
  padding: 11px 14px;
  border: 1px solid var(--accent-2);
  border-radius: 6px;
  background: rgba(8, 11, 16, 0.94);
  color: var(--ink);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.36), 0 0 18px rgba(98, 217, 255, 0.15);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.offline-notice.visible {
  opacity: 1;
  transform: translateY(0);
}

.upload-form {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.upload-form > label {
  color: var(--accent-2);
}

.login {
  position: relative;
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 480px);
  padding-top: 70px;
  background: var(--bg);
}

.login-brandbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}

.login-brandbar .wordmark {
  font-size: 1.45rem;
}

.login-brandbar span {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.wordmark {
  color: var(--ink);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.9;
  text-transform: uppercase;
}

.login-visual {
  display: grid;
  align-content: center;
  min-height: calc(100vh - 70px);
  padding: clamp(28px, 6vw, 88px);
  border-right: 1px solid var(--line);
  background: var(--bg);
}

.login-panel {
  align-self: stretch;
  display: grid;
  align-content: center;
  padding: clamp(32px, 4vw, 56px);
  background: var(--surface-glass);
  border-left: 1px solid var(--accent-2);
  color: var(--ink);
  backdrop-filter: blur(24px) saturate(1.12);
}

.login-panel h2 {
  max-width: none;
  margin: 6px 0 10px;
  font-size: clamp(2rem, 3vw, 3.1rem);
  line-height: 1;
  text-transform: none;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login h1 {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(3.4rem, 7vw, 7.4rem);
  line-height: 0.88;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.login-visual p {
  max-width: 540px;
  color: var(--muted);
  font-size: 1rem;
}

.login-index {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 34px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.login-status {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  margin-top: 34px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.login-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 14px rgba(114, 242, 189, 0.6);
}

.auth-error {
  display: grid;
  gap: 5px;
  margin: 12px 0 16px;
  padding: 11px 12px;
  border-left: 2px solid var(--danger);
  background: rgba(255, 92, 114, 0.07);
}

.auth-error strong { color: var(--danger); font-size: 0.78rem; text-transform: uppercase; }
.auth-error span { color: var(--muted); font-size: 0.8rem; line-height: 1.4; }
.auth-error .mini { justify-self: start; margin-top: 4px; }

.login-panel .eyebrow {
  color: var(--accent);
}

.login-panel label {
  color: var(--muted);
}

.login-panel input {
  border-color: var(--line);
  background: rgba(8, 11, 16, 0.68);
  color: var(--ink);
}

.login-panel .btn {
  width: 100%;
}

.register-panel {
  align-content: start;
  overflow-y: auto;
  padding-top: clamp(30px, 5vh, 58px);
  padding-bottom: 34px;
}

.register-panel h2 {
  font-size: clamp(2rem, 3.5vw, 3.4rem);
}

.register-grid {
  margin-top: 4px;
}

.register-grid small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.auth-switch {
  width: 100%;
  padding: 10px;
  background: transparent;
  color: var(--accent-2);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-consent-box {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(8, 11, 16, 0.42);
}

.legal-consent-box label {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 9px;
  align-items: start;
  font-size: 0.78rem;
  line-height: 1.35;
}

.legal-consent-box input {
  margin-top: 2px;
}

.legal-open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--accent-2);
  border-radius: 5px;
  background: rgba(8, 11, 16, 0.76);
  color: var(--ink);
  text-align: left;
}

.legal-open strong {
  color: var(--accent);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.demo-access {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.76rem;
}

.demo-access summary {
  cursor: pointer;
  font-weight: 800;
  text-transform: uppercase;
}

.field {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
}

label {
  color: #e7e7e2;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 9px 10px;
  background: rgba(8, 11, 16, 0.72);
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(183, 255, 60, 0.14);
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 4px;
  background: var(--accent);
  color: #071006;
  font-weight: 950;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.btn:hover {
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-1px);
}

.btn.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn.secondary:hover {
  color: #050505;
  border-color: var(--accent);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
}

.glass-btn {
  background: var(--accent);
  color: var(--ink);
  border: 1px solid var(--accent);
  backdrop-filter: blur(18px);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  background: rgba(8, 11, 16, 0.86);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 16px;
  background: linear-gradient(180deg, rgba(13, 19, 27, 0.98), rgba(8, 11, 16, 0.97));
  color: var(--ink);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
  backdrop-filter: blur(24px) saturate(1.12);
}

.sidebar::before {
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  content: "";
  background: var(--accent);
}

.brand {
  display: grid;
  gap: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand .wordmark {
  font-size: 1.45rem;
  line-height: 0.9;
}

.brand > span,
.sidebar-label {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand > span { margin-top: -7px; }

.sidebar-section { display: grid; gap: 7px; }
.sidebar-label { margin: 0; }

.command-launcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid rgba(98, 217, 255, 0.34);
  border-radius: 5px;
  background: rgba(98, 217, 255, 0.07);
  color: var(--ink);
  text-align: left;
}

.command-launcher:hover { border-color: var(--accent-2); background: rgba(98, 217, 255, 0.12); }
.command-launcher kbd { color: var(--accent-2); font-size: 0.68rem; font-weight: 900; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  color: var(--accent);
}

.main-nav {
  display: grid;
  gap: 5px;
}

.nav-button {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--muted);
  text-align: left;
}

.nav-button strong { font-size: 0.82rem; letter-spacing: 0.03em; text-transform: uppercase; }
.nav-button small { grid-column: 1; color: var(--muted); font-size: 0.69rem; font-weight: 600; line-height: 1.2; }

.nav-count {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 0.68rem;
}

.nav-button:hover,
.nav-button.active {
  border-color: var(--accent);
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-button.active {
  background: rgba(183, 255, 60, 0.09);
  box-shadow: inset 3px 0 0 var(--accent), 0 0 22px rgba(183, 255, 60, 0.08);
}

.sidebar-project-switcher {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(31, 33, 31, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(18px);
}

.sidebar-project-switcher select {
  min-width: 0;
  background: var(--bg);
}

.active-project-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.active-project-meta strong,
.active-project-meta small {
  display: block;
}

.active-project-meta small {
  margin-top: 3px;
  color: var(--muted);
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(183, 255, 60, 0.12), 0 0 14px rgba(183, 255, 60, 0.55);
}

.sidebar-agenda {
  display: grid;
  gap: 8px;
  overflow: auto;
}

.sidebar-agenda-item {
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
}

.sidebar-agenda-item small {
  color: var(--muted);
}

.user-box {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px;
}

.legal-proof {
  display: grid;
  gap: 3px;
  margin: 10px 0;
  padding: 9px 10px;
  border-left: 2px solid var(--warn);
  background: rgba(243, 201, 105, 0.06);
}

.legal-proof.verified {
  border-color: var(--ok);
  background: rgba(125, 214, 166, 0.06);
}

.legal-proof strong,
.legal-proof span {
  display: block;
}

.legal-proof span {
  color: var(--muted);
  font-size: 0.72rem;
}

.legal-admin-note {
  padding: 10px 12px;
  border-left: 2px solid var(--warn);
  background: rgba(243, 201, 105, 0.06);
  color: var(--muted);
}

.admin-mini {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.admin-mini div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0a0e13;
}

.admin-mini strong,
.admin-mini span {
  display: block;
}

.admin-mini strong {
  font-size: 1.7rem;
}

.admin-mini span {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.content {
  min-width: 0;
  padding: 20px clamp(16px, 2.2vw, 34px) 34px;
  display: grid;
  gap: 16px;
  align-content: start;
  animation: riseIn 260ms ease both;
}

.content::before {
  position: fixed;
  inset: 0 0 auto 260px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, var(--accent), transparent 32%);
  opacity: 0.65;
  pointer-events: none;
}

.topbar {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(105deg, rgba(24, 33, 45, 0.77), rgba(12, 17, 24, 0.62));
  box-shadow: var(--shadow);
}

.topbar::before {
  position: absolute;
  inset: 13px auto 13px 0;
  width: 2px;
  content: "";
  background: var(--accent);
  box-shadow: 0 0 14px rgba(183, 255, 60, 0.35);
}

.topbar .page-title {
  padding-left: 14px;
}

.page-title {
  min-width: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.page-title h1 {
  max-width: min(100%, 16ch);
  overflow-wrap: anywhere;
  margin: 0;
  font-size: clamp(1.8rem, 3.2vw, 3.4rem);
  line-height: 0.92;
  text-transform: uppercase;
}

.workspace-nav {
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 12px 34px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(18px) saturate(1.1);
}

.workspace-group {
  flex: 0 0 auto;
  padding: 3px;
  border-right: 1px solid var(--line);
}

.workspace-group:last-child { border-right: 0; }

.workspace-group > p {
  margin: 0 5px 3px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-group > div { display: flex; gap: 3px; }

.workspace-group.active-group > p { color: var(--accent); }

.workflow-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 13px;
  border-left: 2px solid var(--accent-2);
  background: rgba(98, 217, 255, 0.055);
}

.workflow-hint div { display: grid; gap: 2px; }
.workflow-hint span { color: var(--accent-2); font-size: 0.65rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.workflow-hint strong { font-size: 0.88rem; }
.workflow-hint small { color: var(--muted); font-size: 0.75rem; }

.tab {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 950;
  text-transform: uppercase;
}

.tab:hover,
.tab.active {
  color: var(--ink);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.command-backdrop {
  position: fixed;
  z-index: 500;
  inset: 0;
  display: grid;
  place-items: start center;
  padding: min(13vh, 120px) 16px 24px;
  background: rgba(4, 7, 11, 0.72);
  backdrop-filter: blur(12px);
}

.command-palette {
  width: min(680px, 100%);
  overflow: hidden;
  border: 1px solid rgba(98, 217, 255, 0.38);
  border-radius: 8px;
  background: #111820;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.65), 0 0 46px rgba(98, 217, 255, 0.10);
  animation: modalIn 180ms ease both;
}

.command-palette header,
.command-palette footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.command-palette h2 { margin: 0; font-size: 1.25rem; }
.command-palette footer { border-top: 1px solid var(--line); border-bottom: 0; color: var(--muted); font-size: 0.7rem; }
.command-search { display: grid; gap: 6px; padding: 14px 18px; color: var(--muted); font-size: 0.7rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.command-search input { padding: 12px; border-color: rgba(98, 217, 255, 0.36); background: #090d12; color: var(--ink); }
.command-project { display: flex; justify-content: space-between; gap: 12px; padding: 0 18px 12px; color: var(--muted); font-size: 0.78rem; }
.command-project strong { color: var(--ink); }
.command-list { max-height: min(48vh, 410px); overflow-y: auto; padding: 6px; }
.command-item { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 12px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--ink); text-align: left; }
.command-item:hover { border-color: var(--line-strong); background: rgba(183, 255, 60, 0.08); }
.command-item span { color: var(--accent-2); font-size: 0.7rem; font-weight: 900; text-transform: uppercase; }

.tab.active {
  background: rgba(183, 255, 60, 0.9);
  border-color: var(--accent);
  color: #071006;
  box-shadow: 0 0 24px rgba(183, 255, 60, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 10px;
}

.next-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border: 1px solid rgba(183, 255, 60, 0.42);
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(183, 255, 60, 0.11), rgba(14, 20, 25, 0.62));
}

.next-step p { margin: 0 0 3px; }
.next-step strong, .next-step span { display: block; }
.next-step span { margin-top: 3px; color: var(--muted); font-size: 0.82rem; }

.route-field { position: relative; }

.route-suggestions {
  position: absolute;
  z-index: 8;
  top: calc(100% - 1px);
  right: 0;
  left: 0;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 0 0 6px 6px;
  background: #10161c;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.38);
}

.route-suggestions:empty { display: none; }

.route-suggestion {
  display: grid;
  width: 100%;
  gap: 2px;
  padding: 9px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.route-suggestion:hover { background: rgba(183, 255, 60, 0.10); }
.route-suggestion span { color: var(--muted); font-size: 0.73rem; line-height: 1.25; }
.route-action .btn { width: 100%; }
.route-attribution { display: block; margin: 6px 0 0; color: var(--muted); font-size: 0.68rem; }

.panel {
  position: relative;
  background: var(--surface-glass);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 14px 36px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(18px) saturate(1.08);
  animation: riseIn 240ms ease both;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.panel:hover {
  border-color: rgba(98, 217, 255, 0.42);
  transform: translateY(-1px);
  box-shadow: inset 2px 0 0 rgba(183, 255, 60, 0.72), 0 18px 46px rgba(0, 0, 0, 0.18);
}

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.metric {
  min-height: 104px;
  display: grid;
  gap: 10px;
  align-content: space-between;
}

.metric strong {
  font-size: clamp(1.7rem, 3vw, 2.7rem);
  line-height: 0.92;
  font-weight: 950;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(24, 26, 24, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 14px 36px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(18px);
}

.kpi {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 96px;
  gap: 5px;
  align-content: space-between;
  padding: 13px;
}

.kpi::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 2px;
  content: "";
  background: var(--accent);
  box-shadow: 0 0 12px rgba(183, 255, 60, 0.42);
}

.kpi + .kpi {
  border-left: 1px solid var(--line);
}

.kpi span,
.kpi small {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.kpi strong {
  overflow-wrap: anywhere;
  font-size: clamp(1.45rem, 2.5vw, 2.35rem);
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.compact-panel {
  padding: 12px;
}

.compact-list {
  gap: 6px;
}

.compact-list .item {
  padding: 9px 10px;
}

.compact-list .item p {
  margin: 4px 0;
}

.project-facts > p {
  margin: 8px 0 12px;
  color: var(--muted);
}

.project-facts dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.project-facts dl div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.project-facts dt {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.project-facts dd {
  margin: 0;
}

.travel-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
}

.travel-row p {
  margin: 4px 0 0;
}

.travel-form .section-head > strong {
  color: var(--accent);
  font-size: 1.45rem;
}

.compact-form {
  gap: 7px 10px;
}

.inline-checks {
  margin: 8px 0 12px;
}

.calc-breakdown {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  background: rgba(8, 11, 16, 0.72);
  color: var(--muted);
  font-size: 0.75rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 9px;
}

.section-head h2,
.panel h2 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(8, 11, 16, 0.72);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.item:hover {
  transform: translateY(-1px);
  border-color: rgba(247, 247, 242, 0.28);
}

.item-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.item strong {
  color: #fff;
}

/* Production Intelligence design system */
:root {
  --bg: #06090d;
  --panel: #0e151d;
  --panel-2: #151f2a;
  --ink: #f5f8fb;
  --muted: #8493a4;
  --line: #263442;
  --line-strong: #5d7184;
  --accent: #c4ff3f;
  --accent-2: #5de1ff;
  --surface-soft: rgba(10, 16, 23, 0.88);
  --surface-glass: rgba(13, 20, 28, 0.9);
}

body::before {
  background-image: linear-gradient(rgba(93, 225, 255, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(93, 225, 255, 0.025) 1px, transparent 1px);
  background-size: 54px 54px;
}

.app-shell { grid-template-columns: 284px 1fr; }
.sidebar { padding: 20px 16px; border-right-color: rgba(93, 225, 255, 0.2); }
.brand { grid-template-columns: 28px 1fr; column-gap: 9px; align-items: center; }
.brand img { grid-row: span 2; width: 28px; height: 28px; object-fit: contain; filter: brightness(0) invert(1); opacity: 0.95; }
.brand .wordmark { font-size: 1.28rem; letter-spacing: 0.12em; }
.brand > span { margin: 0; font-size: 0.57rem; }
.sidebar-project-switcher { border-radius: 3px; border-color: rgba(93, 225, 255, 0.23); background: rgba(5, 9, 13, 0.64); }
.nav-button { border-color: transparent; background: transparent; border-radius: 3px; }
.nav-button:hover, .nav-button.active { border-color: rgba(93, 225, 255, 0.26); box-shadow: inset 2px 0 0 var(--accent); }
.nav-button.active { background: rgba(196, 255, 63, 0.07); }
.command-launcher { border-radius: 3px; border-style: dashed; }

.content { max-width: 1920px; margin: 0 auto; width: 100%; padding-top: 24px; }
.content::before { inset: 0 0 auto 284px; background: linear-gradient(90deg, var(--accent-2), transparent 30%); }
.topbar { border-radius: 3px; background: rgba(10, 16, 23, 0.8); box-shadow: none; }
.page-title h1 { max-width: 28ch; font-size: clamp(1.6rem, 2.6vw, 3rem); letter-spacing: 0.02em; }
.topbar::before { width: 3px; background: var(--accent-2); box-shadow: 0 0 20px rgba(93, 225, 255, 0.42); }
.workspace-nav { border-radius: 3px; background: rgba(7, 12, 17, 0.78); box-shadow: none; }
.workspace-group > p { color: #66778a; }
.tab { border-radius: 2px; font-size: 0.72rem; }
.tab.active { background: var(--accent); color: #071006; box-shadow: none; }
.workflow-hint { border-left-color: var(--accent-2); background: rgba(93, 225, 255, 0.05); }

.panel { border-radius: 3px; box-shadow: none; backdrop-filter: none; }
.panel:hover { transform: none; border-color: rgba(93, 225, 255, 0.42); box-shadow: inset 2px 0 0 rgba(196, 255, 63, 0.72); }
.item { border-radius: 2px; background: rgba(5, 9, 13, 0.76); }
.item:hover { transform: none; border-color: rgba(93, 225, 255, 0.52); }
.section-head h2, .panel h2 { font-size: 0.82rem; letter-spacing: 0.12em; }

.project-command-deck {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(340px, 0.9fr);
  gap: 20px;
  overflow: hidden;
  padding: 26px;
  border: 1px solid rgba(93, 225, 255, 0.32);
  border-radius: 3px;
  background: linear-gradient(120deg, rgba(15, 29, 39, 0.94), rgba(7, 13, 19, 0.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.055), 0 26px 70px rgba(0,0,0,0.27);
}

.project-command-deck::after {
  position: absolute;
  inset: auto -60px -90px auto;
  width: 260px;
  height: 260px;
  content: "";
  border: 1px solid rgba(93,225,255,0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(93,225,255,0.035), 0 0 0 68px rgba(93,225,255,0.02);
  pointer-events: none;
}

.deck-identity { position: relative; z-index: 1; align-self: center; }
.deck-identity p, .deck-decision p { margin: 0 0 8px; color: var(--accent-2); font-size: 0.66rem; font-weight: 900; letter-spacing: 0.14em; }
.deck-identity h2 { max-width: 16ch; margin: 0; font-size: clamp(2rem, 4.2vw, 4.9rem); line-height: 0.91; letter-spacing: 0.01em; text-transform: uppercase; }
.deck-identity > span { display: block; max-width: 58ch; margin-top: 14px; color: var(--muted); line-height: 1.5; }
.deck-vitals { position: relative; z-index: 1; display: grid; grid-template-columns: 104px 1fr 1fr; gap: 10px; align-items: center; }
.deck-vitals > div:not(.deck-health) { display: grid; gap: 4px; padding: 12px; border-left: 1px solid var(--line); }
.deck-vitals span, .deck-vitals small { color: var(--muted); font-size: 0.67rem; text-transform: uppercase; }
.deck-vitals strong { font-size: 1rem; }
.deck-health { position: relative; display: grid; place-content: center; width: 94px; height: 94px; border: 3px solid var(--accent); border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--health) * 1%), rgba(255,255,255,0.08) 0); box-shadow: 0 0 22px rgba(196,255,63,0.16); }
.deck-health::before { position: absolute; width: 74px; height: 74px; content: ""; border-radius: 50%; background: #101a21; }
.deck-health strong, .deck-health span { position: relative; z-index: 1; text-align: center; }
.deck-health strong { font-size: 1.55rem; line-height: 1; }
.deck-health span { color: var(--muted); font-size: 0.57rem; font-weight: 900; letter-spacing: 0.1em; }
.deck-phase-track { position: relative; z-index: 1; grid-column: 1 / -1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; padding-top: 8px; }
.deck-phase { display: grid; gap: 7px; color: #586878; font-size: 0.62rem; font-weight: 900; text-transform: uppercase; }
.deck-phase i { display: block; height: 5px; background: #283441; }
.deck-phase.done i { background: var(--accent-2); }
.deck-phase.current { color: var(--ink); }
.deck-phase.current i { background: var(--accent); box-shadow: 0 0 18px rgba(196,255,63,0.5); }
.deck-decision { position: relative; z-index: 1; grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 16px; border-top: 1px solid rgba(93,225,255,0.18); }
.deck-decision strong, .deck-decision span { display: block; }
.deck-decision strong { font-size: 1.04rem; }
.deck-decision span { margin-top: 3px; color: var(--muted); font-size: 0.78rem; }

.mission-metrics { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(7, 11, 16, 0.62); }
.mission-metrics > div { display: grid; gap: 6px; min-width: 0; padding: 15px 16px; border-right: 1px solid var(--line); }
.mission-metrics > div:last-child { border-right: 0; }
.mission-metrics span, .mission-metrics small { color: var(--muted); font-size: 0.64rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.mission-metrics strong { overflow-wrap: anywhere; font-size: clamp(1.1rem, 2.2vw, 1.8rem); font-variant-numeric: tabular-nums; }
.mission-metrics small { color: #607286; font-weight: 600; letter-spacing: 0; text-transform: none; }

.command-queue, .command-radar { padding: 18px; border: 1px solid var(--line); background: rgba(11,17,24,0.84); }
.command-task-list { display: grid; }
.command-task { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 13px 4px; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); text-align: left; }
.command-task:hover { background: rgba(93,225,255,0.045); }
.command-task:last-child { border-bottom: 0; }
.command-task b { color: var(--accent-2); font-size: 0.7rem; letter-spacing: 0.1em; }
.command-task strong, .command-task span { display: block; }
.command-task span { margin-top: 3px; color: var(--muted); font-size: 0.73rem; }
.command-task em { padding: 4px 6px; border: 1px solid var(--line); color: var(--accent); font-size: 0.62rem; font-style: normal; font-weight: 900; text-transform: uppercase; }
.radar-score { display: flex; align-items: baseline; gap: 4px; margin: 22px 0 14px; }
.radar-score strong { color: var(--accent); font-size: 4.2rem; line-height: 0.8; }
.radar-score span { color: var(--muted); }
.radar-signals { display: grid; gap: 6px; min-height: 72px; margin-bottom: 14px; }
.radar-signals div { padding: 7px 8px; border-left: 2px solid var(--accent-2); background: rgba(93,225,255,0.05); color: var(--muted); font-size: 0.75rem; }
.action-dock { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.action-dock button { display: grid; gap: 5px; min-height: 106px; padding: 16px; border-right: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); text-align: left; }
.action-dock button:last-child { border-right: 0; }
.action-dock button:hover { background: rgba(196,255,63,0.08); box-shadow: inset 0 3px 0 var(--accent); }
.action-dock span { color: var(--accent-2); font-size: 0.68rem; font-weight: 900; letter-spacing: 0.1em; }
.action-dock strong { font-size: 1rem; }
.action-dock small { color: var(--muted); font-size: 0.72rem; }

.tab-moodboard .milanote-board { border-color: rgba(196,255,63,0.32); background-color: #0b1218; }
.tab-media .media-review, .tab-media .cinema-stage { border-color: rgba(93,225,255,0.32); }
.tab-finance .finance-kpis { border-top: 2px solid var(--accent); }
.tab-command .health-core { border-top: 2px solid var(--accent-2); }
.page-admin .topbar { border-left: 3px solid var(--accent-2); }
.page-calendar .calendar-main { border-top: 2px solid var(--accent-2); }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 250px 1fr; }
  .project-command-deck { grid-template-columns: 1fr; }
  .deck-vitals { grid-template-columns: 94px 1fr 1fr; }
  .mission-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mission-metrics > div:nth-child(3) { border-right: 0; }
  .mission-metrics > div:nth-child(n + 4) { border-top: 1px solid var(--line); }
}

@media (max-width: 720px) {
  .app-shell { grid-template-columns: 1fr; }
  .brand { grid-template-columns: 28px 1fr; }
  .project-command-deck { padding: 18px; }
  .deck-identity h2 { font-size: clamp(2rem, 12vw, 3.3rem); }
  .deck-vitals { grid-template-columns: 94px 1fr; }
  .deck-vitals > div:last-child { display: none; }
  .deck-phase-track { grid-template-columns: repeat(4, 1fr); }
  .deck-phase { margin-bottom: 5px; }
  .deck-decision { align-items: flex-start; flex-direction: column; }
  .mission-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mission-metrics > div:nth-child(3) { border-right: 1px solid var(--line); }
  .mission-metrics > div:nth-child(even) { border-right: 0; }
  .action-dock { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-dock button:nth-child(2) { border-right: 0; }
  .action-dock button:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

.kanban,
.mood-columns,
.equipment-grid,
.feature-grid {
  display: grid;
  gap: 12px;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}

.calendar-main {
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.calendar-aside {
  display: grid;
  gap: 14px;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
}

.calendar-nav,
.calendar-filters,
.segmented {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-nav h2 {
  min-width: 190px;
  margin: 0 0 0 6px;
  text-transform: capitalize;
}

.calendar-filters {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.calendar-filters select {
  width: auto;
  min-width: 145px;
}

.icon-btn.square {
  border-radius: 4px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays span {
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  min-width: 0;
  min-height: 138px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 7, 7, 0.58);
}

.calendar-day.outside {
  opacity: 0.32;
}

.calendar-day.today {
  box-shadow: inset 0 3px 0 var(--accent);
}

.calendar-day-number {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.calendar-day-events {
  display: grid;
  gap: 5px;
}

.calendar-event {
  display: grid;
  min-width: 0;
  gap: 2px;
  width: 100%;
  padding: 6px 7px;
  border: 1px solid #315e48;
  border-left: 3px solid var(--ok);
  border-radius: 3px;
  background: #102019;
  color: var(--ink);
  text-align: left;
  overflow: hidden;
}

.calendar-event strong,
.calendar-event span,
.calendar-event small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event strong,
.calendar-event small {
  color: var(--muted);
  font-size: 0.65rem;
}

.calendar-event.type-postproduktion,
.calendar-event.type-meeting {
  border-color: #38547a;
  border-left-color: #8ebcff;
  background: #111a27;
}

.calendar-event.type-deadline,
.calendar-event.type-freigabe {
  border-color: #755d2f;
  border-left-color: var(--warn);
  background: #211b10;
}

.calendar-event.type-abwesenheit,
.calendar-event.type-wartung {
  border-color: #694356;
  border-left-color: #ff9bc7;
  background: #23141b;
}

.calendar-event.has-conflict {
  border-color: #ff715d;
  border-left-color: #ff715d;
  box-shadow: 0 0 0 2px rgba(255, 113, 93, 0.16);
}

.calendar-event.derived {
  opacity: 0.72;
}

.more-events {
  color: var(--muted);
  font-size: 0.68rem;
}

.calendar-list {
  display: grid;
}

.calendar-list-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 130px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.calendar-list-row time,
.calendar-list-row time small {
  display: block;
}

.calendar-list-row time small {
  margin-top: 4px;
  color: var(--muted);
}

.resource-list,
.activity-list {
  display: grid;
  gap: 9px;
}

.resource-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 80px auto;
  gap: 10px;
  align-items: center;
}

.resource-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.load-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.load-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.equipment-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 180px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(5, 5, 5, 0.44);
}

.equipment-checks label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 0.7rem;
  text-transform: none;
}

.equipment-checks input {
  width: auto;
}

.glass-modal.calendar-modal {
  width: min(820px, 100%);
}

.calendar-sync .btn {
  flex: 1;
  text-decoration: none;
}

.activity-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.activity-row p,
.activity-row time {
  margin: 4px 0 0;
  color: var(--muted);
}

.kanban {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  align-items: start;
}

.lane,
.mood-column {
  min-height: 180px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.28);
}

.lane h3,
.mood-column h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.mini {
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #050505;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mini:hover,
.mini.active {
  color: #050505;
  background: var(--accent);
  border-color: var(--accent);
}

.mini.danger-action {
  color: var(--danger);
}

.mini.danger-action:hover {
  color: #050505;
  background: var(--danger);
  border-color: var(--danger);
}

.pill {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  min-height: 25px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #101010;
  color: var(--ok);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.pill.warn {
  color: var(--warn);
}

.pill.danger {
  color: var(--danger);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.board-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.milanote-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-areas:
    "toolbar side"
    "board side";
  gap: 14px;
  align-items: start;
}

.board-toolbar {
  grid-area: toolbar;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(17, 17, 17, 0.92);
}

.board-toolbar h2 {
  margin: 0;
  font-size: 1.2rem;
  text-transform: uppercase;
}

.milanote-board {
  grid-area: board;
  position: relative;
  min-height: 680px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px) 0 0 / 32px 32px,
    #0b0b0b;
}

.milanote-side {
  grid-area: side;
  display: grid;
  gap: 14px;
  position: sticky;
  top: 18px;
}

.empty-board {
  position: absolute;
  inset: 24px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 4px;
}

.canvas-card {
  position: absolute;
  width: 250px;
  min-height: 165px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #151515;
  box-shadow: 0 22px 60px rgba(0,0,0,0.35);
  overflow: hidden;
  cursor: grab;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.canvas-card:hover {
  transform: translateY(-3px) rotate(-0.4deg);
  border-color: rgba(247, 247, 242, 0.36);
  box-shadow: 0 30px 90px rgba(0,0,0,0.48);
}

.canvas-card.dragging {
  cursor: grabbing;
  transform: scale(1.02) rotate(0deg);
  z-index: 20;
  border-color: var(--accent);
}

.canvas-card.note {
  background: #202018;
}

.canvas-card.color {
  background: #0c0c0c;
}

.canvas-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.canvas-card-body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.canvas-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.canvas-card p {
  margin: 0;
}

.color-card {
  height: 80px;
  border-bottom: 1px solid var(--line);
}

.mood-columns {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.mood-tile {
  min-height: 150px;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08), transparent 40%),
    #0a0e13;
  display: grid;
  align-content: space-between;
  gap: 12px;
}

.mood-tile h4 {
  margin: 10px 0 4px;
  font-size: 1rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tags span {
  display: inline-flex;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
}

.swatch {
  height: 56px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.3);
}

.error {
  color: var(--danger);
  font-weight: 800;
}

.calc-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
}

.equipment-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.feature-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0a0e13;
}

.checks input,
label input[type="checkbox"] {
  width: auto;
}

.admin-tabs {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.admin-table {
  display: grid;
  gap: 8px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) 1fr auto auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0a0e13;
  color: var(--ink);
  text-align: left;
}

.admin-row:hover {
  border-color: var(--line-strong);
}

.user-grid,
.equipment-admin-list {
  display: grid;
  gap: 12px;
}

.user-card {
  display: grid;
  gap: 12px;
}

.equipment-catalog {
  display: grid;
  gap: 18px;
}

.equipment-catalog h3 {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.media-card {
  display: grid;
  gap: 12px;
}

.timecode {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(8, 11, 16, 0.72);
}

.timecode strong {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.timecode p {
  margin: 0;
}

.inlineForm {
  display: grid;
  gap: 8px;
}

.export-box {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #060606;
}

.export-box pre {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px) saturate(1.15);
}

.legal-backdrop[hidden] {
  display: none !important;
}

.legal-modal {
  width: min(820px, 100%);
}

.legal-provider {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(244, 247, 251, 0.16);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
}

.legal-provider span {
  color: var(--muted);
  font-size: 0.76rem;
}

.legal-scroll {
  max-height: min(52vh, 540px);
  overflow-y: auto;
  padding: 4px 18px 20px 4px;
  scroll-behavior: smooth;
}

.legal-scroll section {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.legal-scroll h3 {
  margin: 0 0 6px;
  font-size: 0.88rem;
  text-transform: uppercase;
}

.legal-scroll p {
  margin: 0;
  color: #d0d2ca;
  font-size: 0.84rem;
  line-height: 1.55;
}

.legal-template-note {
  margin-top: 16px !important;
  padding: 10px;
  border: 1px solid rgba(243, 201, 105, 0.35);
  color: var(--warn) !important;
}

.legal-progress {
  height: 3px;
  overflow: hidden;
  background: var(--line);
}

.legal-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(183, 255, 60, 0.5);
  transition: width 120ms linear;
}

.glass-modal {
  width: min(980px, 100%);
  max-height: min(86vh, 860px);
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(247, 247, 242, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.045)),
    rgba(12, 12, 12, 0.72);
  box-shadow: 0 40px 140px rgba(0,0,0,0.62);
  backdrop-filter: blur(28px) saturate(1.25);
  animation: modalIn 220ms ease both;
}

.danger-modal {
  width: min(520px, 100%);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.modal-head h2,
.glass-modal h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(247,247,242,0.24);
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--ink);
  font-size: 1.4rem;
}

.icon-btn:hover {
  background: var(--accent);
  color: #050505;
}

.quick-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.glass-card {
  padding: 14px;
  border: 1px solid rgba(247, 247, 242, 0.18);
  border-radius: 8px;
  background: rgba(5, 5, 5, 0.44);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.glass-card h3 {
  margin: 0 0 12px;
  text-transform: uppercase;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.danger-btn {
  background: var(--danger);
  color: #050505;
}

@media (max-width: 980px) {
  .login,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }

  .login-panel {
    width: min(100%, 520px);
    min-height: calc(100vh - 70px);
    margin: 0 auto;
    border-right: 1px solid var(--line);
  }

  .sidebar {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
  }

  .content::before {
    left: 0;
  }

  .sidebar::before {
    position: fixed;
    z-index: 5;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .main-nav {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    justify-content: center;
  }

  .nav-button {
    min-width: 112px;
    text-align: center;
  }

  .sidebar-project-switcher {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .sidebar-agenda,
  .admin-mini {
    grid-column: 1 / -1;
    grid-row: 3;
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  }

  .user-box {
    display: none;
  }

  .sidebar > #logout {
    grid-column: 3;
    grid-row: 1;
    min-height: 42px;
  }

  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 {
    grid-column: span 12;
  }

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

  .milanote-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "toolbar"
      "side"
      "board";
  }

  .milanote-side {
    position: static;
  }

  .admin-row {
    grid-template-columns: 1fr;
  }

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

  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .calendar-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-filters {
    justify-content: flex-start;
  }

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

  .kpi:nth-child(3) {
    border-left: 0;
  }

  .kpi:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 620px) {
  .content,
  .sidebar {
    padding: 14px;
  }

  .login-panel {
    min-height: calc(100vh - 70px);
    margin: 0;
    padding: 24px;
  }

  .register-panel {
    min-height: auto;
  }

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

  .legal-open {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar,
  .item-row {
    align-items: stretch;
    flex-direction: column;
  }

  .sidebar {
    grid-template-columns: 1fr auto;
    padding: 12px 14px;
  }

  .brand .wordmark {
    font-size: 1.35rem;
  }

  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: stretch;
  }

  .nav-button {
    flex: 1;
    min-width: 0;
  }

  .sidebar-project-switcher {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .sidebar-agenda,
  .admin-mini {
    grid-column: 1 / -1;
    grid-row: 4;
  }

  .sidebar > #logout {
    grid-column: 2;
    grid-row: 1;
  }

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

  .page-title h1 {
    max-width: 100%;
    font-size: clamp(1.7rem, 8vw, 2.6rem);
  }

  .workspace-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: thin;
  }

  .calendar-nav {
    flex-wrap: wrap;
  }

  .calendar-nav h2 {
    width: 100%;
    min-width: 0;
    margin: 6px 0 0;
  }

  .calendar-filters,
  .calendar-filters select,
  .segmented {
    width: 100%;
  }

  .calendar-filters select,
  .segmented .mini {
    flex: 1;
  }

  .calendar-main {
    overflow-x: auto;
  }

  .calendar-weekdays,
  .calendar-grid {
    min-width: 760px;
  }

  .calendar-list-row {
    grid-template-columns: 1fr;
  }

  .equipment-checks {
    grid-template-columns: 1fr;
  }

  .activity-row {
    flex-direction: column;
  }

  .travel-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .tab {
    flex: 0 0 auto;
  }

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

  .next-step { align-items: flex-start; flex-direction: column; }
  .workflow-hint { align-items: flex-start; flex-direction: column; }

  .kanban,
  .calc-row {
    grid-template-columns: 1fr;
  }

  .milanote-board {
    min-height: 540px;
  }

  .canvas-card {
    position: static;
    width: auto;
    margin: 12px;
  }

  .modal-backdrop {
    padding: 12px;
    place-items: end center;
  }

  .glass-modal {
    max-height: 92vh;
    padding: 16px;
  }

  .quick-modal-grid {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .header-actions {
    justify-content: stretch;
  }

  .header-actions .btn,
  .header-actions .pill {
    width: 100%;
    justify-content: center;
  }
}

/* Production OS modules */
.system-badge {
  padding: 5px 8px;
  border: 1px solid rgba(98, 217, 255, 0.45);
  border-radius: 4px;
  color: var(--accent-2);
  font: 700 0.68rem ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
}

.health-core {
  overflow: hidden;
}

.health-score {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 14px 0 4px;
}

.health-score strong {
  font-size: clamp(3.2rem, 7vw, 5.8rem);
  line-height: 0.8;
  color: var(--accent);
  text-shadow: 0 0 28px rgba(183, 255, 60, 0.2);
}

.health-score span {
  color: var(--muted);
}

.health-ring {
  height: 4px;
  margin: 14px 0;
  background: linear-gradient(90deg, var(--accent) calc(var(--score) * 1%), var(--line) 0);
  box-shadow: 0 0 18px rgba(183, 255, 60, 0.18);
}

.risk-line {
  padding: 7px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.copilot-panel {
  background: rgba(15, 23, 31, 0.82);
  border-color: rgba(98, 217, 255, 0.28);
}

.copilot-actions,
.copilot-summary > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.copilot-result {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.copilot-summary span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--accent-2);
  font-size: 0.72rem;
}

.copilot-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.copilot-preview > div {
  display: grid;
  gap: 3px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.copilot-preview small {
  color: var(--muted);
}

.shoot-day-strip,
.suggestion-list {
  display: grid;
  gap: 8px;
}

.team-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.team-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.16);
  color: var(--ink);
  text-align: left;
}

.team-check small {
  grid-column: 2;
  color: var(--muted);
}

.team-check.present {
  border-color: rgba(114, 242, 189, 0.45);
  background: rgba(114, 242, 189, 0.06);
}

.team-check.present .status-dot {
  background: var(--ok);
}

.shoot-day,
.suggestion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
}

.shoot-day div {
  flex: 1;
}

.shoot-day p {
  margin: 3px 0 0;
  color: var(--muted);
}

.live-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 92, 114, 0.12), 0 0 16px rgba(255, 92, 114, 0.65);
  animation: loaderPulse 1.4s ease-in-out infinite;
}

.approval-timeline {
  display: grid;
}

.approval-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.approval-index {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--warn);
  border-radius: 50%;
  color: var(--warn);
  font-size: 0.7rem;
}

.approval-step.approved .approval-index {
  border-color: var(--ok);
  color: var(--ok);
  box-shadow: 0 0 18px rgba(114, 242, 189, 0.16);
}

.approval-step.changes .approval-index {
  border-color: var(--danger);
  color: var(--danger);
}

.approval-step p,
.approval-step small {
  display: block;
  margin: 3px 0 0;
  color: var(--muted);
}

.pipeline-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.pipeline-source {
  margin: 14px 0;
}

.pipeline-error {
  padding: 10px 12px;
  border-left: 2px solid var(--danger);
  background: rgba(255, 92, 114, 0.08);
  color: var(--danger);
  overflow-wrap: anywhere;
}

.pipeline-node {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 110px;
  padding: 14px;
  align-content: space-between;
  background: rgba(0, 0, 0, 0.16);
}

.pipeline-node + .pipeline-node {
  border-left: 1px solid var(--line);
}

.pipeline-node span {
  color: var(--accent-2);
  font: 700 0.7rem ui-monospace, SFMono-Regular, Menlo, monospace;
}

.pipeline-node small {
  color: var(--muted);
}

.pipeline-node.active::before {
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  content: "";
  background: var(--accent);
  box-shadow: 0 0 14px rgba(183, 255, 60, 0.4);
}

.pipeline-path {
  display: grid;
  gap: 6px;
  padding: 10px;
  background: #080b10;
}

.pipeline-path span {
  color: var(--accent-2);
  font-size: 0.65rem;
}

.pipeline-path code {
  overflow-wrap: anywhere;
}

.pipeline-success {
  color: var(--ok);
}

.automation-log > div {
  display: grid;
  grid-template-columns: auto 160px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.automation-log time {
  color: var(--muted);
  font-size: 0.72rem;
}

.automation-rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.crm-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(240px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.crm-column {
  min-height: 480px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(14, 20, 27, 0.7);
}

.crm-column > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 2px 10px;
  border-bottom: 1px solid var(--line);
}

.crm-column h2 {
  margin: 0;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.crm-column header span {
  color: var(--accent-2);
}

.crm-stack {
  display: grid;
  gap: 8px;
  padding-top: 8px;
}

.crm-card {
  padding: 10px;
  border: 1px solid rgba(98, 217, 255, 0.16);
  border-radius: 6px;
  background: rgba(24, 33, 45, 0.8);
}

.crm-card h3,
.crm-card p {
  margin: 5px 0;
}

.crm-card small {
  color: var(--muted);
}

.crmStageForm {
  display: flex;
  gap: 5px;
  margin: 10px 0 6px;
}

.crmStageForm select {
  min-width: 0;
  width: 100%;
}

.equipment-asset-head {
  display: grid;
  grid-template-columns: 1fr 74px;
  gap: 10px;
}

.equipment-asset-head img {
  width: 74px;
  height: 74px;
  padding: 4px;
  border-radius: 4px;
  background: var(--ink);
}

.asset-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.budget-alert {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 200, 87, 0.45);
  border-left: 3px solid var(--warn);
  border-radius: 6px;
  background: rgba(255, 200, 87, 0.07);
  color: var(--warn);
}

.budget-alert.critical {
  border-color: rgba(255, 92, 114, 0.5);
  color: var(--danger);
  background: rgba(255, 92, 114, 0.07);
}

.cinema-backdrop,
.live-backdrop {
  padding: 0;
  background: rgba(3, 5, 8, 0.96);
  backdrop-filter: blur(18px);
}

.cinema-modal,
.live-modal {
  width: 100%;
  height: 100dvh;
  overflow: auto;
  background: #05080c;
}

.cinema-head,
.live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.cinema-head h2,
.live-head h2 {
  margin: 2px 0;
  font-size: 1.3rem;
}

.cinema-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: min(68vh, 780px);
  overflow: hidden;
  background: #000;
}

.cinema-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cinema-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.draw-hint {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(5, 8, 12, 0.76);
  color: var(--muted);
  font-size: 0.7rem;
  pointer-events: none;
}

.video-placeholder {
  color: var(--muted);
}

.cinema-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 34%);
  gap: 14px;
  padding: 14px 18px 24px;
}

.cinema-comments {
  display: grid;
  gap: 6px;
  max-height: 190px;
  overflow-y: auto;
}

.review-comment {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
}

.review-comment strong {
  color: var(--accent);
}

.live-dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.live-dashboard section {
  display: grid;
  gap: 5px;
  min-height: 120px;
  padding: 18px;
  align-content: center;
}

.live-dashboard section + section {
  border-left: 1px solid var(--line);
}

.live-dashboard span,
.live-dashboard small {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.live-dashboard strong {
  font-size: clamp(1.7rem, 4vw, 3.2rem);
}

.live-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 32%);
  gap: 18px;
  padding: 18px;
}

.live-shot {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.live-shot > span {
  color: var(--accent-2);
  font: 700 0.8rem ui-monospace, SFMono-Regular, Menlo, monospace;
}

.live-shot small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.live-shot b {
  color: var(--warn);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.live-shot.done {
  opacity: 0.58;
}

.live-shot.done b {
  color: var(--ok);
}

.live-equipment {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.live-equipment > div {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
}

@media (max-width: 980px) {
  .pipeline-track,
  .live-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pipeline-node:nth-child(3),
  .live-dashboard section:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .pipeline-node:nth-child(4),
  .live-dashboard section:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .cinema-bottom,
  .live-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .copilot-preview,
  .automation-rule-grid {
    grid-template-columns: 1fr;
  }

  .approval-step {
    grid-template-columns: 36px 1fr;
  }

  .approval-step .quick-actions {
    grid-column: 1 / -1;
  }

  .pipeline-track {
    grid-template-columns: 1fr;
  }

  .pipeline-node + .pipeline-node {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .automation-log > div {
    grid-template-columns: auto 1fr;
  }

  .automation-log time {
    grid-column: 2;
  }

  .cinema-head,
  .live-head {
    align-items: flex-start;
  }

  .cinema-stage {
    height: 46vh;
  }

  .cinema-bottom {
    padding: 12px;
  }

  .live-dashboard {
    grid-template-columns: 1fr 1fr;
  }

  .live-dashboard section {
    min-height: 100px;
    padding: 12px;
  }

  .live-columns {
    padding: 12px;
  }

  .live-shot {
    grid-template-columns: 34px 1fr;
  }

  .live-shot b {
    grid-column: 2;
  }
}

/* Simplified workflow navigation */
.workspace-primary {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.workspace-stage {
  position: relative;
  min-width: 130px;
  padding: 13px 16px;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
}

.workspace-stage:hover { color: var(--ink); background: rgba(255,255,255,0.025); }
.workspace-stage.active { color: var(--ink); }
.workspace-stage.active::after { position: absolute; right: 16px; bottom: 0; left: 16px; height: 2px; content: ""; background: var(--accent); box-shadow: 0 0 12px rgba(196,255,63,0.45); }

.workspace-secondary {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 3px 0 0;
}

.workspace-secondary .tab { min-height: 30px; padding: 6px 9px; color: var(--muted); }
.workspace-secondary .tab.active { color: #071006; }

.command-deck-simple .project-command-deck { grid-template-columns: minmax(0, 1fr) 250px; min-height: 300px; }
.command-deck-simple .deck-vitals { align-self: center; grid-template-columns: 94px 1fr; }
.command-deck-simple .deck-identity h2 { max-width: 18ch; font-size: clamp(2.25rem, 4.5vw, 4.4rem); }
.command-deck-simple .mission-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.command-deck-simple .mission-metrics > div:nth-child(3) { border-right: 0; }
.command-deck-simple .command-queue, .command-deck-simple .command-radar { min-height: 260px; }

@media (max-width: 1120px) {
  .command-deck-simple .project-command-deck { grid-template-columns: 1fr; }
  .command-deck-simple .deck-vitals { justify-self: start; }
}

@media (max-width: 720px) {
  .workspace-stage { min-width: 112px; padding-inline: 12px; }
  .command-deck-simple .mission-metrics { grid-template-columns: 1fr; }
  .command-deck-simple .mission-metrics > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .command-deck-simple .mission-metrics > div:last-child { border-bottom: 0; }
}

/* Company home */
.home-shell { display: grid; gap: 18px; }
.home-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 10px 0 20px; border-bottom: 1px solid var(--line); }
.home-header h1 { max-width: 18ch; margin: 2px 0 8px; font-size: clamp(2.2rem, 5vw, 5.6rem); line-height: 0.9; text-transform: uppercase; }
.home-header > div > p:last-child { margin: 0; color: var(--muted); }
.home-finance { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.7fr); align-items: end; gap: 28px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.finance-lead { display: grid; gap: 5px; }
.finance-lead span, .finance-lead small { color: var(--muted); font-size: 0.7rem; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.finance-lead strong { color: var(--accent); font-size: clamp(2.8rem, 7vw, 7rem); font-variant-numeric: tabular-nums; line-height: 0.82; }
.finance-ratio { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; color: var(--muted); font-size: 0.72rem; }
.finance-ratio > div { grid-column: 1 / -1; height: 8px; overflow: hidden; background: #263442; }
.finance-ratio i { display: block; width: var(--ratio); height: 100%; background: var(--accent-2); box-shadow: 0 0 18px rgba(93,225,255,0.34); }
.finance-ratio span:last-child { text-align: right; }
.home-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.home-metrics > div { display: grid; gap: 5px; padding: 4px 18px 18px 0; border-right: 1px solid var(--line); }
.home-metrics > div + div { padding-left: 18px; }
.home-metrics > div:last-child { border-right: 0; }
.home-metrics span, .home-metrics small { color: var(--muted); font-size: 0.66rem; font-weight: 800; text-transform: uppercase; }
.home-metrics strong { font-size: clamp(1.8rem, 4vw, 3.6rem); font-variant-numeric: tabular-nums; line-height: 0.95; }
.home-metrics small { color: #617184; font-size: 0.62rem; font-weight: 600; text-transform: none; }
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; }
.portfolio, .home-focus { min-width: 0; padding-top: 4px; }
.portfolio-head, .portfolio-row { display: grid; grid-template-columns: minmax(220px, 1.5fr) 120px minmax(130px, 0.7fr) minmax(130px, 0.6fr); align-items: center; gap: 14px; }
.portfolio-head { padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.62rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.portfolio-row { width: 100%; padding: 14px 12px; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); text-align: left; }
.portfolio-row:hover { background: rgba(93,225,255,0.045); box-shadow: inset 2px 0 0 var(--accent-2); }
.portfolio-row strong, .portfolio-row small { display: block; }
.portfolio-row small { margin-top: 4px; color: var(--muted); font-size: 0.69rem; }
.status-label { color: var(--accent-2); font-size: 0.68rem; font-weight: 900; text-transform: uppercase; }
.portfolio-progress { position: relative; height: 5px; background: #263442; }
.portfolio-progress i { display: block; height: 100%; background: var(--accent); }
.portfolio-progress small { position: absolute; top: 8px; right: 0; font-size: 0.6rem; }
.portfolio-profit { text-align: right; }
.portfolio-profit.negative strong { color: var(--danger); }
.home-focus { border-left: 1px solid var(--line); padding-left: 22px; }
.home-task-list { display: grid; }
.home-task-list > button { display: grid; grid-template-columns: 8px 1fr; gap: 10px; width: 100%; padding: 12px 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); text-align: left; }
.home-task-list > button:hover strong { color: var(--accent); }
.home-task-list strong, .home-task-list small { display: block; }
.home-task-list small { margin-top: 3px; color: var(--muted); font-size: 0.68rem; }
.priority-dot { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--accent-2); }
.priority-dot.hoch { background: var(--danger); }
.priority-dot.mittel { background: var(--warn); }
.status-distribution { display: grid; gap: 0; margin-top: 26px; }
.status-distribution > div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.72rem; }
.status-distribution strong { color: var(--ink); }

@media (max-width: 1040px) {
  .home-layout { grid-template-columns: 1fr; }
  .home-focus { border-top: 1px solid var(--line); border-left: 0; padding: 20px 0 0; }
  .home-finance { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .home-header { align-items: flex-start; flex-direction: column; }
  .home-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-metrics > div { padding: 12px; border-bottom: 1px solid var(--line); }
  .home-metrics > div + div { padding-left: 12px; }
  .home-metrics > div:nth-child(2) { border-right: 0; }
  .portfolio-head { display: none; }
  .portfolio-row { grid-template-columns: 1fr auto; }
  .portfolio-progress { grid-column: 1 / -1; }
  .portfolio-profit { text-align: right; }
}

/* Production polish */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.panel:hover {
  border-color: var(--line);
  box-shadow: none;
}

.panel > .list > .item {
  padding: 11px 2px;
  border-width: 0 0 1px;
  border-color: var(--line);
  border-radius: 0;
  background: transparent;
}

.panel > .list > .item:last-child { border-bottom: 0; }
.panel > .list > .item:hover { border-color: var(--line-strong); background: rgba(93, 225, 255, 0.025); }

.home-header h1 {
  max-width: 22ch;
  font-size: clamp(2rem, 3.8vw, 3.8rem);
  line-height: 0.96;
}

.finance-lead strong { font-size: clamp(2.7rem, 5.5vw, 5.4rem); }
.home-finance { grid-template-columns: minmax(260px, 0.72fr) minmax(460px, 1.28fr); padding-block: 20px; }

.finance-lead strong.negative { color: var(--danger); }

.finance-chart {
  min-width: 0;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.finance-chart-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.finance-chart-head div { display: grid; gap: 3px; }
.finance-chart-head span,
.finance-chart-head small { color: var(--muted); font-size: 0.62rem; font-weight: 900; text-transform: uppercase; }
.finance-chart-head strong { font-size: 0.86rem; text-transform: uppercase; }
.finance-chart-head small { color: var(--accent-2); }

.finance-chart-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 145px;
  align-items: center;
  gap: 12px;
}

#financeDonut {
  display: block;
  width: 100%;
  height: 280px;
  min-width: 0;
  cursor: default;
  touch-action: pan-y;
}

.finance-chart-legend { display: grid; align-content: center; }
.finance-chart-legend button {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 3px 9px;
  width: 100%;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.finance-chart-legend button:hover,
.finance-chart-legend button.active { color: var(--ink); background: rgba(93, 225, 255, 0.035); }
.finance-chart-legend button i { grid-row: 1 / 3; width: 7px; height: 7px; margin-top: 3px; border-radius: 50%; }
.finance-chart-legend button i.cost { background: var(--accent-2); box-shadow: 0 0 10px rgba(93, 225, 255, 0.5); }
.finance-chart-legend button i.profit { background: var(--accent); box-shadow: 0 0 10px rgba(196, 255, 63, 0.45); }
.finance-chart-legend button i.overrun { background: var(--danger); box-shadow: 0 0 10px rgba(255, 92, 114, 0.45); }
.finance-chart-legend button span { font-size: 0.62rem; font-weight: 900; text-transform: uppercase; }
.finance-chart-legend button strong { color: var(--ink); font-size: 0.78rem; font-variant-numeric: tabular-nums; }

@media (max-width: 1040px) {
  .home-finance { grid-template-columns: 1fr; }
  .finance-chart { padding: 20px 0 0; border-top: 1px solid var(--line); border-left: 0; }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .app-shell { grid-template-columns: 224px minmax(0, 1fr); }
  .sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    padding: 16px 12px;
  }
  .brand,
  .main-nav,
  .sidebar-project-switcher,
  .sidebar-agenda,
  .admin-mini,
  .user-box,
  .sidebar > #logout {
    grid-column: auto;
    grid-row: auto;
  }
  .main-nav { display: grid; justify-content: stretch; }
  .nav-button { min-width: 0; text-align: left; }
  .sidebar-agenda { grid-template-columns: 1fr; }
  .content::before { left: 224px; }
}

@media (max-width: 760px) {
  .command-launcher,
  .sidebar-agenda,
  .admin-mini,
  .user-box { display: none; }
  .sidebar { gap: 10px; }
  .sidebar-project-switcher { padding: 9px; }
  .active-project-meta { display: none; }
  .home-header h1 { font-size: 2rem; }
  .home-finance { padding-block: 16px; }
  .finance-lead strong { font-size: 2.65rem; }
  .finance-chart { padding: 16px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .finance-chart-layout { grid-template-columns: 1fr; gap: 0; }
  #financeDonut { height: 240px; }
  .finance-chart-legend { grid-template-columns: repeat(auto-fit, minmax(82px, 1fr)); }
  .finance-chart-legend button { min-width: 0; }
  .finance-chart-legend button strong { overflow-wrap: anywhere; }
}

/* App shell refinement */
:root {
  --bg: #070a0e;
  --panel: #0d1218;
  --panel-2: #121922;
  --line: #202b36;
  --line-strong: #405366;
  --surface-soft: rgba(13, 18, 24, 0.96);
  --surface-glass: rgba(13, 18, 24, 0.96);
}

body {
  background: #070a0e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
}

body::before { display: none; }

.app-shell { grid-template-columns: 236px minmax(0, 1fr); background: var(--bg); }
.sidebar {
  gap: 10px;
  padding: 18px 12px 14px;
  background: #0a0e13;
  border-right-color: #1b2630;
  backdrop-filter: none;
}
.sidebar::before { height: 1px; background: var(--accent-2); }
.brand { grid-template-columns: 24px 1fr; column-gap: 8px; padding: 2px 5px 12px; }
.brand img { width: 24px; height: 24px; }
.brand .wordmark { font-size: 1.05rem; letter-spacing: 0.08em; }
.brand > span { font-size: 0.54rem; }
.sidebar-label { padding-inline: 8px; color: #607080; font-size: 0.58rem; }

.command-launcher {
  min-height: 36px;
  padding: 7px 9px;
  border-style: solid;
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}
.command-launcher:hover { border-color: var(--accent-2); background: rgba(93, 225, 255, 0.045); color: var(--ink); }

.main-nav { gap: 2px; }
.nav-button {
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
}
.nav-button strong { font-size: 0.78rem; font-weight: 700; letter-spacing: 0; text-transform: none; }
.nav-button:hover { border: 0; background: rgba(255, 255, 255, 0.035); box-shadow: none; }
.nav-button.active { border: 0; background: rgba(93, 225, 255, 0.08); color: var(--ink); box-shadow: inset 2px 0 0 var(--accent-2); }
.nav-count { min-width: 20px; height: 20px; background: var(--accent-2); color: #061015; }

.sidebar-project-switcher {
  gap: 7px;
  padding: 10px;
  border-color: var(--line);
  border-radius: 5px;
  background: #0d1319;
  box-shadow: none;
}
.sidebar-project-switcher label { font-size: 0.58rem; }
.sidebar-project-switcher select { min-height: 36px; padding: 7px 8px; }
.active-project-meta { padding-top: 8px; }
.active-project-meta strong { font-size: 0.72rem; }
.active-project-meta small { font-size: 0.66rem; }
.sidebar .admin-mini { display: none; }
.user-box { padding: 12px 6px 0; }
.sidebar > #logout { min-height: 34px; }

.content {
  max-width: 1680px;
  gap: 14px;
  padding: 22px clamp(18px, 2.4vw, 36px) 40px;
  animation-duration: 180ms;
}
.content::before { left: 236px; background: linear-gradient(90deg, var(--accent-2), transparent 22%); opacity: 0.42; }

.topbar {
  min-height: 76px;
  padding: 4px 0 16px;
  border-width: 0 0 1px;
  border-radius: 0;
  background: transparent;
}
.topbar::before { display: none; }
.topbar .page-title { padding-left: 0; }
.page-title h1 { margin-top: 3px; font-size: clamp(1.55rem, 2.4vw, 2.55rem); line-height: 1.04; text-transform: none; }
.page-title .muted { margin: 6px 0 0; font-size: 0.78rem; }
.eyebrow { color: var(--accent-2); font-size: 0.62rem; letter-spacing: 0.08em; }

.btn,
.mini,
.tab,
.workspace-stage {
  letter-spacing: 0;
  text-transform: none;
}
.btn { min-height: 36px; border-radius: 5px; background: var(--accent-2); color: #061015; font-size: 0.76rem; }
.btn:hover { background: #a8edff; color: #061015; transform: none; }
.btn.secondary { border-color: var(--line); }
.btn.secondary:hover { border-color: var(--line-strong); background: var(--panel-2); color: var(--ink); }
.mini { border-radius: 4px; font-size: 0.7rem; }

.workspace-primary {
  position: sticky;
  z-index: 20;
  top: 0;
  gap: 3px;
  padding: 7px 0 0;
  background: rgba(7, 10, 14, 0.94);
  backdrop-filter: blur(14px);
}
.workspace-stage { min-width: 112px; padding: 10px 12px; font-size: 0.7rem; font-weight: 700; }
.workspace-stage.active::after { right: 12px; left: 12px; background: var(--accent-2); box-shadow: none; }
.workspace-secondary { gap: 3px; padding-top: 0; }
.workspace-secondary .tab { min-height: 31px; padding: 6px 9px; font-weight: 700; }
.workspace-secondary .tab.active { background: rgba(93, 225, 255, 0.12); border-color: rgba(93, 225, 255, 0.28); color: var(--accent-2); }

.panel {
  padding: 14px;
  border-color: var(--line);
  border-radius: 6px;
  background: var(--panel);
  animation-duration: 170ms;
}
.panel:hover { border-color: var(--line); }
.section-head { margin-bottom: 12px; }
.section-head h2,
.panel h2 { font-size: 0.82rem; font-weight: 750; letter-spacing: 0; text-transform: none; }
.item { border-color: var(--line); border-radius: 5px; background: #0a0f14; }
.item:hover { border-color: var(--line-strong); }

label { color: #9ba8b5; font-size: 0.66rem; letter-spacing: 0; text-transform: none; }
input,
select,
textarea { min-height: 38px; border-color: var(--line); border-radius: 5px; background: #090d12; }
textarea { min-height: 86px; }
input:hover,
select:hover,
textarea:hover { border-color: #334352; }

.home-shell { gap: 14px; }
.home-header { padding: 4px 0 16px; }
.home-header h1 { margin-top: 4px; font-size: clamp(1.9rem, 3.1vw, 3.1rem); text-transform: none; }
.home-finance { gap: 22px; }
.home-metrics strong { font-size: clamp(1.6rem, 3vw, 2.7rem); }
.home-metrics > div { padding-bottom: 14px; }
.portfolio-row { padding-block: 12px; }

.admin-tabs {
  gap: 2px;
  padding: 0 0 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.admin-tabs .tab.active { background: rgba(93, 225, 255, 0.1); border-color: transparent; color: var(--accent-2); }
.admin-row { padding: 10px 4px; border-width: 0 0 1px; border-radius: 0; background: transparent; }
.crm-column { background: #0a0f14; }
.crm-card { border-radius: 5px; background: var(--panel); }

.modal-backdrop { background: rgba(2, 5, 8, 0.74); backdrop-filter: blur(14px); }
.glass-modal { border-color: #344758; border-radius: 7px; background: rgba(13, 18, 24, 0.97); box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62); }

@media (min-width: 761px) and (max-width: 1100px) {
  .app-shell { grid-template-columns: 214px minmax(0, 1fr); }
  .content::before { left: 214px; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    height: auto;
    padding: 12px 14px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand { grid-column: 1; grid-row: 1; padding: 0; }
  .sidebar-section { display: contents; }
  .sidebar-section .sidebar-label { display: none; }
  .sidebar > #logout { grid-column: 2; grid-row: 1; }
  .sidebar-project-switcher { grid-column: 1 / -1; grid-row: 2; padding: 7px 8px; }
  .sidebar-project-switcher label { display: none; }
  .main-nav {
    position: fixed;
    z-index: 120;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: rgba(10, 14, 19, 0.96);
    backdrop-filter: blur(18px);
  }
  .nav-button { min-height: 42px; padding: 6px; text-align: center; }
  .nav-button.active { box-shadow: inset 0 2px 0 var(--accent-2); }
  .nav-count { position: absolute; top: 3px; right: 7px; }
  .content { padding: 16px 14px calc(82px + env(safe-area-inset-bottom)); }
  .content::before { left: 0; }
  .topbar { align-items: flex-start; min-height: 0; }
  .workspace-primary { top: 0; margin-inline: -14px; padding-inline: 14px; }
  .home-metrics strong { font-size: 1.7rem; }
}

/* Executive home */
.home-shell { gap: 14px; }
.home-header {
  align-items: center;
  min-height: 86px;
  padding: 2px 0 16px;
}
.home-header h1 {
  max-width: none;
  margin: 4px 0 7px;
  font-size: clamp(1.85rem, 2.8vw, 2.8rem);
  line-height: 1;
}
.home-header > div > p:last-child { max-width: 640px; font-size: 0.78rem; }

.executive-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.86fr) minmax(480px, 1.14fr);
  gap: 14px;
}
.finance-command,
.finance-chart {
  min-width: 0;
  min-height: 340px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0c1117;
}
.finance-command { display: grid; align-content: space-between; gap: 18px; }
.finance-command-head,
.finance-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}
.finance-command-head > div,
.finance-chart-head > div { display: grid; gap: 3px; }
.finance-command-head span,
.finance-chart-head span { color: var(--muted); font-size: 0.62rem; font-weight: 750; text-transform: none; }
.finance-command-head small { color: #657483; font-size: 0.68rem; }
.finance-chart-head strong { font-size: 0.9rem; text-transform: none; }
.finance-chart-head small { color: var(--accent-2); font-size: 0.62rem; font-weight: 750; text-transform: none; }
.finance-signal {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-size: 0.67rem;
  font-weight: 750;
}
.finance-signal i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 12px currentColor; }
.finance-signal.watch { color: var(--warn); }
.finance-signal.critical { color: var(--danger); }
.finance-result { display: grid; gap: 7px; }
.finance-result strong {
  color: var(--accent);
  font-size: clamp(2.65rem, 4.5vw, 4.9rem);
  font-variant-numeric: tabular-nums;
  line-height: 0.9;
}
.finance-result strong.negative { color: var(--danger); }
.finance-result span { color: var(--muted); font-size: 0.72rem; }
.finance-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.finance-facts > div { display: grid; gap: 5px; padding: 12px 10px; border-right: 1px solid var(--line); }
.finance-facts > div:first-child { padding-left: 0; }
.finance-facts > div:last-child { padding-right: 0; border-right: 0; }
.finance-facts span { color: var(--muted); font-size: 0.62rem; }
.finance-facts strong { font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.margin-meter { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; align-items: center; }
.margin-meter > div { grid-column: 1 / -1; height: 4px; overflow: hidden; border-radius: 2px; background: #1a242e; }
.margin-meter i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); box-shadow: 0 0 12px rgba(185, 243, 74, 0.35); animation: margin-meter-in 700ms ease-out both; }
.margin-meter span,
.margin-meter strong { color: var(--muted); font-size: 0.65rem; }
.margin-meter strong { color: var(--ink); font-variant-numeric: tabular-nums; }
@keyframes margin-meter-in { from { width: 0; } }

.finance-chart { padding: 18px; border-left: 1px solid var(--line); }
.finance-chart-layout { grid-template-columns: minmax(280px, 1fr) minmax(150px, 0.55fr); gap: 14px; min-height: 270px; }
.finance-canvas-wrap { position: relative; min-width: 0; }
.finance-canvas-wrap > span {
  position: absolute;
  bottom: 8px;
  left: 50%;
  color: #586675;
  font-size: 0.58rem;
  transform: translateX(-50%);
  white-space: nowrap;
}
#financeDonut { height: 270px; cursor: crosshair; }
.finance-chart-legend { gap: 3px; }
.finance-chart-legend button {
  grid-template-columns: 9px 1fr;
  gap: 3px 9px;
  padding: 12px 8px;
  border: 1px solid transparent;
  border-radius: 5px;
}
.finance-chart-legend button:hover,
.finance-chart-legend button.active { border-color: var(--line); background: #111820; }
.finance-chart-legend button i { grid-row: 1 / 4; width: 8px; height: 8px; }
.finance-chart-legend button span { font-size: 0.64rem; font-weight: 700; text-transform: none; }
.finance-chart-legend button strong { font-size: 0.82rem; }
.finance-chart-legend button small { color: #657483; font-size: 0.6rem; }

.home-metrics { gap: 10px; border: 0; }
.home-metrics > div,
.home-metrics > div + div {
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0a0f14;
}
.home-metrics > div:last-child { border-right: 1px solid var(--line); }
.home-metrics span { color: #83909c; font-size: 0.64rem; font-weight: 700; text-transform: none; }
.home-metrics strong { font-size: clamp(1.65rem, 2.5vw, 2.35rem); }
.home-metrics small { color: #657483; font-size: 0.64rem; }
.home-metrics .metric-alert strong,
.home-metrics .metric-alert small { color: var(--warn); }
.home-layout { margin-top: 6px; }

@media (max-width: 1180px) {
  .executive-grid { grid-template-columns: 1fr; }
  .finance-command { min-height: 300px; }
}

@media (max-width: 760px) {
  .home-header { align-items: flex-start; min-height: 0; }
  .home-header h1 { font-size: 1.85rem; }
  .executive-grid { grid-template-columns: minmax(0, 1fr); }
  .finance-command,
  .finance-chart { min-height: 0; padding: 14px; }
  .finance-result strong { font-size: clamp(2.35rem, 13vw, 3.6rem); }
  .finance-facts { grid-template-columns: 1fr; }
  .finance-facts > div,
  .finance-facts > div:first-child,
  .finance-facts > div:last-child { padding: 9px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .finance-facts > div:last-child { border-bottom: 0; }
  .finance-chart-layout { grid-template-columns: 1fr; min-height: 0; }
  #financeDonut { height: 245px; }
  .finance-canvas-wrap > span { display: none; }
  .finance-chart-legend { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .finance-chart-legend button { align-content: start; padding: 9px 5px; }
  .finance-chart-legend button i { grid-row: 1; }
  .finance-chart-legend button span,
  .finance-chart-legend button strong,
  .finance-chart-legend button small { grid-column: 1 / -1; overflow-wrap: anywhere; }
  .home-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-metrics > div,
  .home-metrics > div + div { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .margin-meter i { animation: none; }
}

/* Studio OS and final layout containment */
.content,
.content > *,
.grid > *,
.panel,
.studio-os,
.studio-module,
.operation-main { min-width: 0; }
.header-actions,
.quick-actions,
.section-head { flex-wrap: wrap; }
.workspace-primary,
.workspace-secondary,
.admin-tabs {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}
.workspace-stage,
.workspace-secondary .tab,
.admin-tabs .tab { flex: 0 0 auto; }
img,
video,
canvas { max-width: 100%; }
.export-box,
.pipeline-path,
.item a,
.operation-row a { overflow-wrap: anywhere; }

.studio-os { display: grid; gap: 14px; }
.studio-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 2px 0 14px;
  border-bottom: 1px solid var(--line);
}
.studio-toolbar h2 { margin: 4px 0 0; font-size: 1.05rem; }
.studio-toolbar nav { display: flex; gap: 4px; max-width: 100%; overflow-x: auto; }
.studio-toolbar nav .mini { flex: 0 0 auto; border-color: transparent; background: transparent; color: var(--muted); }
.studio-toolbar nav .mini.active { border-color: rgba(85, 217, 246, 0.28); background: rgba(85, 217, 246, 0.09); color: var(--accent-2); }
.studio-modules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
.studio-module {
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0b1016;
}
.studio-module.studio-wide { grid-column: 1 / -1; }
.studio-module > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.studio-module > header h2 { margin: 0; font-size: 0.82rem; }
.studio-module > header p { max-width: 66ch; margin: 4px 0 0; color: var(--muted); font-size: 0.67rem; line-height: 1.45; }
.studio-module > header > span { display: grid; place-items: center; min-width: 25px; height: 25px; padding-inline: 7px; border-radius: 4px; background: #151e27; color: var(--accent-2); font-size: 0.68rem; font-weight: 750; }
.operation-list { display: grid; }
.operation-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.operation-row:last-child { border-bottom: 0; }
.operation-main { display: grid; gap: 4px; }
.operation-main > strong { font-size: 0.76rem; }
.operation-main > small,
.operation-main > p { margin: 0; color: var(--muted); font-size: 0.65rem; line-height: 1.45; }
.operation-main > a { color: var(--accent-2); font-size: 0.65rem; }
.operation-state { width: max-content; color: var(--accent-2); font-size: 0.58rem; font-weight: 750; }
.decision-proof { color: var(--accent) !important; }
.operation-actions { display: flex; align-items: flex-start; gap: 5px; }
.operation-edit { grid-column: 1 / -1; }
.operation-edit summary,
.studio-create summary {
  width: max-content;
  cursor: pointer;
  color: #748392;
  font-size: 0.63rem;
  font-weight: 700;
  list-style-position: inside;
}
.operation-edit[open] summary,
.studio-create[open] summary { margin-bottom: 10px; color: var(--accent-2); }
.operation-edit form,
.studio-create form { padding: 11px; border: 1px solid var(--line); border-radius: 5px; background: #080d12; }
.studio-create { padding-top: 4px; border-top: 1px solid var(--line); }
.studio-empty { margin: 4px 0; color: #687684; font-size: 0.67rem; }
.studio-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 4px 0 16px; }
.studio-intro h2 { margin: 4px 0; font-size: 1.35rem; }
.studio-intro p:last-child { margin: 0; color: var(--muted); font-size: 0.72rem; }
.studio-intro > strong { display: grid; place-items: center; width: 58px; height: 58px; border: 1px solid rgba(85, 217, 246, 0.35); border-radius: 50%; color: var(--accent-2); font-size: 1.4rem; }
.studio-stat-line { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.studio-stat-line > div { display: grid; gap: 3px; padding: 12px; border-right: 1px solid var(--line); }
.studio-stat-line > div:last-child { border-right: 0; }
.studio-stat-line strong { font-size: 1.25rem; }
.studio-stat-line span { color: var(--muted); font-size: 0.62rem; }
.studio-key-values,
.security-readiness { display: grid; }
.studio-key-values > div,
.security-readiness > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.67rem; }
.studio-key-values span,
.security-readiness span { color: var(--muted); }
.security-readiness strong { color: var(--accent); }
.security-readiness strong.pending { color: var(--warn); }
.capacity-list { display: grid; }
.capacity-row { display: grid; grid-template-columns: minmax(130px, 0.5fr) minmax(120px, 1fr) 58px; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.capacity-row > div:first-child { display: grid; gap: 3px; }
.capacity-row small { color: var(--muted); font-size: 0.62rem; }
.capacity-row > div:nth-child(2) { height: 5px; overflow: hidden; border-radius: 3px; background: #1b2530; }
.capacity-row i { display: block; height: 100%; background: var(--accent-2); }
.capacity-row > strong { text-align: right; font-size: 0.7rem; }
.profit-table { display: grid; }
.profit-table button { display: grid; grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(90px, 0.4fr)); gap: 12px; width: 100%; padding: 10px 4px; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--muted); text-align: right; font-size: 0.68rem; }
.profit-table button:hover { background: rgba(85, 217, 246, 0.035); }
.profit-table button span:first-child { color: var(--ink); text-align: left; }
.profit-table strong { color: var(--accent); }
.profit-table strong.negative { color: var(--danger); }
.mini-activity { display: grid; max-height: 210px; overflow-y: auto; }
.mini-activity p { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.64rem; }
.mini-activity strong { color: var(--ink); }

@media (max-width: 980px) {
  .studio-toolbar { align-items: flex-start; flex-direction: column; }
  .studio-toolbar nav { width: 100%; padding-bottom: 3px; }
}

@media (max-width: 760px) {
  .studio-modules { grid-template-columns: 1fr; }
  .studio-module.studio-wide { grid-column: auto; }
  .studio-module { padding: 12px; }
  .operation-row { grid-template-columns: 1fr; }
  .operation-actions { grid-row: auto; }
  .profit-table { overflow-x: auto; }
  .profit-table button { min-width: 620px; }
  .capacity-row { grid-template-columns: 1fr 52px; }
  .capacity-row > div:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .studio-stat-line { grid-template-columns: 1fr; }
  .studio-stat-line > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .studio-stat-line > div:last-child { border-bottom: 0; }
}

/* Final collision and density guardrails */
.glass-modal {
  width: min(840px, 100%);
  max-height: min(88dvh, 820px);
  padding: clamp(14px, 2vw, 20px);
  overscroll-behavior: contain;
}
.modal-head h2,
.glass-modal h2 {
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: none;
}
.cinema-modal,
.live-modal {
  width: 100%;
  height: 100dvh;
  max-width: 100%;
}
.calendar-main,
.kanban,
.crm-board,
.equipment-admin-list,
.milanote-layout { max-width: 100%; }
.calendar-main,
.kanban,
.crm-board { overflow-x: auto; overscroll-behavior-inline: contain; }
.calendar-grid,
.calendar-weekdays { contain: layout paint; }
.canvas-card { max-width: calc(100% - 24px); }
.modal-actions { position: sticky; bottom: -1px; z-index: 2; padding-top: 10px; background: inherit; }
.topbar > *,
.section-head > *,
.modal-head > * { min-width: 0; }
.topbar .page-title,
.section-head > div,
.modal-head > div { flex: 1 1 240px; }
.page-title h1,
.section-head h2,
.modal-head h2 { overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .modal-backdrop { padding: 8px; }
  .glass-modal { width: 100%; max-height: 94dvh; border-radius: 6px; }
  .cinema-backdrop,
  .live-backdrop { padding: 0; }
  .topbar { gap: 10px; }
  .workspace-secondary { padding-bottom: 5px; }
}

/* Connected workflow suite */
.legal-modal {
  width: min(960px, 100%);
  max-height: min(92dvh, 980px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.legal-modal .modal-head { flex: 0 0 auto; }
.legal-provider { flex: 0 0 auto; margin: 0; padding: 14px 16px; }
.legal-provider strong { font-size: 0.95rem; }
.legal-provider span { line-height: 1.55; overflow-wrap: anywhere; }
.legal-scroll {
  flex: 1 1 auto;
  min-height: 160px;
  max-height: min(64dvh, 700px);
  padding: 4px 22px 20px 4px;
  overscroll-behavior: contain;
}
.legal-scroll section {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 18px 0;
}
.legal-scroll section > div { min-width: 0; }
.legal-section-number {
  padding-top: 2px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.legal-scroll h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.4;
  letter-spacing: 0.04em;
}
.legal-scroll p {
  max-width: 76ch;
  margin: 0 0 9px;
  color: #d4d7d0;
  font-size: 0.9rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.legal-scroll p:last-child { margin-bottom: 0; }
.legal-progress { flex: 0 0 4px; border-radius: 4px; }
.legal-modal .modal-actions { flex: 0 0 auto; padding-top: 2px; }
.legal-modal .modal-actions .btn:disabled { cursor: not-allowed; opacity: 0.48; }
@media (max-width: 600px) {
  .legal-modal { gap: 10px; padding: 14px; }
  .legal-provider { padding: 11px 12px; }
  .legal-scroll { max-height: 58dvh; padding-right: 10px; }
  .legal-scroll section { grid-template-columns: 26px minmax(0, 1fr); gap: 8px; padding: 14px 0; }
  .legal-scroll p { font-size: 0.86rem; line-height: 1.72; }
}
.command-list { max-height: min(56vh, 520px); overflow-y: auto; }
.command-divider {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 12px 6px;
  border-bottom: 1px solid var(--line);
  background: #0c1117;
  color: #667684;
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
}
.command-record span { color: #748493; text-transform: none; }

.home-operations {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 14px;
}
.action-center,
.capacity-center {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0a0f14;
}
.action-center .section-head,
.capacity-center .section-head { margin-bottom: 5px; }
.action-feed { display: grid; }
.action-feed > button {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.action-feed > button:last-child { border-bottom: 0; }
.action-feed > button:hover { padding-inline: 8px; background: rgba(85, 217, 246, 0.04); }
.action-feed > button > div { display: grid; gap: 2px; min-width: 0; }
.action-feed span,
.action-feed small { color: #738291; font-size: 0.61rem; }
.action-feed strong { overflow: hidden; font-size: 0.73rem; text-overflow: ellipsis; white-space: nowrap; }
.action-feed b { color: var(--accent-2); font-size: 0.61rem; }
.action-priority { width: 7px; height: 28px; border-radius: 2px; background: #526171; }
.action-priority.p0 { background: var(--danger); box-shadow: 0 0 12px rgba(255, 94, 105, 0.22); }
.action-priority.p1 { background: var(--warn); }
.action-priority.p2 { background: var(--accent-2); }
.action-empty { display: grid; gap: 4px; padding: 24px 0; color: var(--muted); }
.action-empty strong { color: var(--accent); }
.capacity-center .capacity-row { grid-template-columns: minmax(110px, 0.8fr) minmax(100px, 1fr) 52px; padding: 9px 0; }
.capacity-center .capacity-row i.over { background: var(--danger); }
.capacity-note { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; color: var(--muted); font-size: 0.62rem; }
.capacity-note strong { color: var(--ink); }

.wizard-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 5px 0 16px; border-block: 1px solid var(--line); }
.wizard-steps span { display: flex; align-items: center; gap: 7px; padding: 9px 5px; color: var(--muted); font-size: 0.62rem; }
.wizard-steps b { display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid rgba(85, 217, 246, 0.28); border-radius: 50%; color: var(--accent-2); font-size: 0.58rem; }
.wizard-note { margin: 4px 0 14px; color: #70808e; font-size: 0.65rem; line-height: 1.5; }
.lead-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lead-score { color: var(--accent); font-size: 0.58rem; font-weight: 800; }

.rent-calculator { display: grid; gap: 12px; }
.rent-result { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.rent-result > div { display: grid; gap: 5px; padding: 13px; border-right: 1px solid var(--line); }
.rent-result > div:last-child { border-right: 0; }
.rent-result span { color: var(--muted); font-size: 0.62rem; }
.rent-result strong { color: var(--accent); font-size: 1rem; }

@media (max-width: 980px) {
  .home-operations { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .home-operations { grid-template-columns: minmax(0, 1fr); }
  .action-center,
  .capacity-center { padding: 12px; }
  .action-feed > button { grid-template-columns: 6px minmax(0, 1fr); }
  .action-feed b { display: none; }
  .wizard-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rent-result { grid-template-columns: 1fr; }
  .rent-result > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .rent-result > div:last-child { border-bottom: 0; }
}

/* Release UX */
.toast-region {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1200;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 28px));
  pointer-events: none;
}
.toast {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(114, 242, 189, 0.32);
  border-radius: 6px;
  background: rgba(8, 13, 18, 0.96);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.38);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.visible { opacity: 1; transform: translateY(0); }
.toast > span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(114, 242, 189, 0.12); color: var(--ok); font-weight: 900; }
.toast p { margin: 0; color: var(--ink); font-size: 0.76rem; line-height: 1.45; }
.toast.error { border-color: rgba(255, 92, 114, 0.42); }
.toast.error > span { background: rgba(255, 92, 114, 0.12); color: var(--danger); }

.release-center { overflow: hidden; border-color: rgba(98, 217, 255, 0.22); background: linear-gradient(130deg, rgba(98, 217, 255, 0.055), rgba(17, 23, 32, 0.84) 42%); }
.release-center.ready { border-color: rgba(114, 242, 189, 0.3); }
.release-center.attention { border-color: rgba(255, 200, 87, 0.32); }
.release-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.release-summary h2 { margin: 4px 0 7px; font-size: 1.35rem; }
.release-summary p { margin: 0; color: var(--muted); }
.release-score { display: grid; flex: 0 0 112px; place-items: center; min-height: 88px; border: 1px solid rgba(98, 217, 255, 0.24); background: rgba(8, 12, 17, 0.72); }
.release-score strong { color: var(--accent); font-size: 1.65rem; }
.release-score span { color: var(--muted); font-size: 0.62rem; text-transform: uppercase; }
.release-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; margin-top: 1px; background: var(--line); }
.release-check { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 9px; min-width: 0; padding: 13px; background: #0b1016; }
.release-check > span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(114, 242, 189, 0.11); color: var(--ok); font-weight: 900; }
.release-check.critical > span { background: rgba(255, 92, 114, 0.12); color: var(--danger); }
.release-check.pending > span { background: rgba(255, 200, 87, 0.12); color: var(--warn); }
.release-check strong { display: block; overflow-wrap: anywhere; font-size: 0.7rem; }
.release-check p { margin: 4px 0 0; color: var(--muted); font-size: 0.61rem; line-height: 1.45; }
.section-pills { display: flex; flex: 0 0 auto; gap: 6px; }
.admin-row.archived { opacity: 0.58; }
.admin-row strong small { display: block; margin-bottom: 2px; color: var(--muted); font-size: 0.52rem; font-weight: 700; }
button:disabled { cursor: wait; opacity: 0.62; }

@media (max-width: 1100px) {
  .release-checks { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
}

@media (max-width: 620px) {
  .toast-region { top: 10px; right: 10px; }
  .topbar .page-title { flex: 0 1 auto; width: 100%; }
  .release-summary { align-items: stretch; flex-direction: column; }
  .release-score { grid-template-columns: auto auto; justify-content: center; gap: 8px; min-height: 58px; }
  .release-checks { grid-template-columns: 1fr; }
  .section-pills { flex-wrap: wrap; }
}

/* Nextcloud project access */
.project-cloud-access {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border-color: rgba(98, 217, 255, 0.28);
  background: linear-gradient(110deg, rgba(98, 217, 255, 0.07), rgba(17, 23, 32, 0.88) 46%);
}
.project-cloud-access.inactive { border-color: var(--line); background: var(--panel); }
.project-cloud-access.dropbox-access.active,
.dropbox-share-panel,
.dropbox-settings { border-color: color-mix(in srgb, #3984ff 30%, var(--line)); }
.project-cloud-access.dropbox-access.active { background: color-mix(in srgb, #3984ff 7%, var(--panel)); }
.dropbox-settings input[readonly] { color: var(--muted); cursor: copy; }
.project-cloud-access h2 { margin: 3px 0 6px; font-size: 1rem; }
.project-cloud-access p { max-width: 72ch; margin: 0; color: var(--muted); line-height: 1.5; }
.project-cloud-access .btn { flex: 0 0 auto; }
.cloud-share-panel { border-color: rgba(98, 217, 255, 0.24); }
.cloud-permission-note { display: flex; gap: 10px; margin: 2px 0 14px; padding: 11px 12px; border-left: 2px solid var(--accent-2); background: rgba(98, 217, 255, 0.045); font-size: 0.68rem; }
.cloud-permission-note span { color: var(--muted); }
.integration-result { margin: 12px 0 0; color: var(--ok); font-size: 0.68rem; }

@media (max-width: 620px) {
  .project-cloud-access { align-items: stretch; flex-direction: column; }
  .project-cloud-access .btn { width: 100%; }
  .cloud-permission-note { flex-direction: column; }
}

/* MX Production OS 3.0 - calm, dense product interface */
:root {
  --bg: #080b0e;
  --panel: #111720;
  --panel-2: #18212d;
  --ink: #f3f6f5;
  --muted: #87938e;
  --line: #263241;
  --line-strong: #c8d4df;
  --accent: #c5ff38;
  --accent-2: #62d9ff;
  --ok: #72f2bd;
  --warn: #e8b45b;
  --danger: #f06c75;
  --surface-soft: rgba(13, 18, 22, 0.94);
  --surface-glass: rgba(13, 18, 22, 0.96);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

html,
body { background: var(--bg); }
body { font-family: Arial, Helvetica, "SF Pro Text", sans-serif; }
body, button, input, select, textarea { font-synthesis: none; }
body::before { display: none; }

.app-shell { grid-template-columns: 236px minmax(0, 1fr); background: var(--bg); }
.sidebar {
  width: 236px;
  padding: 18px 14px;
  border-right: 1px solid #18211e;
  background: #090d10;
}
.brand { display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 0 7px 15px; }
.brand > div:last-child { display: grid; gap: 1px; }
.brand img { display: none; }
.mx-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(197, 255, 56, 0.62);
  border-radius: 7px;
  background: rgba(197, 255, 56, 0.1);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
}
.brand .wordmark { font-size: 0.86rem; letter-spacing: 0; }
.brand span { color: #63706b; font-size: 0.55rem; letter-spacing: 0.08em; }
.command-launcher { min-height: 38px; border-color: #1d2824; border-radius: 7px; background: #0d1316; }
.command-launcher:hover { border-color: rgba(98, 217, 255, 0.46); background: #101720; }
.sidebar-label { margin: 18px 8px 6px; color: #56625e; font-size: 0.54rem; letter-spacing: 0.08em; }
.main-nav { gap: 2px; }
.nav-button {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #87938e;
  font-size: 0.7rem;
}
.nav-button:hover { background: #111a23; color: #e5eef5; }
.nav-button.active { border-color: rgba(98, 217, 255, 0.26); background: rgba(98, 217, 255, 0.08); color: var(--accent); }
.sidebar-project-switcher { margin-top: 16px; padding: 12px; border: 1px solid #1d2824; border-radius: 7px; background: #0b1013; }
.sidebar-project-switcher select { background: #0f1619; }
.admin-mini { gap: 1px; overflow: hidden; border: 1px solid #1d2824; border-radius: 7px; background: #1d2824; }
.admin-mini > div { background: #0b1013; }
.user-box { margin-top: auto; border-color: #1d2824; background: transparent; }

.content { padding: 22px clamp(18px, 2.4vw, 34px) 42px; }
.home-shell,
.time-center { width: min(1480px, 100%); margin: 0 auto; gap: 14px; }
.home-header { min-height: 86px; padding: 2px 0 15px; border-bottom: 1px solid var(--line); }
.home-header h1 { margin: 5px 0 7px; font-size: clamp(1.7rem, 2.7vw, 2.5rem); font-weight: 800; }
.page-title h1, .section-head h2, .panel h2, .studio-toolbar h2, .studio-module > header h2 { font-weight: 800; }
.home-header > div > p:last-child { color: var(--muted); }
.compact-header { min-height: 0; }
.eyebrow { color: var(--accent); letter-spacing: 0.08em; }
.btn { min-height: 38px; border-radius: 6px; background: var(--accent); color: #04100b; box-shadow: none; }
.btn:hover { background: #d5ff70; box-shadow: 0 8px 24px rgba(197, 255, 56, 0.18); }
.btn.secondary { border-color: #2a3631; background: #10171a; color: #dce5e1; }
.mini,
.icon-btn { border-radius: 5px; }

.finance-command,
.finance-chart,
.panel,
.action-center,
.capacity-center,
.studio-module,
.home-metrics > div,
.home-metrics > div + div {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}
.finance-command,
.finance-chart { min-height: 300px; padding: 17px; }
.finance-result strong { font-size: clamp(2.3rem, 4vw, 4rem); }
.finance-chart { border-left-color: var(--line); }
.finance-chart-head small { color: var(--accent); }
.finance-chart-legend button:hover,
.finance-chart-legend button.active { background: #111915; }
.home-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.home-metrics strong { font-size: clamp(1.35rem, 2vw, 1.85rem); }

.module-launchpad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.module-launchpad button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b1013;
  color: var(--ink);
  text-align: left;
}
.module-launchpad button:hover { border-color: rgba(98, 217, 255, 0.46); background: #101a22; transform: translateY(-1px); }
.module-launchpad i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; background: rgba(197, 255, 56, 0.1); color: var(--accent); font-size: 0.55rem; font-style: normal; font-weight: 850; }
.module-launchpad span { display: grid; gap: 3px; min-width: 0; }
.module-launchpad strong { overflow: hidden; font-size: 0.71rem; text-overflow: ellipsis; white-space: nowrap; }
.module-launchpad small { overflow: hidden; color: #74807b; font-size: 0.59rem; text-overflow: ellipsis; white-space: nowrap; }
.finance-chart-legend button i.cost { background: #829089; box-shadow: none; }
.finance-chart-legend button i.profit { background: var(--accent); box-shadow: 0 0 12px rgba(197, 255, 56, 0.42); }
.finance-chart-legend button i.overrun { background: var(--danger); box-shadow: 0 0 10px rgba(240, 108, 117, 0.3); }

.workspace-primary { border-color: var(--line); border-radius: 7px; background: #0b1013; }
.workspace-stage.active { background: rgba(98, 217, 255, 0.1); color: var(--accent); }
.workspace-secondary { border-bottom-color: var(--line); }
.workspace-secondary .tab.active { color: var(--accent); }
.workspace-secondary .tab.active::after { background: var(--accent); }
.topbar { padding-bottom: 14px; border-bottom: 1px solid var(--line); }

.insight-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.insight-cards article { display: grid; gap: 7px; min-width: 0; padding: 15px; border: 1px solid var(--line); border-top: 2px solid rgba(197, 255, 56, 0.84); border-radius: 7px; background: var(--panel); }
.insight-cards span { color: var(--muted); font-size: 0.62rem; }
.insight-cards strong { font-size: clamp(1.35rem, 2.4vw, 2rem); font-variant-numeric: tabular-nums; }
.insight-cards small { color: #67736e; font-size: 0.6rem; }
.time-center { display: grid; }
.time-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr); gap: 12px; align-items: start; }
.time-side { display: grid; gap: 12px; }
.time-timeline { min-height: 440px; }
.focus-list { display: grid; }
.focus-entry { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.focus-entry > i { width: 7px; height: 28px; border-radius: 2px; background: #4e5c56; }
.focus-entry > i.desktop { background: var(--accent); }
.focus-entry > div { display: grid; gap: 3px; min-width: 0; }
.focus-entry strong,
.focus-entry span,
.focus-entry small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.focus-entry strong { font-size: 0.72rem; }
.focus-entry span { color: #a4afaa; font-size: 0.65rem; }
.focus-entry small { color: #68746f; font-size: 0.58rem; }
.focus-entry > b { color: var(--accent); font-size: 0.68rem; font-variant-numeric: tabular-nums; }
.app-usage { display: grid; gap: 10px; }
.app-usage > div { display: grid; grid-template-columns: minmax(80px, 0.8fr) minmax(80px, 1fr) 44px; align-items: center; gap: 8px; font-size: 0.62rem; }
.app-usage i { height: 4px; overflow: hidden; border-radius: 2px; background: #1c2622; }
.app-usage i b { display: block; height: 100%; background: var(--accent); }
.app-usage strong { text-align: right; }
.live-badge { color: var(--accent); font-size: 0.6rem; }
.device-list { display: grid; margin-top: 8px; }
.device-list > div { display: grid; grid-template-columns: 8px minmax(0, 1fr) 30px; align-items: center; gap: 9px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.device-list > div > i { width: 7px; height: 7px; border-radius: 50%; background: #4b5652; }
.device-list > div > i.online { background: var(--accent); box-shadow: 0 0 12px rgba(197, 255, 56, 0.5); }
.device-list span { display: grid; gap: 3px; min-width: 0; }
.device-list strong { font-size: 0.67rem; }
.device-list small { overflow: hidden; color: var(--muted); font-size: 0.56rem; text-overflow: ellipsis; white-space: nowrap; }
.context-table { display: grid; }
.context-table > div:not(.section-head) { display: grid; grid-template-columns: minmax(100px, 0.45fr) minmax(130px, 0.65fr) minmax(180px, 1fr) 56px; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 0.64rem; }
.context-table span,
.context-table small { color: var(--muted); }
.context-table b { color: var(--accent); text-align: right; }
.time-coach { display: grid; gap: 15px; padding: 16px; }
.time-coach-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.time-coach-head h2 { margin: 4px 0; }
.time-coach-head p:last-child { margin: 0; color: var(--muted); font-size: 0.68rem; }
.time-coach-badge { flex: 0 0 auto; padding: 6px 8px; border: 1px solid rgba(197, 255, 56, 0.25); border-radius: 5px; color: var(--accent); font-size: 0.55rem; font-weight: 750; }
.time-coach-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.time-coach-stats article { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 6px; background: #0b1013; }
.time-coach-stats span { color: var(--muted); font-size: 0.6rem; }
.time-coach-stats strong { overflow-wrap: anywhere; color: var(--ink); font-size: 1.12rem; font-variant-numeric: tabular-nums; }
.time-coach-stats small { color: #7d8984; font-size: 0.58rem; line-height: 1.45; }
.time-coach-advice { display: grid; grid-template-columns: minmax(120px, 0.22fr) minmax(0, 1fr); gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.time-coach-advice > strong { font-size: 0.68rem; }
.time-coach-advice ul { display: grid; gap: 6px; margin: 0; padding-left: 16px; color: #aab5b0; font-size: 0.63rem; line-height: 1.5; }
.time-coach-advice li::marker { color: var(--accent); }
.mx-time-downloads { display: grid; gap: 10px; }
.download-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.download-actions .btn { display: grid; place-items: center; min-height: 38px; padding: 8px 10px; text-align: center; text-decoration: none; font-size: 0.62rem; }
.download-actions .secondary { border: 1px solid var(--line); background: #10171a; color: var(--ink); }
.download-note { color: var(--muted); font-size: 0.58rem; line-height: 1.5; }
.download-note a { color: var(--accent); }

.rental-auth-link { display: block; margin-top: 8px; color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.mx-mark { box-shadow: 0 0 20px rgba(197, 255, 56, 0.08); }
.nav-button.active { box-shadow: inset 2px 0 0 var(--accent), 0 0 22px rgba(98, 217, 255, 0.05); }
.page-title h1, .section-head h2, .panel h2 { text-shadow: 0 0 24px rgba(98, 217, 255, 0.045); }
.admin-tabs .tab.active { box-shadow: inset 0 -2px 0 var(--accent); }
.rental-admin { padding: 16px; }
.rental-admin .section-head { align-items: flex-start; }
.rental-admin .section-head h2 { margin: 0; }
.rental-request-list { display: grid; gap: 8px; }
.rental-request { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: #0d131a; }
.rental-request-main { min-width: 0; }
.rental-request-main > p { margin: 7px 0; color: var(--muted); font-size: .72rem; }
.rental-request-main a { color: var(--accent-2); }
.rental-request-lines { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rental-request-lines > span { padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); font-size: .66rem; }
.rental-request-lines small { margin-left: 6px; color: var(--accent); }
.rental-status-form { display: grid; align-content: center; gap: 8px; }
.rental-status-form label { display: grid; gap: 5px; color: var(--muted); font-size: .65rem; }
.empty-state { display: grid; justify-items: start; gap: 5px; padding: 22px 0; }
.empty-state p { margin: 0 0 8px; color: var(--muted); font-size: .72rem; }
.empty-state a { display: inline-flex; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; color: var(--accent-2); text-decoration: none; }

@media (max-width: 1050px) {
  .module-launchpad { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insight-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .time-layout { grid-template-columns: 1fr; }
  .time-coach-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .time-coach-head { display: grid; }
  .download-actions { grid-template-columns: 1fr; }
  .time-coach-badge { justify-self: start; }
  .time-coach-advice { grid-template-columns: 1fr; gap: 7px; }
  .rental-request { grid-template-columns: 1fr; }
  .rental-status-form { grid-template-columns: 1fr auto; align-items: end; }
  .app-shell { display: block; }
  .sidebar { width: 100%; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { min-height: 38px; padding-bottom: 8px; }
  .main-nav { display: grid; grid-template-columns: repeat(5, minmax(92px, 1fr)); overflow-x: auto; }
  .nav-button { justify-content: center; }
  .sidebar-project-switcher,
  .admin-mini,
  .user-box { display: none; }
  .sidebar > #logout { position: absolute; top: 13px; right: 12px; display: block; width: 68px; min-height: 32px; padding: 0 8px; font-size: 0.6rem; }
  .content { padding: 15px 12px 32px; }
  .home-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-launchpad { grid-template-columns: 1fr; }
  .module-launchpad small { white-space: normal; }
  .insight-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .context-table { overflow-x: auto; }
  .context-table > div:not(.section-head) { min-width: 650px; }
}

@media (max-width: 430px) {
  .insight-cards,
  .home-metrics { grid-template-columns: 1fr; }
  .home-header { align-items: stretch; }
  .header-actions .btn { width: 100%; }
}

/* MXVFRAMES wordmark based on the supplied reference. */
.brand { align-items: center; gap: 10px; }
.brand .mxv-wordmark { width: 76px; }
.mxv-wordmark { display: inline-grid; grid-template-columns: 1fr; gap: 0; color: var(--ink); text-decoration: none; line-height: .94; }
.mxv-wordmark strong { font-family: Arial, Helvetica, "SF Pro Text", sans-serif; font-size: 1.32rem; font-weight: 900; letter-spacing: 0; }
.mxv-wordmark span { display: flex; justify-content: space-between; margin-top: 4px; color: var(--ink); font-family: Arial, Helvetica, "SF Pro Text", sans-serif; font-size: .44rem; font-weight: 800; letter-spacing: .12em; line-height: 1; }
.brand > small, .login-brandbar > small { color: var(--muted); font-size: .52rem; font-weight: 700; letter-spacing: .12em; }
.brand > small { align-self: center; padding-left: 10px; border-left: 1px solid var(--line); }
.login-brandbar { justify-content: flex-start; gap: 14px; }
.login-brandbar .mxv-wordmark strong { font-size: 1.5rem; }
.login-brandbar .mxv-wordmark span { font-size: .49rem; }
.login-brandbar > small { padding-left: 13px; border-left: 1px solid var(--line); }

@media (max-width: 430px) {
  .brand .mxv-wordmark { width: 70px; }
  .brand .mxv-wordmark strong { font-size: 1.18rem; }
  .brand > small { font-size: .46rem; }
}

/* MXVFRAMES Design System: warm paper, ink, and restrained signals. */
@font-face {
  font-family: "Satoshi";
  src: url("assets/Satoshi-500.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Satoshi";
  src: url("assets/Satoshi-900.woff2") format("woff2");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f5f5ef;
  --panel: #ffffff;
  --panel-2: #f4f4f5;
  --ink: #10100e;
  --muted: #71717a;
  --line: #e4e4e7;
  --line-strong: #a1a1aa;
  --accent: #10100e;
  --accent-2: #71717a;
  --brand-cream: #ffffe3;
  --focus: #e92f32;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --surface-soft: rgba(255, 255, 255, 0.94);
  --surface-glass: rgba(255, 255, 255, 0.98);
  --shadow: 0 4px 16px rgba(1, 3, 4, 0.08);
  --font: "Satoshi", "Helvetica Neue", Arial, system-ui, sans-serif;
}

html,
body,
body::before { background: var(--bg); }
body {
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}
body::before { display: none; }
button, input, select, textarea { font-family: var(--font); }
button, input, select, textarea, a { letter-spacing: 0; }
a { color: var(--ink); }
a:hover { color: #3f3f46; }
::selection { background: var(--brand-cream); color: var(--ink); }
:focus-visible {
  outline: 3px solid var(--focus) !important;
  outline-offset: 3px;
}

.app-shell { background: var(--bg); }
.sidebar {
  color: #fff;
  background: var(--ink);
  border-right-color: rgba(255, 255, 255, 0.12);
}
.sidebar::before { background: var(--brand-cream); box-shadow: none; }
.brand .mxv-wordmark { color: #fff; }
.brand > small { color: rgba(255, 255, 255, 0.6); border-color: rgba(255, 255, 255, 0.22); }
.brand span, .sidebar-label, .sidebar .muted { color: rgba(255, 255, 255, 0.62); }
.sidebar-project-switcher,
.command-launcher,
.admin-mini,
.user-box {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.045);
  color: #fff;
  box-shadow: none;
}
.sidebar-project-switcher label { color: rgba(255, 255, 255, 0.66); }
.sidebar-project-switcher select { border-color: rgba(255, 255, 255, 0.2); background: #1b1d1f; color: #fff; }
.command-launcher { color: rgba(255, 255, 255, 0.82); }
.command-launcher:hover { border-color: var(--brand-cream); background: rgba(255, 255, 227, 0.08); color: #fff; }
.command-launcher kbd { color: var(--brand-cream); }
.nav-button { color: rgba(255, 255, 255, 0.72); }
.nav-button:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-button.active {
  background: rgba(255, 255, 227, 0.12);
  color: var(--brand-cream);
  box-shadow: inset 3px 0 0 var(--brand-cream);
}
.nav-count { background: var(--brand-cream); color: var(--ink); }
.sidebar .btn.secondary,
.sidebar #logout { border-color: rgba(255, 255, 255, 0.22); background: transparent; color: #fff; }
.sidebar .btn.secondary:hover,
.sidebar #logout:hover { border-color: var(--brand-cream); background: rgba(255, 255, 227, 0.1); }

.content { color: var(--ink); }
.content::before { display: none; }
.topbar { border-color: var(--line); background: transparent; box-shadow: none; }
.page-title h1, .home-header h1, .section-head h2, .panel h2,
.studio-toolbar h2, .studio-module > header h2 { color: var(--ink); text-shadow: none; }
.eyebrow { color: var(--muted); }
.muted, .page-title .muted, .home-header > div > p:last-child { color: var(--muted); }

.workspace-primary {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
}
.workspace-stage { color: var(--muted); }
.workspace-stage:hover { background: var(--panel-2); color: var(--ink); }
.workspace-stage.active { background: var(--ink); color: #fff; }
.workspace-stage.active::after { background: var(--brand-cream); box-shadow: none; }
.workspace-secondary { border-color: var(--line); }
.workspace-secondary .tab { color: var(--muted); }
.workspace-secondary .tab.active,
.workspace-secondary .tab.active:hover { border-color: var(--ink); background: var(--ink); color: #fff; }
.workspace-secondary .tab.active::after { background: var(--brand-cream); }
.tab { border-color: transparent; }
.tab:hover { background: var(--panel-2); color: var(--ink); }

.btn {
  border-color: var(--ink);
  border-radius: var(--r-sm, 4px);
  background: var(--ink);
  color: #fff;
  box-shadow: none;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.btn:hover { border-color: #3f3f46; background: #3f3f46; color: #fff; box-shadow: none; transform: translateY(-1px); }
.btn.secondary,
.btn.ghost,
.mini,
.icon-btn {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink);
}
.btn.secondary:hover, .btn.ghost:hover, .mini:hover, .icon-btn:hover {
  border-color: var(--ink);
  background: var(--panel-2);
  color: var(--ink);
}
.btn:disabled { opacity: 0.48; }

.panel, .finance-command, .finance-chart, .studio-module, .action-center,
.capacity-center, .finance-kpis, .home-metrics > div, .home-metrics > div + div,
.insight-cards article {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.panel:hover, .item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.panel h3, .panel h4, .panel strong, .item strong { color: var(--ink); }
.item, .rental-request, .module-launchpad button, .home-task-list > button,
.portfolio-row, .calendar-event, .timecode, .workspace-group,
.project-command-deck, .project-card, .contact-card, .equipment-card {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}
.module-launchpad button:hover { border-color: var(--line-strong); background: var(--panel-2); transform: translateY(-1px); }
.module-launchpad i { background: var(--brand-cream); color: var(--ink); }
.module-launchpad small, .insight-cards small { color: var(--muted); }
.insight-cards article { border-top-color: var(--ink); }
.home-metrics span, .home-metrics small, .finance-chart-head small { color: var(--muted); }
.finance-chart-legend button:hover, .finance-chart-legend button.active { background: var(--panel-2); }
.finance-chart-legend button i.profit, .finance-lead strong, .finance-result strong { color: var(--ink); }
.finance-chart-legend button i.profit { background: var(--ink); box-shadow: none; }
.finance-chart-legend button i.cost { background: #a1a1aa; }
.finance-chart-legend button i.overrun { background: var(--danger); box-shadow: none; }
.portfolio-progress i { background: var(--ink); }
.status-label, .rental-auth-link, .empty-state a { color: #3f3f46; }
.workflow-hint, .radar-signals div { border-color: var(--line); background: var(--panel-2); color: var(--muted); }
.radar-signals div { border-left-color: var(--ink); }
.radar-score strong { color: var(--ink); }
.priority-dot { background: #a1a1aa; }

input, select, textarea {
  border-color: var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}
input::placeholder, textarea::placeholder { color: #71717a; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ink); }
label, .form-label { color: var(--ink); }
table, .admin-table, .context-table { color: var(--ink); }
th { background: var(--panel-2); color: var(--ink); }
td, th, .context-table > div:not(.section-head) { border-color: var(--line); }

.glass-modal, .glass-card {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}
.glass-modal {
  box-shadow: 0 24px 80px rgba(1, 3, 4, 0.22);
  backdrop-filter: none;
}
.modal-backdrop { background: rgba(16, 16, 14, 0.58); backdrop-filter: blur(8px); }
.modal-head h2, .glass-modal h2 { color: var(--ink); }
.legal-provider, .legal-scroll, .export-box {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}
.legal-scroll p { color: #3f3f46; }
.legal-scroll h3 { color: var(--ink); }
.legal-section-number { color: var(--muted); }
.modal-actions { background: #fff; }
.global-loader > div { border-color: var(--line); background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.global-loader::after, .boot-loader i, .global-loader i { background: var(--ink); box-shadow: none; }
.boot-loader, .boot-loader strong, .boot-loader small { background: var(--bg); color: var(--ink); }
.boot-loader > span, .global-loader .loader-track { background: var(--line); }

.offline-notice, .toast, #toast { border-color: var(--line); background: var(--ink); color: #fff; box-shadow: var(--shadow); }
.login { background: var(--bg); }
.login-brandbar { border-color: var(--line); background: rgba(245, 245, 239, 0.94); }
.login-brandbar .mxv-wordmark { color: var(--ink); }
.login-panel, .login-card, .register-card { border-color: var(--line); background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.login-panel {
  width: min(100%, 480px);
  min-height: 0;
  align-self: center;
  margin: 24px auto;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: 8px;
  backdrop-filter: none;
}
.login-panel input {
  border-color: #d4d4d8;
  background: #fff;
  color: var(--ink);
}
.login-panel input::placeholder { color: #71717a; }
.login h1, .login h2, .login h3 { color: var(--ink); }
.login p, .login .muted { color: var(--muted); }
.login .legal-open { border-color: var(--line-strong); background: var(--panel-2); color: var(--ink); }
.login .legal-open:hover { border-color: var(--ink); background: var(--brand-cream); }
.rental-request-main a { color: var(--ink); }
.danger-btn { background: var(--danger); color: #fff; }

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

/* MX Production OS dark workspace. Signals stay vivid and semantic. */
:root {
  color-scheme: dark;
  --bg: #0b0e12; --panel: #12171d; --panel-2: #1a2129;
  --ink: #f4f5f2; --muted: #a6b0ba; --line: #2a333d; --line-strong: #53606d;
  --accent: #ffffe3; --accent-2: #57c7ff; --brand-cream: #ffffe3;
  --focus: #ff6b8a; --ok: #42dfa2; --warn: #ffc45b; --danger: #ff6b7f;
  --surface-soft: #151b21; --surface-glass: #151b21; --shadow: 0 8px 24px rgba(0,0,0,.24);
}
html, body, .app-shell, .content { background: var(--bg); color: var(--ink); }
body::before, .content::before { display: none; }
a { color: #dce5ec; } a:hover { color: var(--accent-2); }
.sidebar { background: #080a0d; color: var(--ink); border-right-color: var(--line); }
.brand .mxv-wordmark, .brand .mxv-wordmark span { color: var(--ink); }
.brand > small, .brand span, .sidebar-label, .sidebar .muted, .sidebar-project-switcher label { color: #aab4be; }
.sidebar-project-switcher, .command-launcher, .admin-mini, .user-box { border-color: var(--line); background: #10151a; color: var(--ink); }
.sidebar-project-switcher select { border-color: var(--line-strong); background: #151c23; color: var(--ink); }
.command-launcher:hover, .nav-button:hover { border-color: #445461; background: #171f26; color: #fff; }
.command-launcher kbd, .command-record span { color: var(--accent-2); }
.nav-button { color: #c0c9d1; }
.nav-button.active { background: #1a2229; color: var(--accent); box-shadow: inset 3px 0 0 var(--accent-2); }
.nav-count { background: var(--accent-2); color: #071018; }
.sidebar .btn.secondary, .sidebar #logout { border-color: var(--line-strong); background: transparent; color: var(--ink); }
.topbar { border-color: var(--line); }
.page-title h1, .home-header h1, .section-head h2, .panel h2, .studio-toolbar h2, .studio-module > header h2,
.panel h3, .panel h4, .panel strong, .item strong, .modal-head h2, .glass-modal h2 { color: var(--ink); }
.eyebrow { color: #b5c0c9; }
.muted, .page-title .muted, .home-header > div > p:last-child, .module-launchpad small, .insight-cards small,
.home-metrics span, .home-metrics small, .finance-chart-head small { color: var(--muted); }
.workspace-primary, .panel, .finance-command, .finance-chart, .studio-module, .action-center, .capacity-center,
.finance-kpis, .home-metrics > div, .home-metrics > div + div, .insight-cards article {
  border-color: var(--line); background: var(--panel); color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.16);
}
.workspace-stage { color: var(--muted); }
.workspace-stage:hover, .tab:hover, .finance-chart-legend button:hover, .finance-chart-legend button.active { background: var(--panel-2); color: var(--ink); }
.workspace-stage.active, .workspace-secondary .tab.active, .workspace-secondary .tab.active:hover { border-color: var(--line-strong); background: #252d35; color: var(--ink); }
.workspace-stage.active::after, .workspace-secondary .tab.active::after { background: var(--accent-2); }
.workspace-secondary, .tab { border-color: var(--line); }
.btn { border-color: var(--accent); background: var(--accent); color: #11130f; }
.btn:hover { border-color: #f0f0d0; background: #f0f0d0; color: #11130f; }
.btn.secondary, .btn.ghost, .mini, .icon-btn { border-color: var(--line-strong); background: #1a2129; color: var(--ink); }
.btn.secondary:hover, .btn.ghost:hover, .mini:hover, .icon-btn:hover { border-color: var(--accent-2); background: #202a33; color: #fff; }
.item, .rental-request, .module-launchpad button, .home-task-list > button, .portfolio-row, .calendar-event, .timecode,
.workspace-group, .project-command-deck, .project-card, .contact-card, .equipment-card, .workflow-hint, .radar-signals div {
  border-color: var(--line); background: #151b21; color: var(--ink);
}
.module-launchpad button:hover { border-color: var(--accent-2); background: #1b252e; }
.module-launchpad i { background: #17384a; color: var(--accent-2); }
.insight-cards article { border-top-color: var(--accent-2); }
.finance-chart-legend button i.profit, .finance-lead strong, .finance-result strong, .radar-score strong { color: var(--ok); }
.finance-chart-legend button i.profit, .portfolio-progress i { background: var(--ok); }
.finance-chart-legend button i.cost { background: var(--accent-2); }
.finance-chart-legend button i.overrun { background: var(--danger); }
.status-label, .rental-auth-link, .empty-state a { color: var(--accent-2); }
.radar-signals div { border-left-color: var(--accent-2); }
.priority-dot { background: var(--accent-2); }
.action-priority.p0, .finance-signal.critical { color: var(--danger); }
.action-priority.p1, .finance-signal.watch { color: var(--warn); }
.action-priority.p2 { color: var(--accent-2); }
input, select, textarea, .login-panel input { border-color: var(--line-strong); background: #10161c; color: var(--ink); }
input::placeholder, textarea::placeholder, .login-panel input::placeholder { color: #a6b0ba; opacity: 1; }
input:focus, select:focus, textarea:focus, .login-panel input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 1px var(--accent-2); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent-2); }
label, .form-label { color: #e4e9ed; }
table, .admin-table, .context-table { color: var(--ink); }
th { background: #1b232b; color: #eff3f5; }
td, th, .context-table > div:not(.section-head) { border-color: var(--line); }
tr:hover td { background: rgba(87,199,255,.045); }
.glass-modal, .glass-card, .legal-provider, .legal-scroll, .export-box, .modal-actions, .global-loader > div,
.login-panel, .login-card, .register-card { border-color: var(--line); background: #141a20; color: var(--ink); }
.glass-modal { box-shadow: 0 24px 80px rgba(0,0,0,.62); }
.modal-backdrop { background: rgba(0,0,0,.74); }
.legal-scroll p { color: #c3ccd3; }
.legal-scroll h3, .login h1, .login h2, .login h3 { color: var(--ink); }
.login-brandbar { border-color: var(--line); background: #090c10; }
.login-brandbar .mxv-wordmark { color: var(--ink); }
.login .legal-open { border-color: var(--line-strong); background: #1a2129; color: var(--ink); }
.login .legal-open:hover { border-color: var(--accent-2); background: #17384a; }
.boot-loader, .boot-loader strong, .boot-loader small { background: var(--bg); color: var(--ink); }
.boot-loader > span, .global-loader .loader-track { background: var(--line); }
.global-loader::after, .boot-loader i, .global-loader i { background: var(--accent-2); }
.offline-notice, .toast, #toast { border-color: var(--line); background: #182129; color: var(--ink); }
.danger-btn { background: #9f2639; color: #fff; }
.danger-btn:hover { background: #c2394f; }
.status, .status-pill, .status-badge { color: var(--ok); }
::selection { background: #24546b; color: #fff; }
@media (max-width: 760px) { .sidebar { background: #080a0d; } .workspace-primary { background: var(--panel); } }
