/* ────────────────────────────────────────────
   PERLA ROSA — Gestionale
   Aesthetic: Editorial Italian luxury, Lake Como
   ──────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Italiana&family=Instrument+Serif:ital@0;1&family=Archivo:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500&display=swap');

:root {
  /* Palette — pearl, rose, aged gold */
  --bg: #F5EEE6;
  --bg-deep: #EADFD3;
  --paper: #FBF6F0;
  --paper-warm: #FDFAF5;
  --ink: #231816;
  --ink-soft: #5A4842;
  --ink-faint: #9A8780;
  --ink-ghost: #CFC0B6;
  --rose: #B0555F;
  --rose-deep: #8A3843;
  --rose-soft: #D9A8AB;
  --rose-pale: #F2D9DA;
  --rose-mist: #F9E9E9;
  --gold: #B8935E;
  --gold-soft: #D9BE95;
  --burgundy: #5C1F2C;
  --sage: #8E9A7D;
  --line: rgba(35, 24, 22, 0.09);
  --line-strong: rgba(35, 24, 22, 0.18);
  --shadow-sm: 0 2px 8px rgba(92, 31, 44, 0.04);
  --shadow: 0 10px 40px -18px rgba(92, 31, 44, 0.18);
  --shadow-lg: 0 30px 80px -30px rgba(92, 31, 44, 0.25);

  /* Typography */
  --ff-display: 'Italiana', serif;
  --ff-serif: 'Instrument Serif', 'Cormorant', serif;
  --ff-sans: 'Archivo', -apple-system, sans-serif;
  --ff-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--ff-sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background:
    radial-gradient(ellipse 1200px 600px at 10% -10%, rgba(217, 168, 171, 0.25), transparent 60%),
    radial-gradient(ellipse 900px 500px at 110% 110%, rgba(184, 147, 94, 0.12), transparent 60%),
    var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.14 0 0 0 0 0.09 0 0 0 0 0.08 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.6;
  mix-blend-mode: multiply;
}

/* ─── LAYOUT ─── */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 2;
}

/* ─── SIDEBAR ─── */
.sidebar {
  padding: 32px 22px 28px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--paper-warm) 0%, var(--bg) 100%);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 44px; height: 44px;
  flex-shrink: 0;
}
.brand-text {
  line-height: 1;
}
.brand-text .name {
  font-family: var(--ff-display);
  font-size: 17px;
  letter-spacing: 0.22em;
  color: var(--ink);
  display: block;
}
.brand-text .sub {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 11px;
  color: var(--rose);
  letter-spacing: 0.05em;
  margin-top: 3px;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-label {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.25em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin: 0 0 10px 12px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s ease;
  position: relative;
  letter-spacing: 0.01em;
}
.nav-item:hover {
  color: var(--ink);
  background: rgba(176, 85, 95, 0.05);
}
.nav-item.active {
  color: var(--rose-deep);
  background: linear-gradient(90deg, rgba(217, 168, 171, 0.22) 0%, transparent 100%);
  font-weight: 500;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--rose);
}
.nav-item svg {
  width: 16px; height: 16px;
  stroke: currentColor;
  stroke-width: 1.3;
  fill: none;
  flex-shrink: 0;
}
.nav-item .badge {
  margin-left: auto;
  font-family: var(--ff-mono);
  font-size: 10px;
  background: var(--rose);
  color: var(--paper);
  padding: 2px 6px;
  border-radius: 10px;
  line-height: 1;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.luna-pill {
  background: linear-gradient(135deg, var(--ink) 0%, #3A2924 100%);
  color: var(--paper-warm);
  padding: 14px 14px 12px;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}
.luna-pill::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  background: radial-gradient(circle, var(--gold-soft) 0%, transparent 70%);
  opacity: 0.4;
}
.luna-pill .row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--gold-soft);
  margin-bottom: 4px;
}
.luna-pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #8FBF8F;
  animation: pulse 2s infinite;
  box-shadow: 0 0 0 3px rgba(143, 191, 143, 0.2);
}
.luna-pill .name {
  font-family: var(--ff-display);
  font-size: 22px;
  letter-spacing: 0.08em;
}
.luna-pill .meta {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-ghost);
  opacity: 0.85;
  margin-top: 2px;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose-soft), var(--rose));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-display);
  font-size: 14px;
  color: var(--paper);
  letter-spacing: 0.08em;
  flex-shrink: 0;
}
.user-card .name {
  font-size: 13px;
  font-weight: 500;
}
.user-card .role {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 11px;
  color: var(--ink-faint);
}

/* ─── MAIN ─── */
.main {
  padding: 36px 48px 60px;
  min-width: 0;
}

/* ─── TOP BAR ─── */
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 36px;
  gap: 32px;
}
.greeting .eyebrow {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--rose);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.greeting h1 {
  font-family: var(--ff-display);
  font-size: 56px;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--ink);
  font-weight: 400;
}
.greeting h1 .italic {
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--rose-deep);
}
.greeting .date {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 16px;
  color: var(--ink-soft);
  margin-top: 8px;
}

.topbar-right {
  display: flex;
  gap: 10px;
  align-items: center;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  width: 260px;
}
.search input {
  border: 0; outline: 0;
  background: transparent;
  font-family: var(--ff-sans);
  font-size: 13px;
  color: var(--ink);
  flex: 1;
}
.search input::placeholder {
  color: var(--ink-faint);
  font-style: italic;
  font-family: var(--ff-serif);
}
.icon-btn {
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all 0.2s;
  position: relative;
}
.icon-btn:hover { color: var(--rose); border-color: var(--rose-soft); }
.icon-btn svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.4; fill: none; }
.icon-btn .dot-flag {
  position: absolute;
  top: 8px; right: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--rose);
}

.btn {
  padding: 10px 20px;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  font-family: var(--ff-sans);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:hover { background: var(--rose-deep); }
.btn.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn.secondary:hover { background: var(--ink); color: var(--paper); }
.btn.rose { background: var(--rose); }
.btn.rose:hover { background: var(--rose-deep); }

/* ─── CARD ─── */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px;
  position: relative;
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.card-title {
  font-family: var(--ff-display);
  font-size: 18px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}
.card-title .num {
  font-family: var(--ff-mono);
  color: var(--rose);
  font-size: 12px;
  letter-spacing: 0.05em;
  margin-left: 8px;
}
.card-sub {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-faint);
}

/* ─── STAT TILE ─── */
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-label {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.stat-value {
  font-family: var(--ff-display);
  font-size: 38px;
  color: var(--ink);
  line-height: 1;
  letter-spacing: 0.02em;
}
.stat-value .unit {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-faint);
  margin-left: 4px;
}
.stat-delta {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--sage);
  letter-spacing: 0.1em;
}
.stat-delta.down { color: var(--rose); }

