/* Theme: shared semantic tokens first, then dark/glass overrides. Keep after styles.css. */
:root {
  color-scheme: dark;
  --brand-black: #0d0d0c;
  --brand-gold: #d4a84f;
  --brand-gold-dark: #f0ca76;
  --ink: #f3f0e8;
  --graphite: #171715;
  --paper: #211f1c;
  --canvas: #0c0c0b;
  --line: rgba(255, 255, 255, 0.12);
  --muted: #aaa59c;
  --accent: #d4a84f;
  --accent-ink: #f0ca76;
  --accent-soft: rgba(212, 168, 79, 0.14);
  --success: rgba(80, 170, 118, 0.16);
  --success-ink: #8ed4a9;
  --panel: rgba(32, 30, 26, 0.62);
  --panel-solid: #201f1c;
  --panel-raised: #292722;
  --danger: #ff938c;
  --shadow: 0 24px 62px rgba(0, 0, 0, 0.34);
  --glass-edge: rgba(255, 255, 255, 0.17);
  --glass-shine: rgba(255, 255, 255, 0.12);
}

html {
  background: var(--canvas);
}
body {
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(
      circle at 16% 0%,
      rgba(224, 228, 226, 0.055),
      transparent 31rem
    ),
    radial-gradient(
      circle at 88% 18%,
      rgba(212, 168, 79, 0.085),
      transparent 36rem
    ),
    linear-gradient(135deg, #080808 0%, #17120c 48%, #080909 100%),
    var(--canvas);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline-color: var(--accent);
}

.app-shell {
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
}
.sidebar {
  top: 14px;
  height: calc(100dvh - 28px);
  padding: 25px 18px 20px;
  border: 1px solid var(--glass-edge);
  border-radius: 25px;
  background: linear-gradient(
    160deg,
    rgba(35, 32, 27, 0.72),
    rgba(12, 12, 11, 0.68)
  );
  box-shadow:
    inset 0 1px 0 var(--glass-shine),
    0 28px 70px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(32px) saturate(135%);
  -webkit-backdrop-filter: blur(32px) saturate(135%);
}
.brand {
  min-height: 42px;
  padding: 0 10px;
}
.brand-mark {
  width: 62px;
  flex-basis: 62px;
  filter: drop-shadow(0 7px 18px rgba(212, 168, 79, 0.12));
}
.brand-name {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.075em;
}
.workspace {
  margin: 34px 10px 12px;
  color: #77736d;
}
.nav {
  gap: 4px;
}
.nav-link {
  min-height: 44px;
  padding: 10px 12px;
  border-left: 0;
  border-radius: 10px;
  color: #99958e;
  transition:
    color 0.15s ease,
    background-color 0.15s ease,
    transform 0.15s ease;
}
.nav-link:hover,
.nav-link:focus-visible {
  background: rgba(255, 255, 255, 0.055);
}
.nav-link.active {
  border-left: 0;
  background: linear-gradient(
    110deg,
    rgba(212, 168, 79, 0.22),
    rgba(212, 168, 79, 0.07)
  );
  color: #fff8e9;
  box-shadow: inset 0 0 0 1px rgba(212, 168, 79, 0.18);
}
.nav-link.active::before {
  width: 3px;
  height: 20px;
  border-radius: 3px;
  background: var(--accent);
  content: "";
}
.sidebar-bottom {
  border-top-color: rgba(255, 255, 255, 0.08);
  color: #aaa59c;
}
.sidebar-bottom small {
  color: #77736d;
}

.main-content {
  position: relative;
  min-height: calc(100dvh - 28px);
  overflow: clip;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background:
    radial-gradient(
      circle at 14% 10%,
      rgba(228, 232, 230, 0.065),
      transparent 28%
    ),
    radial-gradient(
      circle at 86% 18%,
      rgba(212, 168, 79, 0.11),
      transparent 34%
    ),
    linear-gradient(
      120deg,
      rgba(7, 8, 8, 0.94) 0 28%,
      rgba(20, 17, 13, 0.72) 54%,
      rgba(7, 8, 8, 0.92) 78% 100%
    ),
    #11110f;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.34);
  isolation: isolate;
}
.main-content::before {
  position: absolute;
  z-index: -2;
  top: -30%;
  left: -22%;
  width: 145%;
  height: 175%;
  background: url("assets/ambient-wave.svg") center / 100% 100% no-repeat;
  content: "";
  opacity: 0.94;
  transform: translate3d(-3%, -2%, 0) rotate(12deg) scale(1.025, 1);
  transform-origin: 58% 48%;
  animation: rz-glass-wave 24s cubic-bezier(0.45, 0, 0.25, 1) infinite alternate;
  will-change: transform;
  pointer-events: none;
}
.main-content::after {
  position: absolute;
  z-index: -1;
  top: -30%;
  left: -22%;
  width: 145%;
  height: 175%;
  background: linear-gradient(
    105deg,
    transparent 12%,
    rgba(231, 239, 238, 0.12) 29%,
    rgba(255, 244, 211, 0.28) 45%,
    transparent 58%,
    rgba(232, 172, 64, 0.18) 73%,
    transparent 88%
  );
  content: "";
  opacity: 0.7;
  transform: translate3d(-6%, -2%, 0) rotate(12deg) scale(1.03);
  transform-origin: 58% 48%;
  animation: rz-glass-reflection 16s cubic-bezier(0.45, 0, 0.25, 1) infinite
    alternate;
  -webkit-mask: url("assets/ambient-wave.svg") center / 100% 100% no-repeat;
  mask: url("assets/ambient-wave.svg") center / 100% 100% no-repeat;
  will-change: transform, opacity;
  pointer-events: none;
}

@keyframes rz-glass-wave {
  0% {
    transform: translate3d(-3%, -2%, 0) rotate(12deg) scale(1.025, 1);
  }
  50% {
    transform: translate3d(0, 2%, 0) rotate(13deg) scale(1.04, 1.025);
  }
  100% {
    transform: translate3d(3%, -1%, 0) rotate(11.5deg) scale(1.025, 1.05);
  }
}
@keyframes rz-glass-reflection {
  0% {
    opacity: 0.42;
    transform: translate3d(-7%, -2%, 0) rotate(12deg) scale(1.03);
  }
  52% {
    opacity: 0.82;
    transform: translate3d(1%, 1.5%, 0) rotate(13deg) scale(1.045, 1.02);
  }
  100% {
    opacity: 0.5;
    transform: translate3d(6%, -1%, 0) rotate(11.5deg) scale(1.03, 1.04);
  }
}
.topbar {
  position: sticky;
  z-index: 4;
  top: 14px;
  min-height: 82px;
  margin: 12px 12px 0;
  padding: 17px 26px;
  border: 1px solid var(--glass-edge);
  border-radius: 20px;
  background: linear-gradient(
    120deg,
    rgba(37, 34, 29, 0.64),
    rgba(17, 17, 15, 0.44)
  );
  box-shadow:
    inset 0 1px 0 var(--glass-shine),
    0 18px 42px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(30px) saturate(138%);
  -webkit-backdrop-filter: blur(30px) saturate(138%);
}
.topbar h1 {
  margin-top: 4px;
  color: #fffaf0;
  font-size: 26px;
  font-weight: 780;
  letter-spacing: -0.8px;
}
.eyebrow,
.workspace {
  color: #8e8980;
}
.date-label {
  color: #8e8980;
}
.avatar {
  border: 1px solid rgba(212, 168, 79, 0.28);
  background: linear-gradient(145deg, #3a3326, #1b1a17);
  color: #f6d98e;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}
.avatar:hover {
  background: #342e23;
  box-shadow: 0 0 0 3px rgba(212, 168, 79, 0.1);
}
.menu-button img {
  filter: invert(100%);
}

.page {
  width: calc(100% - 24px);
  max-width: 1540px;
  margin: 12px auto 24px;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 26px;
  background: linear-gradient(
    145deg,
    rgba(29, 27, 23, 0.4),
    rgba(12, 12, 11, 0.26)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 26px 68px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(20px) saturate(125%);
  -webkit-backdrop-filter: blur(20px) saturate(125%);
}
.metrics {
  gap: 16px;
  margin-bottom: 18px;
}
.metric,
.card {
  position: relative;
  border-color: var(--glass-edge);
  background: linear-gradient(
    145deg,
    rgba(50, 46, 39, 0.66),
    rgba(22, 21, 18, 0.46)
  );
  box-shadow:
    inset 0 1px 0 var(--glass-shine),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    var(--shadow);
  backdrop-filter: blur(28px) saturate(135%);
  -webkit-backdrop-filter: blur(28px) saturate(135%);
}
.metric {
  position: relative;
  min-height: 140px;
  padding: 22px;
  overflow: hidden;
  background: linear-gradient(
    145deg,
    rgba(245, 241, 232, 0.84),
    rgba(185, 176, 159, 0.68)
  );
  color: #161512;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(68, 58, 43, 0.18),
    0 24px 50px rgba(0, 0, 0, 0.26);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.metric::before,
.card:not(.table-card)::before {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 7%;
  left: 7%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.78),
    transparent
  );
  content: "";
  pointer-events: none;
}
.metric > *,
.card:not(.table-card) > * {
  position: relative;
  z-index: 1;
}
.metric:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 0 1px 0 #fff,
    0 30px 60px rgba(0, 0, 0, 0.34);
}
.metric::after {
  position: absolute;
  right: -18px;
  bottom: -34px;
  width: 118px;
  height: 86px;
  border: 1px solid rgba(70, 55, 30, 0.22);
  border-radius: 50%;
  content: "";
  transform: rotate(-12deg);
}
.metric:nth-child(4) {
  background: linear-gradient(
    145deg,
    rgba(244, 185, 68, 0.9),
    rgba(145, 96, 27, 0.82)
  );
  color: #17120b;
}
.metric-label,
.metric:first-child .metric-label,
.metric:first-child .metric-foot {
  color: #5c574f;
}
.metric-value {
  margin: 22px 0 6px;
  color: #151412;
  font-size: 32px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}
.metric-foot {
  color: #6d665c;
}
.metric:first-child {
  background: linear-gradient(
    145deg,
    rgba(31, 30, 27, 0.86),
    rgba(10, 10, 9, 0.7)
  );
  color: #fffaf0;
}
.metric:first-child .metric-label,
.metric:first-child .metric-foot {
  color: #aaa59c;
}
.metric:first-child .metric-value {
  color: #fffaf0;
}

.dashboard-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}
.dashboard-chart-card {
  grid-column: span 8;
  min-height: 390px;
}
.dashboard-tasks {
  grid-column: span 4;
  min-height: 390px;
}
.dashboard-deals {
  grid-column: span 8;
}
.dashboard-quick {
  grid-column: span 4;
  margin-top: 0;
}
.dashboard-quick {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  justify-content: space-between;
}
.dashboard-quick .card-header {
  margin-bottom: 0;
}
.dashboard-quick .primary-button {
  width: 100%;
}
.card:not(.table-card) {
  padding: 24px;
}
.card h2 {
  color: #fffaf0;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.025em;
}
.card-header,
.section-toolbar {
  margin-bottom: 18px;
}
.helper-text {
  color: #9a958d;
}

.stage-chart {
  display: grid;
  grid-template-columns: repeat(14, 88px);
  gap: 10px;
  height: 310px;
  padding: 12px 4px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-color: rgba(212, 168, 79, 0.38) rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
}
.stage-chart::-webkit-scrollbar {
  height: 6px;
}
.stage-chart::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}
.stage-chart::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(212, 168, 79, 0.38);
}
.stage-chart-item {
  display: grid;
  min-width: 88px;
  grid-template-rows: 22px minmax(145px, 1fr) 78px;
  gap: 8px;
  align-items: end;
  justify-items: center;
  scroll-snap-align: start;
  text-align: center;
}
.stage-chart-value {
  color: #ded9cf;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.stage-chart-track {
  position: relative;
  display: flex;
  height: 100%;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}
