:root {
  --bg: #F7F8FC;
  --paper: #FFFFFF;
  --paper-secondary: #FBFBFE;
  --ink: #1D2333;
  --muted: #727B92;
  --muted-more: #9CA3B5;
  --line: rgba(138, 144, 189, 0.12);
  --line-strong: rgba(138, 144, 189, 0.2);
  --gold: #F5B942;
  --gold-soft: rgba(245, 185, 66, 0.12);
  --green: #21C087;
  --green-soft: rgba(33, 192, 135, 0.12);
  --red: #F06767;
  --red-soft: rgba(240, 103, 103, 0.12);
  --warning: #F5B942;
  --purple: #6f4cf5;
  --purple-light: #8b67ff;
  --purple-soft: rgba(111, 76, 245, 0.08);
  --purple-mid: rgba(111, 76, 245, 0.14);
  --teal: #48d5bf;
  --teal-soft: rgba(72, 213, 191, 0.12);
  --dark-navy: #1D2333;
  --gray-lavender: #727B92;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.05);
  --shadow-xl: 0 24px 64px rgba(73, 78, 114, 0.10);
  --radius-card: 16px;
  --radius-button: 14px;
  --radius-input: 14px;
  --radius-badge: 999px;
  --radius-panel: 26px;
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-64: 64px;
  --font-display: 48px;
  --font-section: 34px;
  --font-card-title: 18px;
  --font-body: 15px;
  --font-caption: 13px;
  --gradient-purple: linear-gradient(135deg, var(--purple), var(--purple-light));
  --gradient-bg: linear-gradient(180deg, #F7F8FC 0%, #eef0f8 100%);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  font-size: var(--font-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--gradient-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body[data-mode="app"] {
  background: var(--gradient-bg);
}

img {
  display: block;
  max-width: 100%;
}

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

button {
  cursor: pointer;
}

a {
  color: var(--purple);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
  border-radius: var(--radius-input);
}

#app {
  position: relative;
  min-height: 100vh;
  padding: var(--space-16);
}

.page-glow {
  position: fixed;
  inset: auto;
  width: 34rem;
  height: 34rem;
  filter: blur(80px);
  opacity: 0.2;
  z-index: 0;
  pointer-events: none;
}

.page-glow-left {
  top: -10rem;
  left: -12rem;
  background: rgba(111, 76, 245, 0.12);
}

.page-glow-right {
  right: -12rem;
  bottom: -12rem;
  background: rgba(72, 213, 191, 0.08);
}

body[data-mode="app"] .page-glow-left {
  background: rgba(111, 76, 245, 0.10);
}

body[data-mode="app"] .page-glow-right {
  background: rgba(72, 213, 191, 0.08);
}

.eyebrow {
  display: inline-block;
  margin-bottom: var(--space-8);
  color: var(--gray-lavender);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

/* ─── Auth Screen ─── */

.auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  min-height: calc(100vh - 48px);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius-panel);
  overflow: hidden;
  background: rgba(248, 249, 255, 0.78);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow-xl);
}

.auth-hero {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 1.35rem;
  padding: var(--space-40) var(--space-40) var(--space-32);
  background: linear-gradient(180deg, rgba(242, 244, 252, 0.96), rgba(247, 248, 255, 0.9));
  color: var(--dark-navy);
}

.auth-hero p {
  color: var(--gray-lavender);
}

.auth-hero-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.auth-hero-top .eyebrow {
  margin-bottom: var(--space-8);
  color: var(--gray-lavender);
}