/* ─── DASHBOARD GRID ─── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}
.col-8 { grid-column: span 8; }
.col-7 { grid-column: span 7; }
.col-6 { grid-column: span 6; }
.col-5 { grid-column: span 5; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
.col-12 { grid-column: span 12; }

/* ─── APPOINTMENT CLOCK (radial) ─── */
.clock-wrap {
  aspect-ratio: 1;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
}
.clock-wrap svg { width: 100%; height: 100%; display: block; }
.clock-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
}
.clock-center .big {
  font-family: var(--ff-display);
  font-size: 64px;
  line-height: 1;
  color: var(--ink);
}
.clock-center .label {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  color: var(--ink-faint);
  margin-top: 8px;
}
.clock-center .ongoing {
  margin-top: 14px;
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--rose-deep);
  max-width: 180px;
}

/* ─── APPOINTMENT LIST ─── */
.appt-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: -4px -4px;
}
.appt {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 16px;
  padding: 14px 4px;
  border-bottom: 1px dashed var(--line);
  align-items: center;
  position: relative;
}
.appt:last-child { border-bottom: 0; }
.appt.now::before {
  content: '';
  position: absolute;
  left: -6px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--rose);
}
.appt-time {
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--ink);
  letter-spacing: 0.05em;
}
.appt-time .dur {
  display: block;
  color: var(--ink-faint);
  font-size: 9px;
  margin-top: 2px;
  letter-spacing: 0.15em;
}
.appt-body .client {
  font-family: var(--ff-serif);
  font-size: 17px;
  color: var(--ink);
}
.appt-body .service {
  font-family: var(--ff-sans);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}
.appt-body .service .dot-sep { color: var(--gold); margin: 0 6px; }
.appt-stylist {
  display: flex;
  align-items: center;
  gap: 8px;
}
.appt-stylist .mini-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--rose-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-display);
  font-size: 10px;
  color: var(--rose-deep);
}
.appt-stylist .tag {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
}

.status-pill {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  padding: 3px 8px;
  border-radius: 2px;
  text-transform: uppercase;
  background: var(--rose-mist);
  color: var(--rose-deep);
  display: inline-block;
}
.status-pill.confirmed { background: rgba(142, 154, 125, 0.18); color: var(--sage); }
.status-pill.waiting { background: rgba(184, 147, 94, 0.15); color: var(--gold); }
.status-pill.vip { background: var(--ink); color: var(--gold-soft); }

/* ─── LUNA AI CARD ─── */
.luna-card {
  background: linear-gradient(155deg, var(--ink) 0%, #3A2924 55%, #4A2A2F 100%);
  color: var(--paper-warm);
  border-radius: 6px;
  padding: 26px;
  position: relative;
  overflow: hidden;
  min-height: 100%;
}
.luna-card::after {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(217, 190, 149, 0.35) 0%, transparent 60%);
  pointer-events: none;
}
.luna-card::before {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(217, 168, 171, 0.2) 0%, transparent 60%);
  pointer-events: none;
}
.luna-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}
.luna-title {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--gold-soft);
  margin-bottom: 10px;
}
.luna-name {
  font-family: var(--ff-display);
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0.06em;
}
.luna-name .italic {
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--gold-soft);
  font-size: 32px;
  letter-spacing: 0.02em;
}
.luna-orb {
  width: 54px; height: 54px;
  position: relative;
  flex-shrink: 0;
}
.luna-orb svg { width: 100%; height: 100%; }
.luna-status {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 14px;
  color: var(--rose-soft);
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
  line-height: 1.4;
}
.luna-activity {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.luna-msg {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 251, 246, 0.08);
}
.luna-msg .ch {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(217, 190, 149, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-soft);
}
.luna-msg .ch svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 1.5; fill: none; }
.luna-msg .content {
  font-size: 12px;
  color: var(--paper-warm);
  line-height: 1.5;
}
.luna-msg .content b {
  font-weight: 500;
  color: var(--gold-soft);
}
.luna-msg .content .t {
  display: block;
  font-family: var(--ff-mono);
  font-size: 9px;
  color: var(--ink-ghost);
  opacity: 0.7;
  margin-top: 3px;
  letter-spacing: 0.1em;
}

.luna-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 251, 246, 0.12);
  position: relative;
  z-index: 1;
}
.luna-stat .v {
  font-family: var(--ff-display);
  font-size: 26px;
  line-height: 1;
  color: var(--paper-warm);
}
.luna-stat .l {
  font-family: var(--ff-mono);
  font-size: 8px;
  letter-spacing: 0.2em;
  color: var(--gold-soft);
  text-transform: uppercase;
  margin-top: 6px;
}

/* ─── REVENUE CURVE ─── */
.revenue-chart {
  height: 160px;
  margin-top: 8px;
  position: relative;
}
.revenue-chart svg { width: 100%; height: 100%; overflow: visible; }
.revenue-legend {
  display: flex;
  gap: 24px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-top: 16px;
}
.revenue-legend .item { display: flex; align-items: center; gap: 6px; }
.revenue-legend .sq { width: 8px; height: 8px; }

/* ─── HEATMAP ─── */
.heat-grid {
  display: grid;
  grid-template-columns: 40px repeat(7, 1fr);
  gap: 4px;
  font-family: var(--ff-mono);
  font-size: 9px;
}
.heat-head {
  text-align: center;
  color: var(--ink-faint);
  letter-spacing: 0.15em;
  padding: 6px 0;
  text-transform: uppercase;
}
.heat-hour {
  color: var(--ink-faint);
  padding: 4px 0;
  text-align: right;
  padding-right: 6px;
  letter-spacing: 0.05em;
}
.heat-cell {
  aspect-ratio: 1.6;
  border-radius: 2px;
  background: var(--rose-mist);
  cursor: pointer;
  transition: transform 0.2s;
  position: relative;
}
.heat-cell:hover { transform: scale(1.08); }

/* ─── CLIENT LIST ─── */
.client-row {
  display: grid;
  grid-template-columns: 40px 1fr 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.client-row:last-child { border-bottom: 0; }
.client-row .name {
  font-family: var(--ff-serif);
  font-size: 16px;
}
.client-row .meta {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
}
.client-row .last {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-soft);
}
.client-row .spend {
  font-family: var(--ff-mono);
  font-size: 13px;
  color: var(--ink);
}

/* ─── CHANNEL CHIPS ─── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  background: var(--rose-mist);
  color: var(--rose-deep);
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: 10px;
}
.chip.whatsapp { background: #E6F4EA; color: #1E6B3A; }
.chip.phone { background: #FEF3E2; color: #8B5A1B; }
.chip.email { background: #EAE6F4; color: #3A2A6B; }

/* ─── DIVIDER ─── */
.ornament {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gold);
  margin: 32px 0 20px;
}
.ornament-line { flex: 1; height: 1px; background: var(--line-strong); }
.ornament-mark {
  font-family: var(--ff-display);
  font-size: 14px;
  letter-spacing: 0.3em;
  color: var(--rose);
  text-transform: uppercase;
}

