@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@600;700;800&family=Inter:wght@400;500;600;700;800;900&family=Playfair+Display:wght@600;700&family=Space+Grotesk:wght@600;700&display=swap');

:root {
  color-scheme: light;
  --bg: #EDE8E1;
  --surface: #FAFAF8;
  --surface-alt: #FFFFFF;
  --surface-raised: #F2EEE8;
  --ink: #18212b;
  --muted: #657386;
  --line: #D9D4CC;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --brand-soft: rgba(15, 118, 110, 0.1);
  --blue: #2563eb;
  --gold: #b7791f;
  --red: #c2414b;
  --green: #15803d;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 3px 8px -2px rgba(0, 0, 0, 0.03);
  --shadow-raised: 0 14px 34px rgba(0, 0, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.05);
  --font-ui: Inter, Aptos, "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Arial, Helvetica, sans-serif;
  --font-display: "Space Grotesk", Inter, Aptos, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --font-data: Inter, "Segoe UI", Aptos, ui-sans-serif, system-ui, sans-serif;
}

/* OS V3 decision pass
   Keeps the current OS information architecture, then applies the approved
   direction from Website > OS Comparison: stronger shell, warmer active
   states, clearer topbar elevation, category-dot stat cards, and richer
   empty states. */
:root {
  --os-shell-v3: #0A2E38;
  --os-shell-v3-dark: #071E28;
  --os-accent-v3: #C45520;
  --os-accent-v3-dark: #A84418;
  --os-stone-v3: #EDE8E1;
  --os-stone-v3-dark: #D9D4CC;
  --bg: #EDE8E1;
  --surface: #FAFAF8;
  --surface-alt: #FFFFFF;
  --surface-raised: #F2EEE8;
  --line: #D9D4CC;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 3px 8px -2px rgba(0, 0, 0, 0.03);
  --shadow-raised: 0 14px 34px rgba(0, 0, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.05);
}

.sidebar {
  background:
    radial-gradient(circle at 100% 0%, rgba(196, 85, 32, 0.10), transparent 34%),
    var(--os-shell-v3);
  border-right-color: rgba(255, 255, 255, 0.08);
  box-shadow: 3px 0 18px rgba(7, 30, 40, 0.32);
}

.brand {
  padding: 18px 10px 22px;
}

.brand-logo {
  width: min(176px, 100%);
}

.nav-section-title {
  margin: 20px 10px 7px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.nav-item {
  position: relative;
  border-left-color: transparent;
  border-radius: 10px;
  transition: background 150ms cubic-bezier(0.2, 0, 0, 1), color 150ms cubic-bezier(0.2, 0, 0, 1), transform 150ms cubic-bezier(0.2, 0, 0, 1);
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(1px);
}

.nav-item.active {
  border-left-color: transparent;
  background: #115e75;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 18px rgba(7, 30, 40, 0.18);
}

.nav-item.active::before {
  background: var(--os-accent-v3);
}

.nav-item.active .nav-icon {
  background: rgba(196, 85, 32, 0.18);
  color: #ffe1d1;
}

.nav-icon {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
}

.topbar {
  min-height: 64px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: rgba(13, 13, 15, 0.10);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 14px 30px rgba(15, 23, 42, 0.07);
}

.search-wrap {
  flex-basis: 500px;
}

.search-wrap input,
.list-tools input {
  border-color: rgba(13, 13, 15, 0.14);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.topbar-actions {
  border-left-color: rgba(13, 13, 15, 0.10);
}

.primary-button {
  border-radius: 10px;
  background: var(--os-accent-v3);
  box-shadow: 0 10px 22px rgba(196, 85, 32, 0.18);
  transition: background 150ms cubic-bezier(0.2, 0, 0, 1), box-shadow 150ms cubic-bezier(0.2, 0, 0, 1), transform 150ms cubic-bezier(0.2, 0, 0, 1);
}

.primary-button:hover {
  background: var(--os-accent-v3-dark);
  box-shadow: 0 14px 28px rgba(196, 85, 32, 0.24);
  transform: translateY(-1px);
}

.secondary-button,
.icon-button,
.user-button,
.notification-button,
.action-list button {
  border-radius: 10px;
}

.stat-card,
.panel {
  background: #FAFAF8;
  border-color: #D9D4CC;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.stat-card {
  background: #FAFAF8;
  padding: 17px 18px;
}

.stat-card::before {
  inset: 16px 16px auto auto;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--brand);
  opacity: 1;
  box-shadow: 0 0 0 5px rgba(15, 118, 110, 0.10);
}

.stat-grid .stat-card:nth-child(2)::before {
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.10);
}

.stat-grid .stat-card:nth-child(3)::before {
  box-shadow: 0 0 0 5px rgba(21, 128, 61, 0.10);
}

.stat-grid .stat-card:nth-child(4)::before {
  box-shadow: 0 0 0 5px rgba(183, 121, 31, 0.12);
}

.stat-grid .stat-card:nth-child(5)::before {
  box-shadow: 0 0 0 5px rgba(194, 65, 75, 0.10);
}

.stat-grid .stat-card:nth-child(6)::before {
  background: var(--os-accent-v3);
  box-shadow: 0 0 0 5px rgba(196, 85, 32, 0.12);
}

a.stat-card:hover {
  border-color: rgba(196, 85, 32, 0.34);
  background: #fffdf8;
  box-shadow: var(--shadow-raised);
  transform: translateY(-2px);
}

.stat-label {
  font-size: 12px;
  letter-spacing: 0.10em;
}

.stat-card strong {
  font-size: clamp(32px, 2.7vw, 42px);
  font-weight: 700;
}

.subnav {
  background: rgba(237, 232, 225, 0.72);
  border-color: #D9D4CC;
  border-radius: 10px;
}

.pill {
  border-radius: 999px;
  transition: background 150ms cubic-bezier(0.2, 0, 0, 1), border-color 150ms cubic-bezier(0.2, 0, 0, 1), color 150ms cubic-bezier(0.2, 0, 0, 1);
}

.pill.active {
  background: rgba(196, 85, 32, 0.12);
  border-color: rgba(196, 85, 32, 0.34);
  color: var(--os-accent-v3-dark);
}

.workshop-card-action {
  border-color: rgba(196, 85, 32, 0.24);
  border-radius: 10px;
  background: rgba(196, 85, 32, 0.10);
  color: var(--os-accent-v3-dark);
}

.workshop-card-action:hover {
  border-color: rgba(196, 85, 32, 0.42);
  background: rgba(196, 85, 32, 0.14);
}

.table-empty-state,
.inline-empty-state {
  position: relative;
  min-height: 150px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 0%, rgba(196, 85, 32, 0.10), transparent 58%),
    #fafaf8;
}

.table-empty-state > span {
  width: 44px;
  height: 44px;
  border-color: rgba(196, 85, 32, 0.22);
  border-radius: 13px;
  background: rgba(196, 85, 32, 0.12);
  color: var(--os-accent-v3);
}

.inline-empty-state::before {
  border-color: rgba(196, 85, 32, 0.28);
  background:
    linear-gradient(135deg, transparent 48%, rgba(196, 85, 32, 0.46) 49%, rgba(196, 85, 32, 0.46) 52%, transparent 53%) 8px 16px / 36px 12px no-repeat,
    linear-gradient(90deg, rgba(196, 85, 32, 0.16), rgba(196, 85, 32, 0.04));
}

[data-theme="dark"] {
  --os-shell-v3: #071E28;
  --os-shell-v3-dark: #04141B;
  --os-stone-v3: #171C20;
  --os-stone-v3-dark: #21282D;
}

[data-theme="dark"] .sidebar {
  background:
    radial-gradient(circle at 100% 0%, rgba(196, 85, 32, 0.12), transparent 34%),
    var(--os-shell-v3-dark);
}

[data-theme="dark"] .nav-item.active {
  background: rgba(17, 94, 117, 0.72);
}

[data-theme="dark"] .topbar {
  background: rgba(26, 29, 36, 0.96);
}

[data-theme="dark"] .stat-card {
  background: #1c2026;
}

[data-theme="dark"] .subnav {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .pill.active {
  background: rgba(196, 85, 32, 0.16);
  border-color: rgba(196, 85, 32, 0.36);
  color: #f1a06b;
}

[data-theme="dark"] .table-empty-state,
[data-theme="dark"] .inline-empty-state {
  background:
    radial-gradient(circle at 50% 0%, rgba(196, 85, 32, 0.12), transparent 58%),
    var(--surface);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1117;
  --surface: #1a1d24;
  --surface-alt: #21242d;
  --surface-raised: #2a2d38;
  --ink: #e8eaf0;
  --muted: #8b90a0;
  --line: #2a2d35;
  --brand: #1d9e75;
  --brand-dark: #159060;
  --brand-soft: rgba(29, 158, 117, 0.12);
  --blue: #4d8ef0;
  --gold: #d4960a;
  --red: #e05560;
  --green: #22c55e;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-raised: 0 14px 32px rgba(0, 0, 0, 0.35), 0 2px 10px rgba(0, 0, 0, 0.26);
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .sidebar {
  background: #0b0e13;
  border-right: 1px solid #1e2128;
}

[data-theme="dark"] .nav-item:hover,
[data-theme="dark"] .nav-item.active {
  background: rgba(29, 158, 117, 0.14);
}

[data-theme="dark"] .topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

[data-theme="dark"] table {
  background: var(--surface);
}

[data-theme="dark"] th {
  background: var(--surface-alt);
  color: var(--muted);
}

[data-theme="dark"] tbody tr:hover {
  background: var(--surface-alt);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--surface-alt);
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--muted);
}