.hero-brand-lockup {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: clamp(2rem, 4vw, 2.9rem);
  color: var(--dark-navy);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.brand-mark {
  width: 72px;
  height: 72px;
  padding: 0.45rem;
  border-radius: var(--radius-card);
  border: 0;
  background: linear-gradient(180deg, #ffffff, #f4f6ff);
  box-shadow: var(--shadow-lg);
  object-fit: cover;
}

.auth-hero-stage {
  display: grid;
  grid-template-columns: minmax(250px, 0.42fr) minmax(0, 0.58fr);
  gap: 1.25rem;
  align-items: start;
  min-height: 0;
}

.auth-hero-copy {
  display: grid;
  gap: 0.9rem;
  align-content: start;
  padding-top: 0.4rem;
}

.auth-hero-copy h1 {
  max-width: 10ch;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: clamp(2.7rem, 5vw, 4.5rem);
  color: var(--dark-navy);
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.auth-copy-points {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.auth-copy-points span {
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-badge);
  background: var(--purple-soft);
  border: 1px solid rgba(111, 76, 245, 0.08);
  color: var(--gray-lavender);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
}

.auth-visual-stage {
  position: relative;
  min-height: 560px;
  border-radius: var(--radius-panel);
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 18%, rgba(111, 76, 245, 0.18), transparent 28%),
    radial-gradient(circle at 82% 24%, rgba(72, 213, 191, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 247, 255, 0.96));
  border: 1px solid rgba(138, 144, 189, 0.12);
  box-shadow: var(--shadow-xl);
  animation: fadeSlideUp 520ms ease both;
}

.auth-color-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(0.2px);
  opacity: 0.9;
}

.auth-color-orb-one {
  width: 240px;
  height: 240px;
  top: -48px;
  left: -36px;
  background: radial-gradient(circle at 40% 40%, rgba(111, 76, 245, 0.36), rgba(111, 76, 245, 0.05));
}

.auth-color-orb-two {
  width: 220px;
  height: 220px;
  right: -34px;
  bottom: 94px;
  background: radial-gradient(circle at 40% 40%, rgba(72, 213, 191, 0.28), rgba(72, 213, 191, 0.04));
}

.auth-portrait-wrap {
  position: absolute;
  inset: auto 22px 8px 118px;
}

.auth-portrait {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  filter: drop-shadow(0 28px 38px rgba(73, 80, 119, 0.16));
}

.auth-float-card {
  position: absolute;
  z-index: 1;
  display: grid;
  gap: var(--space-4);
  padding: var(--space-16);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(138, 144, 189, 0.14);
  box-shadow: var(--shadow-lg);
  animation: authFloat 7s ease-in-out infinite;
  backdrop-filter: blur(8px);
}

.auth-float-card span,
.auth-float-card em {
  color: var(--gray-lavender);
  font-size: 0.8rem;
  font-style: normal;
  line-height: 1.5;
}

.auth-float-card strong {
  color: var(--dark-navy);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

.auth-float-card-top {
  top: 26px;
  left: 28px;
  min-width: 190px;
}

.auth-float-card-side {
  top: 86px;
  right: 26px;
  min-width: 160px;
  animation-delay: 1.1s;
}

.auth-float-card-side.accent {
  background: var(--gradient-purple);
  border-color: rgba(111, 76, 245, 0.2);
}

.auth-float-card-side.accent span,
.auth-float-card-side.accent strong {
  color: #ffffff;
}

.auth-float-card-bottom {
  left: 42px;
  bottom: 52px;
  max-width: 240px;
  animation-delay: 2.1s;
}

.auth-mini-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 10px;
  gap: 0.38rem;
  align-items: end;
  min-height: 52px;
}

.auth-mini-bars span {
  display: block;
  border-radius: var(--radius-badge);
  background: linear-gradient(180deg, rgba(111, 76, 245, 0.2), var(--purple));
}

.auth-mini-bars span:nth-child(1) { height: 24px; }
.auth-mini-bars span:nth-child(2) { height: 42px; }
.auth-mini-bars span:nth-child(3) { height: 34px; }
.auth-mini-bars span:nth-child(4) { height: 48px; }

.auth-mini-trend {
  width: 72px;
  height: 28px;
  border-radius: var(--radius-badge);
}

.auth-visual-caption {
  position: absolute;
  right: 32px;
  bottom: 34px;
  z-index: 1;
  max-width: 208px;
  display: grid;
  gap: var(--space-4);
  padding: var(--space-16);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(138, 144, 189, 0.12);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
}

.auth-visual-caption strong {
  color: var(--dark-navy);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 1.05rem;
}

.auth-visual-caption span {
  color: var(--gray-lavender);
  font-size: 0.88rem;
  line-height: 1.5;
}

.auth-panel {
  position: relative;
  padding: var(--space-32) var(--space-24) var(--space-24);
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(250, 251, 255, 0.62));
}

.panel-frame {
  width: min(100%, 32rem);
  display: grid;
  gap: 1.4rem;
  padding: var(--space-32);
  border: 1px solid rgba(138, 144, 189, 0.12);
  border-radius: var(--radius-panel);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-xl);
}

.panel-frame .panel-heading h2 {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--dark-navy);
  letter-spacing: -0.04em;
}

.panel-frame .panel-heading p {
  color: var(--gray-lavender);
}

.auth-tabs {
  display: inline-grid;
  grid-auto-flow: column;
  gap: var(--space-4);
  width: fit-content;
  padding: var(--space-4);
  border-radius: var(--radius-badge);
  background: var(--purple-soft);
}

.tab-button,
.soft-button,
.ghost-button,
.primary-button,
.inline-button,
.nav-button {
  border: 0;
  border-radius: var(--radius-button);
  transition: all 180ms var(--ease-smooth);
}

.tab-button {
  padding: var(--space-12) var(--space-16);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  border-radius: var(--radius-badge);
}

.tab-button.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.tab-button:hover:not(.active) {
  background: rgba(111, 76, 245, 0.06);
}

.panel-heading {
  display: grid;
  gap: var(--space-4);
}

.panel-heading h2,
.panel-heading h3 {
  font-size: 1.6rem;
}

.stack-form {
  display: grid;
  gap: var(--space-16);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-16);
}

.field {
  display: grid;
  gap: var(--space-8);
}

.field > span {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  background: var(--paper);
  padding: var(--space-12) var(--space-16);
  color: var(--ink);
  outline: none;
  transition: border-color 180ms var(--ease-smooth), box-shadow 180ms var(--ease-smooth);
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted-more);
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--line-strong);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(111, 76, 245, 0.4);
  box-shadow: 0 0 0 3px rgba(111, 76, 245, 0.1);
}

.field-inline-note {
  min-height: 100%;
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-input);
  background: var(--purple-soft);
  color: var(--muted);
  line-height: 1.6;
}

.field-note-block {
  align-content: start;
}

.checkbox-field {
  align-content: end;
}

.checkbox-line {
  display: flex;
  gap: var(--space-12);
  align-items: center;
  padding: var(--space-12) var(--space-16);
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  background: var(--paper);
}

.checkbox-line input {
  width: auto;
  margin: 0;
}