/* ─── CALENDAR VIEW ─── */
.cal-week {
  display: grid;
  grid-template-columns: 60px repeat(6, 1fr);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.cal-head {
  padding: 16px 10px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: var(--paper-warm);
}
.cal-head:last-child { border-right: 0; }
.cal-head .dow {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.25em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.cal-head .dd {
  font-family: var(--ff-display);
  font-size: 28px;
  color: var(--ink);
  line-height: 1;
  margin-top: 4px;
}
.cal-head.today .dd { color: var(--rose); }
.cal-head.today::after {
  content: '';
  display: block;
  width: 20px; height: 2px;
  background: var(--rose);
  margin-top: 6px;
}

.cal-time {
  padding: 8px 10px 8px 4px;
  text-align: right;
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--ink-faint);
  border-right: 1px solid var(--line);
  border-top: 1px solid var(--line);
  letter-spacing: 0.05em;
}
.cal-cell {
  border-right: 1px solid var(--line);
  border-top: 1px solid var(--line);
  min-height: 52px;
  padding: 3px;
  position: relative;
}
.cal-cell:last-child { border-right: 0; }
.cal-slot {
  background: var(--rose-mist);
  border-left: 2px solid var(--rose);
  padding: 6px 8px;
  border-radius: 2px;
  font-size: 11px;
  color: var(--ink);
  line-height: 1.3;
  cursor: pointer;
  transition: all 0.2s;
  height: 100%;
}
.cal-slot:hover { background: var(--rose-pale); }
.cal-slot .cs-c {
  font-family: var(--ff-serif);
  font-size: 13px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-slot .cs-s {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-top: 2px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-slot.sage { background: rgba(142, 154, 125, 0.12); border-left-color: var(--sage); }
.cal-slot.gold { background: rgba(184, 147, 94, 0.12); border-left-color: var(--gold); }
.cal-slot.burg { background: rgba(92, 31, 44, 0.1); border-left-color: var(--burgundy); }

/* ─── DOSSIER (client profile) ─── */
.dossier-hero {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 32px;
  align-items: center;
  padding: 36px;
  background: linear-gradient(135deg, var(--paper-warm) 0%, var(--rose-mist) 100%);
  border: 1px solid var(--line);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}
.dossier-hero::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(184, 147, 94, 0.1) 0%, transparent 60%);
}
.big-avatar {
  width: 180px; height: 180px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose-soft), var(--rose));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-display);
  color: var(--paper);
  font-size: 64px;
  letter-spacing: 0.08em;
  border: 3px solid var(--paper-warm);
  box-shadow: var(--shadow);
}
.dossier-info .eyebrow {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--rose);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.dossier-info h1 {
  font-family: var(--ff-display);
  font-size: 58px;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--ink);
  font-weight: 400;
}
.dossier-info .tagline {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 16px;
  color: var(--ink-soft);
  margin-top: 8px;
  max-width: 420px;
}
.dossier-meta {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.dossier-meta .m {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}
.dossier-meta .m b {
  color: var(--ink);
  font-weight: 500;
  margin-left: 6px;
  font-family: var(--ff-mono);
}
.dossier-score {
  text-align: right;
}
.dossier-score .lbl {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.25em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.dossier-score .stars {
  font-family: var(--ff-display);
  color: var(--gold);
  font-size: 24px;
  letter-spacing: 0.1em;
  margin-top: 4px;
}
.dossier-score .count {
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--ink-faint);
  font-size: 12px;
}

/* ─── COLOR FORMULA ─── */
.formula-card {
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--paper-warm);
  border-radius: 4px;
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 18px;
  align-items: center;
}
.formula-swatch {
  width: 60px; height: 60px;
  border-radius: 50%;
  position: relative;
  box-shadow: inset 0 -6px 14px rgba(0,0,0,0.15);
  border: 2px solid var(--paper);
}
.formula-title {
  font-family: var(--ff-display);
  font-size: 16px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.formula-desc {
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 13px;
  margin-top: 2px;
}
.formula-mix {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
  margin-top: 6px;
  line-height: 1.5;
}

/* ─── GALLERY (before/after) ─── */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.gallery-item {
  aspect-ratio: 3/4;
  border-radius: 4px;
  background: var(--rose-pale);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s;
}
.gallery-item:hover { transform: translateY(-3px); }
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(35, 24, 22, 0.7));
}
.gallery-item .cap {
  position: absolute;
  bottom: 10px; left: 10px;
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--paper);
  z-index: 1;
  text-transform: uppercase;
}

