:root {
  --bg: #0c0c0d;
  --bg-raised: #141416;
  --bg-panel: #18181b;
  --bg-field: #101012;
  --ink: #f4f1e8;
  --muted: #9a9588;
  --line: rgba(243, 226, 122, 0.12);
  --gold: #f3e27a;
  --gold-fill: #f3e27a;
  --gold-deep: #c9b44a;
  --accent: #f3e27a;
  --danger: #e36a56;
  --nav-bg: rgba(12, 12, 13, 0.72);
  --nav-shadow: 0 18px 28px rgba(0, 0, 0, 0.18);
  --nav-hover: rgba(255, 255, 255, 0.05);
  --control-border: rgba(255, 255, 255, 0.08);
  --control-border-strong: rgba(255, 255, 255, 0.16);
  --hairline: rgba(255, 255, 255, 0.05);
  --inset-highlight: rgba(255, 255, 255, 0.045);
  --field-focus-bg: #121214;
  --select-option-bg: #161618;
  --select-picker-bg: rgba(20, 20, 22, 0.92);
  --glass: rgba(24, 24, 27, 0.78);
  --table-field-bg: rgba(8, 8, 9, 0.72);
  --chip-bg: rgba(255, 255, 255, 0.04);
  --kpi-tile-bg: rgba(8, 8, 9, 0.35);
  --num: #ebe6d6;
  --placeholder: rgba(154, 149, 136, 0.72);
  --toast-bg: #111;
  --toast-ink: #fff;
  --close-filter: invert(1) grayscale(1) brightness(1.6);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --radius: 18px;
  --radius-field: 12px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 48px rgba(0, 0, 0, 0.35);
  --font: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' viewBox='0 0 12 8'%3E%3Cpath d='M1.2 1.6 6 6.4l4.8-4.8' stroke='%23f3e27a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

html {
  color-scheme: dark;
}

html[data-theme="light"]:not(:has(body.home-screen)) {
  color-scheme: light;
  --bg: #f6f1e4;
  --bg-raised: #fbf8f0;
  --bg-panel: #fffdf8;
  --bg-field: #ffffff;
  --ink: #1c1a14;
  --muted: #6d6758;
  --line: rgba(28, 26, 20, 0.1);
  --gold: #9a7d1c;
  --gold-fill: #f3e27a;
  --gold-deep: #8f7820;
  --accent: #9a7d1c;
  --nav-bg: rgba(246, 241, 228, 0.86);
  --nav-shadow: 0 12px 28px rgba(28, 26, 20, 0.08);
  --nav-hover: rgba(28, 26, 20, 0.05);
  --control-border: rgba(28, 26, 20, 0.12);
  --control-border-strong: rgba(28, 26, 20, 0.2);
  --hairline: rgba(28, 26, 20, 0.08);
  --inset-highlight: rgba(255, 255, 255, 0.7);
  --field-focus-bg: #ffffff;
  --select-option-bg: #fffdf8;
  --select-picker-bg: rgba(255, 253, 248, 0.96);
  --glass: rgba(255, 253, 248, 0.88);
  --table-field-bg: #ffffff;
  --chip-bg: rgba(28, 26, 20, 0.05);
  --kpi-tile-bg: rgba(255, 255, 255, 0.7);
  --num: #1c1a14;
  --placeholder: rgba(109, 103, 88, 0.78);
  --toast-bg: #1c1a14;
  --toast-ink: #f4f1e8;
  --close-filter: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 18px 40px rgba(28, 26, 20, 0.08);
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' viewBox='0 0 12 8'%3E%3Cpath d='M1.2 1.6 6 6.4l4.8-4.8' stroke='%239a7d1c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

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

body.app-body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(243, 226, 122, 0.08), transparent 55%),
    var(--bg);
  font: 100%/1.5 var(--font);
  font-optical-sizing: auto;
  letter-spacing: -0.011em;
}

html[data-theme="light"]:not(:has(body.home-screen)) body.app-body {
  background:
    radial-gradient(900px 420px at 8% -8%, rgba(243, 226, 122, 0.28), transparent 52%),
    radial-gradient(720px 380px at 100% 110%, rgba(69, 170, 184, 0.12), transparent 55%),
    var(--bg);
}

body.marketing-body {
  margin: 0;
  font: 100%/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

body.auth-body {
  margin: 0;
  color: var(--ink);
  font: 100%/1.5 var(--font);
  font-optical-sizing: auto;
  letter-spacing: -0.011em;
}

.display,
.app-title {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
  font-weight: 600;
  color: var(--ink);
}

.app-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: var(--nav-bg);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--nav-shadow);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.app-brand img {
  height: 42px;
  width: auto;
  display: block;
}