.primary-button,
.ghost-button,
.soft-button,
.inline-button {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.primary-button {
  padding: var(--space-16) var(--space-24);
  background: var(--gradient-purple);
  color: #ffffff;
  border-radius: var(--radius-button);
  box-shadow: 0 8px 24px rgba(111, 76, 245, 0.25);
  position: relative;
  overflow: hidden;
  min-height: 52px;
}

.primary-button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 180ms var(--ease-smooth);
  border-radius: inherit;
}

.primary-button:hover::after {
  background: rgba(255,255,255,0.1);
}

.primary-button:active::after {
  background: rgba(255,255,255,0.2);
}

.primary-button:active {
  transform: scale(0.98);
}

.primary-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.primary-button:disabled::after {
  display: none;
}

.soft-button {
  padding: var(--space-12) var(--space-16);
  background: rgba(255, 248, 236, 0.1);
  color: #fff1db;
  border: 1px solid rgba(255, 241, 219, 0.14);
}

.soft-button:hover {
  background: rgba(255, 248, 236, 0.18);
}

.ghost-button {
  padding: var(--space-12) var(--space-16);
  background: rgba(21, 38, 31, 0.06);
  color: var(--ink);
  border-radius: var(--radius-button);
}

.ghost-button:hover {
  background: rgba(21, 38, 31, 0.1);
}

.inline-button {
  padding: var(--space-8) var(--space-12);
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 0.9rem;
  min-height: 38px;
}

.inline-button:hover {
  background: var(--purple-mid);
}

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

.inline-button.danger:hover {
  background: rgba(240, 103, 103, 0.2);
}

.credential-note {
  padding: var(--space-16);
  border-radius: var(--radius-input);
  background: var(--gold-soft);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ─── Keyframes ─── */

@keyframes authFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

.flash {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-input);
  border: 1px solid transparent;
  font-size: 0.95rem;
  animation: fadeSlideUp 200ms var(--ease-smooth);
}

.flash button {
  background: transparent;
  border: 0;
  color: inherit;
  font-weight: 700;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-button);
  min-height: 38px;
}

.flash button:hover {
  opacity: 0.8;
}

.flash-success {
  background: var(--green-soft);
  color: var(--green);
  border-color: rgba(33, 192, 135, 0.18);
}

.flash-error {
  background: var(--red-soft);
  color: var(--red);
  border-color: rgba(240, 103, 103, 0.18);
}

.flash-warning {
  background: var(--gold-soft);
  color: var(--warning);
  border-color: rgba(245, 185, 66, 0.18);
}

.flash-neutral {
  background: var(--purple-soft);
  color: var(--muted);
  border-color: rgba(111, 76, 245, 0.08);
}

/* ─── Shell & Sidebar ─── */

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: calc(100vh - 48px);
  max-width: 1360px;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: var(--radius-panel);
  overflow: hidden;
  background: rgba(249, 250, 255, 0.78);
  backdrop-filter: blur(26px);
  box-shadow: var(--shadow-xl);
  animation: fadeSlideUp 300ms var(--ease-smooth);
}

.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(9, 16, 13, 0.3);
  opacity: 0;
  pointer-events: none;
  border: 0;
  transition: opacity 180ms ease;
}

.sidebar {
  position: relative;
  inset: auto;
  width: auto;
  z-index: 1;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: var(--space-8);
  padding: var(--space-16) var(--space-12) var(--space-12);
  color: var(--gray-lavender);
  border-right: 1px solid var(--line);
  box-shadow: none;
  transform: none;
  transition: transform 220ms var(--ease-smooth);
  overflow: visible;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 248, 255, 0.88));
}

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

.shell.menu-open .sidebar-scrim {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-brand,
.sidebar-user,
.sidebar-foot {
  display: grid;
  gap: var(--space-8);
}

.sidebar-mobile-top {
  display: none;
}

.sidebar-brand {
  grid-template-columns: auto 1fr;
  align-items: center;
  padding: 0 var(--space-4) var(--space-12);
  border-bottom: 1px solid var(--line);
}

.sidebar-mark {
  width: 40px;
  height: 40px;
  padding: var(--space-4);
  border-radius: var(--radius-card);
  border: 0;
  background: linear-gradient(180deg, #ffffff, #f4f6ff);
  box-shadow: var(--shadow-sm);
  object-fit: cover;
}

.sidebar h2,
.sidebar strong,
.sidebar .foot-label,
.sidebar .foot-copy,
.sidebar .eyebrow {
  color: var(--dark-navy);
}

.sidebar h2,
.topbar h1,
.dashboard-card-head h3,
.profile-meta h3,
.action-copy h3,
.stat-detail strong,
.dashboard-meta-card strong,
.dashboard-big-value,
.profile-avatar {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.sidebar-user {
  padding: var(--space-12);
  border-radius: var(--radius-card);
  background: var(--purple-soft);
  border: 1px solid rgba(111, 76, 245, 0.08);
}

.sidebar-user strong {
  font-size: 1rem;
  color: var(--dark-navy);
}

.sidebar-user span {
  color: var(--gray-lavender);
  font-size: 0.85rem;
  line-height: 1.5;
}

.sidebar-nav {
  display: grid;
  gap: var(--space-8);
  align-content: start;
}

.nav-button {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-button);
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  text-align: left;
  font-weight: 600;
  font-size: 0.88rem;
  position: relative;
  min-height: 38px;
  transition: all 180ms var(--ease-smooth);
}

.nav-button:hover:not(.active) {
  background: var(--purple-soft);
  color: var(--purple);
  transform: translateX(4px);
}

.nav-button.active {
  color: #ffffff;
  background: var(--gradient-purple);
  border-color: rgba(111, 76, 245, 0.28);
  box-shadow: 0 8px 24px rgba(111, 76, 245, 0.3);
}

.nav-button.active::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--purple);
  border-radius: 0 3px 3px 0;
  animation: slideInLeft 200ms var(--ease-spring);
}