.stage-chart-track::before {
  position: absolute;
  inset: 0;
  opacity: 0.65;
  background: repeating-linear-gradient(
    to top,
    rgba(255, 255, 255, 0.055) 0 1px,
    transparent 1px 25%
  );
  content: "";
}
.stage-chart-track i {
  position: relative;
  z-index: 1;
  width: 38px;
  min-height: 5px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(
    180deg,
    var(--stage-color),
    color-mix(in srgb, var(--stage-color) 48%, #4e3e23)
  );
  box-shadow: 0 -8px 25px
    color-mix(in srgb, var(--stage-color) 17%, transparent);
}
.stage-chart-label {
  display: block;
  width: 100%;
  min-width: 0;
  color: #9a958d;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-align: center;
}

.primary-button,
.secondary-button,
.text-button,
.row-button {
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}
.primary-button {
  border: 1px solid #e1b75e;
  background: linear-gradient(180deg, #e0b65b, #bd8f39);
  color: #1a150c;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 8px 18px rgba(129, 91, 26, 0.18);
}
.primary-button:hover {
  background: linear-gradient(180deg, #e8c271, #c69a45);
}
.secondary-button,
.text-button {
  border-color: rgba(255, 255, 255, 0.13);
  background: #292722;
  color: #e8e3da;
}
.secondary-button:hover,
.text-button:hover,
.row-button:hover {
  border-color: rgba(212, 168, 79, 0.55);
  background: #332e24;
  color: #fff3d5;
}
.row-button {
  border-color: rgba(255, 255, 255, 0.09);
  background: #282621;
  color: #f2eee5;
}

.table-card {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(27, 26, 23, 0.9);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.24);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
table {
  color: #ded9cf;
  font-variant-numeric: tabular-nums;
}
th {
  color: #817d75;
}
td {
  border-top-color: rgba(255, 255, 255, 0.065);
}
tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}
.badge {
  background: #34322e;
  color: #c9c4bb;
}
.badge.new {
  background: rgba(212, 168, 79, 0.15);
  color: #edca7c;
}
.badge.work {
  background: rgba(115, 158, 190, 0.14);
  color: #a9cee6;
}
.badge.offer {
  background: rgba(151, 120, 177, 0.14);
  color: #d0b3e5;
}
.badge.won,
.badge.done {
  background: var(--success);
  color: var(--success-ink);
}
.task-item {
  border-top-color: rgba(255, 255, 255, 0.075);
}
.task-dot {
  box-shadow: 0 0 0 4px rgba(212, 168, 79, 0.1);
}
.task-item span {
  color: #858178;
}

.pipeline {
  gap: 12px;
  padding-bottom: 18px;
}
.pipeline-column {
  min-height: 500px;
  border-color: rgba(255, 255, 255, 0.14);
  background: linear-gradient(
    155deg,
    rgba(44, 40, 34, 0.62),
    rgba(20, 19, 17, 0.48)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 18px 46px rgba(0, 0, 0, 0.23);
  backdrop-filter: blur(24px) saturate(128%);
  -webkit-backdrop-filter: blur(24px) saturate(128%);
}
.pipeline-column.drop-target {
  border-color: var(--stage-color);
  background: #242017;
}
.pipeline-title {
  color: #98938a;
}
.pipeline-count {
  background: #302e29;
  color: #ddd7cd;
}
.deal-tile {
  border-color: rgba(255, 255, 255, 0.09);
  background: #272520;
  color: #f2ede4;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}
.deal-tile:hover {
  border-color: rgba(212, 168, 79, 0.52);
  background: #2d2a23;
}
.deal-tile span {
  color: #8f8a82;
}
.deal-tile footer {
  color: #c9c4ba;
}
.deal-tile .checklist-summary {
  color: #e2bb65;
}

dialog,
.profile-panel,
.auth-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(30, 29, 26, 0.9);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
}
dialog::backdrop {
  background: rgba(4, 4, 4, 0.76);
  backdrop-filter: blur(6px);
}
.icon-button {
  background: #302e29;
  color: #ded9cf;
}
.form-grid label,
.modal > form > label,
.auth-card label {
  color: #d4cfc5;
}
input,
select,
textarea {
  border-color: #565149;
  background: #171715;
  color: #f4efe5;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline-color: rgba(212, 168, 79, 0.18);
}
input::placeholder,
textarea::placeholder {
  color: #66625c;
}
.form-error {
  color: var(--danger);
}
.deal-card,
.checklist-item,
.checklist-empty {
  border-color: rgba(255, 255, 255, 0.075);
  background: #191816;
  color: #d9d4cb;
}
.deal-checklist-section {
  border-color: rgba(255, 255, 255, 0.085);
  background: #1c1b18;
}
.checklist-kind {
  background: #33312c;
  color: #aaa59c;
}
.checklist-kind.required,
.checklist-header > strong {
  background: rgba(212, 168, 79, 0.14);
  color: #edca7c;
}
.profile-panel {
  border-left-color: rgba(255, 255, 255, 0.09);
}
.profile-panel-header,
.profile-details,
.profile-details div {
  border-color: rgba(255, 255, 255, 0.075);
}
.profile-avatar {
  background: linear-gradient(145deg, #6a5429, #2e281d);
  color: #f4d88f;
}
.profile-security-note {
  border-color: rgba(212, 168, 79, 0.22);
  background: rgba(212, 168, 79, 0.08);
}
.auth-screen {
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 16% 14%,
      rgba(224, 228, 226, 0.09),
      transparent 30rem
    ),
    radial-gradient(
      circle at 84% 72%,
      rgba(212, 168, 79, 0.15),
      transparent 38rem
    ),
    linear-gradient(
      120deg,
      rgba(5, 5, 5, 0.94),
      rgba(40, 29, 18, 0.7),
      rgba(5, 6, 6, 0.94)
    ),
    #0c0c0b;
}
.auth-screen::before {
  position: absolute;
  z-index: -1;
  top: -30%;
  left: -22%;
  width: 145%;
  height: 175%;
  background: url("assets/ambient-wave.svg") center / 100% 100% no-repeat;
  content: "";
  opacity: 0.88;
  transform: translate3d(-3%, -2%, 0) rotate(12deg) scale(1.025, 1);
  transform-origin: 58% 48%;
  animation: rz-glass-wave 24s cubic-bezier(0.45, 0, 0.25, 1) infinite alternate;
  pointer-events: none;
}
.auth-card {
  border-color: var(--glass-edge);
  background: linear-gradient(
    145deg,
    rgba(45, 41, 35, 0.72),
    rgba(18, 18, 16, 0.58)
  );
  box-shadow:
    inset 0 1px 0 var(--glass-shine),
    0 32px 90px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(34px) saturate(136%);
  -webkit-backdrop-filter: blur(34px) saturate(136%);
}
.auth-card h1 {
  color: #fffaf0;
}
.totp-enrollment {
  border-color: rgba(255, 255, 255, 0.08);
  background: #171715;
}
.step-number {
  background: rgba(212, 168, 79, 0.14);
  color: #edca7c;
}
.empty-cell strong {
  color: #eee9df;
}
.status-toast {
  background: #733a36;
}
.preflight-form label {
  color: #d4cfc5;
}

.mobile-bottom-nav {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(20, 20, 18, 0.92);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}
.mobile-nav-link {
  color: #8f8b84;
}
.mobile-nav-link.active {
  color: #f0ca76;
}
.mobile-nav-link.active .mobile-nav-icon {
  background: rgba(212, 168, 79, 0.14);
}

@supports not ((backdrop-filter: blur(2px))) {
  .sidebar,
  .topbar,
  .page,
  .metric,
  .card,
  .pipeline-column,
  .auth-card,
  .mobile-bottom-nav {
    background: #201f1c;
  }
}

@media (max-width: 1120px) {
  .dashboard-chart-card,
  .dashboard-deals {
    grid-column: span 7;
  }
  .dashboard-tasks,
  .dashboard-quick {
    grid-column: span 5;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 10px;
  }
  .sidebar {
    top: 10px;
    height: calc(100dvh - 20px);
    background: #121211;
  }
  .main-content {
    min-height: calc(100dvh - 20px);
  }
  .topbar {
    margin: 10px 10px 0;
    padding: 16px 22px;
  }
  .page {
    width: calc(100% - 20px);
    margin: 10px auto 20px;
    padding: 22px;
  }
  .dashboard-chart-card,
  .dashboard-tasks,
  .dashboard-deals,
  .dashboard-quick {
    grid-column: 1 / -1;
  }
  .dashboard-tasks {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 74px;
  }
  .page {
    padding-bottom: 116px;
  }
  .mobile-bottom-nav {
    backdrop-filter: blur(18px) saturate(120%);
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 6px;
  }
  .main-content {
    min-height: calc(100dvh - 12px);
    border-radius: 22px;
  }
  .main-content::before,
  .main-content::after {
    top: -22%;
    left: -88%;
    width: 260%;
    height: 160%;
  }
  .main-content::before {
    opacity: 0.8;
  }
  .main-content::after {
    opacity: 0.5;
  }
  .topbar {
    margin: 7px 7px 0;
    padding: 14px 16px;
    border-radius: 17px;
  }
  .page {
    width: calc(100% - 14px);
    margin: 7px auto 14px;
    padding: 14px 12px 112px;
    border-radius: 20px;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .metric {
    min-height: 120px;
    padding: 16px;
  }
  .metric-value {
    margin-top: 18px;
    font-size: 25px;
  }
  .dashboard-grid {
    gap: 12px;
  }
  .dashboard-chart-card {
    min-height: 360px;
  }
  .stage-chart {
    grid-template-columns: repeat(14, 84px);
    height: 305px;
  }
  .stage-chart-item {
    min-width: 84px;
    grid-template-rows: 22px minmax(135px, 1fr) 82px;
  }
  .dashboard-quick {
    min-height: 210px;
  }
  .card:not(.table-card) {
    padding: 18px;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .sidebar,
  .topbar,
  .page,
  .card,
  .pipeline-column,
  .auth-card,
  .mobile-bottom-nav {
    background: #201f1c;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .metric {
    background: #e2ddd2;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .main-content::before,
  .auth-screen::before {
    opacity: 0.18;
    animation: none;
  }
  .main-content::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .main-content::before,
  .auth-screen::before,
  .main-content::after {
    animation: none;
    transform: rotate(12deg) scale(1.02);
  }
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Video reference: floating icon rail and glass surfaces; no idle motion. */
:root {
  --ease-ui: cubic-bezier(0.23, 1, 0.32, 1);
  --muted: #b1ada4;
  --desktop-background: #232a28;
  --surface-glass: linear-gradient(155deg, #ffffff16, #ffffff02 48%), #23252bcc;
  --surface-shadow:
    inset 0 1px 0 #ffffff24, inset 0 -1px 0 #ffffff06, 0 10px 24px #0003;
}
body {
  background: var(--desktop-background);
  background-attachment: fixed;
}
:root[data-wallpaper="gold"] {
  --desktop-background: linear-gradient(135deg, #292820, #252522 48%, #30291d);
}
:root[data-wallpaper="graphite"] {
  --desktop-background: #25282c;
}
:root[data-wallpaper="sage"] {
  --desktop-background: linear-gradient(140deg, #263c35, #202b29 65%, #344436);
}
:root[data-wallpaper="tide"] {
  --desktop-background: linear-gradient(135deg, #203442, #202730 55%, #313248);
}
:root[data-wallpaper="graphite"] .main-content::before {
  display: none;
}
:root[data-wallpaper="sage"] .main-content::before {
  filter: hue-rotate(70deg) saturate(0.5);
}
:root[data-wallpaper="tide"] .main-content::before {
  filter: hue-rotate(170deg) saturate(0.6);
}
:root[data-accent="blue"] {
  --accent: #90c9f6;
  --accent-ink: #b2dcff;
  --accent-soft: #81bfff26;
}
:root[data-accent="pink"] {
  --accent: #f4a5c8;
  --accent-ink: #ffd0e5;
  --accent-soft: #f4a5c826;
}
:root[data-accent="blue"] .nav-link.active .nav-icon {
  filter: invert(78%) sepia(25%) saturate(916%) hue-rotate(175deg);
}
:root[data-accent="pink"] .nav-link.active .nav-icon {
  filter: invert(75%) sepia(23%) saturate(901%) hue-rotate(291deg);
}
:root[data-solid="true"] {
  --surface-glass: #282b30;
}
:root[data-solid="true"] :is(.card, .metric, .sidebar, .pipeline-column) {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.quick-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid #ffffff30;
  border-radius: 999px;
  background: var(--surface-glass);
  box-shadow: var(--surface-shadow);
}
.quick-actions .icon-button,
.quick-actions .avatar {
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 50%;
}
.quick-actions .icon-button {
  background: transparent;
  color: var(--ink);
  border: 0;
}
.quick-actions .icon-button:hover {
  background: #ffffff12;
}
.appearance-card {
  margin-bottom: 20px;
  max-width: 880px;
}
.appearance-card fieldset {
  border: 0;
  padding: 22px 0;
  margin: 0;
  border-bottom: 1px solid #ffffff15;
  min-width: 0;
}
.appearance-card legend {
  padding: 8px 0 0;
  font-weight: 650;
}
.wallpaper-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.wallpaper-option {
  padding: 6px;
  background: transparent;
  color: var(--ink);
  border: 2px solid transparent;
  border-radius: 17px;
  min-height: 44px;
}
.wallpaper-option[aria-pressed="true"] {
  border-color: var(--accent);
}
.wallpaper-preview {
  display: flex;
  gap: 6px;
  height: 80px;
  padding: 12px;
  border: 1px solid #ffffff20;
  border-radius: 10px;
  margin-bottom: 8px;
}
.wallpaper-preview i {
  border: 1px solid #ffffff50;
  border-radius: 5px;
  width: 12px;
}
.wallpaper-preview i + i {
  width: 65%;
  height: 32px;
}
.wallpaper-graphite {
  background: #25282c;
}
.wallpaper-gold {
  background: linear-gradient(135deg, #292820, #71582e);
}
.wallpaper-sage {
  background: linear-gradient(135deg, #263c35, #55775b);
}
.wallpaper-tide {
  background: linear-gradient(135deg, #203442, #526492);
}
.accent-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.accent-option {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid #ffffff25;
  background: #ffffff05;
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  min-height: 44px;
}
.accent-option[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.accent-option span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d4a84f;
}
.accent-blue span {
  background: #90c9f6;
}
.accent-pink span {
  background: #f4a5c8;
}
.appearance-transparency {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 0 0;
}
.appearance-transparency small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 400;
}
.appearance-transparency input {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  accent-color: var(--accent);
}
#appearance-status {
  min-height: 20px;
  margin-bottom: 0;
}
@media (max-height: 700px) and (min-width: 901px) {
  .sidebar {
    overflow-y: auto;
    scrollbar-width: thin;
  }
  .nav-link:hover .nav-label,
  .nav-link:focus-visible .nav-label {
    position: fixed;
    left: 90px;
  }
}
@media (prefers-reduced-transparency: reduce) {
  :root {
    --surface-glass: #282b30;
  }
}
.app-shell {
  gap: 20px;
  padding: 18px;
  grid-template-columns: 64px minmax(0, 1fr);
}
.sidebar {
  top: 18px;
  height: calc(100dvh - 36px);
  padding: 10px 7px;
  overflow: visible;
  border-color: #ffffff30;
  border-radius: 24px;
  background: var(--surface-glass);
  box-shadow: var(--surface-shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.workspace {
  display: none;
}
.sidebar .brand {
  justify-content: center;
  padding: 0;
  margin-bottom: 16px;
}
.sidebar .brand-mark {
  width: 38px;
  flex-basis: 38px;
}
.sidebar .brand-name {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.sidebar .nav {
  gap: 5px;
}
.nav-link {
  position: relative;
  min-height: 44px;
  justify-content: center;
  padding: 10px;
  border-radius: 15px;
  color: #d1d3d6;
  font-weight: 600;
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease;
}
.nav-link .nav-label {
  display: none;
  position: absolute;
  z-index: 10;
  left: calc(100% + 16px);
  width: max-content;
  max-width: 220px;
  padding: 10px 14px;
  border: 1px solid #ffffff30;
  border-radius: 12px;
  background: #27292f;
  box-shadow: 0 8px 24px #0005;
  color: #fff;
  text-align: left;
  font-size: 13px;
  pointer-events: none;
}
.nav-link:hover .nav-label,
.nav-link:focus-visible .nav-label {
  display: block;
}
.nav-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.nav-link.active {
  background: linear-gradient(160deg, #ffffff25, #ffffff08), var(--accent-soft);
  box-shadow:
    inset 0 1px 0 #ffffff40,
    inset 0 0 0 1px #ffffff16,
    0 3px 10px #0002;
}
.nav-link.active::before {
  display: none;
}
.sidebar-bottom {
  padding: 14px 0 0;
  text-align: center;
}
.sidebar-bottom span:not(.status-dot),
.sidebar-bottom small,
.sidebar-bottom br {
  display: none;
}
.sidebar-bottom .status-dot {
  margin: 0;
}
.main-content {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.main-content::before {
  animation: none;
  will-change: auto;
  position: fixed;
  opacity: 0.28;
}
.main-content::after {
  display: none;
}
.topbar {
  position: relative;
  top: 0;
  min-height: 88px;
  margin: 0;
  padding: 12px 16px 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.topbar h1 {
  font-size: 25px;
  letter-spacing: -0.7px;
}
.eyebrow,
.workspace,
.date-label {
  color: #aaa59c;
}
.page {
  width: 100%;
  margin: 0 auto;
  padding: 8px 16px 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.metric,
.metric:first-child,
.metric:nth-child(4) {
  min-height: 112px;
  padding: 16px 20px;
  border: 1px solid #ffffff20;
  border-radius: 14px;
  background: var(--surface-glass);
  color: var(--ink);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    0 4px 12px #0002;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: none;
}
.metric:hover {
  transform: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    0 4px 12px #0002;
}
.metric::before,
.metric::after,
.card:not(.table-card)::before {
  display: none;
}
.metric-label,
.metric:first-child .metric-label {
  color: #c0bbb2;
  font-size: 12px;
  font-weight: 600;
}
.metric-value,
.metric:first-child .metric-value {
  margin: 18px 0 6px;
  color: var(--accent-ink);
  font-size: 32px;
  letter-spacing: -1px;
}
.metric-foot,
.metric:first-child .metric-foot {
  color: #aaa59c;
}
.card {
  border: 1px solid #ffffff30;
  border-radius: 24px;
  background: var(--surface-glass);
  box-shadow: var(--surface-shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.card:not(.table-card) {
  padding: 22px;
}
.dashboard-grid {
  gap: 16px;
}
.dashboard-chart-card {
  min-height: 340px;
}
.dashboard-tasks {
  min-height: 0;
}
.stage-chart {
  height: 260px;
}
.stage-chart-item {
  grid-template-rows: 22px minmax(100px, 1fr) 78px;
}
.stage-chart-label {
  color: #b9b4ab;
  font-size: 11px;
}
.helper-text,
.task-item span {
  color: #b1ada4;
}
.section-toolbar {
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.section-toolbar .helper-text {
  max-width: 680px;
}
.primary-button,
.secondary-button,
.text-button,
.row-button,
.icon-button,
.avatar {
  touch-action: manipulation;
  transition: transform 140ms var(--ease-ui);
}
.primary-button {
  border-color: transparent;
  border-radius: 999px;
  background: linear-gradient(#ffffff35, #ffffff00), var(--accent);
  box-shadow:
    inset 0 1px 0 #ffffff30,
    0 2px 4px #0003;
  color: #19150e;
}
.secondary-button,
.text-button,
.row-button {
  background: #282723;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 2px #0002;
}
.primary-button:active,
.secondary-button:active,
.text-button:active,
.row-button:active,
.icon-button:active,
.avatar:active {
  transform: scale(0.97);
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 3px;
  transition: none;
  transform: none;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}
.table-card {
  overflow: hidden;
  background: var(--surface-glass);
}
th {
  padding-top: 18px;
  padding-bottom: 18px;
  color: #c1bcb3;
  background: rgba(255, 255, 255, 0.025);
  font-weight: 650;
}
td {
  padding-top: 17px;
  padding-bottom: 17px;
  line-height: 1.5;
}
td small {
  color: #aaa59c;
}
.table-wrap {
  scrollbar-color: #625744 transparent;
  scrollbar-width: thin;
}
.pipeline {
  grid-auto-columns: 286px;
  gap: 14px;
}
.pipeline-column {
  min-height: 460px;
  padding: 16px 12px;
  border: 1px solid #ffffff28;
  border-radius: 22px;
  background: var(--surface-glass);
  box-shadow: var(--surface-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.pipeline-column::before {
  height: 2px;
  opacity: 0.8;
}
.pipeline-title {
  color: #cdc8be;
  font-size: 11px;
}
.deal-tile {
  padding: 16px;
  border-radius: 14px;
  background: #191d21e6;
  border-color: #ffffff20;
  box-shadow:
    inset 0 1px 0 #ffffff12,
    0 3px 8px #0003;
}
.deal-tile strong {
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.deal-tile span {
  color: #b7b1a7;
}
.deal-tile footer {
  gap: 12px;
  flex-wrap: wrap;
}
.modal {
  background: #201f1c;
  border-color: transparent;
  box-shadow:
    0 0 0 1px #ffffff20,
    0 24px 80px #0008;
}
.modal-header {
  margin-bottom: 24px;
}
input,
select,
textarea {
  min-height: 44px;
  border-color: #555149;
  background: #181816;
  font-size: 16px;
}
input::placeholder,
textarea::placeholder {
  color: #aaa398;
}
.checklist-item input {
  min-height: 17px;
}
.auth-card {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.profile-panel {
  background: #201f1c;
}
@media (hover: hover) and (pointer: fine) {
  .primary-button:hover {
    background: linear-gradient(#ffffff50, #ffffff12), var(--accent);
  }
  .secondary-button:hover,
  .text-button:hover,
  .row-button:hover {
    background: #34312b;
    border-color: #7b6740;
  }
}
@media (hover: none) {
  .primary-button:hover {
    background: var(--accent);
  }
  .secondary-button:hover,
  .text-button:hover,
  .row-button:hover {
    background: #282723;
    border-color: rgba(255, 255, 255, 0.1);
  }
  .deal-tile:hover {
    background: #2a2925;
    border-color: #ffffff12;
  }
}
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 8px;
  }
  .sidebar {
    top: 8px;
    height: calc(100dvh - 16px);
    padding: 18px 12px;
    overflow-y: auto;
    background: #282b30;
    left: 0;
    transform: translateX(calc(-100% - 10px));
  }
  .sidebar .brand-name {
    position: static;
    width: auto;
    height: auto;
    clip-path: none;
  }
  .sidebar .brand {
    gap: 8px;
  }
  .sidebar .nav-link {
    justify-content: flex-start;
  }
  .sidebar .nav-label {
    display: block;
    position: static;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 13px;
  }
  .sidebar-bottom span:not(.status-dot),
  .sidebar-bottom small {
    display: inline;
  }
  .sidebar-bottom br {
    display: block;
  }
  .topbar-actions {
    gap: 8px;
  }
  .date-label {
    display: none;
  }
  .wallpaper-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .appearance-card .card-header {
    flex-wrap: wrap;
    gap: 12px;
  }
  .quick-actions {
    gap: 0;
  }
  .quick-actions .icon-button,
  .quick-actions .avatar {
    width: 40px;
    height: 40px;
  }
  .topbar h1 {
    font-size: 23px;
  }
  .topbar .eyebrow {
    display: none;
  }
  .topbar {
    gap: 10px;
  }
  .topbar {
    top: 8px;
    padding: 16px 20px;
  }
  .page {
    padding: 22px 20px;
  }
}
@media (max-width: 760px) {
  .page {
    padding-bottom: 112px;
  }
  .mobile-bottom-nav {
    border-radius: 20px;
    background: rgba(25, 25, 22, 0.97);
  }
  .mobile-nav-icon img {
    filter: invert(0.8);
  }
}
@media (max-width: 560px) {
  .app-shell {
    padding: 4px;
  }
  .topbar {
    top: 4px;
    padding: 16px;
  }
  .page {
    padding: 18px 12px 112px;
  }
  .section-toolbar {
    align-items: stretch;
  }
  .metric,
  .metric:first-child,
  .metric:nth-child(4) {
    min-height: 124px;
    padding: 16px;
  }
  .metric-value,
  .metric:first-child .metric-value {
    font-size: 26px;
  }
  .pipeline {
    grid-auto-columns: min(286px, calc(100vw - 64px));
  }
  .modal form {
    padding: 20px;
  }
  .icon-button {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .primary-button:active,
  .secondary-button:active,
  .text-button:active,
  .row-button:active,
  .icon-button:active,
  .avatar:active {
    transform: none;
  }
}
.franchise-map-frame {display:block;width:100%;height:calc(100vh - 160px);min-height:780px;border:0;border-radius:20px;background:#0e0e0e;}
#franchise-map {width:100%;max-width:none;margin:0;padding:8px 16px 28px;}
@media(max-width:900px) {
  #franchise-map {padding:10px 12px 112px;}
}