.app-brand .brand-logo-ink {
  display: none;
}

html[data-theme="light"]:not(:has(body.home-screen)) .app-brand .brand-logo-dark {
  display: none;
}

html[data-theme="light"]:not(:has(body.home-screen)) .app-brand .brand-logo-ink {
  display: block;
}

.app-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.app-modules {
  display: grid;
  grid-template-columns: 1fr;
  min-width: 0;
  overflow: hidden;
  opacity: 1;
  transform: translateX(0);
  transition:
    grid-template-columns 380ms var(--ease-in-out),
    opacity 260ms var(--ease-out),
    transform 380ms var(--ease-in-out);
}

.app-modules-inner {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.app-modules a {
  white-space: nowrap;
  flex: 0 0 auto;
}

.app-org-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  max-width: 18rem;
}

.app-org-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-nav.is-folding .app-modules,
.app-nav.is-org-picker .app-modules,
html.nav-will-unfold .app-modules {
  grid-template-columns: 0fr;
  max-width: 0;
  opacity: 0;
  transform: translateX(36px);
  pointer-events: none;
}

.app-nav.is-org-picker .app-modules {
  max-height: 0;
}

.app-nav.is-org-picker .app-modules,
html.nav-will-unfold .app-modules {
  transition: none;
}

.app-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: 0.01em;
  padding: 8px 12px;
  border-radius: 999px;
  transition: color 160ms ease, background-color 160ms ease;
}

.promo-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 3px 7px 4px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(243, 226, 122, 0.18);
  color: var(--gold);
  vertical-align: middle;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.promo-badge-price,
.promo-badge-status {
  display: block;
}

.promo-badge-status {
  font-size: 8px;
  letter-spacing: 0.1em;
  opacity: 0.78;
  font-weight: 700;
}

.app-links a.is-active .promo-badge {
  background: rgba(17, 17, 17, 0.14);
  color: #111;
}

.promo-badge s,
.price-was {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  opacity: 0.55;
  font-weight: 550;
}

.price-promo,
.addon-price.is-promo {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.app-title:has(.promo-badge),
.addon-option strong:has(.promo-badge) {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.module-card h3 .promo-badge,
.app-title .promo-badge,
.addon-option .promo-badge,
th .promo-badge {
  margin-left: 6px;
  font-size: 10px;
  padding: 3px 8px 4px;
}

.module-card h3 .promo-badge-status,
.app-title .promo-badge-status,
.addon-option .promo-badge-status,
th .promo-badge-status {
  font-size: 8px;
}

body.home-screen.home-light .module-card .promo-badge {
  background: rgba(28, 26, 20, 0.12);
  color: #1c1a14;
}

body.marketing-body .promo-badge {
  background: rgba(154, 125, 28, 0.16);
  color: #8f7820;
}

@media (hover: hover) and (pointer: fine) {
  .app-links a:hover {
    color: var(--ink);
    background: var(--nav-hover);
  }
}

.app-links a.is-active {
  color: #111;
  background: var(--gold-fill);
}

.app-links .btn-ghost {
  margin-left: 8px;
}

.theme-toggle {
  appearance: none;
  border: 0;
  margin-left: 8px;
  padding: 4px;
  width: 58px;
  height: 32px;
  border-radius: 999px;
  background: var(--bg-field);
  box-shadow: inset 0 0 0 1px var(--control-border-strong);
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
}

.theme-toggle-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold-fill);
  display: grid;
  place-items: center;
  color: #111;
  transition: transform 180ms var(--ease-out);
}

html[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(26px);
}

.theme-toggle .theme-toggle-moon {
  display: none;
}

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

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

.theme-toggle:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 1px var(--gold), 0 0 0 3px rgba(243, 226, 122, 0.14);
}

.theme-toggle svg {
  display: block;
}

.app-main {
  width: min(1140px, calc(100% - 48px));
  margin: 36px auto 80px;
}

body.home-screen {
  background: #000;
}

body.home-screen.home-light {
  background: #f6f1e4;
}

.home-video {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.home-video::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(12, 12, 13, 0.28), rgba(12, 12, 13, 0.58)),
    radial-gradient(900px 420px at 12% -10%, rgba(243, 226, 122, 0.08), transparent 55%);
}