.sidebar-foot {
  padding: var(--space-12);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, rgba(111, 76, 245, 0.09), rgba(111, 76, 245, 0.04));
}

.sidebar-foot strong {
  font-size: 1.1rem;
  color: var(--dark-navy);
}

.foot-label {
  font-size: 0.8rem;
  opacity: 1;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gray-lavender);
}

.foot-copy {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ─── Workspace ─── */

.workspace {
  display: grid;
  align-content: start;
  gap: var(--space-12);
  padding: var(--space-16);
  background: linear-gradient(180deg, rgba(241, 243, 250, 0.92), rgba(244, 246, 252, 0.98));
}

/* ─── Topbar ─── */

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-16);
  align-items: start;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.topbar-main {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  min-height: 0;
}

.topbar-copy {
  display: grid;
  gap: var(--space-4);
}

.topbar-copy .eyebrow {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.topbar h1 {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--dark-navy);
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-12);
  align-items: center;
  justify-content: flex-end;
}

.topbar-chip {
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-badge);
  background: var(--purple-soft);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.menu-button,
.sidebar-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-16);
  border: 1px solid var(--line);
  border-radius: var(--radius-button);
  background: var(--paper);
  color: var(--dark-navy);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  min-height: 48px;
}

.menu-button:hover,
.sidebar-close:hover {
  background: var(--paper-secondary);
}

.menu-button {
  display: none;
}

.topbar .ghost-button {
  background: var(--paper);
  color: var(--dark-navy);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  min-height: 48px;
}

.topbar .ghost-button:hover {
  background: var(--paper-secondary);
  border-color: var(--line-strong);
}

/* ─── Search ─── */

.search-shell {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  min-width: min(34vw, 320px);
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-input);
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  transition: all 200ms var(--ease-smooth);
}

.search-shell:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.search-shell:focus-within {
  border-color: rgba(111, 76, 245, 0.4);
  box-shadow: 0 0 0 3px rgba(111, 76, 245, 0.1);
}

.search-shell span {
  color: var(--muted-more);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.search-shell .kbd-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--paper-secondary);
  border: 1px solid var(--line);
  color: var(--muted-more);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1.4;
  min-width: 24px;
  min-height: 22px;
}

.search-shell input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
}

.search-shell input::placeholder {
  color: var(--muted-more);
}

/* ─── Section Heading ─── */

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: var(--space-12);
  align-items: center;
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-panel);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-md);
  min-height: 52px;
}

.section-heading h2 {
  font-size: 1.5rem;
}

.section-heading p {
  font-size: var(--font-body);
}

/* ─── Hero Panel ─── */

.hero-panel {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: var(--space-12);
  padding: var(--space-16);
  border-radius: var(--radius-panel);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-md);
}

.hero-panel h2 {
  max-width: 14ch;
  font-size: clamp(1.3rem, 3vw, 2rem);
  line-height: 1.1;
}

.hero-panel-callout {
  display: grid;
  gap: 0.9rem;
  padding: var(--space-16);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, var(--green-soft), var(--gold-soft));
}

.hero-panel-callout div {
  display: grid;
  gap: var(--space-4);
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(21, 38, 31, 0.08);
}

.hero-panel-callout div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.hero-panel-callout span {
  color: var(--muted);
  font-size: 0.86rem;
}

.hero-panel-callout strong {
  font-size: 1.28rem;
}

/* ─── Metric Strip / Bar Chart ─── */

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border-radius: var(--radius-panel);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-md);
}

.metric-card {
  display: grid;
  gap: 2px;
  padding: var(--space-12) var(--space-16);
  border-right: 1px solid var(--line);
}

.metric-card:last-child {
  border-right: 0;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-card strong {
  font-size: 1.25rem;
  color: var(--dark-navy);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  letter-spacing: -0.04em;
}

/* ─── Content Grid ─── */

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

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

.panel {
  display: grid;
  gap: var(--space-12);
  padding: var(--space-16);
  border-radius: var(--radius-panel);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-md);
}

.dashboard-stack {
  display: grid;
  gap: var(--space-12);
}

/* ─── KPI Dashboard Stat Grid ─── */

.dashboard-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-12);
}

.dashboard-stat-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-16);
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  animation: fadeSlideUp 420ms ease both;
  transition: all 200ms var(--ease-smooth);
  position: relative;
}

.dashboard-stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.dashboard-stat-card.accent {
  color: #ffffff;
  background: var(--gradient-purple);
  border-color: rgba(111, 76, 245, 0.24);
  box-shadow: 0 8px 24px rgba(111, 76, 245, 0.3);
}

.dashboard-stat-card.accent:hover {
  box-shadow: 0 12px 32px rgba(111, 76, 245, 0.35);
}