[data-theme="dark"] .panel,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .chart-card,
[data-theme="dark"] .widget-card {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

[data-theme="dark"] .panel > .panel-header {
  background: var(--surface);
  border-bottom-color: var(--line);
}

[data-theme="dark"] .subnav {
  background: var(--surface-alt);
  border-color: var(--line);
}

[data-theme="dark"] .pill.active {
  background: var(--surface-raised);
  border-color: rgba(29, 158, 117, 0.35);
  color: var(--brand);
}

[data-theme="dark"] .secondary-button,
[data-theme="dark"] .icon-button,
[data-theme="dark"] .user-button,
[data-theme="dark"] .notification-button {
  background: var(--surface-alt);
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .secondary-button:hover,
[data-theme="dark"] .icon-button:hover,
[data-theme="dark"] .user-button:hover,
[data-theme="dark"] .notification-button:hover {
  background: var(--surface-raised);
  border-color: var(--muted);
}

[data-theme="dark"] .badge {
  background: var(--surface-raised);
  color: var(--muted);
}

[data-theme="dark"] .detail-panel {
  background: var(--surface);
  border-left: 1px solid var(--line);
}

[data-theme="dark"] .search-results-menu {
  background: var(--surface);
  border-color: var(--line);
}

[data-theme="dark"] .notification-menu,
[data-theme="dark"] .user-menu {
  background: var(--surface);
  border-color: var(--line);
}

[data-theme="dark"] .notification-row,
[data-theme="dark"] .user-menu a:hover,
[data-theme="dark"] .user-menu button:hover {
  background: var(--surface-alt);
}

[data-theme="dark"] .badge.ok {
  background: rgba(34, 197, 94, 0.12);
  color: var(--green);
}

[data-theme="dark"] .badge.neutral {
  background: var(--surface-raised);
  color: var(--muted);
}

[data-theme="dark"] .badge.warn {
  background: rgba(212, 150, 10, 0.14);
  color: var(--gold);
}

[data-theme="dark"] .badge.danger {
  background: rgba(224, 85, 96, 0.14);
  color: var(--red);
}

[data-theme="dark"] .badge.info {
  background: rgba(77, 142, 240, 0.14);
  color: var(--blue);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 120ms, background 120ms;
}

.theme-toggle:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-moon {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.35;
}

::selection {
  background: rgba(15, 118, 110, 0.18);
}

body.is-locked {
  overflow: hidden;
}

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

input::placeholder,
textarea::placeholder {
  color: #8a96a5;
}

select option {
  background: var(--surface);
  color: var(--ink);
}

button,
a {
  cursor: pointer;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(420px, 0.85fr);
  background: #0e151d;
  color: #f8fafc;
  overflow: auto;
}

.login-screen-internal {
  --login-accent: #36d6b3;
  --login-accent-strong: #0f766e;
  --login-panel: #101820;
  --login-field: #131f29;
  --login-line: rgba(203, 213, 225, 0.18);
  --login-visual-a: #071018;
  --login-visual-b: #132431;
}

.login-screen-portal {
  --login-accent: #d6b36a;
  --login-accent-strong: #a9813c;
  --login-panel: #12110f;
  --login-field: #1a1814;
  --login-line: rgba(246, 230, 195, 0.18);
  --login-visual-a: #0d0b09;
  --login-visual-b: #231d14;
}

.login-screen-builder {
  --login-accent: #c08352;
  --login-accent-strong: #8b5e3c;
  --login-panel: #151311;
  --login-field: #201b16;
  --login-line: rgba(246, 220, 196, 0.18);
  --login-visual-a: #14100d;
  --login-visual-b: #302015;
}

.login-screen.hidden {
  display: none;
}

.login-visual {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  contain: paint;
  isolation: isolate;
  clip-path: inset(0);
  padding: clamp(34px, 6vw, 78px);
  background:
    radial-gradient(circle at 20% 14%, color-mix(in srgb, var(--login-accent) 26%, transparent), transparent 28%),
    radial-gradient(circle at 78% 82%, color-mix(in srgb, var(--login-accent) 18%, transparent), transparent 34%),
    linear-gradient(135deg, var(--login-visual-a), var(--login-visual-b));
}

.login-visual::before {
  content: "";
  position: absolute;
  inset: 9% 8% 12% 12%;
  opacity: 0.34;
  background:
    linear-gradient(90deg, transparent 0 18%, color-mix(in srgb, var(--login-accent) 44%, transparent) 18% 18.25%, transparent 18.25% 100%),
    linear-gradient(0deg, transparent 0 28%, color-mix(in srgb, var(--login-accent) 32%, transparent) 28% 28.25%, transparent 28.25% 100%),
    linear-gradient(135deg, transparent 0 49.8%, color-mix(in srgb, var(--login-accent) 40%, transparent) 50%, transparent 50.25% 100%);
  border: 1px solid color-mix(in srgb, var(--login-accent) 22%, transparent);
  border-radius: 22px;
  transform: perspective(900px) rotateY(-8deg) rotateX(2deg);
}

.login-visual::after {
  content: "";
  position: absolute;
  width: min(64vw, 860px);
  aspect-ratio: 1;
  right: -9%;
  top: 3%;
  background: var(--login-accent);
  opacity: 0.045;
  -webkit-mask: url("/images/ontic-logo-mark-exact.png") center / contain no-repeat;
  mask: url("/images/ontic-logo-mark-exact.png") center / contain no-repeat;
  pointer-events: none;
  filter: drop-shadow(-34px 46px 28px rgba(0, 0, 0, 0.42)) drop-shadow(0 0 42px color-mix(in srgb, var(--login-accent) 26%, transparent));
  transform: perspective(1100px) translateZ(-40px) rotateY(-28deg) rotateX(5deg) rotateZ(-11deg);
  transform-origin: right center;
}

.login-visual-content {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  display: grid;
  gap: 18px;
}

.login-visual-logo {
  width: min(250px, 62vw);
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.login-visual-kicker {
  width: fit-content;
  margin: 24px 0 0;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--login-accent) 36%, transparent);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--login-accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-visual h2 {
  max-width: 13ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(46px, 6.4vw, 86px);
  line-height: 0.98;
  letter-spacing: 0;
}

.login-screen-builder .login-visual h2 {
  font-family: "Archivo", var(--font-ui);
  max-width: 15ch;
}

.login-screen-portal .login-visual h2 {
  font-family: "Playfair Display", Georgia, serif;
  max-width: 12ch;
  line-height: 1.04;
}

.login-visual-content > p:last-child {
  max-width: 56ch;
  margin: 0;
  color: rgba(248, 250, 252, 0.76);
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.55;
}

.login-panel {
  min-height: 100vh;
  width: 100%;
  display: grid;
  align-content: center;
  background: var(--login-panel);
  border-left: 1px solid var(--login-line);
  box-shadow: -18px 0 46px rgba(0, 0, 0, 0.28);
  padding: clamp(28px, 5vw, 72px);
}

.brand-block {
  display: grid;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.login-copy {
  margin: 0 0 28px;
}

.login-form-logo {
  width: min(190px, 70%);
  margin-bottom: 34px;
  filter: brightness(0) invert(1);
  opacity: 0.94;
}

.login-copy h1 {
  margin: 0 0 12px;
  color: #f8fafc;
  font-size: clamp(34px, 3.6vw, 48px);
  line-height: 1.04;
}

.login-screen-internal .login-copy h1 {
  font-family: var(--font-display);
}

.login-screen-builder .login-copy h1 {
  font-family: "Archivo", var(--font-ui);
}

.login-screen-portal .login-copy h1 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(38px, 4vw, 54px);
  line-height: 1.08;
}

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

.login-copy .page-context {
  color: rgba(248, 250, 252, 0.68);
  font-size: 15px;
}

.login-form {
  display: grid;
  gap: 14px;
}

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

.login-field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--login-line);
  border-radius: 10px;
  padding: 0 14px;
  color: #f8fafc;
  background: var(--login-field);
  font-size: 15px;
  font-weight: 600;
  outline: 0;
  transition: border-color 160ms cubic-bezier(0.2, 0, 0, 1), box-shadow 160ms cubic-bezier(0.2, 0, 0, 1), background 160ms cubic-bezier(0.2, 0, 0, 1);
}

.login-field span {
  position: static;
  color: rgba(248, 250, 252, 0.56);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-field input:focus {
  border-color: color-mix(in srgb, var(--login-accent) 70%, #ffffff);
  background: color-mix(in srgb, var(--login-field) 84%, #ffffff);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--login-accent) 18%, transparent);
}

.login-field:focus-within span {
  color: var(--login-accent);
}

.login-field input:-webkit-autofill,
.login-field input:-webkit-autofill:hover,
.login-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f8fafc;
  box-shadow: 0 0 0 1000px var(--login-field) inset;
  transition: background-color 9999s ease-out;
}

.form-status,
.form-error {
  margin: 0;
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  text-transform: none;
}

.form-status {
  border: 1px solid color-mix(in srgb, var(--login-accent) 34%, transparent);
  color: #f8fafc;
  background: color-mix(in srgb, var(--login-accent) 12%, transparent);
}

.form-error {
  border: 1px solid rgba(194, 65, 75, 0.24);
  color: #991b1b;
  background: rgba(194, 65, 75, 0.08);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(248, 250, 252, 0.68);
  font-size: 13px;
}

.login-options a {
  color: var(--login-accent);
  font-weight: 700;
  text-decoration: none;
}

.login-options a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.login-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.login-toggle input {
  appearance: none;
  width: 34px;
  height: 20px;
  border: 1px solid var(--login-line);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.08);
  position: relative;
  cursor: pointer;
}

.login-toggle input::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: 2px;
  top: 2px;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.72);
  transition: transform 140ms cubic-bezier(0.2, 0, 0, 1), background 140ms cubic-bezier(0.2, 0, 0, 1);
}