.home-light .home-video::after {
  background:
    linear-gradient(180deg, rgba(246, 241, 228, 0.08), rgba(246, 241, 228, 0.22)),
    radial-gradient(900px 420px at 12% -10%, rgba(243, 226, 122, 0.14), transparent 55%);
}

body.home-screen.home-light .app-title {
  color: #1c1a14;
}

.home-video video,
.home-video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.wallpaper-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  cursor: pointer;
}

.wallpaper-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wallpaper-preview {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 10px;
  background: #000;
  box-shadow: inset 0 0 0 1px var(--control-border-strong);
  transition: box-shadow 160ms ease;
}

.wallpaper-preview video,
.wallpaper-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wallpaper-option:hover .wallpaper-preview,
.wallpaper-option:has(input:focus-visible) .wallpaper-preview {
  box-shadow: inset 0 0 0 1px rgba(243, 226, 122, 0.45);
}

.wallpaper-option:has(input:checked) .wallpaper-preview {
  box-shadow: inset 0 0 0 2px var(--gold);
}

.wallpaper-name {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.wallpaper-option:has(input:checked) .wallpaper-name {
  color: var(--gold);
}

.home-screen .app-nav,
.home-screen .app-main {
  position: relative;
  z-index: 1;
}

body.modal-open.home-screen .app-main {
  z-index: auto;
}

body.home-screen .modal {
  z-index: 1080;
}

body.home-screen .modal-backdrop {
  z-index: 1070;
}

.home-screen .module-card {
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.page-kicker {
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 22px;
  border-bottom: 1px solid var(--line);
}

.section-tabs a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px 12px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.section-tabs a.is-active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.app-modal .section-tabs {
  margin: 0 0 16px;
}

.journal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 12px;
}

.journal-table td,
.journal-table th {
  font-variant-numeric: tabular-nums;
}

.lede,
.app-body .text-muted {
  color: var(--muted) !important;
}

body.home-screen.home-light .page-kicker {
  color: #1c1a14;
}

body.home-screen.home-light .text-muted {
  color: #3f3b32 !important;
}

.btn-app,
.btn-ghost,
.auth-card .btn,
.auth-card input[type="submit"],
.marketing-body .btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 140ms var(--ease-out), background-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

.btn-app,
.auth-card input[type="submit"],
.marketing-body .btn-primary,
.marketing-body .btn-warning {
  background: var(--gold-fill);
  color: #111;
}

.marketing-body .btn-dark {
  background: #111;
  color: #fff;
}

.marketing-body .btn-light {
  background: #fff;
  color: #111;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--control-border-strong);
}

.marketing-body .btn-outline-primary,
.marketing-body .btn-outline-dark {
  background: transparent;
  color: #111;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.28);
}

.btn-app:active,
.btn-ghost:active,
.auth-card input[type="submit"]:active,
.module-card:active,
.org-card:active,
.marketing-body .btn:active {
  transform: scale(0.97);
}

.module-grid,
.org-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.module-card,
.org-card,
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.module-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 22px 20px 20px;
  min-height: 148px;
  position: relative;
  overflow: hidden;
  transition: transform 180ms var(--ease-out);
}

.module-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--gold);
  transform: scaleY(0.35);
  transform-origin: top;
  transition: transform 200ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .module-card:hover::before {
    transform: scaleY(1);
  }
}

.module-card h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
  font-weight: 600;
  line-height: 1.1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}

.module-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.module-card.is-soon {
  cursor: default;
  opacity: 0.72;
}

.module-card.is-soon:active {
  transform: none;
}

@media (hover: hover) and (pointer: fine) {
  .module-card.is-soon:hover::before {
    transform: scaleY(0.35);
  }
}

.panel {
  padding: 22px;
  overflow: hidden;
}

.facts-panel {
  padding: 20px 22px;
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px 20px;
}

.facts-label {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.facts-value {
  margin: 0;
  font-size: 15px;
  font-weight: 550;
  letter-spacing: -0.02em;
}

.dates-form {
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}

.dates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px 16px;
  align-items: end;
}

.dates-actions {
  display: flex;
  align-items: flex-end;
  padding-bottom: 1px;
}

.panel h2,
.panel .h5,
.panel .h6 {
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.app-main a:not([class]) {
  color: var(--gold);
  text-decoration: none;
}

.app-main a:not([class]):hover {
  color: var(--ink);
}

.app-body .form-control,
.app-body .form-select,
.app-body select,
.auth-card .form-control,
.auth-card select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 44px;
  background-color: var(--bg-field);
  color: var(--ink);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-field);
  padding: 11px 14px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 450;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color-scheme: inherit;
  box-shadow: inset 0 1px 0 var(--inset-highlight);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.app-body .form-select,