.stat-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.dashboard-stat-card.accent .stat-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.stat-detail {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.stat-detail span {
  color: var(--muted-more);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat-detail strong {
  color: var(--dark-navy);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.dashboard-stat-card.accent .stat-detail span,
.dashboard-stat-card.accent .stat-detail strong,
.dashboard-stat-card.accent .stat-note {
  color: #ffffff;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: var(--radius-badge);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  background: var(--green-soft);
  color: var(--green);
  justify-self: end;
}

.stat-trend.negative {
  background: var(--red-soft);
  color: var(--red);
}

.stat-trend.neutral {
  background: var(--purple-soft);
  color: var(--muted);
}

.stat-note {
  color: var(--muted-more);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
}

.stat-sparkline {
  grid-column: 1 / -1;
  height: 28px;
}

/* ─── Dashboard Main Grid ─── */

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.05fr) minmax(270px, 0.9fr);
  gap: var(--space-12);
  align-items: start;
}

.dashboard-wide {
  grid-column: 1 / span 2;
  min-height: 280px;
}

.dashboard-plot-panel,
.profile-panel,
.transfer-panel,
.action-panel {
  animation: fadeSlideUp 500ms ease both;
}

.dashboard-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-16);
}

.dashboard-card-head h3,
.profile-meta h3,
.action-copy h3 {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--dark-navy);
  letter-spacing: -0.04em;
}

.dashboard-card-head h3 {
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
}

.dashboard-card-head p {
  max-width: 34ch;
  color: var(--muted);
  font-size: 0.94rem;
}

.dashboard-status,
.dashboard-delta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-badge);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.dashboard-status.positive,
.dashboard-delta.positive {
  background: var(--green-soft);
  color: var(--green);
}

.dashboard-status.alert,
.dashboard-delta.negative {
  background: var(--red-soft);
  color: var(--red);
}

/* ─── Dashboard Meta ─── */

.dashboard-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-8);
}

.dashboard-meta-card {
  display: grid;
  gap: 2px;
  padding: var(--space-12) var(--space-12);
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: var(--paper-secondary);
}

.dashboard-meta-card span {
  color: var(--muted-more);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dashboard-meta-card strong,
.dashboard-big-value {
  color: var(--dark-navy);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  letter-spacing: -0.04em;
}

.dashboard-meta-card strong {
  font-size: clamp(1.2rem, 2.1vw, 1.7rem);
}

.dashboard-big-value {
  font-size: clamp(2rem, 4vw, 2.8rem);
}

/* ─── Chart ─── */

.dashboard-chart {
  display: grid;
  gap: var(--space-8);
  min-height: 160px;
}

.dashboard-chart.compact {
  min-height: 110px;
}

.sparkline {
  width: 100%;
  height: auto;
  overflow: visible;
}

.sparkline-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: traceLine 1.4s var(--ease-smooth) forwards;
}

@keyframes traceLine {
  to { stroke-dashoffset: 0; }
}

.sparkline-area {
  opacity: 0.5;
}

.sparkline-line-primary {
  stroke: var(--purple);
}

.sparkline-line-mint {
  stroke: var(--teal);
}

.sparkline-guideline {
  stroke: rgba(138, 144, 189, 0.15);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.sparkline-dot {
  opacity: 0;
  transition: opacity 150ms ease;
}

.sparkline:hover .sparkline-dot {
  opacity: 1;
}

.dashboard-chart-foot {
  display: flex;
  justify-content: space-between;
  gap: var(--space-16);
  color: var(--muted-more);
  font-size: 0.82rem;
  font-weight: 700;
}

/* ─── Profile Panel ─── */

.profile-panel {
  justify-items: center;
  text-align: center;
  align-content: start;
  gap: var(--space-16);
}

.profile-avatar {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gradient-purple);
  color: #ffffff;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  box-shadow: 0 6px 16px rgba(111, 76, 245, 0.25);
}

.profile-avatar-admin {
  background: linear-gradient(135deg, var(--dark-navy), var(--purple));
}

.profile-meta {
  display: grid;
  gap: var(--space-4);
}

.profile-meta h3 {
  font-size: 1.15rem;
}

.profile-meta p {
  color: var(--muted);
  font-size: 0.82rem;
}

.profile-stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-8);
  padding-top: var(--space-12);
  border-top: 1px solid var(--line);
}

.profile-stat {
  display: grid;
  gap: var(--space-4);
  justify-items: center;
}

.profile-stat span {
  color: var(--muted-more);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-stat strong {
  color: var(--dark-navy);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 0.95rem;
}

/* ─── Activity Feed ─── */

.activity-feed {
  display: grid;
  gap: var(--space-12);
}

.feed-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-4) 0;
}

.feed-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.feed-avatar-income {
  background: var(--teal-soft);
  color: var(--teal);
}

.feed-avatar-expense {
  background: var(--red-soft);
  color: var(--red);
}

.feed-copy {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.feed-copy strong {
  color: var(--dark-navy);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-copy span {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-amount {
  font-size: 0.95rem;
  font-weight: 800;
  white-space: nowrap;
}

.activity-amount.positive {
  color: var(--green);
}

.activity-amount.negative {
  color: var(--red);
}

.activity-amount.neutral {
  color: var(--purple);
}

/* ─── Action Panel ─── */

.action-panel {
  justify-items: center;
  text-align: center;
  align-content: center;
  gap: var(--space-12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 248, 255, 0.92));
}

.action-orb {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(111, 76, 245, 0.26), rgba(111, 76, 245, 0.06));
  color: var(--purple);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 8px 20px rgba(111, 76, 245, 0.12);
}

.action-copy {
  display: grid;
  gap: var(--space-4);
}

.action-copy h3 {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
}

.action-copy p {
  max-width: 31ch;
  color: var(--muted);
}

.action-points {
  width: 100%;
  display: grid;
  gap: var(--space-12);
}

.action-points div {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-card);
  border: 1px solid rgba(111, 76, 245, 0.08);
  background: var(--purple-soft);
  text-align: left;
}