.login-toggle input:checked {
  border-color: transparent;
  background: var(--login-accent-strong);
}

.login-toggle input:checked::before {
  background: #ffffff;
  transform: translateX(14px);
}

.login-form .primary-button {
  min-height: 50px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--login-accent), var(--login-accent-strong));
  box-shadow: 0 14px 30px color-mix(in srgb, var(--login-accent-strong) 32%, transparent);
  transition: transform 140ms cubic-bezier(0.2, 0, 0, 1), box-shadow 140ms cubic-bezier(0.2, 0, 0, 1);
}

.login-form .primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px color-mix(in srgb, var(--login-accent-strong) 38%, transparent);
}

.login-form .primary-button:active {
  transform: translateY(0) scale(0.99);
}

.full-width {
  width: 100%;
}

.login-footnote {
  margin-top: 18px;
  color: rgba(248, 250, 252, 0.48);
  font-size: 12px;
}

@media (max-width: 920px) {
  .login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100svh;
    padding: 18px;
    background:
      radial-gradient(circle at 16% 10%, color-mix(in srgb, var(--login-accent) 24%, transparent), transparent 34%),
      radial-gradient(circle at 84% 86%, color-mix(in srgb, var(--login-accent) 18%, transparent), transparent 36%),
      linear-gradient(135deg, var(--login-visual-a), var(--login-visual-b));
  }

  .login-visual {
    position: absolute;
    inset: 0;
    min-height: 100%;
    padding: 24px;
    background: transparent;
    pointer-events: none;
  }

  .login-visual::before {
    inset: 5% 5% 5% 5%;
    opacity: 0.26;
    border-radius: 18px;
  }

  .login-visual::after {
    width: min(112vw, 620px);
    right: -34%;
    top: -8%;
    opacity: 0.06;
  }

  .login-visual-content {
    position: absolute;
    inset: 24px 22px auto;
    gap: 8px;
    max-width: calc(100% - 44px);
  }

  .login-visual-kicker {
    margin: 0;
    padding: 6px 9px;
    font-size: 10px;
  }

  .login-visual h2,
  .login-screen-builder .login-visual h2,
  .login-screen-portal .login-visual h2 {
    max-width: 15ch;
    font-size: clamp(27px, 8.5vw, 44px);
    line-height: 1.02;
  }

  .login-visual-content > p:last-child {
    max-width: 36ch;
    font-size: 13px;
    line-height: 1.4;
  }

  .login-panel {
    position: relative;
    z-index: 2;
    min-height: auto;
    width: min(100%, 430px);
    margin-top: clamp(122px, 34vh, 260px);
    border: 1px solid var(--login-line);
    border-radius: 18px;
    background: color-mix(in srgb, var(--login-panel) 92%, transparent);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.44);
    padding: 24px 20px 26px;
    backdrop-filter: blur(16px);
  }

  .login-form-logo {
    width: min(158px, 58vw);
    margin-bottom: 22px;
  }

  .login-copy {
    margin-bottom: 22px;
  }

  .login-copy h1,
  .login-screen-portal .login-copy h1 {
    font-size: clamp(30px, 9vw, 42px);
  }

  .login-options {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .login-screen {
    align-items: flex-start;
    padding: 14px;
  }

  .login-visual-content {
    inset: 18px 18px auto;
  }

  .login-visual h2,
  .login-screen-builder .login-visual h2,
  .login-screen-portal .login-visual h2 {
    font-size: clamp(25px, 8vw, 36px);
  }

  .login-visual-content > p:last-child {
    display: none;
  }

  .login-panel {
    margin-top: 112px;
    padding: 22px 18px 24px;
    border-radius: 16px;
  }
}

.sidebar {
  background: #18212b;
  color: #edf2f7;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  position: sticky;
  top: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 2px 0 10px rgba(15, 23, 42, 0.22);
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(226, 232, 240, 0.22);
  border-radius: 999px;
}

.brand {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 5px;
  padding: 12px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: #2dd4bf;
  color: #102027;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.brand-logo {
  display: block;
  width: min(164px, 100%);
  height: auto;
}

.brand-name {
  font-weight: 800;
  font-size: 15px;
  color: #f8fafc;
}

.brand-subtitle {
  color: #aab7c6;
  font-size: 12px;
}

.nav-section {
  display: grid;
  gap: 2px;
  padding-top: 12px;
}

.nav-section-title {
  margin: 18px 8px 6px;
  color: #aab7c6;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-section-title:first-child {
  margin-top: 0;
}

.nav-separator {
  display: block;
  height: 1px;
  margin: 13px 8px 2px;
  background: rgba(226, 232, 240, 0.18);
}

.nav-item {
  border: 0;
  background: transparent;
  color: #c8d4df;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 34px;
  border-radius: 9px;
  padding: 6px 8px;
  text-align: left;
  font-size: 12.5px;
  font-weight: 700;
  border-left: 3px solid transparent;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.nav-item.active {
  border-left-color: var(--brand);
  background: rgba(15, 118, 110, 0.24);
  box-shadow: inset 0 0 0 1px rgba(54, 214, 179, 0.16);
}

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

.nav-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: rgba(15, 118, 110, 0.2);
  color: #c9f5ed;
  font-size: 11px;
  font-weight: 700;
}

.nav-svg {
  width: 15px;
  height: 15px;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  padding: 16px 8px 4px;
  border-top: 1px solid var(--line);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 62px;
  background: rgba(248, 250, 252, 0.94);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.05), 0 10px 22px rgba(15, 23, 42, 0.06);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  position: sticky;
  top: 0;
  z-index: 3;
  backdrop-filter: blur(12px);
}

.search-wrap {
  flex: 0 1 520px;
  position: relative;
}

.search-wrap input,
.list-tools input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 38px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface-alt);
}

.search-results-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  gap: 2px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 8;
}

.search-result {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
}

.search-group {
  display: grid;
  gap: 2px;
}