.app-body select,
.auth-card select {
  padding-right: 40px;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  cursor: pointer;
}

.app-body .form-control::placeholder,
.auth-card .form-control::placeholder {
  color: var(--placeholder);
  font-weight: 400;
}

.app-body textarea.form-control {
  min-height: 104px;
  resize: vertical;
  line-height: 1.45;
  padding-top: 12px;
}

.app-body .form-control:hover,
.app-body .form-select:hover,
.app-body select:hover,
.auth-card .form-control:hover,
.auth-card select:hover {
  border-color: rgba(243, 226, 122, 0.28);
}

.app-body .form-control:focus,
.app-body .form-select:focus,
.app-body select:focus,
.app-body select:open,
.auth-card .form-control:focus,
.auth-card select:focus,
.auth-card select:open {
  outline: 0;
  border-color: rgba(243, 226, 122, 0.7);
  box-shadow: 0 0 0 3px rgba(243, 226, 122, 0.14), inset 0 1px 0 var(--inset-highlight);
  background-color: var(--field-focus-bg);
  color: var(--ink);
}

.app-body select:disabled,
.auth-card select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.app-body .form-select option,
.app-body select option,
.auth-card select option {
  background: var(--select-option-bg);
  color: var(--ink);
}

@supports (appearance: base-select) {
  .app-body select:not([multiple]),
  .app-body select:not([multiple])::picker(select),
  .auth-card select:not([multiple]),
  .auth-card select:not([multiple])::picker(select) {
    appearance: base-select;
    -webkit-appearance: base-select;
  }

  .app-body select:not([multiple]),
  .auth-card select:not([multiple]) {
    background-image: none;
    padding-right: 14px;
  }

  .app-body .table select:not([multiple]) {
    padding-right: 12px;
  }

  .app-body select::picker-icon,
  .auth-card select::picker-icon {
    content: "";
    width: 12px;
    height: 8px;
    margin-inline-start: 10px;
    background-color: var(--gold);
    mask: var(--select-chevron) center / contain no-repeat;
    -webkit-mask: var(--select-chevron) center / contain no-repeat;
    transition: rotate 180ms var(--ease-out);
  }

  .app-body select:open::picker-icon,
  .auth-card select:open::picker-icon {
    rotate: 180deg;
  }

  .app-body select::picker(select),
  .auth-card select::picker(select) {
    margin-top: 6px;
    min-inline-size: anchor-size(self-inline);
    max-height: min(320px, 70vh);
    overflow: auto;
    padding: 6px;
    background: var(--select-picker-bg);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    color: var(--ink);
    border: 1px solid rgba(243, 226, 122, 0.18);
    border-radius: 14px;
    box-shadow: var(--shadow);
    scrollbar-width: thin;
    scrollbar-color: rgba(243, 226, 122, 0.35) transparent;
    opacity: 0;
    transform: translateY(-6px);
    transition:
      opacity 180ms var(--ease-out),
      transform 180ms var(--ease-out),
      overlay 180ms allow-discrete,
      display 180ms allow-discrete;
  }

  .app-body select:open::picker(select),
  .auth-card select:open::picker(select) {
    opacity: 1;
    transform: translateY(0);
  }

  @starting-style {
    .app-body select:open::picker(select),
    .auth-card select:open::picker(select) {
      opacity: 0;
      transform: translateY(-6px);
    }
  }

  .app-body select option,
  .auth-card select option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    margin: 1px 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 450;
    letter-spacing: -0.015em;
    white-space: normal;
    cursor: pointer;
  }

  .app-body select option:hover,
  .app-body select option:focus,
  .auth-card select option:hover,
  .auth-card select option:focus {
    background: var(--nav-hover);
  }

  .app-body select option:checked,
  .auth-card select option:checked {
    background: rgba(243, 226, 122, 0.12);
    color: var(--gold);
    font-weight: 600;
  }

  .app-body select option:disabled,
  .auth-card select option:disabled {
    color: var(--muted);
    opacity: 0.5;
    cursor: not-allowed;
  }

  .app-body select option::checkmark,
  .auth-card select option::checkmark {
    content: "";
    order: 1;
    width: 8px;
    height: 8px;
    margin-inline-start: auto;
    flex-shrink: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: inset 0 0 0 1px rgba(243, 226, 122, 0.35);
  }

  .app-body select option:checked::checkmark,
  .auth-card select option:checked::checkmark {
    background: var(--gold);
    box-shadow: none;
  }

  .app-body select optgroup,
  .auth-card select optgroup {
    padding: 8px 8px 4px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .app-body .table select option,
  .app-modal .table select option {
    padding: 7px 10px;
    font-size: 13px;
  }
}