.action-points strong {
  color: var(--dark-navy);
}

.action-points span {
  color: var(--muted);
  font-size: 0.9rem;
}

.dashboard-cta {
  width: 100%;
  background: var(--gradient-purple);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(111, 76, 245, 0.3);
}

/* ─── Bars ─── */

.bars {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-16);
  align-items: end;
  min-height: 240px;
}

.bar-group {
  display: grid;
  gap: var(--space-8);
  justify-items: center;
  text-align: center;
}

.bar-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 22px));
  align-items: end;
  gap: var(--space-8);
  height: 180px;
}

.bar {
  width: 22px;
  align-self: end;
  border-radius: var(--radius-badge);
}

.income-bar {
  background: linear-gradient(180deg, rgba(33, 192, 135, 0.26), var(--green));
}

.expense-bar {
  background: linear-gradient(180deg, rgba(245, 185, 66, 0.22), var(--gold));
}

/* ─── Distribution / Lists ─── */

.distribution-list,
.activity-list,
.recommendation-list,
.member-snapshot {
  display: grid;
  gap: var(--space-12);
}

.distribution-row,
.activity-item,
.recommendation,
.queue-item {
  display: grid;
  gap: var(--space-8);
  padding: var(--space-16);
  border-radius: var(--radius-card);
  background: var(--purple-soft);
}

.distribution-head,
.activity-item,
.queue-item,
.spotlight-meta,
.advert-card-top,
.advert-footer {
  display: flex;
  justify-content: space-between;
  gap: var(--space-16);
  align-items: center;
}

.distribution-track {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-badge);
  background: var(--line);
  overflow: hidden;
}

.distribution-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gradient-purple);
}

.recommendation strong,
.activity-item strong,
.queue-item strong,
.spotlight-meta strong {
  font-size: 1rem;
}

.recommendation p,
.activity-item span,
.queue-item span,
.table-muted {
  color: var(--muted);
  line-height: 1.6;
}

.spotlight {
  background: linear-gradient(180deg, var(--gold-soft), var(--green-soft));
}

/* ─── Ledger ─── */

.ledger-grid,
.marketplace-grid {
  align-items: start;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

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

.data-table th,
.data-table td {
  padding: var(--space-10) var(--space-12);
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 0.85rem;
}

.data-table td {
  color: var(--ink);
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--paper);
}

.data-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.data-table tbody tr {
  transition: background 120ms ease;
}

.data-table tbody tr:hover {
  background: var(--purple-soft);
}

.data-table tbody tr.row-selected {
  background: rgba(111, 76, 245, 0.05);
}

.data-table tbody tr.row-editing {
  background: rgba(111, 76, 245, 0.08);
}

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

.data-table td input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--purple);
}

.edit-inline {
  padding: 4px 8px;
  border: 1px solid var(--purple);
  border-radius: 8px;
  background: var(--paper);
  font-size: 0.82rem;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.edit-inline:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 2px rgba(111, 76, 245, 0.15);
}

.data-table td strong {
  color: var(--dark-navy);
}

/* ─── Badges / Status Pills ─── */

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-badge);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: capitalize;
  line-height: 1.3;
  box-shadow: var(--shadow-sm);
}

.status-pill.approved,
.status-pill.premium,
.status-pill.income {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.pending,
.status-pill.standard,
.status-pill.expense {
  background: var(--gold-soft);
  color: #b8862f;
}

.status-pill.rejected {
  background: var(--red-soft);
  color: var(--red);
}

.status-pill.transfer {
  background: rgba(72, 213, 191, 0.14);
  color: #1ea88f;
}

.status-pill.investment {
  background: var(--purple-soft);
  color: var(--purple);
}

.money-positive {
  color: var(--green);
  font-weight: 700;
}

.money-negative {
  color: var(--red);
  font-weight: 700;
}

/* ─── Action Groups ─── */

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  align-items: center;
}

.inline-form select,
.inline-form input {
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: var(--radius-badge);
  background: var(--paper);
  padding: var(--space-8) var(--space-12);
}

.stack-actions {
  display: grid;
  gap: var(--space-8);
}

.secret-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-badge);
  background: var(--purple-soft);
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.86rem;
}

/* ─── Marketplace ─── */

.market-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-16);
}

.single-column-grid {
  grid-template-columns: 1fr;
}

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

.advert-card {
  overflow: hidden;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
  transition: all 200ms var(--ease-smooth);
}

.advert-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.advert-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--purple-soft);
}

.advert-card-body {
  display: grid;
  gap: var(--space-12);
  padding: var(--space-16);
}

.advert-contact {
  display: grid;
  gap: var(--space-8);
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-input);
  background: var(--purple-soft);
  color: var(--muted);
}

.advert-contact strong {
  color: var(--dark-navy);
}

.advert-card h4 {
  font-size: 1.35rem;
  color: var(--dark-navy);
}

.advert-date {
  color: var(--muted);
  font-size: 0.85rem;
}