/* ─── TIMELINE ─── */
.timeline {
  position: relative;
  padding-left: 24px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 1px;
  background: var(--line-strong);
}
.tl-item {
  position: relative;
  padding-bottom: 22px;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: -24px; top: 6px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--rose);
}
.tl-date {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--rose);
  text-transform: uppercase;
}
.tl-title {
  font-family: var(--ff-serif);
  font-size: 15px;
  margin-top: 2px;
  color: var(--ink);
}
.tl-desc {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* ─── SEGRETARIA (inbox) ─── */
.inbox-layout {
  display: grid;
  grid-template-columns: 340px 1fr 320px;
  gap: 16px;
  height: calc(100vh - 200px);
  min-height: 640px;
}

.inbox-list {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow-y: auto;
}
.inbox-filter {
  display: flex;
  gap: 6px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 1;
}
.inbox-filter .f {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  padding: 5px 10px;
  border-radius: 20px;
  background: var(--bg);
  color: var(--ink-faint);
  cursor: pointer;
  text-transform: uppercase;
}
.inbox-filter .f.on { background: var(--ink); color: var(--paper); }

.inbox-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  transition: background 0.2s;
}
.inbox-item:hover { background: var(--bg); }
.inbox-item.active { background: var(--rose-mist); }
.inbox-item .ch-ic {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.inbox-item .ch-ic svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.5; fill: none; }
.inbox-item .ch-ic.wa { background: #DCF5E3; color: #1E6B3A; }
.inbox-item .ch-ic.ph { background: #FBEACB; color: #8B5A1B; }
.inbox-item .ch-ic.em { background: #E3DCF5; color: #3A2A6B; }
.inbox-item .ch-ic .ai-mark {
  position: absolute;
  right: -3px; bottom: -3px;
  width: 14px; height: 14px;
  background: var(--ink);
  color: var(--gold-soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-display);
  font-size: 8px;
  letter-spacing: 0;
  border: 2px solid var(--paper);
}
.inbox-item .name {
  font-family: var(--ff-serif);
  font-size: 15px;
  color: var(--ink);
}
.inbox-item .preview {
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.inbox-item .time {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
}
.inbox-item .unread {
  background: var(--rose);
  color: var(--paper);
  font-family: var(--ff-mono);
  font-size: 9px;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}

.conv-pane {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.conv-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.conv-head .left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.conv-head .conv-name {
  font-family: var(--ff-display);
  font-size: 22px;
  letter-spacing: 0.05em;
}
.conv-head .conv-sub {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-faint);
}
.conv-body {
  flex: 1;
  padding: 22px;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--paper) 0%, var(--bg) 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  position: relative;
}
.bubble .tm {
  font-family: var(--ff-mono);
  font-size: 9px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  margin-top: 6px;
  opacity: 0.8;
}
.bubble.them {
  align-self: flex-start;
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-bottom-left-radius: 2px;
}
.bubble.luna {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--ink), #3A2924);
  color: var(--paper-warm);
  border-bottom-right-radius: 2px;
}
.bubble.luna::before {
  content: 'LUNA';
  position: absolute;
  top: -16px;
  right: 2px;
  font-family: var(--ff-mono);
  font-size: 8px;
  letter-spacing: 0.3em;
  color: var(--rose);
}
.bubble.system {
  align-self: center;
  background: transparent;
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--ink-faint);
  font-size: 12px;
  padding: 6px 12px;
  max-width: 80%;
  text-align: center;
}

.conv-composer {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--paper);
}
.conv-composer .input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-family: var(--ff-sans);
  font-size: 13px;
  outline: 0;
}
.handoff-banner {
  padding: 10px 14px;
  background: linear-gradient(90deg, rgba(184, 147, 94, 0.15), rgba(176, 85, 95, 0.1));
  border-top: 1px solid var(--line);
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ─── Luna side panel ─── */
.luna-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}
.luna-panel h3 {
  font-family: var(--ff-display);
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.suggest-card {
  padding: 14px;
  background: var(--rose-mist);
  border-left: 2px solid var(--rose);
  border-radius: 2px;
  font-size: 12px;
  color: var(--ink);
  line-height: 1.5;
}
.suggest-card .hdr {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--rose-deep);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.suggest-card b {
  font-family: var(--ff-serif);
  font-size: 14px;
  font-weight: 400;
}

.kpi-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.kpi-mini .k {
  padding: 10px;
  background: var(--bg);
  border-radius: 4px;
}
.kpi-mini .kv {
  font-family: var(--ff-display);
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
}
.kpi-mini .kl {
  font-family: var(--ff-mono);
  font-size: 8px;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-top: 6px;
}

/* ─── FLOURISH / ornaments ─── */
.eye-flourish {
  display: flex;
  align-items: center;
  gap: 8px;
}
.eye-flourish::before, .eye-flourish::after {
  content: '';
  width: 12px; height: 1px;
  background: var(--gold);
}

.pulse-ring {
  animation: ring 2.4s ease-out infinite;
}
@keyframes ring {
  0% { r: 20; opacity: 0.8; }
  100% { r: 34; opacity: 0; }
}

/* ─── Page intro animation ─── */
.fade-up { animation: fu 0.9s cubic-bezier(.2,.7,.2,1) both; }
@keyframes fu {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.d1 { animation-delay: 0.05s; }
.d2 { animation-delay: 0.15s; }
.d3 { animation-delay: 0.25s; }
.d4 { animation-delay: 0.35s; }
.d5 { animation-delay: 0.45s; }
.d6 { animation-delay: 0.55s; }

/* Fallback: se il browser blocca le animazioni (reduced-motion o altro),
   gli elementi restano comunque visibili */
@media (prefers-reduced-motion: reduce) {
  .fade-up,
  .visual-pearl,
  .orbit-ring,
  .shimmer,
  .pulse-ring,
  .heart,
  .luna-fab-dot,
  .cb-typing span {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ─── SERVIZI (listino) ─── */
.service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 8px;
}
.svc-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.svc-card:hover { border-color: var(--rose-soft); box-shadow: var(--shadow); }
.svc-card.premium {
  background: linear-gradient(135deg, var(--paper-warm) 0%, var(--rose-mist) 100%);
  border-color: var(--rose-pale);
}
.svc-card.premium::before {
  content: '★ PREMIUM';
  position: absolute;
  top: 14px; right: 14px;
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--gold);
}
.svc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
}
.svc-head h3 {
  font-family: var(--ff-display);
  font-size: 20px;
  letter-spacing: 0.08em;
  color: var(--ink);
  font-weight: 400;
}
.svc-price {
  font-family: var(--ff-display);
  font-size: 26px;
  color: var(--rose-deep);
  letter-spacing: 0.02em;
}
.svc-meta {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.svc-desc {
  font-family: var(--ff-serif);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.svc-actions {
  display: flex;
  gap: 8px;
}
.svc-btn {
  padding: 7px 14px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
}
.svc-btn:hover { background: var(--rose-deep); }
.svc-btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.svc-btn.ghost:hover { background: var(--ink); color: var(--paper); }

/* ─── MAGAZZINO ─── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 8px;
}
.prod-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: all 0.2s;
}
.prod-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--rose-pale); }
.prod-card.low {
  border-color: var(--rose-soft);
  background: linear-gradient(135deg, var(--paper) 0%, var(--rose-mist) 100%);
}
.prod-swatch {
  width: 52px; height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 -6px 12px rgba(0,0,0,0.15);
  border: 2px solid var(--paper);
}
.prod-body { flex: 1; min-width: 0; }
.prod-brand {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.prod-name {
  font-family: var(--ff-serif);
  font-size: 14px;
  color: var(--ink);
  margin: 2px 0;
  line-height: 1.25;
}
.prod-sku {
  font-family: var(--ff-mono);
  font-size: 9px;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.prod-stock .stock-bar {
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}
.prod-stock .stock-bar > div {
  height: 100%;
  transition: width 0.3s;
}
.prod-stock .stock-lbl {
  font-family: var(--ff-mono);
  font-size: 9px;
  color: var(--ink-soft);
  letter-spacing: 0.1em;
}

@media (max-width: 1200px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .service-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .product-grid { grid-template-columns: 1fr; }
  .svc-card { padding: 18px; }
  .svc-head h3 { font-size: 17px; }
  .svc-price { font-size: 22px; }
}

/* ─── IMPOSTAZIONI ─── */
.settings-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 22px;
  align-items: start;
}
.settings-tabs {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.st-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s;
  color: var(--ink-soft);
}
.st-tab:hover { background: var(--rose-mist); color: var(--rose-deep); }
.st-tab.active { background: linear-gradient(90deg, rgba(217, 168, 171, 0.2), transparent); color: var(--rose-deep); position: relative; }
.st-tab.active::before {
  content: '';
  position: absolute;
  left: -12px; top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--rose);
}
.st-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--rose);
}
.st-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }
.st-tab div { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.st-tab b {
  font-family: var(--ff-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.st-tab em {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 2px;
}

.settings-body {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
}
.st-panel { display: none; }
.st-panel.active { display: block; }

.st-head {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.st-head h2 {
  font-family: var(--ff-display);
  font-size: 34px;
  letter-spacing: 0.04em;
  color: var(--ink);
  font-weight: 400;
  margin-bottom: 6px;
}
.st-head h2 em {
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--rose-deep);
}
.st-head p {
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--ink-faint);
  font-size: 14px;
}

.form-row {
  margin-bottom: 18px;
}
.form-row label {
  display: block;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row input[type="time"],
.form-row input[type="date"],
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--ff-sans);
  font-size: 14px;
  color: var(--ink);
  outline: 0;
  transition: border 0.2s;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus { border-color: var(--rose); }
.form-row small {
  display: block;
  margin-top: 6px;
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-faint);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Team rows */
.team-list { display: flex; flex-direction: column; gap: 10px; }
.team-row {
  display: grid;
  grid-template-columns: 48px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  background: var(--bg);
  border-radius: 6px;
}
.team-row .tr-name {
  font-family: var(--ff-serif);
  font-size: 16px;
  color: var(--ink);
}
.team-row .tr-meta {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-top: 2px;
}

/* Hours grid */
.hours-grid { display: flex; flex-direction: column; gap: 8px; }
.hr-row {
  display: grid;
  grid-template-columns: 110px 120px 20px 120px 60px;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 4px;
}
.hr-row .hr-day {
  font-family: var(--ff-serif);
  font-size: 14px;
  color: var(--ink);
}
.hr-row input[type="time"] {
  padding: 7px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--ink);
}

/* Switch */
.switch {
  position: relative;
  width: 44px;
  height: 22px;
  display: inline-block;
  cursor: pointer;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute;
  inset: 0;
  background: var(--ink-ghost);
  border-radius: 22px;
  transition: 0.3s;
}
.switch span::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: var(--paper);
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + span { background: var(--rose); }
.switch input:checked + span::before { transform: translateX(22px); }

/* Slider */
.slider-group {
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  gap: 10px;
  align-items: center;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.slider-group input[type="range"] {
  -webkit-appearance: none;
  height: 4px;
  background: var(--bg-deep);
  border-radius: 2px;
  outline: none;
}
.slider-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--rose);
  cursor: pointer;
  border: 3px solid var(--paper);
  box-shadow: 0 2px 6px rgba(92,31,44,0.3);
}
.slider-group input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--rose);
  cursor: pointer;
  border: 3px solid var(--paper);
}