.app-body .form-label,
.app-body .form-check-label {
  display: block;
  color: var(--gold);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 7px;
}

.app-body .form-check {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-body .form-check-label {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-transform: none;
  cursor: pointer;
}

.app-body .form-check-input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 18px;
  border-radius: 5px;
  background: var(--bg-field);
  border: 1px solid var(--control-border-strong);
  accent-color: var(--gold);
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--inset-highlight);
}

.app-body .form-check-input:checked {
  background-color: var(--gold);
  border-color: var(--gold);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' fill='none' viewBox='0 0 12 10'%3E%3Cpath d='M1.2 5.2 4.4 8.4 10.8 1.6' stroke='%23111111' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 11px 9px;
}

.app-body .form-check-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(243, 226, 122, 0.14);
}

.app-body .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  --bs-table-striped-bg: transparent;
  --bs-table-hover-bg: transparent;
  --bs-table-border-color: transparent;
  --bs-table-accent-bg: transparent;
  color: var(--ink);
  margin: 0;
  font-size: 14px;
  border-collapse: separate;
  border-spacing: 0;
}

.app-body .table thead th {
  color: var(--gold);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(243, 226, 122, 0.055);
  border: 0;
  border-bottom: 1px solid rgba(243, 226, 122, 0.18);
  padding: 11px 14px;
  white-space: nowrap;
}

.app-body .table td,
.app-body .table th {
  padding: 13px 14px;
  vertical-align: middle;
  border: 0;
  border-bottom: 1px solid var(--hairline);
}

.app-body .table tbody tr:last-child td {
  border-bottom: 0;
}

.app-body .table tbody tr {
  transition: background-color 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .app-body .table tbody tr:hover td {
    background: rgba(243, 226, 122, 0.035);
  }

  .app-body .table tbody tr:hover td:first-child {
    box-shadow: inset 2px 0 0 var(--gold);
  }
}

.app-body .table a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 550;
}

.app-body .table a:hover {
  color: var(--ink);
}

.app-body .table .sku,
.app-body .table td.sku a {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--gold);
}

.app-body.is-trade .table:has(th.item) {
  --sku-col: 16rem;
  --item-col: 22rem;
}

.app-body.is-trade .table th.sku,
.app-body.is-trade .table td.sku {
  width: var(--sku-col, 16rem);
  min-width: var(--sku-col, 16rem);
  max-width: var(--sku-col, 16rem);
}

.app-body.is-trade .table th.item,
.app-body.is-trade .table td.item {
  width: var(--item-col, 22rem);
  min-width: var(--item-col, 22rem);
  max-width: var(--item-col, 22rem);
}

.app-body.is-trade .table:has(th.item) th.sku,
.app-body.is-trade .table:has(th.item) td.sku,
.app-body.is-trade .table:has(th.item) th.item,
.app-body.is-trade .table:has(th.item) td.item {
  position: sticky;
  z-index: 2;
  background: var(--bg-panel);
}

.app-body.is-trade .table:has(th.item) th.sku,
.app-body.is-trade .table:has(th.item) td.sku {
  left: 0;
}

.app-body.is-trade .table:has(th.item) th.item,
.app-body.is-trade .table:has(th.item) td.item {
  left: var(--sku-col, 16rem);
  box-shadow: inset -1px 0 0 var(--hairline);
}

.app-body.is-trade .table:has(th.item) thead th.sku,
.app-body.is-trade .table:has(th.item) thead th.item {
  z-index: 3;
  background: color-mix(in srgb, var(--gold) 8%, var(--bg-panel));
}

.app-body.is-trade .table:has(th.item) tbody tr:hover td.sku,
.app-body.is-trade .table:has(th.item) tbody tr:hover td.item {
  background: color-mix(in srgb, var(--gold) 6%, var(--bg-panel));
}

.app-body.is-trade .table td.sku,
.app-body.is-trade .table td.item,
.app-body.is-trade .table td.sku .cell-clip,
.app-body.is-trade .table td.item .cell-clip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-body.is-trade .table td.sku .cell-clip,
.app-body.is-trade .table td.item .cell-clip {
  display: block;
}

.app-body.is-trade .table td.sku .cell-clip {
  max-width: 16rem;
}

.app-body.is-trade .table td.item .cell-clip {
  max-width: 22rem;
}

