/* ==========================================================================
   Claudia — Design System
   Feminine editorial SaaS · wine/cream/peach palette · Fraunces + Geist
   ========================================================================== */

:root {
  /* Palette — warm cream canvas, dusty rose primary, burgundy ink */
  --bg:              #fbf7f4;
  --bg-veil:         #f8efe9;
  --surface:         #ffffff;
  --surface-warm:    #fdf6f0;
  --surface-peach:   #fbeee4;

  --primary:         #b84666;
  --primary-ink:     #7a1f3c;
  --primary-soft:    #f4d9e1;
  --primary-50:      #fff4f7;
  --primary-100:     #fde4ec;
  --primary-200:     #f9c5d3;
  --primary-600:     #b84666;
  --primary-700:     #8e2f4b;

  --accent-peach:    #e8a380;
  --accent-gold:     #c2832a;

  --ink:             #2a1818;
  --ink-soft:        #4d3a3f;
  --muted:           #846a70;
  --muted-soft:      #b29ba1;

  --border:          #f0e4dd;
  --border-strong:   #e5d3c9;
  --divider:         #f5ebe4;

  --success:         #4a7c59;
  --success-soft:    #e4efe7;
  --warning:         #c2832a;
  --warning-soft:    #faecd5;
  --danger:          #b54851;
  --danger-soft:     #fae0e2;

  /* Gradient tokens */
  --grad-peach:      linear-gradient(135deg, #fde4ec 0%, #fef1e4 100%);
  --grad-rose:       linear-gradient(135deg, #fff4f7 0%, #fdf6f0 100%);
  --grad-accent:     linear-gradient(135deg, #b84666 0%, #d97284 100%);

  /* Shadow tokens — warm, low-contrast */
  --sh-sm: 0 1px 2px rgba(122, 31, 60, .05), 0 1px 1px rgba(122, 31, 60, .03);
  --sh-md: 0 4px 14px rgba(122, 31, 60, .06), 0 2px 4px rgba(122, 31, 60, .04);
  --sh-lg: 0 20px 40px rgba(122, 31, 60, .08), 0 6px 12px rgba(122, 31, 60, .04);
  --sh-glow: 0 0 0 1px rgba(184, 70, 102, .12), 0 8px 28px rgba(184, 70, 102, .12);

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 9999px;

  /* Type */
  --f-serif: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --f-sans: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --f-mono: 'Geist Mono', 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
  --f-hand: 'Caveat', 'Patrick Hand', cursive;

  /* Transitions */
  --ease-soft: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ===== Dark theme ===== */
[data-theme="dark"] {
  --bg:              #1a1418;
  --bg-veil:         #241b20;
  --surface:         #241b20;
  --surface-warm:    #2d2128;
  --surface-peach:   #332530;

  --primary:         #e07594;
  --primary-ink:     #f8c6d4;
  --primary-soft:    #3d2530;
  --primary-50:      #2a1d24;
  --primary-100:     #3a2530;
  --primary-200:     #4d2f3e;
  --primary-600:     #e07594;
  --primary-700:     #f0a0b5;

  --accent-peach:    #f0b090;
  --accent-gold:     #e0a458;

  --ink:             #f6eae2;
  --ink-soft:        #d8c5bf;
  --muted:           #a89094;
  --muted-soft:      #6d5c63;

  --border:          #3a2a30;
  --border-strong:   #4a3640;
  --divider:         #2e2228;

  --success:         #7ec090;
  --success-soft:    #2a3d30;
  --warning:         #e0a458;
  --warning-soft:    #3d3020;
  --danger:          #e06870;
  --danger-soft:     #3a2428;

  --grad-peach:      linear-gradient(135deg, #3a2530 0%, #3d2a24 100%);
  --grad-rose:       linear-gradient(135deg, #2a1d24 0%, #2d2128 100%);
  --grad-accent:     linear-gradient(135deg, #c95c7e 0%, #e0898f 100%);

  --sh-sm: 0 1px 2px rgba(0,0,0,.35), 0 1px 1px rgba(0,0,0,.25);
  --sh-md: 0 4px 14px rgba(0,0,0,.4), 0 2px 4px rgba(0,0,0,.3);
  --sh-lg: 0 20px 40px rgba(0,0,0,.5), 0 6px 12px rgba(0,0,0,.35);
  --sh-glow: 0 0 0 1px rgba(224, 117, 148, .2), 0 8px 28px rgba(224, 117, 148, .15);
}
[data-theme="dark"] body {
  color-scheme: dark;
}
[data-theme="dark"] body::before {
  background: radial-gradient(circle, #3d2030 0%, transparent 70%);
  opacity: 0.4;
}
[data-theme="dark"] body::after {
  background: radial-gradient(circle, #3a2820 0%, transparent 70%);
  opacity: 0.35;
}
[data-theme="dark"] .nav { background: rgba(26, 20, 24, 0.85); }
[data-theme="dark"] .tabbar {
  background: rgba(36, 27, 32, 0.94);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23a89094' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}
[data-theme="dark"] .chip-gray { background: #3a2e34; color: #c5b0b5; }
[data-theme="dark"] .chip-gray::before { background: #a89094; }
[data-theme="dark"] .chip-rose { background: #3a2530; color: #f8c6d4; }
[data-theme="dark"] .chip-green { background: #1f2e25; color: #a8d4b4; }
[data-theme="dark"] .chip-amber { background: #3a2e1d; color: #e8c280; }
[data-theme="dark"] .chip-danger { background: #3a2028; color: #f0a0a8; }
[data-theme="dark"] .today-card {
  background: linear-gradient(135deg, #2a1d24 0%, #302028 50%, #3a2530 100%);
  border-color: #4d2f3e;
}
[data-theme="dark"] .today-pill {
  background: var(--primary);
  color: #1a1418;
}
[data-theme="dark"] .action-pill { background: #1f2e25; color: #a8d4b4; }
[data-theme="dark"] .action-pill:hover { background: var(--success); color: #fff; }
[data-theme="dark"] .action-pill.phone { background: #3a2530; color: #f8c6d4; }
[data-theme="dark"] .action-pill.phone:hover { background: var(--primary); color: #fff; }
[data-theme="dark"] .flash.ok {
  background: linear-gradient(135deg, #1f2e25 0%, #253530 100%);
  color: #a8d4b4;
  border-color: #2a4035;
}
[data-theme="dark"] .flash.error {
  background: linear-gradient(135deg, #3a2028 0%, #402830 100%);
  color: #f0a0a8;
  border-color: #4a2a32;
}
[data-theme="dark"] .filter-chip { background: var(--surface-warm); }
[data-theme="dark"] .filter-chip.on {
  background: var(--primary);
  color: #1a1418;
  border-color: var(--primary);
}
[data-theme="dark"] .login-brand {
  background: linear-gradient(90deg, #f8c6d4 0%, #e07594 50%, #f8c6d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
[data-theme="dark"] .login-card::before {
  background: linear-gradient(135deg, rgba(224,117,148,.4), transparent 50%, rgba(240,176,144,.3));
}
[data-theme="dark"] .petal { filter: brightness(0.65) saturate(1.2); }
[data-theme="dark"] .bar-track { background: #3a2530; }
[data-theme="dark"] code {
  background: var(--surface-warm);
  color: var(--primary-ink);
}
[data-theme="dark"] .card-warm { background: #2a2128; }
[data-theme="dark"] .card-accent {
  border-color: rgba(224, 117, 148, 0.3);
  box-shadow: 0 0 0 1px rgba(224, 117, 148, .2), 0 8px 28px rgba(0, 0, 0, .4);
}
[data-theme="dark"] .card-rose {
  background: linear-gradient(135deg, #2a1d24 0%, #2d2128 100%);
  border-color: #3a2530;
}
[data-theme="dark"] input[type="file"] { color-scheme: dark; }
[data-theme="dark"] input[type="date"] { color-scheme: dark; }
[data-theme="dark"] .prod-tile.on {
  background: linear-gradient(135deg, #3a2530 0%, #402830 100%);
  box-shadow: 0 0 0 1px rgba(224, 117, 148, .3), 0 8px 28px rgba(224, 117, 148, .15);
}

/* ===== Active press feedback ===== */
.btn, .chip, .filter-chip, .qty-btn, .tab, .nav-link, .action-pill, .card-hover, .today-cta, .prod-tile button {
  -webkit-user-select: none;
  user-select: none;
}
.btn:active, .filter-chip:active, .action-pill:active, .today-cta:active {
  transform: scale(0.97);
}
.tab:active {
  background: var(--primary-100);
}
.card-hover:active {
  transform: translateY(-1px) scale(0.995);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--primary-200); background-clip: padding-box; }

/* ===== Smoother focus ===== */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ===== File input prettier ===== */
input[type="file"] {
  padding: 10px 14px !important;
  cursor: pointer;
}
input[type="file"]::file-selector-button {
  background: var(--primary-50);
  color: var(--primary-ink);
  border: 0;
  padding: 6px 14px;
  border-radius: var(--r-md);
  font-weight: 500;
  margin-right: 10px;
  cursor: pointer;
  font-family: inherit;
}
input[type="file"]::file-selector-button:hover { background: var(--primary-100); }

/* ===== Radio as card ===== */
input[type="radio"], input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px; height: 16px;
  cursor: pointer;
}

/* ===== Dismiss flash button ===== */
.flash {
  position: relative;
  padding-right: 44px;
}
.flash-close {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  width: 24px; height: 24px;
  border-radius: 50%;
  background: transparent;
  color: currentColor;
  opacity: 0.5;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .15s, background .15s;
}
.flash-close:hover { opacity: 1; background: rgba(0, 0, 0, 0.08); }
.flash.hiding {
  animation: slideUpOut .3s ease-in forwards;
}
@keyframes slideUpOut {
  to { opacity: 0; transform: translateY(-8px); margin-bottom: -60px; padding-top: 0; padding-bottom: 0; max-height: 0; overflow: hidden; }
}

/* ===== Table mobile: scroll hint ===== */
@media (max-width: 640px) {
  .table-wrap { position: relative; }
  .table-wrap::after {
    content: "";
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 28px;
    background: linear-gradient(to right, transparent, var(--surface));
    pointer-events: none;
    opacity: 0.8;
  }
  .t th, .t td { padding: 12px 14px; font-size: .875rem; }
}

/* ===== Smooth number reveal ===== */
.stat-value { will-change: transform; }

/* ===== Nav link underline on active ===== */
.nav-link.active {
  position: relative;
}
.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 2px; left: 14px; right: 14px;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}


/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
/* iOS safe area */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}
body {
  font-family: var(--f-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
/* Floating pastel blobs in background */
body::before, body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: float 18s ease-in-out infinite;
}
body::before {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #fde4ec 0%, transparent 70%);
  top: -150px; left: -150px;
  animation-delay: 0s;
}
body::after {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #fdf1e3 0%, transparent 70%);
  bottom: -200px; right: -200px;
  animation-delay: -9s;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.08); }
  66% { transform: translate(-20px, 40px) scale(0.95); }
}
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ===== Typography ===== */
.serif, h1, h2, h3, h4 {
  font-family: var(--f-serif);
  font-variation-settings: 'opsz' 48, 'SOFT' 50;
  letter-spacing: -0.025em;
  color: var(--ink);
}
h1 { font-size: 2.5rem; font-weight: 400; line-height: 1.05; }
h2 { font-size: 1.625rem; font-weight: 400; line-height: 1.15; }
h3 { font-size: 1.25rem; font-weight: 500; line-height: 1.25; }
.serif { font-variation-settings: 'opsz' 48, 'SOFT' 50; }
.display {
  font-family: var(--f-serif);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  font-weight: 300;
  letter-spacing: -0.04em;
}
.italic { font-style: italic; }
.muted { color: var(--muted); }
.small { font-size: .8125rem; }
.eyebrow {
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 500;
}
.numeral { font-feature-settings: 'tnum', 'ss01'; }

/* ===== Layout ===== */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
  width: 100%;
}
.main {
  padding: 40px 0 120px;
  flex: 1;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}
@media (max-width: 760px) {
  .main { padding: 20px 0 calc(92px + var(--safe-bottom)); }
  .wrap { padding: 0 16px; }
}
.stack > * + * { margin-top: 16px; }
.stack-lg > * + * { margin-top: 28px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ===== Nav (top - desktop) ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: rgba(251, 247, 244, 0.82);
  border-bottom: 1px solid var(--border);
  padding-top: var(--safe-top);
}
.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
}
@media (max-width: 760px) {
  .nav-inner { padding: 10px 16px; }
  .nav-links { display: none; }
}
.brand {
  font-family: var(--f-serif);
  font-variation-settings: 'opsz' 48, 'SOFT' 80;
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--primary-ink);
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--grad-accent);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(184, 70, 102, .4);
}
.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
}
.nav-link {
  padding: 8px 14px;
  border-radius: var(--r-md);
  font-size: .875rem;
  color: var(--muted);
  font-weight: 500;
  transition: all .15s ease;
  position: relative;
}
.nav-link:hover { color: var(--primary-ink); background: var(--primary-50); }
.nav-link.active {
  color: var(--primary-ink);
  background: var(--primary-100);
}
.nav-logout {
  color: var(--muted);
  font-size: .8125rem;
  padding: 6px 12px;
  border-radius: var(--r-md);
  transition: color .15s;
}
.nav-logout:hover { color: var(--primary); }

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
.card-hover:hover {
  box-shadow: var(--sh-md);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.card-p { padding: 24px; }
.card-pad-sm { padding: 18px; }
.card-pad-lg { padding: 32px; }
.card-warm { background: var(--surface-warm); }
.card-rose { background: var(--grad-rose); border-color: var(--primary-100); }
.card-accent {
  background: var(--grad-peach);
  border-color: var(--primary-200);
  box-shadow: var(--sh-glow);
}

/* ===== Stat ===== */
.stat { padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; }
.stat-label {
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--muted);
  font-weight: 500;
}
.stat-value {
  font-family: var(--f-serif);
  font-variation-settings: 'opsz' 72, 'SOFT' 80;
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-feature-settings: 'tnum';
  line-height: 1.05;
  margin-top: 2px;
}
.stat-sub { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.stat-value.rose { color: var(--primary-ink); }
.stat-value.green { color: var(--success); }
.stat-value.amber { color: var(--warning); }
.stat-value.danger { color: var(--danger); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-md);
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: all .15s ease;
  white-space: nowrap;
  line-height: 1;
  min-height: 40px;
}
.btn-primary {
  background: var(--grad-accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(184, 70, 102, .22);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(184, 70, 102, .32);
}
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: var(--primary-50);
  color: var(--primary-ink);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  background: var(--primary-100);
}
.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary-ink); }
.btn-sm { padding: 6px 12px; font-size: .8125rem; min-height: 32px; }
.btn-lg { padding: 14px 24px; font-size: .9375rem; min-height: 48px; border-radius: var(--r-lg); }
.btn-block { width: 100%; }
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

/* ===== Inputs ===== */
.field { display: flex; flex-direction: column; gap: 6px; }
.label {
  font-size: .75rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.input, select.input, textarea.input {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font: inherit;
  color: var(--ink);
  font-size: .9375rem;
  transition: border-color .15s, box-shadow .15s, background .15s;
  font-family: var(--f-sans);
}
.input:hover { border-color: var(--primary-200); }
.input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--primary-100);
}
.input-lg { padding: 14px 16px; font-size: 1rem; }
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23846a70' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.input-group {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

/* ===== Chips ===== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1.5;
  white-space: nowrap;
}
.chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; flex: none; }
.chip-rose    { background: var(--primary-100);  color: var(--primary-ink); }
.chip-rose::before    { background: var(--primary); }
.chip-green   { background: var(--success-soft); color: var(--success); }
.chip-green::before   { background: var(--success); }
.chip-amber   { background: var(--warning-soft); color: var(--warning); }
.chip-amber::before   { background: var(--warning); }
.chip-danger  { background: var(--danger-soft);  color: var(--danger); }
.chip-danger::before  { background: var(--danger); }
.chip-gray    { background: #f2ebe5;             color: #6b5860; }
.chip-gray::before    { background: #a89698; }
.chip-lg { padding: 6px 14px; font-size: .8125rem; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
table.t {
  width: 100%;
  border-collapse: collapse;
}
.t th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-warm);
}
.t th:first-child { border-top-left-radius: var(--r-lg); }
.t th:last-child { border-top-right-radius: var(--r-lg); text-align: right; }
.t td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--divider);
  font-size: .9375rem;
  color: var(--ink);
}
.t td:last-child { text-align: right; }
.t tr:last-child td { border-bottom: none; }
.t tr:hover td { background: var(--primary-50); }
.t td.num { font-feature-settings: 'tnum'; }
.t .strong { font-weight: 500; color: var(--ink); }
.t .dim { color: var(--muted); }

/* Empty state */
.empty {
  padding: 64px 24px;
  text-align: center;
  color: var(--muted);
}
.empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: .6; }
.empty-title {
  font-family: var(--f-serif);
  font-size: 1.375rem;
  color: var(--ink);
  margin-bottom: 8px;
  font-weight: 400;
}
.empty-sub { font-size: .9375rem; max-width: 360px; margin: 0 auto 20px; }

/* ===== Avatar ===== */
.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--grad-accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: 1rem;
  flex: none;
  box-shadow: var(--sh-sm);
}
.avatar-lg { width: 64px; height: 64px; font-size: 1.5rem; }

/* ===== Flash ===== */
.flash {
  padding: 12px 16px;
  border-radius: var(--r-md);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .9375rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.flash.ok { background: var(--success-soft); color: var(--success); border-color: #c5dbcc; }
.flash.error { background: var(--danger-soft); color: var(--danger); border-color: #f2c2c6; }

/* ===== Grid helpers ===== */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ===== Login ===== */
.login-wrap {
  min-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  max-width: 420px;
  width: 100%;
  padding: 44px 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  text-align: center;
  position: relative;
}
.login-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: var(--r-xl);
  padding: 1px;
  background: linear-gradient(135deg, rgba(184,70,102,.3), transparent 50%, rgba(232,163,128,.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.login-brand {
  font-family: var(--f-serif);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  font-size: 3.75rem;
  font-weight: 300;
  color: var(--primary-ink);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 8px;
}
.login-tag {
  color: var(--muted);
  font-size: .9375rem;
  margin-bottom: 32px;
  letter-spacing: 0.01em;
}
.login-ornament {
  display: inline-block;
  margin: 0 auto 28px;
  color: var(--primary);
  font-size: 1.25rem;
  letter-spacing: 0.5em;
  padding-left: 0.5em;
}

/* ===== Hero (client detail, dashboard) ===== */
.hero {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.hero-title {
  font-family: var(--f-serif);
  font-variation-settings: 'opsz' 96, 'SOFT' 100;
  font-size: 2.75rem;
  font-weight: 300;
  letter-spacing: -0.035em;
  line-height: 1.02;
}
.hero-meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: .9375rem; margin-top: 6px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }

/* ===== Filter chips row ===== */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-chip {
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: .8125rem;
  font-weight: 500;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  transition: all .15s;
}
.filter-chip:hover { border-color: var(--primary-200); color: var(--primary-ink); }
.filter-chip.on {
  background: var(--primary-ink);
  color: #fff;
  border-color: var(--primary-ink);
  box-shadow: 0 2px 8px rgba(122, 31, 60, .2);
}

/* ===== Order line items ===== */
.line-row {
  display: grid;
  grid-template-columns: 1fr 100px 120px 32px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
}
.line-remove {
  width: 32px; height: 32px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 1rem;
  transition: background .15s;
}
.line-remove:hover { background: var(--danger-soft); color: var(--danger); }
@media (max-width: 640px) {
  .line-row { grid-template-columns: 1fr 1fr; }
  .line-row > *:nth-child(1) { grid-column: span 2; }
}

/* ===== Utility ===== */
.text-right { text-align: right; }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 48px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.flex-1 { flex: 1; }
.ml-auto { margin-left: auto; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.hidden-mobile { }
@media (max-width: 640px) { .hidden-mobile { display: none; } }
.pill-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary);
  display: inline-block;
}

/* ===== Divider ===== */
.hr {
  height: 1px;
  background: var(--divider);
  border: 0;
  margin: 20px 0;
}

/* ===== Sparkline bar ===== */
.bar-track {
  height: 6px;
  background: var(--primary-100);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--grad-accent);
  border-radius: var(--r-pill);
  transition: width .4s ease;
}

/* ===== Price / number ===== */
.money {
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
}
.money-currency {
  font-size: .7em;
  color: var(--muted);
  margin-right: 2px;
  font-weight: 400;
}

/* Whatsapp link styling */
.wa-link {
  color: var(--success);
  font-size: .875rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.wa-link:hover { text-decoration: underline; }

/* Link default */
.link {
  color: var(--primary-ink);
  font-weight: 500;
  transition: color .15s;
}
.link:hover { color: var(--primary); }

/* ===== Page header ===== */
.page-head {
  margin-bottom: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.page-title {
  font-family: var(--f-serif);
  font-variation-settings: 'opsz' 96, 'SOFT' 80;
  font-size: 2.5rem;
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.page-sub {
  color: var(--muted);
  font-size: .9375rem;
  margin-top: 4px;
}
@media (max-width: 760px) {
  .page-head { margin-bottom: 20px; gap: 14px; }
  .page-title { font-size: 1.875rem; }
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.375rem; }
  .hero-title { font-size: 2rem; }
  .stat-value { font-size: 1.625rem; }
}

/* ===== Bottom tab bar (mobile) ===== */
.tabbar { display: none; }
@media (max-width: 760px) {
  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-top: 1px solid var(--border);
    padding: 6px 6px calc(6px + var(--safe-bottom));
    box-shadow: 0 -4px 24px rgba(122, 31, 60, .06);
  }
  .tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    color: var(--muted);
    border-radius: var(--r-md);
    font-size: .6875rem;
    font-weight: 500;
    transition: color .15s, background .15s;
    min-height: 52px;
  }
  .tab:active { background: var(--primary-50); }
  .tab.active { color: var(--primary-ink); }
  .tab .ico { font-size: 1.25rem; line-height: 1; }
  .tab.fab {
    background: var(--grad-accent);
    color: #fff;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    flex: none;
    align-self: center;
    margin: 0 4px;
    box-shadow: 0 6px 18px rgba(184, 70, 102, .35);
    transform: translateY(-12px);
  }
  .tab.fab .ico { font-size: 1.75rem; }
  .tab.fab span:not(.ico) { display: none; }
}

/* ===== Quantity stepper ===== */
.qty {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  overflow: hidden;
}
.qty-btn {
  width: 40px;
  height: 40px;
  font-size: 1.25rem;
  color: var(--primary-ink);
  font-weight: 500;
  transition: background .12s;
}
.qty-btn:active { background: var(--primary-100); }
.qty-val {
  min-width: 50px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: .9375rem;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink);
  outline: none;
}

/* ===== Product tile (order form) ===== */
.prod-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.prod-tile {
  padding: 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  transition: all .18s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prod-tile:hover { border-color: var(--primary-200); }
.prod-tile.on {
  background: var(--grad-peach);
  border-color: var(--primary);
  box-shadow: var(--sh-glow);
}
.prod-tile-name {
  font-family: var(--f-serif);
  font-variation-settings: 'opsz' 48;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.2;
}
.prod-tile-price {
  color: var(--muted);
  font-size: .8125rem;
  font-variant-numeric: tabular-nums;
}
.prod-tile-stock {
  font-size: .6875rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.prod-tile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.prod-tile-price-edit {
  width: 90px;
  padding: 6px 10px;
  font-size: .8125rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  text-align: right;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
}
.prod-tile-price-edit:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42, 24, 24, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 28px 26px 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--sh-lg);
  text-align: center;
  transform: translateY(10px);
  transition: transform .2s;
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal h3 { margin-bottom: 8px; }
.modal p { color: var(--muted); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 8px; }
.modal-actions > * { flex: 1; }

/* ===== Sticky bottom actions (mobile) ===== */
.sticky-actions {
  margin-top: 24px;
}
@media (max-width: 760px) {
  .sticky-actions {
    position: sticky;
    bottom: calc(80px + var(--safe-bottom));
    background: linear-gradient(to top, var(--bg) 70%, transparent);
    padding: 16px 0;
    z-index: 5;
  }
}

/* ===== Floating action mini (inside pages) ===== */
.action-big {
  display: flex;
  gap: 10px;
  width: 100%;
}
.action-big > * { flex: 1; justify-content: center; }

/* ===== Today card gradient ===== */
.today-card {
  background: linear-gradient(135deg, #fff4f7 0%, #fef1e4 50%, #fde4ec 100%);
  border: 1px solid var(--primary-100);
  border-radius: var(--r-xl);
  padding: 24px 22px;
}
.today-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.today-pill {
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--primary-ink);
  color: #fff;
  font-size: .6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.today-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(184, 70, 102, .1);
}
.today-item:last-child { border-bottom: none; }
.today-item .flex-1 { min-width: 0; }
.today-name { font-weight: 500; font-size: .9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-meta { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.today-cta {
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--primary-ink);
  color: #fff;
  font-size: .75rem;
  font-weight: 500;
  flex: none;
}

/* ===== Toasty links ===== */
.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--success-soft);
  color: var(--success);
  font-size: .8125rem;
  font-weight: 500;
  transition: all .15s;
}
.action-pill:hover { background: var(--success); color: #fff; }
.action-pill.phone { background: var(--primary-100); color: var(--primary-ink); }
.action-pill.phone:hover { background: var(--primary); color: #fff; }

/* ===== iOS keyboards love inputmode ===== */
input[inputmode="decimal"], input[inputmode="numeric"], input[type="number"] {
  font-variant-numeric: tabular-nums;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bloom {
  0%   { opacity: 0; transform: scale(0.8) rotate(-6deg); }
  60%  { opacity: 1; transform: scale(1.05) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes heartbeat {
  0%, 60%, 100% { transform: scale(1); }
  15% { transform: scale(1.12); }
  30% { transform: scale(0.98); }
  45% { transform: scale(1.06); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes petalFall {
  0% { transform: translateY(-20vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(120vh) rotate(720deg); opacity: 0; }
}
@keyframes gentleSpin {
  to { transform: rotate(360deg); }
}

/* Cascade fade-in on page entry */
.main > .wrap > * {
  animation: fadeInUp .5s var(--ease-soft) both;
}
.main > .wrap > *:nth-child(1) { animation-delay: 0s; }
.main > .wrap > *:nth-child(2) { animation-delay: .05s; }
.main > .wrap > *:nth-child(3) { animation-delay: .1s; }
.main > .wrap > *:nth-child(4) { animation-delay: .15s; }
.main > .wrap > *:nth-child(5) { animation-delay: .2s; }
.main > .wrap > *:nth-child(n+6) { animation-delay: .25s; }

/* Stats heartbeat on hover */
.card.stat:hover .stat-value {
  animation: heartbeat 1.2s ease-in-out;
}

/* Button lift & shine */
.btn-primary {
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.25) 50%, transparent 100%);
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity .3s;
}
.btn-primary:hover::after { opacity: 1; animation: shimmer 1.4s ease-in-out infinite; }

/* Brand dot pulsing */
.brand::before {
  animation: heartbeat 2.8s ease-in-out infinite;
}

/* Today card: live dot pulse */
.today-pill {
  position: relative;
  padding-left: 22px !important;
}
.today-pill::before {
  content: "";
  position: absolute;
  left: 10px; top: 50%;
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 0 0 rgba(255,255,255,0.7);
  animation: liveDot 1.6s ease-in-out infinite;
}
@keyframes liveDot {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,.7); }
  70% { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

/* Card hover lift */
.card-hover {
  transition: transform .25s var(--ease-soft), box-shadow .25s ease, border-color .25s ease;
}
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-lg);
}

/* Filter chips bounce when selected */
.filter-chip.on {
  animation: bloom .35s var(--ease-spring);
}

/* Input focus: gentle glow expansion */
.input:focus {
  animation: inputBloom .25s ease-out;
}
@keyframes inputBloom {
  0% { box-shadow: 0 0 0 0 var(--primary-100); }
  100% { box-shadow: 0 0 0 4px var(--primary-100); }
}

/* Flash message bloom on entry */
.flash {
  animation: bloom .4s var(--ease-spring);
}
.flash.ok {
  background: linear-gradient(135deg, #e4efe7 0%, #f0f9f1 100%);
}

/* Avatar gentle rotate on hover */
.avatar { transition: transform .3s var(--ease-spring); }
.avatar:hover { transform: rotate(-8deg) scale(1.06); }

/* Link accent (handwritten) */
.accent {
  font-family: var(--f-hand);
  font-weight: 500;
  font-size: 1.4em;
  color: var(--primary);
  line-height: 1;
  letter-spacing: 0;
}
.accent-sm {
  font-family: var(--f-hand);
  font-weight: 500;
  font-size: 1.2em;
  color: var(--primary-ink);
  line-height: 1;
}

/* Ornamental flower SVG (inline via ::before where used) */
.ornament {
  display: inline-block;
  width: 28px;
  height: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none'%3E%3Cg fill='%23f9c5d3'%3E%3Cellipse cx='20' cy='10' rx='6' ry='8'/%3E%3Cellipse cx='30' cy='20' rx='8' ry='6'/%3E%3Cellipse cx='20' cy='30' rx='6' ry='8'/%3E%3Cellipse cx='10' cy='20' rx='8' ry='6'/%3E%3C/g%3E%3Ccircle cx='20' cy='20' r='5' fill='%23c2832a'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  vertical-align: middle;
  animation: gentleSpin 22s linear infinite;
}
.ornament-sm { width: 18px; height: 18px; }
.ornament-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px 0;
  color: var(--muted);
  font-size: 1rem;
  letter-spacing: 0.8em;
}
.ornament-divider::before, .ornament-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-strong), transparent);
  margin: 0 14px;
}

/* Petal confetti on success actions */
.petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  overflow: hidden;
}
.petal {
  position: absolute;
  top: -20px;
  width: 14px; height: 14px;
  background: var(--primary-200);
  border-radius: 0 100% 0 100%;
  animation: petalFall 3.5s ease-in forwards;
}
.petal:nth-child(odd) { background: #f9c5d3; }
.petal:nth-child(3n) { background: #fbd0a0; border-radius: 50%; width: 10px; height: 10px; }
.petal:nth-child(5n) { background: #fde4ec; }
.petal:nth-child(7n) { background: #fae0e2; }

/* Chip hover wiggle */
.chip { transition: transform .2s var(--ease-spring); }
.chip:hover { transform: scale(1.05); }

/* Stat value soft reveal */
.stat-value { transition: color .2s; }

/* Hearts on CTAs */
.btn-primary .heart {
  display: inline-block;
  animation: heartbeat 2.4s ease-in-out infinite;
  color: #ffc7d3;
}

/* Page title soft underline */
.page-title {
  position: relative;
  display: inline-block;
}
.page-title-underline {
  display: block;
  width: 80px;
  height: 12px;
  margin-top: -4px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12' fill='none'%3E%3Cpath d='M2 7 Q 30 0, 60 6 T 118 5' stroke='%23f9c5d3' stroke-width='3' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}

/* Empty state floats */
.empty-icon {
  animation: gentleBob 3s ease-in-out infinite;
}
@keyframes gentleBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Brand shimmer on login */
.login-brand {
  background: linear-gradient(90deg, #7a1f3c 0%, #b84666 50%, #7a1f3c 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s ease-in-out infinite;
}

/* Motion safety */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}