/* Check rows */
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
  transition: background 0.2s;
}
.check-row:hover { background: var(--rose-mist); }
.check-row input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--rose);
}

/* Channel toggles */
.channel-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}
.ch-toggle {
  display: grid;
  grid-template-columns: auto auto 1fr;
  grid-template-rows: auto auto;
  gap: 4px 12px;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  align-items: center;
}
.ch-toggle:hover { border-color: var(--rose-soft); }
.ch-toggle input { display: none; }
.ch-toggle .cb {
  grid-row: span 2;
  width: 14px; height: 14px;
  border: 1px solid var(--ink-ghost);
  border-radius: 3px;
  background: var(--paper);
  position: relative;
}
.ch-toggle input:checked ~ .cb { background: var(--rose); border-color: var(--rose); }
.ch-toggle input:checked ~ .cb::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  font-size: 10px;
}
.ch-toggle b {
  font-family: var(--ff-sans);
  font-size: 13px;
  color: var(--ink);
  grid-column: 2 / 4;
  grid-row: 1;
}
.ch-toggle em {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 11px;
  color: var(--ink-faint);
  grid-column: 2 / 4;
  grid-row: 2;
}

/* Integrations */
.int-list { display: flex; flex-direction: column; gap: 10px; }
.int-row {
  display: grid;
  grid-template-columns: 48px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: var(--bg);
  border-radius: 6px;
}
.int-logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-display);
  font-size: 14px;
  letter-spacing: 0.08em;
}
.int-info b {
  font-family: var(--ff-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  display: block;
}
.int-info em {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-faint);
}

@media (max-width: 900px) {
  .settings-grid { grid-template-columns: 1fr; }
  .settings-tabs { position: static; }
  .settings-body { padding: 20px; }
  .st-head h2 { font-size: 26px; }
  .form-grid { grid-template-columns: 1fr; }
  .hr-row { grid-template-columns: 1fr 1fr 10px 1fr 50px; }
  .channel-toggles { grid-template-columns: 1fr; }
  .team-row, .int-row { grid-template-columns: 40px 1fr auto; }
  .team-row > *:nth-child(4), .int-row > *:nth-child(4) { grid-column: 2 / 4; margin-top: 4px; }
}

/* ─── MODAL SYSTEM ─── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(35, 24, 22, 0.5);
  backdrop-filter: blur(6px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.show { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 40px 100px -20px rgba(92, 31, 44, 0.4);
  transform: scale(0.96) translateY(10px);
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1);
}
.modal-backdrop.show .modal { transform: none; }
.modal-head {
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.modal-head h2 {
  font-family: var(--ff-display);
  font-size: 26px;
  letter-spacing: 0.04em;
  color: var(--ink);
  font-weight: 400;
  line-height: 1.1;
}
.modal-head h2 em {
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--rose-deep);
}
.modal-head p {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 4px;
}
.modal-x {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: all 0.2s;
  flex-shrink: 0;
}
.modal-x:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.modal-x svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.5; fill: none; }
.modal-body {
  padding: 24px 28px;
}
.modal-foot {
  padding: 18px 28px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--paper-warm);
}
.modal-step-dots { display: flex; gap: 6px; }
.modal-step-dots span {
  width: 16px; height: 2px;
  background: var(--ink-ghost);
  transition: all 0.3s;
}
.modal-step-dots span.on { background: var(--rose); width: 26px; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink);
  color: var(--paper-warm);
  padding: 14px 22px;
  border-radius: 40px;
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 120;
  transition: transform 0.4s cubic-bezier(.2,.7,.2,1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast b { font-family: var(--ff-display); color: var(--gold-soft); font-style: normal; letter-spacing: 0.1em; }

/* ─── CLIENT GRID CARDS ─── */
.client-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 8px;
}
.client-card {
  display: block;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s cubic-bezier(.2,.7,.2,1);
  position: relative;
  overflow: hidden;
}
.client-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 140px; height: 140px;
  background: radial-gradient(circle, var(--rose-mist), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.client-card:hover {
  transform: translateY(-3px);
  border-color: var(--rose-soft);
  box-shadow: var(--shadow);
}
.client-card:hover::after { opacity: 1; }
.cc-avatar {
  width: 54px; height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-display);
  color: var(--paper);
  font-size: 18px;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
.cc-star {
  position: absolute;
  top: 16px; right: 16px;
  font-family: var(--ff-display);
  font-size: 18px;
  z-index: 2;
}
.cc-star.vip { color: var(--gold); }
.cc-name {
  font-family: var(--ff-serif);
  font-size: 17px;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}
.cc-meta {
  font-family: var(--ff-sans);
  font-size: 11px;
  color: var(--ink-faint);
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.cc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}
.cc-tags .chip {
  font-size: 8px;
  padding: 2px 7px;
  letter-spacing: 0.12em;
}
.cc-tags .chip.vip { background: var(--ink); color: var(--gold-soft); }
.cc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  position: relative;
  z-index: 1;
}
.cc-last {
  font-family: var(--ff-mono);
  font-size: 9px;
  color: var(--rose);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.cc-ltv {
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--ink);
}