.app-body.is-trade .table td.sku a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-body .table.is-single-line td {
  white-space: nowrap;
}

.app-body .table.is-single-line td.clip {
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-body .table.is-single-line td.customer {
  max-width: 11rem;
  width: 11rem;
}

.app-body .table .num,
.app-body .journal-table td:not(:first-child),
.app-body .journal-table th:not(:first-child) {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 450;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  color: var(--num);
}

.app-body .table thead th.num,
.app-body .journal-table thead th:not(:first-child) {
  text-align: right;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.app-body .table tfoot th,
.app-body .table tfoot td {
  border-top: 1px solid rgba(243, 226, 122, 0.22);
  border-bottom: 0;
  background: rgba(243, 226, 122, 0.045);
  font-weight: 650;
  color: var(--ink);
  padding: 13px 14px;
}

.app-body .table td.text-muted {
  font-style: italic;
  letter-spacing: 0.01em;
}

.app-body .table .btn-ghost,
.app-body .table .btn-app,
.app-modal .table .btn-ghost,
.app-modal .table .btn-app {
  padding: 6px 12px;
  font-size: 12px;
}

.app-body .table .form-control,
.app-body .table .form-select,
.app-body .table select {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 13.5px;
  border-radius: 10px;
  background-color: var(--table-field-bg);
}

.app-body .table .form-select,
.app-body .table select {
  padding-right: 36px;
  background-position: right 12px center;
}

.app-body .table .form-control[name="qty"],
.app-body .table .form-control[name="qty_per"],
.app-body .table .form-control[name="unit_cost"],
.app-body .table .form-control[name="unit_price"],
.app-body .table .form-control[name="transfer_qty"] {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.panel > .table-responsive:last-child {
  margin: 4px -22px -22px;
}

.panel > .table-responsive:first-child {
  margin-top: -8px;
}

.panel > .table-responsive:last-child .table thead th:first-child,
.panel > .table-responsive:last-child .table tbody td:first-child,
.panel > .table-responsive:last-child .table tfoot th:first-child,
.panel > .table-responsive:last-child .table tfoot td:first-child {
  padding-left: 22px;
}

.panel > .table-responsive:last-child .table thead th:last-child,
.panel > .table-responsive:last-child .table tbody td:last-child,
.panel > .table-responsive:last-child .table tfoot th:last-child,
.panel > .table-responsive:last-child .table tfoot td:last-child {
  padding-right: 22px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(243, 226, 122, 0.12);
  color: var(--gold);
}

.pill.is-received,
.pill.is-fulfilled {
  background: rgba(90, 186, 130, 0.16);
  color: #8ee0b0;
}

.pill.is-draft {
  background: var(--chip-bg);
  color: var(--muted);
}

.pill.is-authorised {
  background: rgba(243, 226, 122, 0.16);
  color: var(--gold);
}

.pill.is-wip {
  background: rgba(90, 160, 220, 0.18);
  color: #9cc7f0;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chips a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--chip-bg);
}

.filter-chips a.is-active {
  color: var(--gold);
  background: rgba(243, 226, 122, 0.16);
}

.app-pagination .page-link {
  color: var(--gold);
  background: var(--bg-panel);
  border-color: var(--control-border);
}

.app-pagination .page-link:hover,
.app-pagination .page-link:focus {
  color: var(--gold-deep);
  background: rgba(243, 226, 122, 0.1);
  border-color: var(--gold);
  box-shadow: none;
}

.app-pagination .page-item.active .page-link {
  color: #111;
  background: var(--gold-fill);
  border-color: var(--gold-fill);
}

.app-pagination .page-item.disabled .page-link {
  color: var(--muted);
  background: var(--chip-bg);
  border-color: var(--control-border);
}

.build-flow,
.status-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

.status-flow-item {
  display: flex;
  align-items: center;
}

.status-flow-item:not(:last-child)::after {
  content: "";
  width: 22px;
  height: 2px;
  margin: 0 6px;
  background: var(--hairline);
  border-radius: 999px;
}

.status-flow-item.is-done:not(:last-child)::after,
.status-flow-item.is-current:not(:last-child)::after,
.status-flow-item.is-partial:not(:last-child)::after {
  background: rgba(243, 226, 122, 0.35);
}

.build-flow-step,
.status-flow-step {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--chip-bg);
  border: 1px solid var(--line);
}

.build-flow-step.is-done,
.status-flow-item.is-done .status-flow-step {
  color: #8ee0b0;
  background: rgba(90, 186, 130, 0.12);
  border-color: rgba(90, 186, 130, 0.22);
}

.build-flow-step.is-current,
.status-flow-item.is-current .status-flow-step {
  color: var(--gold);
  background: rgba(243, 226, 122, 0.14);
  border-color: rgba(243, 226, 122, 0.35);
}

.status-flow-item.is-partial .status-flow-step {
  color: var(--gold);
  background: rgba(243, 226, 122, 0.1);
  border-color: rgba(243, 226, 122, 0.45);
  border-style: dashed;
}

.status-flow-item.is-void .status-flow-step {
  color: var(--danger);
  background: rgba(227, 106, 86, 0.12);
  border-color: rgba(227, 106, 86, 0.35);
}

.status-flow.is-compact {
  margin: 0;
  flex-wrap: nowrap;
}

.status-flow.is-compact .status-flow-step {
  padding: 4px 8px;
  font-size: 10px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.status-flow.is-compact .status-flow-item:not(:last-child)::after {
  width: 12px;
  margin: 0 4px;
}

.auth-body {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: #000;
}

.auth-video {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.auth-video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.45));
}

.auth-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-body > *:not(.auth-video) {
  position: relative;
  z-index: 1;
}

.auth-card {
  width: min(420px, 100%);
  background: rgba(16, 16, 18, 0.72);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(243, 226, 122, 0.2);
  border-radius: 24px;
  padding: 30px 26px 24px;
  box-shadow: var(--shadow);
}

.auth-logo {
  display: block;
  width: min(220px, 70%);
  height: auto;
  margin: 0 auto 18px;
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.auth-card p.lede {
  margin: 0 0 22px;
  color: #c9c4b6;
}

.auth-card .form-control,
.auth-card select {
  width: 100%;
  margin-bottom: 10px;
}

.auth-card input[type="submit"] {
  width: 100%;
  margin-top: 6px;
}

.auth-card .btn-app {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
}

.auth-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  font-size: 14px;
}

.auth-meta a {
  color: #c9c4b6;
}

.auth-qr {
  display: block;
  width: 180px;
  height: 180px;
  margin: 0 auto 16px;
  padding: 8px;
  background: #fff;
  border-radius: 12px;
}

.auth-secret {
  font-size: 13px;
  color: #c9c4b6;
  text-align: center;
  margin: 0 0 18px;
  word-break: break-all;
}

.auth-secret code {
  font-family: 'IBM Plex Mono', monospace;
  color: #f3e27a;
  letter-spacing: 0.08em;
}

.backup-codes {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.backup-codes code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  letter-spacing: 0.06em;
}

.backup-codes.is-app {
  max-width: 360px;
}

.backup-codes.is-app code {
  color: var(--ink);
}

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-stack .toast,
.toast-stack .toast.show {
  display: block;
  min-width: 240px;
  max-width: 360px;
  background: var(--toast-bg);
  color: var(--toast-ink);
  border: 1px solid rgba(243, 226, 122, 0.2);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  opacity: 1;
  transform: translateY(0);
  transition: transform 220ms var(--ease-out), opacity 220ms var(--ease-out);
}

.toast[data-starting-style] {
  opacity: 0;
  transform: translateY(12px) scale(0.97);
}

.org-card {
  padding: 22px 18px;
  text-align: center;
}

.org-card img.org-logo,
.org-card .org-fallback,
.org-logo-field .org-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 16px;
  background: #101012;
  color-scheme: only light;
  filter: none;
  forced-color-adjust: none;
}