.search-group > span {
  padding: 6px 10px 2px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.search-result:hover {
  background: var(--surface-alt);
}

.search-result strong {
  font-size: 13px;
}

.search-result span,
.search-empty {
  color: var(--muted);
  font-size: 12px;
}

.search-empty {
  padding: 10px;
}

.topbar-actions,
.header-actions,
.list-tools,
.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-actions,
.table-actions,
.page-actions {
  position: relative;
  z-index: 3;
}

.topbar-actions {
  position: relative;
  margin-left: auto;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.primary-button,
.secondary-button,
.icon-button,
.user-button,
.text-button,
.pill,
.action-list button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  min-height: 32px;
  border: 1px solid transparent;
  padding: 0 10px;
  font-size: 13px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  position: relative;
}

.primary-button {
  background: #0f766e;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
}

.secondary-button,
.icon-button,
.user-button,
.action-list button {
  border-color: var(--line);
  background: var(--surface-alt);
}

.secondary-button:hover,
.icon-button:hover,
.user-button:hover,
.action-list button:hover {
  border-color: #b7c2cf;
  background: var(--surface-raised);
}

.danger-button {
  color: var(--red);
}

.danger-button:disabled,
.danger-button[disabled] {
  display: none;
}

.danger-button:hover {
  border-color: rgba(194, 65, 75, 0.34);
  background: rgba(194, 65, 75, 0.08);
}

.warning-button {
  color: #9a5b05;
  border-color: rgba(217, 148, 27, 0.34);
  background: rgba(217, 148, 27, 0.08);
}

.warning-button:hover {
  border-color: rgba(217, 148, 27, 0.48);
  background: rgba(217, 148, 27, 0.14);
}

.drawer-actions {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.drawer-actions[hidden] {
  display: none;
}

.text-button,
.row-link {
  color: var(--brand);
  background: transparent;
  padding: 0 2px;
  text-decoration: none;
}

.row-link {
  border: 0;
  min-height: 0;
  font-weight: 700;
  text-align: left;
}

.user-button {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notification-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 900;
}

.notification-button strong {
  position: absolute;
  top: -6px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  line-height: 18px;
}

.notification-menu {
  position: absolute;
  right: 190px;
  top: 46px;
  width: 280px;
  display: none;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  z-index: 6;
}

.notification-menu.open {
  display: grid;
}

.notification-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notification-menu h2 {
  margin: 0 0 4px;
  font-size: 14px;
}

.notification-menu-head button,
.notification-row button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.notification-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 7px;
  background: var(--surface-alt);
}

.notification-menu a {
  display: grid;
  gap: 2px;
  padding: 6px;
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
}

.notification-menu small {
  width: fit-content;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.notification-menu span,
.notification-empty {
  color: var(--muted);
  font-size: 12px;
}

.menu-caret {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.user-menu {
  position: absolute;
  right: 0;
  top: 46px;
  width: 180px;
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 6;
}

.user-menu.open {
  display: grid;
}

.user-menu a,
.user-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 32px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  text-align: left;
  padding: 0 10px;
  color: var(--ink);
  font-size: 12.5px;
  text-decoration: none;
}

.user-menu a:hover,
.user-menu button:hover {
  background: var(--surface-alt);
}

.avatar {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-alt);
  font-size: 11px;
  font-weight: 800;
}

.mobile-menu {
  display: none;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
}

.sidebar-backdrop[hidden] {
  display: none;
}

.content {
  padding: 28px 18px 18px;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: page-rise 220ms cubic-bezier(0.2, 0, 0, 1);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.page-actions form {
  margin: 0;
}

.flash-banner {
  display: grid;
  gap: 3px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(21, 128, 61, 0.22);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: rgba(21, 128, 61, 0.08);
}

.flash-banner.error {
  border-color: rgba(194, 65, 75, 0.25);
  border-left-color: var(--red);
  background: rgba(194, 65, 75, 0.08);
}

.flash-banner strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.flash-banner span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.flash-banner small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.flow-progress {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.flow-step {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon meta";
  align-items: center;
  gap: 2px 8px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.flow-step > span {
  grid-area: icon;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.flow-step strong {
  grid-area: label;
  overflow: hidden;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-step em {
  grid-area: meta;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-step.completed {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
}

.flow-step.completed > span {
  background: var(--green);
  color: white;
}

.flow-step.active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.flow-step.active > span {
  background: var(--brand);
  color: white;
}

.flow-step.pending {
  opacity: 0.72;
}

.next-step-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  border-radius: 8px;
  background: var(--brand-soft);
}

.next-step-card strong {
  display: block;
  margin-bottom: 2px;
  font-size: 14px;
}

.next-step-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  margin-bottom: 10px;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover {
  color: var(--brand-dark);
  border-color: transparent;
  background: transparent;
}

.chart-grid,
.widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.chart-card,
.widget-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.chart-card h2,
.widget-card h2 {
  margin: 0 0 12px;
  font-size: 15px;
}

.bar-chart {
  display: grid;
  gap: 10px;
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  padding-left: min(36%, 128px);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) minmax(110px, 2fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-alt);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.column-chart {
  min-height: 190px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
}

.column-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: 8px 0 42px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.column-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(70px, 1fr);
  gap: 12px;
  align-items: end;
  min-height: 190px;
  padding-top: 6px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.column-item {
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 5px;
  align-items: end;
  text-align: center;
}

.column-track {
  position: relative;
  width: 100%;
  min-height: 124px;
  border-radius: 7px 7px 0 0;
  background: var(--surface-alt);
  overflow: hidden;
}

.column-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--accent), var(--brand));
}

.column-item strong {
  color: var(--ink);
  font-size: 12px;
}

.column-item span {
  color: var(--muted);
  font-size: 11px;
}

.widget-list {
  display: grid;
  gap: 8px;
}

.widget-list a {
  display: grid;
  gap: 2px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface-alt);
}

.widget-list span,
.muted-copy {
  color: var(--muted);
  font-size: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.eyebrow-link {
  display: inline-flex;
  min-height: 0;
  border: 0;
  background: transparent;
  padding: 0;
  text-decoration: none;
}

.eyebrow-link:hover {
  color: var(--brand-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: clamp(30px, 2.5vw, 38px);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: 0;
}

h2 {
  font-size: 14.5px;
  margin-bottom: 2px;
  font-weight: 760;
}

.page-context,
.page-meta,
.panel-header p,
.trend,
.module-list em,
.placeholder-screen p,
.empty-state p {
  color: var(--muted);
}

.page-context {
  max-width: 880px;
  margin-bottom: 8px;
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
}

.page-meta span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-alt);
}

.table-actions {
  justify-content: flex-end;
  margin-bottom: 10px;
}

.table-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  align-items: end;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.table-tools label {
  display: grid;
  gap: 4px;
  width: min(320px, 100%);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.required-marker {
  color: var(--red);
  font-weight: 900;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-grid.six {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stat-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat-card {
  display: block;
  position: relative;
  overflow: hidden;
  padding: 16px 16px 16px 18px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 150ms cubic-bezier(0.2, 0, 0, 1), box-shadow 150ms cubic-bezier(0.2, 0, 0, 1), transform 150ms cubic-bezier(0.2, 0, 0, 1), background 150ms cubic-bezier(0.2, 0, 0, 1);
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--brand);
  opacity: 0.58;
}

.stat-grid .stat-card:nth-child(2)::before {
  background: var(--blue);
}

.stat-grid .stat-card:nth-child(3)::before {
  background: var(--green);
}

.stat-grid .stat-card:nth-child(4)::before {
  background: var(--gold);
}

.stat-grid .stat-card:nth-child(5)::before {
  background: var(--red);
}

.stat-grid .stat-card:nth-child(6)::before {
  background: var(--brand-dark);
}

a.stat-card:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: var(--shadow-raised);
  transform: translateY(-1px);
}

.stat-label {
  display: block;
  color: color-mix(in srgb, var(--muted) 82%, var(--ink));
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-card strong {
  display: block;
  margin: 8px 0 2px;
  font-family: var(--font-display);
  font-size: clamp(34px, 3.2vw, 48px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.stat-grid.six .stat-card strong {
  font-size: clamp(20px, 1.5vw, 28px);
}

.trend.up {
  color: var(--green);
}

.trend.warn {
  color: var(--gold);
}

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

.panel {
  padding: 0;
  overflow: hidden;
}

.panel > form,
.panel > .panel-header,
.panel > .mini-list,
.panel > .action-list,
.panel > .module-list,
.panel > .activity-list,
.panel > .empty-state,
.panel > .placeholder-screen {
  padding: 12px;
}

.related-section > .panel-header {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.panel > .table-wrap + .panel-header,
.panel > .panel-header + .table-wrap {
  padding-top: 0;
}

.panel.wide {
  grid-column: span 1;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 2px;
}

.panel > .panel-header {
  background: #EDE8E1;
  border-bottom: 1px solid #D9D4CC;
}

.panel-header.compact {
  margin-bottom: 0;
}

.panel-header.compact h2 {
  margin-bottom: 0;
}

.panel-header.compact p {
  max-width: 760px;
  margin: 3px 0 0;
  font-size: 11.5px;
  line-height: 1.35;
}

.table-wrap {
  overflow-x: auto;
}

.table-filter-pills {
  max-width: min(680px, 100%);
  margin: 0;
  background: transparent;
  border: 0;
  padding: 0;
  grid-column: 1 / -1;
}

.table-footer {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.table-footer strong {
  color: var(--ink);
}

.table-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-pagination label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.table-pagination select {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: var(--surface-alt);
  color: var(--ink);
}

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

th,
td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(13, 13, 15, 0.07);
  vertical-align: middle;
  font-family: var(--font-data);
  font-size: 13px;
}

.select-column {
  width: 36px;
  text-align: center;
}

.select-column input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #EDE8E1;
  color: #667085;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.table-sort {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  text-transform: inherit;
  cursor: pointer;
}

.table-sort:hover {
  color: var(--ink);
}

.sort-indicator {
  min-width: 10px;
  color: var(--brand);
  font-size: 12px;
}

tbody tr:hover {
  background: #f8fafc;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:focus {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.clickable-row[aria-selected="true"] {
  background: rgba(15, 118, 110, 0.08);
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-alt);
  color: var(--muted);
}

.badge.ok {
  background: rgba(21, 128, 61, 0.1);
  color: var(--green);
}

.badge.neutral {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

.badge.warn {
  background: rgba(183, 121, 31, 0.1);
  color: var(--gold);
}

.badge.danger {
  background: rgba(194, 65, 75, 0.1);
  color: var(--red);
}

.badge.info {
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue);
}

.action-list {
  display: grid;
  gap: 8px;
}

.action-list button {
  text-align: left;
  min-height: 42px;
}

.module-list {
  display: grid;
  gap: 10px;
}

.module-list span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.module-list span:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.activity-list {
  display: grid;
  gap: 12px;
}

.activity-list div {
  border-left: 3px solid var(--brand);
  padding-left: 12px;
}

.activity-list p {
  margin-bottom: 0;
}

.activity-time {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
  padding: 4px;
  background: #e9eef4;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: visible;
  scrollbar-width: thin;
}

.subnav::before,
.subnav::after {
  content: none;
}

.subnav::before {
  left: -4px;
  margin-right: -18px;
  background: linear-gradient(90deg, #e9eef4 28%, transparent);
}

.subnav::after {
  right: -4px;
  margin-left: -18px;
  background: linear-gradient(270deg, #e9eef4 28%, transparent);
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(8, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  overflow-x: auto;
  scroll-padding-inline: 14px;
  padding: 0 14px 6px 2px;
}

.pipeline-column {
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.pipeline-column-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
  font-size: 12px;
  font-weight: 900;
}

.pipeline-column-head span {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.pipeline-cards {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.pipeline-card,
.pipeline-empty {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-alt);
  color: var(--ink);
  text-decoration: none;
}

.pipeline-card strong {
  font-size: 13px;
}

.pipeline-card span,
.pipeline-card em,
.pipeline-empty {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.filter-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  align-items: end;
  grid-column: 1 / -1;
  gap: 8px;
  width: 100%;
}

.filter-form label {
  min-width: 0;
  width: 100%;
}

.pill.active {
  background: var(--surface-raised);
  border-color: rgba(15, 118, 110, 0.45);
  color: var(--brand-dark);
  box-shadow: none;
}

.workshop-card-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 6px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.workshop-card-action::after {
  content: "->";
}

.workshop-card-action:hover {
  border-color: rgba(15, 118, 110, 0.45);
  background: rgba(15, 118, 110, 0.14);
}

.pill {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 9px;
  background: transparent;
  border-color: transparent;
  font-size: 12.5px;
  font-weight: 700;
}

.list-tools {
  margin-bottom: 10px;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pipeline section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  min-height: 190px;
}

.pipeline h2 {
  margin-bottom: 8px;
}

.pipeline article {
  background: var(--surface-alt);
  border-radius: 7px;
  padding: 9px;
  margin-bottom: 6px;
  font-weight: 700;
}

.pipeline article span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  margin-top: 4px;
}

.detail-grid,
.detail-sections,
.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.8fr);
  gap: 12px;
}

.detail-sections {
  grid-template-columns: 1fr;
  align-items: start;
}

.record-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.record-summary strong {
  display: block;
  margin-top: 4px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tab {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 0 10px;
  font-size: 13px;
}

.tab.active {
  background: var(--brand-soft);
  border-color: rgba(15, 118, 110, 0.28);
  color: var(--brand-dark);
}

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

.form-panel {
  padding: 1.5rem 2rem;
}

.form-grid label,
.stacked {
  display: grid;
  grid-column: span 3;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.form-grid label.checkbox-field {
  grid-column: span 2;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 34px;
  padding: 7px 0;
}

.form-grid label.checkbox-field input[type="checkbox"] {
  order: -1;
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.stacked input,
.panel form select {
  min-height: 34px;
  border: 1px solid #D9D4CC;
  border-radius: 7px;
  padding: 7px 9px;
  color: var(--ink);
  background: #FFFFFF;
  font-size: 13px;
  font-weight: 400;
  text-transform: none;
}

[data-theme="dark"] .form-grid input,
[data-theme="dark"] .form-grid select,
[data-theme="dark"] .form-grid textarea,
[data-theme="dark"] .stacked input,
[data-theme="dark"] .panel form select {
  background: var(--surface-alt);
  border-color: var(--line);
  color: var(--ink);
}

.form-grid textarea {
  min-height: 78px;
  resize: vertical;
}

.form-grid textarea[rows="2"] {
  min-height: 54px;
}

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

.form-grid .compact-field {
  grid-column: span 2;
}

.form-grid .contact-relationship-field {
  grid-column: span 3;
}

.required-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-section-break {
  display: grid;
  gap: 3px;
  margin-top: 26px;
  margin-bottom: 6px;
  padding: 14px 12px 9px;
  border-top: 2px solid rgba(8, 143, 142, 0.36);
  border-left: 3px solid rgba(8, 143, 142, 0.5);
  border-radius: 8px;
  background: #f8fafb;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.form-section-break:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  border-left: 0;
  background: transparent;
}

.form-section-break h2 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0;
}

.form-section-break p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.form-subsection-break {
  display: grid;
  gap: 2px;
  margin-top: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  border-left: 3px solid rgba(15, 23, 42, 0.14);
  border-radius: 8px;
  background: var(--surface-alt);
}

.form-subsection-break h3 {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.field-help {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  text-transform: none;
}

.starter-services-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}

.starter-services-head,
.starter-service-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 96px 150px 130px;
  gap: 10px;
  align-items: end;
}

.starter-services-head {
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.starter-service-row {
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: var(--surface);
}

.starter-service-row label {
  grid-column: auto;
}

.starter-quantity-field input:disabled {
  color: var(--muted);
  background: #eef2f5;
  cursor: not-allowed;
}

.starter-unit-price,
.starter-line-total {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--surface-alt);
  font-size: 13px;
  font-weight: 800;
  text-transform: none;
}

.starter-unit-price {
  color: var(--muted);
  font-weight: 700;
}

.starter-line-total {
  justify-content: flex-end;
  color: var(--brand-dark);
}

.starter-services-summary {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.starter-services-summary strong {
  color: var(--brand-dark);
  font-size: 16px;
}

.monthly-rate-status,
.proration-preview {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-transform: none;
}

.monthly-rate-status:not([hidden]) {
  padding: 8px 10px;
  border: 1px solid rgba(217, 119, 6, 0.28);
  border-radius: 7px;
  color: #92400e;
  background: #fffbeb;
}

.agreement-preview-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 14px 0 34px;
}

.view.active:has(.agreement-preview-shell) {
  background: #f3f4f6;
}

.agreement-preview-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.agreement-preview-summary {
  position: sticky;
  top: 78px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.agreement-preview-summary dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.agreement-preview-summary div {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.agreement-preview-summary dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.agreement-preview-summary dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.agreement-preview-document {
  position: relative;
  width: min(100%, 860px);
  margin: 2rem auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.agreement-preview-document.is-draft::before {
  content: "DRAFT";
  position: absolute;
  top: 36%;
  left: 50%;
  z-index: 1;
  color: rgba(15, 23, 42, 0.07);
  font-family: var(--font-sans);
  font-size: 116px;
  font-weight: 900;
  letter-spacing: 0.08em;
  pointer-events: none;
  transform: translateX(-50%) rotate(-30deg);
}

.agreement-markdown {
  position: relative;
  z-index: 2;
  color: #374151;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 13px;
  line-height: 1.75;
  padding: 56px 64px;
}

.agreement-markdown > *:first-child {
  margin-top: 0;
}

.agreement-markdown > *:last-child {
  margin-bottom: 0;
}

.agreement-document-masthead {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: 0 0 24px;
  padding-bottom: 14px;
  border-bottom: 3px solid #0f766e;
  text-align: center;
}

.agreement-document-masthead img {
  width: 180px;
  max-width: 58%;
  height: auto;
  margin-bottom: 0;
  object-fit: contain;
}

.agreement-document-company {
  display: grid;
  gap: 2px;
  color: #6b7280;
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1.3;
  margin-bottom: 6px;
  text-align: center;
}

.agreement-document-meta {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 18px;
  margin-top: 0;
  color: #6b7280;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.agreement-markdown h1,
.agreement-markdown h2,
.agreement-markdown h3 {
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.2;
}

.agreement-markdown h1 {
  margin: 4px 0 8px;
  color: #143b3b;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
}

.agreement-markdown h2 {
  margin: 28px 0 14px;
  padding: 0 0 6px;
  border-bottom: 2px solid #0f766e;
  color: #0f766e;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.agreement-markdown h3 {
  margin: 20px 0 8px;
  padding: 6px 12px;
  border-left: 3px solid #d1d5db;
  background: #f9fafb;
  color: #374151;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.agreement-markdown p,
.agreement-markdown ul,
.agreement-markdown ol {
  margin: 0 0 12px;
}

.agreement-markdown table {
  width: 100%;
  margin: 10px 0 12px;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 12.5px;
}

.agreement-markdown th,
.agreement-markdown td {
  padding: 6px 12px;
  border: 0;
  border-bottom: 1px solid #e5e7eb;
  line-height: 1.4;
  text-align: left;
  vertical-align: top;
}

.agreement-markdown th {
  background: #f9fafb;
  color: #374151;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.agreement-markdown td:first-child {
  width: 40%;
  color: #111827;
  font-weight: 800;
}

.agreement-markdown td a {
  color: inherit;
  text-decoration: none;
  pointer-events: none;
}

.agreement-markdown table:has(th:nth-child(4)) th {
  background: #0f766e;
  color: #fff;
  letter-spacing: 0.06em;
}

.agreement-markdown table:has(th:nth-child(3)) tbody tr:nth-child(even) td {
  background: #f9fafb;
}

.agreement-markdown table:has(th:nth-child(4)) th:nth-child(3),
.agreement-markdown table:has(th:nth-child(4)) th:nth-child(4),
.agreement-markdown table:has(th:nth-child(4)) td:nth-child(3),
.agreement-markdown table:has(th:nth-child(4)) td:nth-child(4) {
  text-align: right;
}

.agreement-markdown tr:has(strong) td {
  border-top: 2px solid #0f766e;
  background: #f0fdf4 !important;
  font-weight: 900;
}

.agreement-zone-warning td {
  padding: 12px !important;
  border-left: 3px solid #f59e0b !important;
  background: #fffbeb !important;
  color: #b45309 !important;
  font-style: italic;
  text-align: center;
}

.agreement-empty-equipment td {
  padding: 10px !important;
  background: #f9fafb !important;
  color: #9ca3af !important;
  font-style: italic;
  text-align: center;
}

.agreement-markdown hr {
  margin: 20px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.agreement-markdown p:has(> strong:first-child) {
  font-family: var(--font-sans);
  break-inside: avoid;
}

.agreement-initials {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 18px;
  padding: 10px 12px;
  border-left: 4px solid #059669;
  border-radius: 6px;
  background: #f0fdf4;
  color: #065f46;
  font-family: var(--font-sans);
  font-weight: 800;
}

.agreement-initials span {
  display: inline-block;
  width: 72px;
  border-bottom: 1px solid #065f46;
  transform: translateY(2px);
}

.agreement-note-callout {
  margin: 16px 0;
  padding: 10px 14px;
  border-left: 3px solid #94a3b8;
  background: #f8fafc;
  color: #475569;
  font-family: var(--font-sans);
  font-size: 12.5px;
}

.agreement-note-callout strong {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.agreement-note-callout p {
  margin: 0;
}

.agreement-authorization-block {
  margin: 16px 0;
  padding: 16px 20px;
  border: 1px solid #d1fae5;
  border-left: 4px solid #059669;
  border-radius: 4px;
  background: #f0fdf4;
  font-size: 13px;
}

.agreement-authorization-block h3 {
  margin-top: 0;
  background: transparent;
  border-left: 0;
  padding-left: 0;
}

.agreement-terms-section {
  display: block;
  margin-top: 38px;
  padding: 18px 20px 20px;
  background: #fafafa;
  font-size: 12px;
}

.agreement-terms-section h2 {
  margin-top: 0;
}

.agreement-terms-section h3 {
  margin-top: 24px;
  margin-bottom: 6px;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
  border-left: 0;
  background: transparent;
  color: #1f2937;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.agreement-terms-section h3:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.agreement-signature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 2px solid #e5e7eb;
}

.agreement-signature-grid h3 {
  margin-top: 0;
}

.agreement-signature-line {
  display: block;
  width: min(100%, 280px);
  min-height: 40px;
  margin: 12px 0 6px;
  border-bottom: 1.5px solid #111827;
}

.agreement-signature-line::before {
  content: "X";
  display: inline-block;
  margin-top: 14px;
  color: #111827;
  font-family: var(--font-sans);
  font-weight: 800;
}

.agreement-markdown table:has(.agreement-signature-line) td {
  height: 56px;
  border-color: transparent;
  border-bottom-color: #e5e7eb;
  background: #fff;
}

.agreement-markdown table:has(.agreement-signature-line) td:first-child {
  width: 130px;
  color: #6b7280;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.agreement-status-badge {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid #fcd34d;
  border-radius: 9999px;
  background: #fef3c7;
  color: #92400e;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@media print {
  .app-shell .topbar,
  .sidebar,
  .back-link,
  .page-header,
  .agreement-preview-summary {
    display: none !important;
  }

  .app-shell,
  .main-content,
  .view.active {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .agreement-preview-shell {
    display: block !important;
  }

  .agreement-preview-document {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .agreement-markdown {
    padding: 0 !important;
    font-size: 11pt;
  }

  .agreement-markdown h2,
  .agreement-markdown h3,
  .agreement-markdown table,
  .agreement-markdown p {
    break-inside: avoid;
  }
}

.line-items-editor {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-alt);
}

.line-items-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.line-items-header h2 {
  margin: 0 0 3px;
}

.line-items-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
}

.line-items-grid {
  display: grid;
  gap: 8px;
}

.line-item-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(180px, 1fr) minmax(88px, 0.45fr) minmax(110px, 0.55fr) minmax(96px, 0.48fr) minmax(110px, 0.55fr) auto auto;
  gap: 8px;
  align-items: end;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.line-item-row label {
  min-width: 0;
}

.line-item-row .line-tax-advanced {
  display: none;
}

.line-item-row.show-advanced .line-tax-advanced {
  display: grid;
  grid-column: 1 / -1;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: var(--surface-alt);
}

.line-advanced-toggle {
  min-height: 34px;
  align-self: end;
}

.line-item-row output {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-transform: none;
}

.line-items-total {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.line-items-total span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.line-items-total strong {
  color: var(--brand-dark);
  font-size: 15px;
}

.calendar-shell {
  display: grid;
  gap: 10px;
}

.project-workspace {
  display: grid;
  gap: 12px;
}

.workspace-header,
.task-column-header,
.timeline-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workspace-header h2 {
  font-size: 18px;
  font-weight: 800;
}

.workspace-header p,
.timeline-label em,
.task-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.task-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(210px, 1fr));
  gap: 10px;
  overflow-x: auto;
}

.task-column {
  min-height: 360px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.task-column.drag-over {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand-soft) 42%, var(--surface));
}

.task-column-header {
  min-height: 42px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
}

.task-column-header span {
  min-width: 24px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.task-cards {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.task-card {
  display: grid;
  gap: 5px;
  padding: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
  cursor: grab;
  transition: opacity 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.task-card:hover {
  border-color: var(--brand);
}

.task-card.dragging {
  opacity: 0.5;
  transform: scale(0.98);
  cursor: grabbing;
}

.task-card span {
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 800;
}

.task-card strong {
  font-size: 13px;
}

.task-card-footer {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.task-empty {
  color: var(--muted);
  font-size: 12px;
}

.timeline-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.timeline-scale {
  color: var(--muted);
  font-size: 12px;
}

.timeline-rows {
  display: grid;
  gap: 8px;
}

.timeline-row {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(280px, 1fr) 170px;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.timeline-label {
  display: grid;
  gap: 2px;
}

.timeline-track {
  position: relative;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-alt);
  overflow: hidden;
}

.timeline-bar {
  position: absolute;
  top: 3px;
  bottom: 3px;
  min-width: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.timeline-dates {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.calendar-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.calendar-toolbar h2 {
  margin-bottom: 2px;
}

.calendar-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.calendar-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

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

.calendar-weekday,
.calendar-day {
  background: var(--surface);
}

.calendar-weekday {
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 132px;
  padding: 8px;
}

.calendar-day.muted {
  background: var(--surface-alt);
}

.calendar-day-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
}

.calendar-day-heading strong {
  color: var(--ink);
  font-size: 12px;
}

.calendar-day-heading span {
  color: var(--muted);
  font-size: 10.5px;
}

.calendar-events,
.calendar-agenda {
  display: grid;
  gap: 6px;
}

.calendar-event,
.calendar-agenda-item {
  display: grid;
  gap: 1px;
  min-width: 0;
  border-left: 3px solid var(--event-color);
  border-radius: 5px;
  background: color-mix(in srgb, var(--event-color) 8%, white);
  color: var(--ink);
  text-decoration: none;
}

.calendar-event {
  padding: 5px 6px;
}

.calendar-event span,
.calendar-agenda-item span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
}

.calendar-event strong,
.calendar-agenda-item strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event em,
.calendar-agenda-item em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.calendar-event:hover,
.calendar-agenda-item:hover {
  outline: 1px solid color-mix(in srgb, var(--event-color) 44%, var(--line));
}

.calendar-empty {
  color: var(--muted);
  font-size: 11px;
}

.calendar-agenda {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.calendar-agenda-item {
  padding: 8px 10px;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin: 12px -2rem -1.5rem;
  padding: 12px 2rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

[data-theme="dark"] .form-actions {
  background: rgba(26, 29, 36, 0.94);
  border-top-color: var(--line);
}

.form-actions.clean {
  justify-content: flex-end;
  margin: 14px 0 0;
  padding: 0;
  border-top: 0;
  background: transparent;
  backdrop-filter: none;
}

.form-actions.contained {
  justify-content: flex-end;
  margin: 16px 0 0;
  padding: 12px 0 16px;
  border-top: 0;
  background: transparent;
  backdrop-filter: none;
}

.panel.has-form-actions {
  padding: 24px 2rem 24px;
}

.lot-form-section,
.panel-body-stack,
.panel-copy,
.action-disclosure {
  padding: 12px;
}

.lot-form-section {
  border-top: 1px solid rgba(13, 13, 15, 0.08);
  padding-top: 14px;
  margin-top: 4px;
}

.lot-form-section h3,
.panel-body-stack h3 {
  margin-top: 0;
}

.lot-form-section p,
.panel-body-stack p,
.panel-copy {
  margin-top: 0;
}

.action-disclosure > summary {
  width: fit-content;
  list-style: none;
  cursor: pointer;
}

.action-disclosure > summary::-webkit-details-marker {
  display: none;
}

.action-disclosure > form {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.form-floating-actions {
  position: fixed;
  left: 232px;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: none;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 28px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -16px 34px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(12px);
}

.form-floating-actions.visible {
  display: flex;
}

.side-panel h2 {
  margin-bottom: 10px;
}

.mini-list,
.access-list,
.check-list {
  display: grid;
  gap: 4px;
}

.mini-list > span,
.mini-list > a,
.mini-list > button,
.access-list > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 34px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.mini-list > span:last-child,
.mini-list > a:last-child,
.mini-list > button:last-child,
.access-list > span:last-child {
  border-bottom: 0;
}

.mini-list > a,
.mini-list > button {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s ease;
}

.mini-list > button {
  width: 100%;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.mini-list > a:hover,
.mini-list > button:hover {
  color: var(--brand);
}

.mini-list > a:hover strong,
.mini-list > button:hover strong {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mini-list em,
.access-list em {
  color: var(--muted);
  font-style: normal;
  font-size: 11.5px;
}

.mini-list strong,
.mini-list em {
  overflow-wrap: anywhere;
}

.mini-list-action {
  justify-self: end;
  align-self: center;
  flex: 0 0 auto;
  min-height: 21px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.mini-list-inline-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

.mini-list-inline-actions a,
.mini-list-inline-actions button {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.mini-list-inline-actions a:hover,
.mini-list-inline-actions button:hover {
  border-color: rgba(14, 115, 110, 0.35);
  color: var(--brand);
}

.summary-detail {
  padding: 10px 12px 12px;
}

.summary-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.summary-detail-heading strong {
  display: block;
  font-size: 13.5px;
}

.summary-detail-heading em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  font-style: normal;
}

.summary-facts,
.summary-notes {
  display: grid;
  gap: 7px 16px;
  margin: 0;
}

.summary-facts {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.summary-notes {
  margin-top: 10px;
}

.summary-facts div,
.summary-notes div {
  min-width: 0;
}

.summary-facts dt,
.summary-notes dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.summary-facts dd,
.summary-notes dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.summary-notes div {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.inventory-overview-detail {
  display: grid;
  gap: 12px;
}

.inventory-hero-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(4, minmax(120px, 1fr)) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.06);
}

.inventory-hero-bar div {
  min-width: 0;
}

.inventory-hero-bar dt,
.inventory-overview-facts dt {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.inventory-hero-bar dd,
.inventory-overview-facts dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.inventory-hero-primary dd {
  font-size: 16px;
  font-weight: 850;
}

.inventory-overview-groups {
  display: grid;
  gap: 10px;
}

.inventory-overview-group {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.inventory-overview-group h3 {
  margin: 0 0 9px;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.inventory-overview-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 9px 12px;
  margin: 0;
}

.inventory-overview-facts div {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 7px;
  background: var(--surface);
}

.inventory-empty-value dd {
  color: #8b97a5;
  font-weight: 550;
}

.access-list span {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.value-list {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.value-list span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-alt);
}

.value-list button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tag-list span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 700;
}

.section-gap {
  margin-top: 12px;
}

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

.check-list {
  margin-bottom: 12px;
}

.review-grid {
  display: grid;
  gap: 8px;
}

.review-grid label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-alt);
}

.empty-state,
.placeholder-screen {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 16px;
}

.table-empty-state,
.inline-empty-state {
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 34px 16px;
  color: var(--muted);
  text-align: center;
}

.inline-empty-state::before {
  content: "";
  width: 52px;
  height: 34px;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, transparent 48%, rgba(15, 118, 110, 0.42) 49%, rgba(15, 118, 110, 0.42) 52%, transparent 53%) 8px 16px / 36px 12px no-repeat,
    linear-gradient(90deg, rgba(15, 118, 110, 0.16), rgba(15, 118, 110, 0.04));
  animation: empty-pulse 3s ease-in-out infinite;
}

.table-empty-state > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--brand);
  font-size: 18px;
  font-weight: 800;
}

.table-empty-state strong,
.inline-empty-state strong {
  color: var(--ink);
  font-size: 14px;
}

.table-empty-state em,
.inline-empty-state em {
  max-width: 42ch;
  font-size: 12px;
  font-style: normal;
}

.inline-empty-state.compact {
  min-height: 120px;
  padding: 18px 12px;
}

.inline-empty-state.compact::before {
  width: 44px;
  height: 28px;
}

@keyframes page-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes empty-pulse {
  0%,
  100% {
    opacity: 0.66;
  }

  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .view.active,
  .inline-empty-state::before {
    animation: none;
  }

  .stat-card,
  a.stat-card:hover {
    transition: none;
    transform: none;
  }
}

td > .table-empty-state,
.table-empty-state.compact {
  padding: 18px 12px;
}

td > .table-empty-state > span,
.table-empty-state.compact > span {
  width: 30px;
  height: 30px;
  font-size: 14px;
}

.detail-drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
}

.detail-drawer.open {
  display: block;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
}

.detail-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(560px, 100%);
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -10px 0 28px rgba(0, 0, 0, 0.34);
  padding: 14px;
  overflow-y: auto;
}

.agreement-preview-panel {
  width: min(1040px, 100%);
}

.agreement-preview-drawer-content {
  display: grid;
  gap: 14px;
}

.agreement-preview-panel .agreement-preview-shell {
  grid-template-columns: 210px minmax(0, 1fr);
}

.agreement-preview-panel .agreement-preview-summary {
  top: 14px;
}

.agreement-preview-panel .agreement-preview-document {
  box-shadow: none;
}

.detail-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.detail-panel h2 {
  font-size: 18px;
  margin-bottom: 0;
}

.detail-panel-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.detail-list div {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-alt);
}

.detail-list dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.detail-list dd {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.detail-list .detail-long {
  grid-column: 1 / -1;
}

.detail-list .detail-long dd {
  max-width: 68ch;
}

.quick-form {
  display: grid;
  gap: 9px;
}

.quick-form[hidden] {
  display: none;
}

.quick-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.quick-form input,
.quick-form select,
.quick-form textarea {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  color: var(--ink);
  background: var(--surface-alt);
  font-size: 13px;
  font-weight: 400;
  text-transform: none;
}

.quick-form textarea {
  min-height: 78px;
  resize: vertical;
}

.quick-form-actions {
  display: flex;
  gap: 8px;
  padding-top: 4px;
}

.decor-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.decor-filter-bar > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.decor-filter-label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 900;
  text-transform: uppercase;
}

.decor-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.decor-media-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-alt);
}

.decor-media-thumb {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.decor-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.decor-video-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.decor-media-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.decor-media-body strong,
.decor-preview-caption strong {
  overflow-wrap: anywhere;
}

.decor-media-body span,
.decor-preview-caption span {
  color: var(--muted);
  font-size: 12px;
}

.decor-media-metadata {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.decor-media-metadata summary {
  color: var(--brand);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.package-review-group {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.package-review-group summary {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.package-review-group summary::-webkit-details-marker {
  display: none;
}

.package-review-group summary::before {
  content: ">";
  color: var(--muted);
  font-weight: 800;
  transition: transform 0.16s ease;
}

.package-review-group[open] summary::before {
  transform: rotate(90deg);
}

.package-review-group summary > div:first-of-type {
  min-width: 0;
}

.package-review-group summary strong {
  display: block;
  color: var(--text);
  font-size: 15px;
}

.package-review-group summary span {
  color: var(--muted);
  font-size: 13px;
}

.package-review-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.package-review-group .table-wrap {
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.decor-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.decor-devices-overview-table {
  min-width: 760px;
}

.decor-playing-column {
  min-width: 180px;
  overflow-wrap: anywhere;
}

.decor-playlist-builder {
  display: grid;
  gap: 10px;
}

.decor-builder-rows {
  display: grid;
  gap: 8px;
}

.decor-builder-row {
  display: grid;
  grid-template-columns: 32px minmax(220px, 1fr) minmax(110px, 0.35fr) minmax(130px, 0.45fr) auto;
  gap: 8px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--surface-alt);
}

.decor-builder-row.touchscreen {
  grid-template-columns: 32px minmax(210px, 1fr) minmax(90px, 0.28fr) minmax(110px, 0.34fr) minmax(120px, 0.38fr) minmax(160px, 0.55fr) minmax(140px, 0.42fr) minmax(170px, 0.55fr) auto;
}

.decor-row-handle {
  display: grid;
  place-items: center;
  min-height: 34px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.decor-media-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}

.decor-picker-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  background: var(--surface-alt);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.decor-picker-card:hover {
  border-color: rgba(15, 118, 110, 0.36);
  background: var(--brand-soft);
}

.decor-picker-card img {
  grid-row: span 2;
  width: 54px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface);
}

.decor-picker-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.decor-picker-card span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.decor-preview-shell {
  display: grid;
  gap: 10px;
  max-width: 100%;
}

.decor-preview-shell.landscape {
  max-width: 620px;
}

.decor-preview-shell.portrait {
  max-width: 360px;
}

.decor-preview-stage {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b141d;
  aspect-ratio: 16 / 9;
}

.decor-preview-shell.portrait .decor-preview-stage {
  aspect-ratio: 9 / 16;
}

.decor-preview-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.decor-touch-overlay {
  position: absolute;
  display: grid;
  gap: 4px;
  max-width: min(78%, 340px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  padding: 12px;
  background: rgba(11, 20, 29, 0.72);
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.decor-touch-overlay[data-zone="top"] {
  inset: 16px 16px auto 16px;
  max-width: none;
}

.decor-touch-overlay[data-zone="bottom"],
.decor-touch-overlay[data-zone="full"] {
  inset: auto 16px 16px 16px;
  max-width: none;
}

.decor-touch-overlay[data-zone="left"] {
  inset: 16px auto 16px 16px;
  align-content: center;
  width: 42%;
}

.decor-touch-overlay[data-zone="right"] {
  inset: 16px 16px 16px auto;
  align-content: center;
  width: 42%;
}

.decor-touch-overlay[data-zone="center"] {
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}

.decor-touch-overlay strong {
  font-size: 16px;
  line-height: 1.2;
}

.decor-touch-overlay span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
}

.decor-touch-overlay em {
  color: #a7f3d0;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.decor-preview-empty {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 800;
}

.decor-preview-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.drawer-status {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 9px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.drawer-status[hidden] {
  display: none;
}

.drawer-status.error {
  border-color: rgba(194, 65, 75, 0.34);
  background: rgba(194, 65, 75, 0.08);
  color: var(--red);
}

.drawer-status.success {
  border-color: rgba(21, 128, 61, 0.32);
  background: rgba(21, 128, 61, 0.08);
  color: var(--green);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.compact-state {
  padding: 14px;
}

.compact-state p {
  margin-bottom: 12px;
}

.placeholder-screen {
  min-height: 280px;
  display: grid;
  align-content: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  body {
    font-size: 13px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 180ms ease;
    z-index: 11;
    box-shadow: 18px 0 38px rgba(15, 23, 42, 0.24);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
  }

  .topbar {
    min-height: auto;
    padding: 9px 12px;
    gap: 8px;
  }

  .topbar-actions .secondary-button,
  .user-text {
    display: none;
  }

  .content {
    padding: 14px 12px 18px;
  }

  .stat-grid,
  .stat-grid.three,
  .dashboard-grid,
  .pipeline,
  .detail-grid,
  .detail-sections,
  .form-layout,
  .line-item-row,
  .decor-builder-row {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .page-actions {
    justify-content: flex-start;
  }

  .page-actions > *,
  .page-actions form,
  .page-actions button,
  .page-actions a {
    width: 100%;
  }

  .panel-header,
  .notification-menu-head,
  .decor-preview-caption {
    flex-direction: column;
    align-items: stretch;
  }

  .inventory-hero-bar,
  .inventory-overview-facts {
    grid-template-columns: 1fr;
  }

  .inline-actions {
    flex-wrap: wrap;
  }

  .inline-actions > *,
  .inline-actions a,
  .inline-actions button {
    flex: 1 1 160px;
  }

  .flow-progress {
    display: flex;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
  }

  .flow-step {
    min-width: 210px;
    scroll-snap-align: start;
  }

  .table-wrap {
    margin-inline: -12px;
    border-radius: 0;
  }

  table {
    min-width: 720px;
  }

  th,
  td {
    padding: 10px 9px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: center;
    flex-wrap: wrap;
  }

  .search-wrap {
    order: 3;
    flex-basis: 100%;
  }

  .topbar-actions {
    margin-left: auto;
    gap: 6px;
  }

  .theme-toggle,
  .notification-button,
  .user-button {
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
  }

  .avatar {
    width: 26px;
    height: 26px;
  }

  .notification-menu,
  .user-menu {
    position: fixed;
    top: 58px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100vh - 76px);
    overflow: auto;
  }

  .user-menu {
    left: auto;
    width: min(220px, calc(100vw - 20px));
  }

  .search-results-menu {
    position: fixed;
    top: 104px;
    left: 10px;
    right: 10px;
    max-height: calc(100vh - 120px);
    overflow: auto;
  }

  .header-actions,
  .list-tools,
  .table-actions,
  .table-footer,
  .table-pagination {
    width: 100%;
    flex-wrap: wrap;
  }

  .header-actions button,
  .list-tools button,
  .table-actions button {
    flex: 1;
  }

  .table-tools {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 23px;
  }

  .form-grid,
  .record-summary,
  .detail-list,
  .summary-facts {
    grid-template-columns: 1fr;
  }

  .form-panel {
    padding: 14px;
  }

  .form-grid label,
  .form-grid label.checkbox-field,
  .form-grid .compact-field,
  .form-grid .contact-relationship-field {
    grid-column: 1 / -1;
  }

  .starter-services-head {
    display: none;
  }

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

  .starter-services-summary {
    justify-content: space-between;
  }

  .agreement-preview-shell {
    grid-template-columns: 1fr;
  }

  .agreement-preview-summary {
    position: static;
  }

  .content {
    padding: 12px 10px 16px;
  }

  .subnav {
    margin-inline: -10px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .pill {
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .stat-card,
  .chart-card,
  .panel {
    border-radius: 7px;
  }

  .panel > .panel-header,
  .panel > .mini-list,
  .panel > .action-list,
  .panel > .module-list,
  .panel > .activity-list,
  .panel > .empty-state,
  .panel > .placeholder-screen {
    padding: 10px;
  }

  .quick-form input,
  .quick-form select,
  .quick-form textarea,
  .search-wrap input,
  .list-tools input {
    min-height: 42px;
    font-size: 16px;
  }

  .quick-form-actions,
  .drawer-actions,
  .form-actions {
    flex-direction: column;
  }

  .form-actions {
    margin: 12px -14px -14px;
    padding: 10px 14px;
  }

  .form-floating-actions {
    left: 0;
    padding: 10px 14px;
  }

  .quick-form-actions button,
  .drawer-actions button,
  .drawer-actions a,
  .primary-button,
  .secondary-button {
    width: 100%;
    min-height: 40px;
  }

  .detail-panel {
    width: 100%;
    max-width: none;
  }

  .detail-panel.open {
    inset: 0;
  }

  .detail-panel-header {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface);
  }

  .summary-detail,
  .inline-empty-state,
  .mini-list > a,
  .mini-list > button,
  .mini-list > span {
    border-radius: 7px;
  }

  .decor-media-grid {
    grid-template-columns: 1fr;
  }

  .decor-media-picker-grid {
    grid-template-columns: 1fr;
  }

  .decor-builder-row,
  .decor-builder-row.touchscreen {
    grid-template-columns: 32px 1fr;
  }

  .decor-builder-row label,
  .decor-builder-row button {
    grid-column: 1 / -1;
  }

  .package-review-group summary {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .package-review-summary {
    grid-column: 2;
    justify-content: flex-start;
  }

  .decor-touch-overlay,
  .decor-touch-overlay[data-zone] {
    inset: auto 10px 10px 10px;
    width: auto;
    max-width: none;
    transform: none;
    padding: 10px;
  }
}

/* Final OS V3 decision overrides. This block intentionally lives at the end so
   it wins over the older shell rules above while the baseline template remains
   available under Website > OS Template. */
.sidebar {
  background:
    radial-gradient(circle at 100% 0%, rgba(196, 85, 32, 0.10), transparent 34%),
    var(--os-shell-v3);
  border-right-color: rgba(255, 255, 255, 0.08);
  box-shadow: 3px 0 18px rgba(7, 30, 40, 0.32);
}

.brand {
  padding: 18px 10px 22px;
}

.brand-logo {
  width: min(176px, 100%);
}

.nav-section-title {
  margin: 20px 10px 7px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.nav-item {
  position: relative;
  border-left-color: transparent;
  border-radius: 10px;
  transition: background 150ms cubic-bezier(0.2, 0, 0, 1), color 150ms cubic-bezier(0.2, 0, 0, 1), transform 150ms cubic-bezier(0.2, 0, 0, 1);
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(1px);
}

.nav-item.active {
  border-left-color: transparent;
  background: #115e75;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 18px rgba(7, 30, 40, 0.18);
}

.nav-item.active::before {
  background: var(--os-accent-v3);
}

.nav-icon {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
}

.nav-item.active .nav-icon {
  background: rgba(196, 85, 32, 0.18);
  color: #ffe1d1;
}

.topbar {
  min-height: 64px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: rgba(13, 13, 15, 0.10);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 14px 30px rgba(15, 23, 42, 0.07);
}

.search-wrap {
  flex-basis: 500px;
}

.search-wrap input,
.list-tools input {
  border-color: rgba(13, 13, 15, 0.14);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.topbar-actions {
  border-left-color: rgba(13, 13, 15, 0.10);
}

.primary-button {
  border-radius: 10px;
  background: var(--os-accent-v3);
  box-shadow: 0 10px 22px rgba(196, 85, 32, 0.18);
  transition: background 150ms cubic-bezier(0.2, 0, 0, 1), box-shadow 150ms cubic-bezier(0.2, 0, 0, 1), transform 150ms cubic-bezier(0.2, 0, 0, 1);
}

.primary-button:hover {
  background: var(--os-accent-v3-dark);
  box-shadow: 0 14px 28px rgba(196, 85, 32, 0.24);
  transform: translateY(-1px);
}

.secondary-button,
.icon-button,
.user-button,
.notification-button,
.action-list button {
  border-radius: 10px;
}

.stat-card,
.panel {
  background: #FAFAF8;
  border-color: #D9D4CC;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.stat-card {
  background: #FAFAF8;
  padding: 17px 18px;
}

.stat-card::before {
  inset: 16px 16px auto auto;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--brand);
  opacity: 1;
  box-shadow: 0 0 0 5px rgba(15, 118, 110, 0.10);
}

.stat-grid .stat-card:nth-child(2)::before {
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.10);
}

.stat-grid .stat-card:nth-child(3)::before {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(21, 128, 61, 0.10);
}

.stat-grid .stat-card:nth-child(4)::before {
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(183, 121, 31, 0.12);
}

.stat-grid .stat-card:nth-child(5)::before {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(194, 65, 75, 0.10);
}

.stat-grid .stat-card:nth-child(6)::before {
  background: var(--os-accent-v3);
  box-shadow: 0 0 0 5px rgba(196, 85, 32, 0.12);
}

a.stat-card:hover {
  border-color: rgba(196, 85, 32, 0.34);
  background: #fffdf8;
  box-shadow: var(--shadow-raised);
  transform: translateY(-2px);
}

.stat-label {
  font-size: 12px;
  letter-spacing: 0.10em;
}

.stat-card strong {
  font-size: clamp(32px, 2.7vw, 42px);
  font-weight: 700;
}

.subnav {
  background: rgba(237, 232, 225, 0.72);
  border-color: #D9D4CC;
  border-radius: 10px;
}

.pill {
  border-radius: 999px;
  transition: background 150ms cubic-bezier(0.2, 0, 0, 1), border-color 150ms cubic-bezier(0.2, 0, 0, 1), color 150ms cubic-bezier(0.2, 0, 0, 1);
}

.pill.active {
  background: rgba(196, 85, 32, 0.12);
  border-color: rgba(196, 85, 32, 0.34);
  color: var(--os-accent-v3-dark);
}

.workshop-card-action {
  border-color: rgba(196, 85, 32, 0.24);
  border-radius: 10px;
  background: rgba(196, 85, 32, 0.10);
  color: var(--os-accent-v3-dark);
}

.workshop-card-action:hover {
  border-color: rgba(196, 85, 32, 0.42);
  background: rgba(196, 85, 32, 0.14);
}

.table-empty-state,
.inline-empty-state {
  position: relative;
  min-height: 150px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 0%, rgba(196, 85, 32, 0.10), transparent 58%),
    #fafaf8;
}

.table-empty-state > span {
  width: 44px;
  height: 44px;
  border-color: rgba(196, 85, 32, 0.22);
  border-radius: 13px;
  background: rgba(196, 85, 32, 0.12);
  color: var(--os-accent-v3);
}

.inline-empty-state::before {
  border-color: rgba(196, 85, 32, 0.28);
  background:
    linear-gradient(135deg, transparent 48%, rgba(196, 85, 32, 0.46) 49%, rgba(196, 85, 32, 0.46) 52%, transparent 53%) 8px 16px / 36px 12px no-repeat,
    linear-gradient(90deg, rgba(196, 85, 32, 0.16), rgba(196, 85, 32, 0.04));
}

[data-theme="dark"] .sidebar {
  background:
    radial-gradient(circle at 100% 0%, rgba(196, 85, 32, 0.12), transparent 34%),
    var(--os-shell-v3-dark);
}

[data-theme="dark"] .nav-item.active {
  background: rgba(17, 94, 117, 0.72);
}

[data-theme="dark"] .topbar {
  background: rgba(26, 29, 36, 0.96);
}

[data-theme="dark"] .stat-card {
  background: #1c2026;
}

[data-theme="dark"] .subnav {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .pill.active {
  background: rgba(196, 85, 32, 0.16);
  border-color: rgba(196, 85, 32, 0.36);
  color: #f1a06b;
}

[data-theme="dark"] .table-empty-state,
[data-theme="dark"] .inline-empty-state {
  background:
    radial-gradient(circle at 50% 0%, rgba(196, 85, 32, 0.12), transparent 58%),
    var(--surface);
}