@media (max-width: 1200px) {
  .client-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .client-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .client-card { padding: 14px; }
  .cc-avatar { width: 44px; height: 44px; font-size: 14px; }
  .cc-name { font-size: 15px; }
}
@media (max-width: 500px) {
  .client-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════
   EASTER EGG · LEONCINA
   Namespace #leoncina-secret — tutto scopato qui dentro.
   ═══════════════════════════════════════════════════════ */
#leoncina-secret {
  all: initial;
  font-family: "Instrument Serif", "Cormorant", Georgia, serif;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s cubic-bezier(.2,.7,.2,1);
  background:
    radial-gradient(ellipse 60% 50% at 50% 38%, #1f2346 0%, transparent 70%),
    radial-gradient(ellipse 70% 60% at 20% 80%, rgba(176,85,95,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 80% 60% at 80% 20%, rgba(217,190,149,0.12) 0%, transparent 60%),
    linear-gradient(180deg, #070917 0%, #0a0c1e 60%, #050610 100%);
}
#leoncina-secret.ls-on { opacity: 1; pointer-events: auto; }
#leoncina-secret .ls-aurora {
  position: absolute; inset: -20%;
  background:
    radial-gradient(circle at 30% 40%, rgba(217,190,149,0.10), transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(217,168,171,0.08), transparent 55%);
  filter: blur(40px);
  animation: ls-drift 18s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes ls-drift {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(3%,-2%) scale(1.06); }
}
#leoncina-secret .ls-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
}
#leoncina-secret .ls-text {
  position: absolute; left: 50%; bottom: 14%;
  transform: translateX(-50%);
  max-width: 620px; width: calc(100% - 48px);
  text-align: center; color: #f3e7d4;
  pointer-events: none;
}
#leoncina-secret .ls-line {
  font-style: italic;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.55; letter-spacing: 0.01em;
  margin: 0 0 4px;
  opacity: 0; transform: translateY(8px); filter: blur(6px);
  transition: opacity 1.2s ease, transform 1.2s ease, filter 1.2s ease;
  text-shadow: 0 0 20px rgba(217,190,149,0.25);
}
#leoncina-secret .ls-line.ls-show { opacity: 1; transform: none; filter: blur(0); }
#leoncina-secret .ls-sig {
  margin-top: 14px;
  font-family: "Italiana","Cormorant",serif;
  font-style: normal;
  font-size: clamp(13px,1.1vw,16px);
  letter-spacing: 0.42em;
  color: #d9be95;
  text-transform: uppercase;
}
#leoncina-secret .ls-close {
  all: unset;
  position: absolute; right: 28px; bottom: 28px;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px;
  font-family: inherit;
  font-size: 11px; letter-spacing: 0.3em;
  color: rgba(243,231,212,0.55); text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.8s ease, color 0.25s;
}
#leoncina-secret .ls-close.ls-show { opacity: 1; }
#leoncina-secret .ls-close:hover { color: #f3e7d4; }
#leoncina-secret .ls-close-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #d9be95;
  box-shadow: 0 0 10px rgba(217,190,149,0.6);
}
@media (prefers-reduced-motion: reduce) {
  #leoncina-secret .ls-aurora { animation: none; }
}

/* ─── INTERACTIVE TOUR ─── */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.tour-overlay.on { opacity: 1; }
.tour-overlay svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.tour-tip {
  position: fixed;
  z-index: 91;
  width: min(360px, calc(100vw - 32px));
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px 22px 18px;
  box-shadow: 0 30px 80px -20px rgba(92, 31, 44, 0.45), 0 6px 20px rgba(35, 24, 22, 0.18);
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.35s cubic-bezier(.2,.7,.2,1);
  pointer-events: auto;
}
.tour-tip.on { opacity: 1; transform: none; }

.tour-tip::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  transform: rotate(45deg);
}
.tour-tip[data-pos="bottom"]::before { top: -8px; left: 30px; border-right: 0; border-bottom: 0; }
.tour-tip[data-pos="top"]::before { bottom: -8px; left: 30px; border-left: 0; border-top: 0; }
.tour-tip[data-pos="right"]::before { left: -8px; top: 30px; border-top: 0; border-right: 0; }
.tour-tip[data-pos="left"]::before { right: -8px; top: 30px; border-bottom: 0; border-left: 0; }

.tour-tip .tt-eyebrow {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  color: var(--rose);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tour-tip .tt-eyebrow .step {
  font-family: var(--ff-display);
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.tour-tip .tt-title {
  font-family: var(--ff-display);
  font-size: 22px;
  letter-spacing: 0.03em;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 10px;
}
.tour-tip .tt-title .i {
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--rose-deep);
}
.tour-tip .tt-body {
  font-family: var(--ff-serif);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.tour-tip .tt-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.tour-tip .tt-dots {
  display: flex;
  gap: 4px;
}
.tour-tip .tt-dots span {
  width: 14px;
  height: 2px;
  background: var(--ink-ghost);
  transition: all 0.3s;
}
.tour-tip .tt-dots span.on {
  background: var(--rose);
  width: 22px;
}
.tour-tip .tt-btns {
  display: flex;
  gap: 6px;
}
.tour-tip .tt-skip {
  background: transparent;
  border: 0;
  color: var(--ink-faint);
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  cursor: pointer;
  padding: 6px 10px;
  text-transform: uppercase;
  transition: color 0.2s;
}
.tour-tip .tt-skip:hover { color: var(--rose); }
.tour-tip .tt-next {
  background: var(--ink);
  color: var(--paper);
  border: 0;
  font-family: var(--ff-sans);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 9px 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tour-tip .tt-next:hover { background: var(--rose-deep); }
.tour-tip .tt-prev {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--ff-sans);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 9px 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.tour-tip .tt-prev:hover { border-color: var(--ink); }

/* Tour trigger button (injected in topbar) */
.tour-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--rose-pale), var(--rose-mist));
  border: 1px solid var(--rose-soft);
  border-radius: 40px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--rose-deep);
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.25s;
}
.tour-trigger:hover {
  background: var(--rose);
  color: var(--paper);
  border-color: var(--rose);
  transform: translateY(-1px);
}
.tour-trigger::before {
  content: '?';
  width: 16px; height: 16px;
  background: var(--rose);
  color: var(--paper);
  border-radius: 50%;
  font-family: var(--ff-display);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}
.tour-trigger:hover::before { background: var(--paper); color: var(--rose); }