.advert-gallery,
.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-8);
}

.advert-gallery img,
.image-preview-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-input);
  object-fit: cover;
}

.image-preview {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: var(--space-16);
  border-radius: var(--radius-input);
  border: 1px dashed var(--line-strong);
  background: var(--purple-soft);
  color: var(--muted);
}

.image-preview img {
  width: 100%;
  border-radius: var(--radius-card);
  object-fit: cover;
}

/* ─── Packages ─── */

.package-grid {
  display: grid;
  gap: var(--space-16);
}

.package-card {
  display: grid;
  gap: var(--space-12);
  padding: var(--space-16);
  border-radius: var(--radius-card);
  background: var(--purple-soft);
}

.package-card-top {
  display: flex;
  justify-content: space-between;
  gap: var(--space-16);
  align-items: start;
}

.package-live-tag {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.package-window-form {
  gap: var(--space-12);
  padding-top: var(--space-16);
  border-top: 1px solid var(--line);
}

.package-window-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-12);
}

.package-window-form .field input {
  padding: var(--space-12) var(--space-12);
  border-radius: var(--radius-input);
}

.package-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.package-feature-list span,
.package-meta span {
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-badge);
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  font-size: 0.88rem;
}

.package-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

/* ─── Detail List ─── */

.detail-list {
  display: grid;
  gap: var(--space-4);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-16);
  padding: var(--space-12) 0;
  border-bottom: 1px solid var(--line);
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-row span {
  color: var(--muted);
}

.detail-row strong {
  max-width: 60%;
  text-align: right;
  color: var(--dark-navy);
}

/* ─── Lock Panel / Empty States ─── */

.lock-panel {
  min-height: 280px;
  place-items: center;
  text-align: center;
  background:
    linear-gradient(180deg, var(--gold-soft), var(--green-soft)),
    rgba(255, 252, 247, 0.82);
}

.lock-panel-copy {
  max-width: 34rem;
  display: grid;
  gap: var(--space-8);
}

.lock-panel-copy strong {
  font-size: 1.2rem;
  color: var(--dark-navy);
}

.disclaimer,
.empty-state {
  padding: var(--space-24);
  border-radius: var(--radius-card);
  background: var(--purple-soft);
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.empty-state strong {
  display: block;
  color: var(--dark-navy);
  margin-bottom: var(--space-4);
}

.empty-state .empty-action {
  margin-top: var(--space-16);
}

/* ─── AI Insight Cards ─── */

.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-8);
}

.insight-card {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-12);
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  transition: all 200ms var(--ease-smooth);
}

.insight-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.insight-card .insight-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 0.7rem;
  font-weight: 800;
}

.insight-card .insight-message {
  font-size: 0.85rem;
  color: var(--dark-navy);
  font-weight: 600;
  line-height: 1.4;
}

.insight-card .insight-sub {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

.insight-card.positive {
  border-color: rgba(33, 192, 135, 0.2);
}

.insight-card.positive .insight-icon {
  background: var(--green-soft);
  color: var(--green);
}

.insight-card.warning-custom {
  border-color: rgba(245, 185, 66, 0.2);
}

.insight-card.warning-custom .insight-icon {
  background: var(--gold-soft);
  color: #b8862f;
}

.insight-card.neutral {
  border-color: rgba(111, 76, 245, 0.12);
}

/* ─── Skeleton / Loading ─── */

.skeleton {
  background: linear-gradient(90deg, var(--paper-secondary) 25%, var(--line) 50%, var(--paper-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-input);
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--space-8);
  width: 80%;
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-heading {
  height: 24px;
  width: 60%;
  margin-bottom: var(--space-12);
}

.skeleton-card {
  height: 120px;
  width: 100%;
}

/* ─── Hover Effects ─── */

.primary-button:hover,
.ghost-button:hover,
.soft-button:hover,
.inline-button:hover,
.nav-button:hover,
.tab-button:hover {
  transform: translateY(-1px);
}

/* ─── Accessibility ─── */

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

/* ─── Responsive: 1180px ─── */

@media (max-width: 1180px) {
  .content-grid,
  .market-grid,
  .admin-market-grid,
  .metric-strip,
  .insight-grid {
    grid-template-columns: 1fr 1fr;
  }

  .auth-hero-stage,
  .auth-visual-stage {
    grid-template-columns: 1fr;
  }

  .auth-visual-stage {
    min-height: 0;
  }

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

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

  .dashboard-wide {
    grid-column: 1 / -1;
  }
}

/* ─── Responsive: 900px ─── */

@media (max-width: 900px) {
  #app {
    padding: var(--space-16);
  }

  .auth-shell,
  .auth-hero-stage,
  .hero-panel,
  .section-heading,
  .content-grid,
  .market-grid,
  .admin-market-grid,
  .metric-strip,
  .dashboard-stat-grid,
  .dashboard-main-grid,
  .dashboard-meta-grid,
  .field-grid,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .auth-hero,
  .workspace,
  .auth-panel {
    padding: var(--space-20);
  }

  .auth-hero-stage {
    min-height: 0;
  }

  .auth-shell {
    gap: 0;
  }

  .auth-visual-stage {
    min-height: 460px;
    border-radius: var(--radius-card);
  }

  .auth-portrait-wrap {
    inset: auto 18px 2px 62px;
  }

  .auth-float-card-top {
    top: 16px;
    left: 16px;
  }

  .auth-float-card-side {
    top: 68px;
    right: 16px;
  }

  .auth-float-card-bottom {
    left: 18px;
    bottom: 18px;
    max-width: 208px;
  }

  .auth-visual-caption {
    right: 18px;
    bottom: 18px;
    max-width: 180px;
  }

  .shell {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 32px);
    overflow: visible;
  }

  .sidebar-scrim {
    display: block;
  }

  .sidebar {
    position: fixed;
    transform: translateX(calc(-100% - 32px));
    width: min(80vw, 292px);
    gap: var(--space-8);
    padding: var(--space-16);
    inset: 10px auto 10px 10px;
    z-index: 30;
    overflow-y: auto;
    border-right: 0;
    border-radius: var(--radius-card);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 248, 255, 0.94));
    box-shadow: var(--shadow-xl);
  }

  .sidebar-mobile-top {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    display: block;
    z-index: 2;
    pointer-events: none;
  }

  .sidebar-close {
    min-width: 2.2rem;
    min-height: 2.2rem;
    padding: var(--space-8);
    font-size: 0.86rem;
    pointer-events: auto;
  }

  .sidebar-brand {
    padding: 0.1rem 2.6rem 0.72rem 0.05rem;
    gap: var(--space-8);
  }

  .sidebar-user {
    padding: var(--space-12);
  }

  .sidebar-nav {
    gap: var(--space-4);
  }

  .nav-button {
    padding: var(--space-12);
    font-size: 0.94rem;
  }

  .sidebar-foot {
    padding: var(--space-12);
  }

  .sidebar-foot .foot-copy {
    display: none;
  }

  .workspace {
    padding: 0;
  }

  .menu-button {
    display: inline-flex;
  }

  .market-grid,
  .admin-market-grid,
  .bars {
    grid-template-columns: 1fr;
  }

  .advert-gallery,
  .image-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bar-group {
    justify-items: start;
    text-align: left;
  }

  .bar-stack {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bar {
    width: 100%;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: var(--space-12);
  }

  .topbar-main {
    min-width: 0;
  }

  .topbar-main > div {
    min-width: 0;
  }

  .topbar-actions,
  .search-shell {
    width: 100%;
  }

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

  .dashboard-wide {
    grid-column: auto;
    min-height: 0;
  }
}