.org-card img.org-logo,
.org-card .org-fallback {
  margin: 0 auto 14px;
}

.org-logo-field {
  display: flex;
  align-items: center;
  gap: 14px;
}

.org-logo-field .org-logo {
  flex: 0 0 auto;
}

.org-logo-field .form-control {
  min-width: 0;
}

.org-card h2 {
  color: var(--ink);
}

.org-card button,
.org-card .btn-app,
.org-card .btn-ghost {
  width: 100%;
}

.org-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.org-addons {
  min-height: 1.4em;
  font-size: 12px;
  margin-bottom: 14px;
}

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

.addon-option {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-field);
  cursor: pointer;
}

.addon-option.is-base {
  cursor: default;
}

.addon-option strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
}

.addon-option .text-muted {
  font-size: 13px;
  margin-top: 2px;
}

.addon-price {
  color: var(--gold);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.form-check-input.is-locked {
  background-color: var(--gold);
  border-color: var(--gold);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' fill='none' viewBox='0 0 12 10'%3E%3Cpath d='M1.2 5.2 4.4 8.4 10.8 1.6' stroke='%23111111' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 11px 9px;
  pointer-events: none;
  cursor: default;
}

.cost-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(243, 226, 122, 0.08);
}

.cost-total strong {
  font-size: 22px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.status-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.status-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-field);
  cursor: pointer;
  font-weight: 600;
}