@media (max-width: 900px) {
  .tour-trigger { padding: 6px 10px; font-size: 9px; letter-spacing: 0.14em; }
  .tour-trigger::before { width: 14px; height: 14px; font-size: 10px; }
  .tour-tip { padding: 18px 18px 14px; }
  .tour-tip .tt-title { font-size: 18px; }
  .tour-tip .tt-body { font-size: 13px; }
}

/* Scopri link in sidebar */
.sidebar-intro-link {
  display: block;
  margin-top: 6px;
  padding: 9px 12px;
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 12px;
  color: var(--rose);
  text-decoration: none;
  border: 1px dashed var(--rose-pale);
  border-radius: 4px;
  text-align: center;
  transition: all 0.2s;
}
.sidebar-intro-link:hover {
  background: var(--rose-mist);
  border-color: var(--rose);
  color: var(--rose-deep);
}

/* ─── FLOATING LUNA CHATBOT ─── */
.luna-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  font-family: var(--ff-sans);
}
.luna-fab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 54px;
  height: 54px;
  border: 0;
  background: linear-gradient(135deg, var(--ink) 0%, #3A2924 100%);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 10px 30px -8px rgba(92, 31, 44, 0.4), 0 2px 6px rgba(35, 24, 22, 0.2);
  position: relative;
  transition: transform 0.25s cubic-bezier(.2,.7,.2,1);
  overflow: hidden;
}
.luna-fab-btn:hover { transform: translateY(-2px) scale(1.05); }
.luna-fab-btn svg {
  width: 40px; height: 40px;
  flex-shrink: 0;
}
.luna-fab-label {
  display: none;
}
.luna-fab-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #8FBF8F;
  border: 2px solid var(--ink);
  animation: pulse 2s infinite;
}

.luna-chat {
  position: absolute;
  bottom: 78px;
  right: 0;
  width: 380px;
  height: 560px;
  background: var(--paper);
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px -20px rgba(92, 31, 44, 0.35), 0 8px 24px -8px rgba(35, 24, 22, 0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  animation: chat-in 0.3s cubic-bezier(.2,.7,.2,1);
}
.luna-fab.open .luna-chat { display: flex; }
@keyframes chat-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.luna-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--ink) 0%, #3A2924 100%);
  color: var(--paper-warm);
  position: relative;
  overflow: hidden;
}
.luna-chat-head::after {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(217, 190, 149, 0.4), transparent 65%);
  pointer-events: none;
}
.luna-chat-title {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.chat-orb {
  width: 36px; height: 36px;
}
.chat-name {
  font-family: var(--ff-display);
  font-size: 20px;
  letter-spacing: 0.1em;
}
.chat-sub {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 11px;
  color: var(--gold-soft);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dot-online {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #8FBF8F;
  box-shadow: 0 0 0 3px rgba(143, 191, 143, 0.25);
}
.chat-x {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255, 251, 246, 0.12);
  border: 0;
  color: var(--paper-warm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: background 0.2s;
}
.chat-x:hover { background: rgba(255, 251, 246, 0.2); }
.chat-x svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.5; fill: none; }

.luna-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px;
  background: linear-gradient(180deg, var(--paper-warm) 0%, var(--bg) 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cb-msg { display: flex; flex-direction: column; gap: 3px; }
.cb-msg.luna-side { align-items: flex-start; }
.cb-msg.you-side { align-items: flex-end; }
.cb-bubble {
  max-width: 86%;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  border-bottom-left-radius: 3px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}
.cb-msg.you-side .cb-bubble {
  background: var(--rose);
  color: var(--paper);
  border-color: transparent;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 3px;
}
.cb-bubble b { font-weight: 500; color: var(--rose-deep); }
.cb-msg.you-side .cb-bubble b { color: var(--paper-warm); }
.cb-t {
  font-family: var(--ff-mono);
  font-size: 9px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  padding: 0 4px;
}

.cb-quick {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.cb-quick button {
  text-align: left;
  padding: 10px 14px;
  background: var(--paper);
  border: 1px solid var(--rose-pale);
  border-radius: 20px;
  font-family: var(--ff-sans);
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s;
}
.cb-quick button:hover {
  background: var(--rose-mist);
  border-color: var(--rose);
  transform: translateX(2px);
}

.luna-chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.luna-chat-input input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-family: var(--ff-sans);
  font-size: 13px;
  color: var(--ink);
  outline: 0;
}
.luna-chat-input input:focus { border-color: var(--rose-soft); }
.luna-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose-deep) 100%);
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  transition: transform 0.2s;
}
.luna-send:hover { transform: scale(1.08); }
.luna-send svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.5; fill: currentColor; fill-opacity: 0.3; }