/* ─── Responsive: 640px ─── */

@media (max-width: 640px) {
  .panel-frame,
  .topbar,
  .panel,
  .hero-panel,
  .section-heading {
    padding: var(--space-16);
    border-radius: var(--radius-card);
  }

  .hero-brand-lockup {
    font-size: 1.6rem;
  }

  .auth-hero {
    padding: var(--space-16);
  }

  .auth-panel {
    padding: var(--space-16);
  }

  .auth-hero-copy h1,
  .hero-panel h2,
  .topbar h1 {
    max-width: none;
  }

  .auth-hero-copy p,
  .hero-footline,
  .section-heading > p,
  .panel-heading p,
  .hero-panel > div > p,
  .credential-note,
  .field-note-block,
  .topbar-chip,
  .sidebar-user span:last-child,
  .sidebar-foot .foot-copy,
  .spotlight-meta span,
  .insight-sub,
  .disclaimer {
    display: none;
  }

  .panel-heading,
  .hero-panel > div,
  .sidebar-user,
  .sidebar-foot {
    gap: var(--space-4);
  }

  .topbar-actions,
  .action-group {
    width: 100%;
  }

  .topbar-actions > * {
    flex: 1 1 auto;
  }

  .topbar h1 {
    font-size: 1.55rem;
  }

  .topbar-copy .eyebrow {
    display: inline-block;
  }

  .metric-card {
    padding: var(--space-16);
  }

  .metric-card span {
    font-size: 0.74rem;
  }

  .metric-card strong {
    font-size: 1.3rem;
  }

  .hero-panel-callout {
    padding: var(--space-16);
    gap: var(--space-8);
  }

  .sidebar {
    width: min(84vw, 280px);
    inset: 8px auto 8px 8px;
    padding: var(--space-12);
  }

  .auth-hero-copy {
    gap: var(--space-12);
    padding-top: 0;
  }

  .auth-visual-stage {
    min-height: 400px;
  }

  .auth-portrait-wrap {
    inset: auto 10px -6px 28px;
  }

  .auth-portrait {
    max-width: 380px;
  }

  .auth-float-card {
    padding: var(--space-12);
    border-radius: var(--radius-input);
  }

  .auth-float-card strong {
    font-size: 1.16rem;
  }

  .auth-float-card-top {
    min-width: 152px;
  }

  .auth-float-card-side {
    min-width: 128px;
  }

  .auth-float-card-bottom {
    max-width: 168px;
  }

  .auth-visual-caption {
    display: none;
  }

  .profile-stats {
    grid-template-columns: 1fr;
  }

  .dashboard-stat-card,
  .feed-row {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .dashboard-stat-card {
    padding: var(--space-16);
  }

  .dashboard-chart-foot {
    gap: var(--space-8);
    font-size: 0.74rem;
  }

  .topbar-actions .ghost-button {
    width: 100%;
  }

  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-form select,
  .inline-form input {
    min-width: 0;
    width: 100%;
  }

  .package-window-grid {
    grid-template-columns: 1fr;
  }

  .detail-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-row strong {
    max-width: none;
    text-align: left;
  }
}