.status-option:has(input:checked) {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
  color: var(--gold);
}

.status-option.is-locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.status-option.is-locked input {
  pointer-events: none;
}

.trial-panel {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-field);
}

.trial-meter {
  height: 8px;
  border-radius: 999px;
  background: var(--chip-bg);
  overflow: hidden;
  margin-bottom: 10px;
}

.trial-meter-fill {
  height: 100%;
  background: var(--gold);
  border-radius: inherit;
}

.org-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.card-on-file {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--chip-bg);
}

.page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.copy-qty-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
}

.copy-qty-from {
  flex: 1 1 280px;
  max-width: 440px;
}

.copy-qty-from-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.copy-qty-from-row .form-select {
  flex: 1 1 auto;
  min-width: 0;
}

.copy-qty-from-row .btn-app {
  flex: 0 0 auto;
  white-space: nowrap;
}

.copy-qty-remaining {
  margin-left: auto;
}

@media (max-width: 720px) {
  .app-nav {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .copy-qty-from {
    max-width: none;
  }

  .copy-qty-remaining {
    margin-left: 0;
  }

  .status-options {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 160ms !important;
    transition-property: opacity, color, background-color !important;
  }

  .auth-video video,
  .home-video video,
  .wallpaper-preview video { display: none; }
  .auth-body,
  body.home-screen { background: var(--bg); }
  body.home-screen.home-light { background: #f6f1e4; }
}

@media (prefers-reduced-transparency: reduce) {
  .app-nav,
  .auth-card {
    background: var(--bg-raised);
    backdrop-filter: none;
  }

  .app-body select::picker(select),
  .auth-card select::picker(select) {
    background: var(--bg-panel);
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  .panel,
  .module-card,
  .org-card,
  .auth-card {
    background: var(--bg);
    border: 1px solid var(--ink);
  }
}

.stock-callout {
  background: rgba(227, 106, 86, 0.1);
  border: 1px solid rgba(227, 106, 86, 0.35);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--ink);
}

.stock-callout ul {
  padding-left: 1.1rem;
}

.stock-callout .btn-app,
.stock-callout .btn-ghost {
  padding: 6px 12px;
  font-size: 12px;
}

.app-body .table tr.is-short td,
.is-short-text {
  color: var(--danger);
}

.app-modal .modal-content {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.app-modal .modal-dialog-scrollable .modal-content {
  max-height: calc(100vh - 3rem);
}

.app-modal .modal-dialog-scrollable .modal-content > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.app-modal .modal-dialog-scrollable .modal-body {
  overflow-y: auto;
}

.app-modal .modal-header,
.app-modal .modal-footer {
  border-color: var(--line);
}

.app-modal .modal-title {
  color: var(--ink);
}

.app-modal .btn-close {
  filter: var(--close-filter);
}

.app-modal .modal-footer {
  gap: 8px;
}

.kpi-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin: -8px 0 22px;
}

.kpi-chip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 140px;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 180ms var(--ease-out);
}

.kpi-chip:hover {
  color: inherit;
  transform: translateY(-1px);
}

.kpi-chip-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kpi-chip-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.kpi-chip-hint {
  color: var(--muted);
  font-size: 12px;
}

.kpi-strip-compare {
  margin-top: -12px;
}

.kpi-chip.is-alert .kpi-chip-value,
.kpi-tile.is-alert .kpi-value {
  color: var(--danger);
}

.kpi-strip-action {
  align-self: center;
  margin-left: auto;
}

.kpi-section {
  margin-bottom: 16px;
}

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

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

.kpi-tile {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 16px 16px 14px;
  min-height: 118px;
  background: var(--kpi-tile-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}

a.kpi-tile:hover {
  color: inherit;
}

.kpi-tile::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--gold);
  transform: scaleY(0.35);
  transform-origin: top;
  transition: transform 200ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  a.kpi-tile:hover::before {
    transform: scaleY(1);
  }
}

.kpi-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kpi-value {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.kpi-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.kpi-up {
  color: var(--gold);
}

.kpi-down {
  color: var(--danger);
}

@media (max-width: 720px) {
  .kpi-strip-action {
    margin-left: 0;
    width: 100%;
  }
}