.cb-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
}
.cb-typing span {
  width: 6px; height: 6px;
  background: var(--rose);
  border-radius: 50%;
  opacity: 0.4;
  animation: typing 1.2s infinite;
}
.cb-typing span:nth-child(2) { animation-delay: 0.2s; }
.cb-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* ─── CREDITS FOOTER ─── */
.credits {
  margin-top: 80px;
  padding: 44px 24px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  position: relative;
}
.credits-ornament {
  width: 36px;
  height: 36px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--rose);
  font-family: var(--ff-display);
  font-size: 15px;
  margin-top: -66px;
  flex-shrink: 0;
  letter-spacing: 0;
}
.credits-message {
  max-width: 540px;
  margin: 4px 0 0;
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.55;
}
.credits-message em {
  color: var(--rose-deep);
  font-weight: 500;
  font-style: italic;
  font-family: var(--ff-serif);
}
.credits .heart {
  color: var(--rose);
  font-style: normal;
  display: inline-block;
  animation: beat 1.8s ease-in-out infinite;
  margin: 0 2px;
}
@keyframes beat {
  0%, 100% { transform: scale(1); }
  10% { transform: scale(1.25); }
  20% { transform: scale(1); }
  30% { transform: scale(1.15); }
  40% { transform: scale(1); }
}
.credits-bottom {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.28em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.credits-bottom .dot {
  color: var(--gold);
  font-family: var(--ff-display);
  font-size: 10px;
}
.credits-bottom a {
  color: var(--rose-deep);
  text-decoration: none;
  font-family: var(--ff-display);
  letter-spacing: 0.25em;
  font-style: normal;
  font-size: 11px;
  transition: color 0.2s;
}
.credits-bottom a:hover { color: var(--rose); }

/* ─── MOBILE HEADER (hidden on desktop) ─── */
.mobile-head {
  display: none;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1200px) {
  .app { grid-template-columns: 200px 1fr; }
  .main { padding: 28px 28px 40px; }
  .greeting h1 { font-size: 42px; }
  .inbox-layout { grid-template-columns: 280px 1fr 280px; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 82%;
    max-width: 320px;
    height: 100vh;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(35, 24, 22, 0.4);
    z-index: 99;
    backdrop-filter: blur(2px);
  }
  .sidebar-backdrop.show { display: block; }

  /* Mobile top bar */
  .mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--paper-warm);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
    background: rgba(253, 250, 245, 0.85);
  }
  .mobile-head .mh-brand {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .mobile-head .mh-brand svg { width: 32px; height: 32px; }
  .mobile-head .mh-name {
    font-family: var(--ff-display);
    font-size: 13px;
    letter-spacing: 0.22em;
    color: var(--ink);
  }
  .mh-btn {
    width: 38px; height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--ink);
    cursor: pointer;
  }
  .mh-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.5; fill: none; }

  /* Main area */
  .main {
    padding: 18px 16px 90px;
  }

  /* Topbar */
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
  }
  .topbar-right {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }
  .search { flex: 1; min-width: 180px; }
  .greeting h1 { font-size: 40px; line-height: 1; }
  .greeting .eyebrow { font-size: 9px; letter-spacing: 0.22em; }
  .greeting .date { font-size: 14px; }

  /* Dashboard grid stacks */
  .dashboard-grid { gap: 14px; grid-template-columns: repeat(4, 1fr); }
  .col-12, .col-8, .col-7, .col-6, .col-5, .col-4 { grid-column: span 4; }
  .col-3 { grid-column: span 2; }

  .card { padding: 18px; border-radius: 8px; }
  .card-head { margin-bottom: 14px; padding-bottom: 12px; flex-wrap: wrap; gap: 8px; }
  .card-title { font-size: 15px; letter-spacing: 0.16em; }

  .stat-value { font-size: 28px; }
  .stat-label { font-size: 9px; }

  /* Clock: shrink */
  .clock-wrap { max-width: 360px; }
  .clock-center .big { font-size: 44px; }
  .clock-center .ongoing { font-size: 11px; max-width: 140px; }

  /* Appt list tighter */
  .appt { grid-template-columns: 52px 1fr; padding: 12px 2px; }
  .appt-stylist { grid-column: 1 / -1; justify-content: flex-start; margin-top: 4px; padding-left: 68px; }
  .appt-body .client { font-size: 15px; }
  .appt-body .service { font-size: 10px; }

  /* Luna card */
  .luna-name { font-size: 32px; }
  .luna-name .italic { font-size: 24px; }
  .luna-stats { gap: 8px; }
  .luna-stat .v { font-size: 22px; }

  /* Revenue chart shrinks */
  .revenue-chart { height: 130px; }
  .revenue-legend { flex-direction: column; gap: 6px; font-size: 9px; }

  /* Calendar → scroll horizontally */
  .cal-week {
    grid-template-columns: 50px repeat(6, 130px);
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .cal-head .dd { font-size: 22px; }

  /* Inbox → stacked, swipe between views */
  .inbox-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
    min-height: 0;
    gap: 12px;
  }
  .inbox-list {
    max-height: 300px;
  }
  .conv-pane { min-height: 480px; }
  .luna-panel { max-height: none; }

  /* Dossier hero stacks */
  .dossier-hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 16px;
    padding: 24px 18px;
  }
  .big-avatar {
    width: 120px; height: 120px;
    font-size: 42px;
    margin: 0 auto;
  }
  .dossier-info h1 { font-size: 42px; }
  .dossier-score { text-align: center; }
  .dossier-meta { justify-content: center; gap: 14px; }

  /* Gallery 2 cols */
  .gallery { grid-template-columns: repeat(2, 1fr); }

  /* Heat grid slightly smaller */
  .heat-grid { grid-template-columns: 30px repeat(7, 1fr); gap: 2px; }
  .heat-head { font-size: 8px; }

  /* Buttons smaller */
  .btn { padding: 9px 14px; font-size: 10px; letter-spacing: 0.12em; }
  .icon-btn { width: 36px; height: 36px; }

  /* Tabs on client page scroll */
  .dossier-tabs-scroll { overflow-x: auto; }

  /* Formula card mobile */
  .formula-card { grid-template-columns: 48px 1fr; gap: 14px; padding: 16px; }
  .formula-swatch { width: 48px; height: 48px; }

  /* Client row compact */
  .client-row {
    grid-template-columns: 36px 1fr;
    grid-template-rows: auto auto;
    gap: 8px;
  }
  .client-row .avatar { grid-row: span 2; }
  .client-row .last,
  .client-row .spend { grid-column: 2; }

  /* Credits */
  .credits { margin-top: 40px; padding: 28px 0 16px; gap: 12px 0; }
  .credits-message { font-size: 13px; padding: 0 10px; }
  .credits-bottom { flex-direction: column; gap: 8px; font-size: 9px; letter-spacing: 0.25em; }
  .credits-bottom .dot { display: none; }
  .credits-bottom a { font-size: 10px; }

  /* ─── MOBILE BOTTOM NAV (app-style) ─── */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 50;
    background: rgba(253, 250, 245, 0.94);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .mobile-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 4px;
    text-decoration: none;
    color: var(--ink-faint);
    font-family: var(--ff-mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    position: relative;
  }
  .mobile-nav a.active { color: var(--rose-deep); }
  .mobile-nav a.active::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 28px; height: 2px;
    background: var(--rose);
  }
  .mobile-nav svg {
    width: 22px; height: 22px;
    stroke: currentColor;
    stroke-width: 1.3;
    fill: none;
  }
  .mobile-nav .badge {
    position: absolute;
    top: 2px;
    right: 18%;
    background: var(--rose);
    color: var(--paper);
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 7px;
    letter-spacing: 0;
    min-width: 14px;
    text-align: center;
  }
}

/* Mobile adjustments for Luna FAB — stays above bottom nav */
@media (max-width: 900px) {
  .luna-fab {
    right: 14px;
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
  .luna-fab-btn { width: 48px; height: 48px; }
  .luna-fab-btn svg { width: 36px; height: 36px; }
  .luna-chat {
    position: fixed !important;
    right: 8px !important;
    left: 8px !important;
    bottom: calc(72px + env(safe-area-inset-bottom)) !important;
    top: auto !important;
    width: auto !important;
    max-width: none !important;
    height: min(70vh, 520px) !important;
  }
}

/* Safety net: always constrain SVG dimensions inside FAB/chat */
.luna-fab-btn > svg,
.chat-orb > svg,
.luna-fab-dot {
  display: block;
  max-width: 100%;
  max-height: 100%;
}
.chat-orb > svg { width: 36px; height: 36px; }
.luna-fab-btn > svg { width: 40px; height: 40px; }

@media (min-width: 901px) {
  .mobile-nav, .mobile-head, .sidebar-backdrop { display: none !important; }
}

@media (max-width: 500px) {
  .greeting h1 { font-size: 34px; }
  .stat-value { font-size: 24px; }
  .col-3 { grid-column: span 2; }
  .dossier-info h1 { font-size: 34px; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .luna-name { font-size: 28px; }
  .luna-name .italic { font-size: 20px; }
  .topbar-right .search { order: -1; width: 100%; }
  .clock-wrap { max-width: 100%; }
  .formula-mix { font-size: 9px; }
}
