@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope-latin-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+1E00-1EFF, U+20A0-20AB, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-soft: #fafafa;
  --surface-strong: #f3f3f1;
  --text: #121212;
  --text-soft: rgba(18, 18, 18, .66);
  --text-faint: rgba(18, 18, 18, .44);
  --border: #e6e6e3;
  --border-strong: #d4d4cf;
  --sidebar: #121212;
  --sidebar-raised: #242424;
  --sidebar-text: #ffffff;
  --sidebar-muted: rgba(255, 255, 255, .5);
  --brand: #ff4c00;
  --brand-dark: #e84400;
  --brand-soft: #ffefe8;
  --chart-1: #ff4c00;
  --chart-2: #7c3aed;
  --chart-3: #2786e8;
  --chart-4: #2fb79a;
  --chart-5: #e6b44a;
  --mint: #ff4c00;
  --mint-ink: #ffffff;
  --orange: #ff4c00;
  --maroon: #780a00;
  --blue: #3f6feb;
  --purple: #7756d9;
  --amber: #c78320;
  --green: #2c8a58;
  --red: #c4433b;
  --shadow-sm: 0 1px 2px rgba(18, 18, 18, .025);
  --shadow-md: 0 10px 28px rgba(18, 18, 18, .065);
  --shadow-lg: 0 34px 100px rgba(18, 18, 18, .18);
  --sidebar-width: 248px;
  --sidebar-collapsed: 78px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
}

html.dark {
  color-scheme: dark;
  --bg: #101010;
  --bg-elevated: #151515;
  --surface: #1a1a1a;
  --surface-soft: #212121;
  --surface-strong: #2b2b2b;
  --text: #f5f5f4;
  --text-soft: #b2b2ae;
  --text-faint: #858581;
  --border: #333331;
  --border-strong: #464642;
  --brand: #ff6a2b;
  --brand-dark: #ff4c00;
  --brand-soft: #3a2117;
  --chart-1: #ff6a2b;
  --chart-2: #ffffff;
  --chart-3: #a7a6ab;
  --chart-4: #a43d13;
  --chart-5: #42251a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .18), 0 6px 16px rgba(0, 0, 0, .12);
  --shadow-md: 0 18px 45px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.auth-pending { overflow: hidden; }

@keyframes clientLoginSpin { to { transform: rotate(360deg); } }

button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent);
  outline-offset: 2px;
}

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow: hidden;
  color: var(--sidebar-text);
  background:
    radial-gradient(circle at 25% -10%, rgba(255, 255, 255, .045), transparent 31%),
    linear-gradient(180deg, #1b1b1b 0%, var(--sidebar) 100%);
  border-right: 1px solid rgba(255,255,255,.07);
  transition: width 220ms cubic-bezier(.2,.8,.2,1), transform 220ms cubic-bezier(.2,.8,.2,1);
}

.sidebar-brand {
  position: relative;
  display: flex;
  min-height: 80px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 13px 18px;
  border-bottom: 1px solid rgba(255,255,255,.075);
}

.brand-link { display: flex; min-width: 0; align-items: center; }
/* La barra es estrecha: el logotipo completo NO cabe legible (el trazo del "360"
   mide 3px sobre 1186px; por debajo de ~200px de ancho cae bajo 1 pixel fisico y
   se deshace). Va la marca sola + el nombre en texto vivo, nitido a cualquier tamano. */
.brand-full { display: flex; align-items: center; gap: 9px; flex-shrink: 0; min-width: 0; }
.brand-full .bf-mark {
  width: 26px; flex-shrink: 0; aspect-ratio: 424 / 248; background: currentColor;
  -webkit-mask: url("assets/sabor360-icon.png") center/contain no-repeat;
          mask: url("assets/sabor360-icon.png") center/contain no-repeat;
}
.brand-full .bf-word { font-weight: 800; font-size: 15px; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
/* El lockup hereda currentColor. Si algún día se conecta el interruptor de tema
   oscuro, sin esto quedaría tinta oscura sobre barra oscura. */
html.dark .brand-full { color: var(--text); }
.brand-mark { display: none; width: 42px; height: 42px; object-fit: contain; }

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  cursor: pointer;
  place-items: center;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease;
}
.icon-button:hover { color: var(--text); background: var(--surface-soft); border-color: var(--border-strong); }
.icon-button:active { transform: scale(.96); }
.icon-button svg, .icon-button [data-icon] svg { width: 18px; height: 18px; }
.dark-button { color: #d9e3de; background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.08); }
.dark-button:hover { color: #fff; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.14); }
.sidebar-collapse svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; transition: transform 220ms ease; }

.sidebar-nav {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 15px 11px;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }
.nav-link {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 43px;
  cursor: pointer;
  align-items: center;
  gap: 11px;
  margin: 3px 0;
  padding: 0 11px;
  color: #aebcb5;
  background: transparent;
  border: 0;
  border-radius: 12px;
  text-align: left;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-link:active { transform: translateY(1px); }
.nav-link.active {
  color: var(--mint-ink);
  background: var(--mint);
  box-shadow: 0 9px 25px rgba(0,0,0,.2), inset 0 0 0 1px rgba(6,30,18,.09);
}
.nav-icon { display: grid; width: 20px; height: 20px; flex: 0 0 20px; place-items: center; }
.nav-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-label { min-width: 0; flex: 1; overflow: hidden; font-size: 12px; font-weight: 540; text-overflow: ellipsis; white-space: nowrap; }
.nav-link.active .nav-label { font-weight: 720; }
.nav-count {
  min-width: 25px;
  padding: 3px 7px;
  color: #cbd6d0;
  background: rgba(255,255,255,.075);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}
.nav-link.active .nav-count { color: var(--mint-ink); background: rgba(8,32,20,.1); }
.nav-dot { width: 7px; height: 7px; background: var(--orange); border-radius: 50%; box-shadow: 0 0 0 4px rgba(255,105,35,.12); }

.sidebar-footer { padding: 11px 12px; border-top: 1px solid rgba(255,255,255,.075); }
.system-status { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 13px; }
.status-pulse { position: relative; width: 9px; height: 9px; flex: 0 0 auto; background: #66d88c; border-radius: 50%; }
.status-pulse::after { content: ""; position: absolute; inset: -4px; border: 1px solid rgba(102,216,140,.35); border-radius: 50%; animation: pulse 2s infinite; }
.status-copy { min-width: 0; }
.status-copy strong, .status-copy small { display: block; white-space: nowrap; }
.status-copy strong { color: #dbe5df; font-size: 11px; font-weight: 620; }
.status-copy small { margin-top: 2px; color: var(--sidebar-muted); font-size: 9px; }
@keyframes pulse { 0%,100% { transform: scale(.85); opacity: .5; } 50% { transform: scale(1.18); opacity: 1; } }

.workspace { min-height: 100vh; margin-left: var(--sidebar-width); transition: margin-left 220ms cubic-bezier(.2,.8,.2,1); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px clamp(18px, 2.5vw, 34px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  backdrop-filter: blur(18px);
}
.mobile-menu-button { display: none; }
.topbar-heading { min-width: 0; }
.breadcrumb { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; color: var(--text-faint); font-size: 9px; font-weight: 600; }
.breadcrumb i { font-style: normal; opacity: .5; }
.breadcrumb strong { color: var(--brand); font-weight: 700; }
.topbar-heading h1 { margin: 0; font-family: "Aeonik", "Inter", sans-serif; font-size: 21px; font-weight: 690; letter-spacing: -.04em; }
.topbar-actions { display: flex; align-items: center; gap: 7px; }
.account-button {
  display: flex;
  min-width: 158px;
  height: 42px;
  cursor: pointer;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.account-avatar { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; color: var(--mint-ink); background: var(--mint); border-radius: 9px; font-size: 11px; font-weight: 800; }
.account-copy { min-width: 0; flex: 1; text-align: left; }
.account-copy strong, .account-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: 10px; font-weight: 690; }
.account-copy small { margin-top: 1px; color: var(--text-faint); font-size: 8px; }
.account-button > [data-icon] svg { width: 15px; height: 15px; fill: none; stroke: var(--text-faint); stroke-width: 2; }
.account-button:hover { background: var(--surface-soft); border-color: var(--border-strong); }

.page-container { max-width: 1500px; margin: 0 auto; padding: 20px clamp(18px, 2.5vw, 36px) 52px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-head-actions-only { align-items: center; justify-content: flex-end; margin-bottom: 10px; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 7px; }

.button {
  display: inline-flex;
  min-height: 38px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 680;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.button:active { transform: translateY(1px); }
.button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.button-primary { color: #fff; background: var(--brand); border-color: var(--brand); box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 18%, transparent); }
.button-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.button-mint { color: var(--mint-ink); background: var(--mint); border-color: color-mix(in srgb, var(--mint) 75%, #102318); }
.button-secondary { color: var(--text); background: var(--surface); border-color: var(--border); }
.button-secondary:hover { background: var(--surface-soft); border-color: var(--border-strong); }
.button-ghost { color: var(--text-soft); background: transparent; border-color: transparent; }
.button-ghost:hover { color: var(--text); background: var(--surface-strong); }
.button-danger { color: #fff; background: var(--red); border-color: var(--red); }
.button-small { min-height: 31px; padding-inline: 10px; border-radius: 9px; font-size: 9px; }

.segmented { display: inline-flex; align-items: center; gap: 2px; padding: 3px; background: var(--surface-strong); border: 1px solid var(--border); border-radius: 11px; }
.segment { min-height: 29px; cursor: pointer; padding: 0 10px; color: var(--text-soft); background: transparent; border: 0; border-radius: 8px; font-size: 9px; font-weight: 650; }
.segment.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 22px 22px 0; }
.card-title { margin: 0; font-size: 14px; font-weight: 720; letter-spacing: -.02em; }
.card-subtitle { margin: 5px 0 0; color: var(--text-soft); font-size: 10px; line-height: 1.5; }
.card-body { padding: 20px 22px 22px; }

.overview-toolbar { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.overview-period-copy { display: flex; min-width: 0; align-items: center; gap: 10px; }
.overview-period-copy strong, .overview-period-copy small { display: block; }
.overview-period-copy strong { font-size: 11px; font-weight: 720; }
.overview-period-copy small { margin-top: 3px; color: var(--text-faint); font-size: 9px; }
.overview-status-dot { width: 9px; height: 9px; flex: 0 0 auto; background: var(--brand); border: 3px solid color-mix(in srgb,var(--brand) 18%,var(--surface)); border-radius: 50%; box-sizing: content-box; }
.overview-toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }

.overview-kpi-grid { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 10px; }
.overview-hero-metric, .overview-metric-card { animation: overviewRise .48s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--delay,0ms); }
.overview-hero-metric { position: relative; grid-column: span 4; min-height: 190px; overflow: hidden; padding: 17px; color: #fff; background: radial-gradient(circle at 95% 5%,rgba(180,255,190,.18),transparent 32%),linear-gradient(145deg,#063d2e 0%,#005f46 62%,#0b795b 100%); border: 1px solid rgba(255,255,255,.09); border-radius: 20px; box-shadow: 0 18px 40px rgba(0,67,49,.16); }
.overview-hero-head { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.overview-hero-head > span, .overview-hero-head > b { display: inline-flex; align-items: center; gap: 6px; }
.overview-hero-head > span { color: rgba(255,255,255,.8); font-size: 10px; font-weight: 680; }
.overview-hero-head > b { padding: 5px 7px; color: var(--mint); background: rgba(180,255,190,.1); border: 1px solid rgba(180,255,190,.18); border-radius: 999px; font-size: 9px; }
.overview-hero-head svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.overview-hero-value { position: relative; z-index: 2; margin-top: 14px; font-size: 34px; font-weight: 750; letter-spacing: -.055em; line-height: 1; font-variant-numeric: tabular-nums; }
.overview-hero-metric > p { position: relative; z-index: 2; margin: 5px 0 0; color: rgba(255,255,255,.62); font-size: 9px; }
.overview-hero-chart { position: absolute; right: 0; bottom: 31px; left: 0; width: 100%; height: 68px; }
.hero-spark-area { fill: url(#heroSparkGradient); }
.hero-spark-line { fill: none; stroke: var(--mint); stroke-width: 2.2; stroke-linecap: round; filter: drop-shadow(0 4px 8px rgba(180,255,190,.2)); }
.overview-hero-footer { position: absolute; right: 15px; bottom: 12px; left: 15px; z-index: 2; display: flex; justify-content: space-between; gap: 10px; color: rgba(255,255,255,.58); font-size: 8px; }
.overview-hero-footer b { color: #fff; font-weight: 700; }

.overview-metric-card { position: relative; display: flex; grid-column: span 2; min-height: 190px; overflow: hidden; flex-direction: column; padding: 15px; background: linear-gradient(155deg,var(--surface) 0%,color-mix(in srgb,var(--brand) 2.5%,var(--surface)) 100%); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-sm); transition: transform 180ms ease,border-color 180ms ease,box-shadow 180ms ease; }
.overview-metric-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb,var(--brand) 28%,var(--border)); box-shadow: var(--shadow-md); }
.overview-metric-head { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.overview-metric-icon { display: grid; width: 31px; height: 31px; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 10px; }
.overview-metric-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.overview-trend { display: inline-flex; align-items: center; gap: 3px; padding: 4px 6px; color: var(--green); background: color-mix(in srgb,var(--green) 9%,transparent); border-radius: 999px; font-size: 8px; font-weight: 760; }
.overview-trend svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 2; }
.overview-trend.down { color: var(--red); background: color-mix(in srgb,var(--red) 9%,transparent); }
.overview-trend.down svg { transform: rotate(180deg); }
.overview-trend.neutral { color: var(--text-soft); background: var(--surface-strong); }
.overview-trend.neutral svg { transform: rotate(180deg); }
.overview-metric-value { position: relative; z-index: 2; margin-top: 15px; font-size: 25px; font-weight: 740; letter-spacing: -.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.overview-metric-label { position: relative; z-index: 2; margin-top: 5px; font-size: 10px; font-weight: 660; }
.overview-metric-note { position: relative; z-index: 2; margin-top: auto; padding-top: 10px; color: var(--text-faint); font-size: 8px; }

.overview-panel { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-sm); transition: border-color 180ms ease,box-shadow 180ms ease; }
.overview-panel:hover { border-color: color-mix(in srgb,var(--brand) 18%,var(--border)); box-shadow: 0 16px 38px rgba(18,30,24,.065); }
.overview-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 18px 0; }
.overview-eyebrow { display: block; margin-bottom: 6px; color: var(--brand); font-size: 8px; font-weight: 780; letter-spacing: .12em; text-transform: uppercase; }
.overview-panel-head h3 { margin: 0; font-size: 14px; font-weight: 730; letter-spacing: -.025em; }
.overview-panel-head p { margin: 5px 0 0; color: var(--text-faint); font-size: 9px; line-height: 1.45; }
.overview-insights-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(330px,.65fr); align-items: stretch; gap: 12px; margin-top: 12px; }
.overview-insights-grid > .overview-panel { min-height: 354px; }
.overview-ranking { padding: 10px 18px 14px; }
.overview-rank-row { display: grid; grid-template-columns: 24px 38px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 58px; border-bottom: 1px solid var(--border); }
.overview-rank-row:last-child { border-bottom: 0; }
.overview-rank-number { color: var(--text-faint); font-size: 8px; font-weight: 720; }
.overview-rank-row:first-child .overview-rank-number { color: var(--brand); }
.overview-rank-image { width: 36px; height: 36px; overflow: hidden; background: var(--surface-soft); border-radius: 10px; }
.overview-rank-image img { width: 100%; height: 100%; object-fit: cover; }
.overview-rank-copy { min-width: 0; }
.overview-rank-copy strong,.overview-rank-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overview-rank-copy strong { font-size: 9px; }
.overview-rank-copy span { margin-top: 2px; color: var(--text-faint); font-size: 8px; }
.overview-rank-copy i { display: block; width: min(100%,180px); height: 3px; margin-top: 5px; overflow: hidden; background: var(--surface-strong); border-radius: 999px; }
.overview-rank-copy i b { display: block; height: 100%; background: linear-gradient(90deg,var(--brand),#6ea48d); border-radius: inherit; }
.overview-rank-value { text-align: right; }
.overview-rank-value strong,.overview-rank-value span { display: block; }
.overview-rank-value strong { font-size: 9px; font-variant-numeric: tabular-nums; }
.overview-rank-value span { margin-top: 2px; color: var(--text-faint); font-size: 7px; }

.category-performance { padding: 20px 18px 16px; }
.category-stack { display: flex; height: 12px; overflow: hidden; background: var(--surface-strong); border: 3px solid var(--surface-strong); border-radius: 999px; }
.category-stack i { height: 100%; }
.category-performance-row { display: grid; grid-template-columns: 8px minmax(0,1fr) 32px 44px; align-items: center; gap: 8px; min-height: 37px; border-bottom: 1px solid var(--border); }
.category-performance-row:last-child { border-bottom: 0; }
.category-performance-row > i { width: 7px; height: 7px; border-radius: 3px; }
.category-performance-row span { font-size: 9px; font-weight: 620; }
.category-performance-row strong { font-size: 9px; text-align: right; }
.category-performance-row small { color: var(--text-faint); font-size: 8px; text-align: right; font-variant-numeric: tabular-nums; }

.click-analytics-modal { width: min(980px,calc(100vw - 36px)); }
.click-analytics-body { padding-top: 16px; }
.click-analytics-summary { display: grid; grid-template-columns: repeat(3,minmax(120px,.45fr)) minmax(220px,1fr); align-items: end; gap: 10px; margin-bottom: 15px; }
.click-analytics-summary > div { min-height: 62px; padding: 11px 13px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 13px; }
.click-analytics-summary span,.click-analytics-summary strong { display: block; }
.click-analytics-summary span { color: var(--text-faint); font-size: 7px; font-weight: 680; letter-spacing: .06em; text-transform: uppercase; }
.click-analytics-summary strong { margin-top: 6px; font-size: 17px; letter-spacing: -.03em; }
.click-search { min-width: 0; }
.click-search input { height: 62px; background: var(--surface); }
.click-table-wrap { max-height: 470px; overflow: auto; border: 1px solid var(--border); border-radius: 14px; }
.click-table { width: 100%; border-collapse: collapse; }
.click-table th { position: sticky; top: 0; z-index: 2; height: 38px; padding: 0 12px; color: var(--text-faint); background: var(--surface-soft); border-bottom: 1px solid var(--border); font-size: 7px; font-weight: 730; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.click-table td { height: 58px; padding: 8px 12px; color: var(--text-soft); border-bottom: 1px solid var(--border); font-size: 8px; }
.click-table tr:last-child td { border-bottom: 0; }
.click-rank { color: var(--text-faint); font-weight: 720; }
.click-dish { display: flex; min-width: 170px; align-items: center; gap: 9px; }
.click-dish img { width: 37px; height: 37px; flex: 0 0 auto; object-fit: cover; border-radius: 10px; }
.click-dish strong,.click-dish span { display: block; }
.click-dish strong { color: var(--text); font-size: 9px; }
.click-dish span { margin-top: 2px; color: var(--text-faint); font-size: 7px; }
.click-number { color: var(--text) !important; font-weight: 720; font-variant-numeric: tabular-nums; }
.click-share { min-width: 120px; }
.click-share strong { display: block; color: var(--text); font-size: 8px; }
.click-share i { display: block; width: 100%; height: 4px; margin-top: 5px; overflow: hidden; background: var(--surface-strong); border-radius: 999px; }
.click-share b { display: block; height: 100%; background: var(--brand); border-radius: inherit; }

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

.toolbar-card { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 15px; box-shadow: var(--shadow-sm); }
.search-field { position: relative; min-width: 220px; flex: 1; }
.search-field svg { position: absolute; top: 50%; left: 13px; width: 17px; height: 17px; fill: none; stroke: var(--text-faint); stroke-width: 2; transform: translateY(-50%); pointer-events: none; }
.search-field input { width: 100%; height: 37px; padding: 0 12px 0 37px; color: var(--text); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 10px; font-size: 10px; }
.filter-row { display: flex; max-width: 100%; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { height: 33px; cursor: pointer; padding: 0 10px; color: var(--text-soft); background: transparent; border: 1px solid var(--border); border-radius: 9px; font-size: 9px; font-weight: 620; white-space: nowrap; }
.filter-chip.active { color: #fff; background: var(--brand); border-color: var(--brand); }
.view-switch { display: inline-flex; padding: 3px; background: var(--surface-strong); border-radius: 10px; }
.view-switch button { display: grid; width: 32px; height: 32px; cursor: pointer; place-items: center; color: var(--text-faint); background: transparent; border: 0; border-radius: 8px; }
.view-switch button.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm); }
.view-switch svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

.dish-control-panel {
  margin-bottom: 14px;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}
.dish-control-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-faint);
  font-size: 7px;
  font-weight: 760;
  letter-spacing: .12em;
  line-height: 1;
  text-transform: uppercase;
}
.dish-control-top { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 12px; }
.dish-control-search { min-width: 0; }
.dish-control-search .search-field { display: block; min-width: 0; }
.dish-control-search .search-field input { height: 40px; background: var(--surface-soft); }
.dish-control-view { min-width: max-content; }
.dish-control-view .view-switch { min-height: 40px; align-items: center; }
.dish-control-view .view-switch button { width: 36px; height: 32px; }
.dish-control-middle {
  display: grid;
  grid-template-columns: minmax(300px,.8fr) minmax(560px,1.25fr);
  align-items: end;
  gap: 20px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
}
.dish-control-group { min-width: 0; }
.dish-control-group .filter-row { min-height: 52px; align-items: center; }
.dish-control-group .filter-chip { height: 38px; padding-inline: 13px; background: var(--surface-soft); }
.dish-control-group .filter-chip.active { background: var(--brand); }
.dish-create-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.dish-create-button {
  display: flex;
  min-width: 0;
  min-height: 52px;
  cursor: pointer;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: left;
  transition: transform 150ms ease, color 150ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.dish-create-button:hover { transform: translateY(-1px); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.dish-create-button > svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.dish-create-button > span { min-width: 0; }
.dish-create-button strong, .dish-create-button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dish-create-button strong { font-size: 9px; font-weight: 720; }
.dish-create-button small { margin-top: 3px; color: var(--text-faint); font-size: 7px; font-weight: 540; }
.dish-create-button.combination { color: var(--brand); background: color-mix(in srgb,var(--brand) 7%,var(--surface)); border-color: color-mix(in srgb,var(--brand) 25%,var(--border)); }
.dish-create-button.combination small { color: color-mix(in srgb,var(--brand) 66%,var(--text-faint)); }
.dish-create-button.category { background: var(--surface); }
.dish-create-button.dish { color: #fff; background: var(--brand); border-color: var(--brand); box-shadow: 0 7px 16px color-mix(in srgb,var(--brand) 16%,transparent); }
.dish-create-button.dish:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.dish-create-button.dish small { color: rgba(255,255,255,.7); }
.dish-control-categories { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--border); }
.dish-control-categories .filter-row { gap: 5px; }
.dish-control-categories .filter-chip { height: 32px; background: transparent; }
.dish-control-categories .filter-chip.active { background: var(--brand); }

.combination-item-modal { width: min(620px,100%); }
.combination-item-form { display: grid; gap: 14px; }
.combination-item-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.combination-item-upload { display: flex; min-height: 72px; cursor: pointer; align-items: center; gap: 12px; padding: 13px; color: var(--text-soft); background: var(--surface-soft); border: 1px dashed var(--border-strong); border-radius: 13px; text-align: left; }
.combination-item-upload:hover { color: var(--brand); border-color: var(--brand); }
.combination-item-upload > svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.combination-item-upload strong, .combination-item-upload small { display: block; }
.combination-item-upload strong { color: var(--text); font-size: 9px; }
.combination-item-upload small { margin-top: 3px; color: var(--text-faint); font-size: 8px; }

.dish-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dish-card { position: relative; overflow: visible; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-sm); transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease; }
.dish-card:has(.dish-status-control.open) { z-index: 30; }
.dish-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.dish-image { position: relative; aspect-ratio: 16/10; overflow: hidden; background: linear-gradient(135deg, #ececea, #f8f8f6); border-radius: 19px 19px 0 0; }
html.dark .dish-image { background: linear-gradient(135deg, #30302e, #1b1b1a); }
.dish-image img { width: 100%; height: 100%; object-fit: cover; }
/* La imagen abre el editor. Antes abría un modal de "Vista previa" con un
   sobreimpreso al hover; se quitó por completo — el dueño edita, no espía. */
button.dish-image { display: block; width: 100%; cursor: pointer; padding: 0; color: inherit; border: 0; text-align: left; }
button.dish-image img { transition: transform 240ms ease; }
button.dish-image:hover img { transform: scale(1.025); }
.dish-image-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-faint); background: repeating-linear-gradient(45deg, transparent 0 14px, color-mix(in srgb, var(--text) 3%, transparent) 14px 28px); }
.dish-image-placeholder svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.status-chip { display: inline-flex; min-height: 25px; align-items: center; gap: 5px; padding: 0 8px; border-radius: 999px; font-size: 8px; font-weight: 750; }
.status-live { color: #17623a; background: #e7f6ec; }
.status-sold { color: #9c3832; background: #fbe9e7; }
.status-scheduled { color: #785514; background: #fbf1d9; }
html.dark .status-live { color: #8be1aa; background: #173323; }
html.dark .status-sold { color: #f0a39d; background: #3b211f; }
html.dark .status-scheduled { color: #e6c879; background: #352d1a; }
.dish-status { position: absolute; top: 11px; left: 11px; }
.dish-status-control { position: absolute; top: 11px; left: 11px; z-index: 8; }
.dish-status-button {
  display: inline-flex;
  min-height: 30px;
  cursor: pointer;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: #17623a;
  background: rgba(231,246,236,.96);
  border: 1px solid rgba(23,98,58,.1);
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(15,34,24,.12);
  font-size: 9px;
  font-weight: 750;
  backdrop-filter: blur(8px);
}
.dish-status-button > i { width: 7px; height: 7px; flex: 0 0 auto; background: #1caf68; border-radius: 50%; }
.dish-status-button.status-sold > i { background: #ef4d55; }
.dish-status-button.status-scheduled > i { background: #e89c13; }
.dish-status-button.status-sold { color: #9c3832; background: rgba(251,233,231,.97); }
.dish-status-button.status-scheduled { color: #785514; background: rgba(251,241,217,.97); }
.status-caret { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform 150ms ease; }
.dish-status-control.open .status-caret { transform: rotate(180deg); }
.dish-status-menu {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  display: none;
  width: 285px;
  padding: 7px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 15px;
  box-shadow: var(--shadow-lg);
}
.dish-status-control.open .dish-status-menu { display: grid; gap: 3px; animation: modalIn 150ms ease both; }
.status-option {
  display: grid;
  grid-template-columns: 10px minmax(0,1fr) 17px;
  gap: 10px;
  padding: 10px;
  cursor: pointer;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 10px;
  text-align: left;
}
.status-option:hover, .status-option.active { background: var(--brand-soft); }
.status-option-dot { width: 9px; height: 9px; margin-top: 3px; background: var(--green); border-radius: 50%; }
.status-option-dot.sold { background: #ef4d55; }
.status-option-dot.scheduled { background: #e89c13; }
.status-option strong, .status-option span, .status-option small { display: block; }
.status-option strong { font-size: 10px; }
.status-option small { margin-top: 3px; color: var(--text-faint); font-size: 8px; line-height: 1.45; }
.status-option > svg { width: 15px; height: 15px; align-self: center; fill: none; stroke: var(--brand); stroke-width: 2.3; }
.dish-body { padding: 15px; }
.dish-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.dish-title { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: -.02em; }
.dish-title > button { cursor: pointer; padding: 0; color: inherit; background: none; border: 0; font: inherit; letter-spacing: inherit; text-align: left; }
.dish-title > button:hover { color: var(--brand); }
.dish-price { color: var(--text); font-size: 12px; font-weight: 760; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dish-description { display: -webkit-box; min-height: 32px; margin: 10px 0 0; overflow: hidden; color: var(--text-soft); font-size: 10px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.dish-card-meta-row { display: flex; min-height: 24px; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; }
.dish-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--border); }
.dish-tags { display: flex; min-width: 0; gap: 5px; overflow: hidden; }
.tiny-tag { padding: 4px 7px; color: var(--text-soft); background: var(--surface-soft); border-radius: 7px; font-size: 8px; white-space: nowrap; }
.dish-actions { display: flex; gap: 4px; }
.mini-icon-button { display: grid; width: 29px; height: 29px; cursor: pointer; place-items: center; color: var(--text-faint); background: transparent; border: 0; border-radius: 8px; }
.mini-icon-button:hover { color: var(--text); background: var(--surface-strong); }
.mini-icon-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.dish-actions-primary {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 8px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
}
.dish-action {
  display: grid;
  cursor: pointer;
  place-items: center;
  gap: 6px;
  padding: 6px 2px;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-radius: 11px;
  font-size: 9px;
  font-weight: 700;
}
.dish-action:hover { color: var(--text); background: var(--surface-soft); }
.dish-action-icon { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 50%; }
.dish-action-icon.combine { position: relative; color: #087c70; background: #dff5f1; }
.dish-action-icon.edit { color: #16314a; background: #e6ebf0; }
.dish-action-icon.delete { color: #ee4b55; background: #fde7e9; }
.dish-action-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.dish-combo-count { position: absolute; top: -6px; right: -9px; display: grid; min-width: 25px; height: 17px; place-items: center; padding: 0 4px; color: #fff; background: #087c70; border: 2px solid var(--surface); border-radius: 999px; font-size: 6.5px; line-height: 1; font-variant-numeric: tabular-nums; }
html.dark .dish-action-icon.combine { color: #6fe3d5; background: #14372f; }
html.dark .dish-combo-count { color: #0b241d; background: #6fe3d5; }
html.dark .dish-action-icon.edit { color: #b9cee1; background: #23313c; }
html.dark .dish-action-icon.delete { color: #ff9097; background: #3e2225; }

.delete-warning { display: flex; align-items: flex-start; gap: 14px; padding: 16px; background: color-mix(in srgb,var(--red) 8%,var(--surface)); border: 1px solid color-mix(in srgb,var(--red) 22%,var(--border)); border-radius: 15px; }
.delete-warning > span { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; color: var(--red); background: color-mix(in srgb,var(--red) 12%,transparent); border-radius: 12px; }
.delete-warning svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.delete-warning strong { font-size: 11px; }
.delete-warning p { margin: 6px 0 0; color: var(--text-soft); font-size: 9px; line-height: 1.5; }

.campaign-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.campaign-card { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-sm); }
.campaign-preview { position: relative; min-height: 168px; padding: 20px; overflow: hidden; color: #fff; background: var(--campaign-bg, linear-gradient(135deg,#153b2c,#0b1f18)); }
.campaign-preview::after { content: ""; position: absolute; right: -32px; bottom: -48px; width: 160px; height: 160px; background: rgba(255,255,255,.08); border-radius: 50%; }
.campaign-badge { position: relative; z-index: 1; display: inline-flex; padding: 5px 8px; color: #0b2315; background: var(--mint); border-radius: 999px; font-size: 8px; font-weight: 780; text-transform: uppercase; letter-spacing: .06em; }
.campaign-preview h3 { position: relative; z-index: 1; max-width: 250px; margin: 32px 0 7px; font-size: 20px; line-height: 1.08; letter-spacing: -.04em; }
.campaign-preview p { position: relative; z-index: 1; max-width: 280px; margin: 0; color: rgba(255,255,255,.72); font-size: 9px; line-height: 1.55; }
.campaign-body { padding: 16px; }
.campaign-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.campaign-topline strong { font-size: 11px; }
.campaign-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 14px; }
.campaign-metric { padding: 9px; background: var(--surface-soft); border-radius: 10px; }
.campaign-metric span, .campaign-metric strong { display: block; }
.campaign-metric span { color: var(--text-faint); font-size: 7px; text-transform: uppercase; letter-spacing: .07em; }
.campaign-metric strong { margin-top: 5px; font-size: 11px; }
.campaign-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; color: var(--text-faint); font-size: 8px; }

.empty-card { display: grid; min-height: 300px; place-items: center; padding: 32px; text-align: center; }
.empty-icon { display: grid; width: 58px; height: 58px; margin: 0 auto 14px; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 18px; }
.empty-icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.empty-card h3 { margin: 0; font-size: 16px; }
.empty-card p { max-width: 420px; margin: 8px auto 18px; color: var(--text-soft); font-size: 10px; line-height: 1.6; }

.pairing-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 14px; align-items: start; }
.pairing-list { display: grid; gap: 9px; }
.pairing-row { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 11px; background: var(--surface); border: 1px solid var(--border); border-radius: 15px; box-shadow: var(--shadow-sm); }
.pairing-thumb { display: grid; width: 48px; height: 48px; place-items: center; color: var(--text-faint); background: var(--surface-strong); border-radius: 12px; }
.pairing-thumb svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.pairing-info { min-width: 0; }
.pairing-info strong, .pairing-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pairing-info strong { font-size: 11px; }
.pairing-info span { margin-top: 4px; color: var(--text-faint); font-size: 8px; }
.pairing-count { margin-right: 4px; color: var(--text-faint); font-size: 9px; font-weight: 650; }
.pairing-panel { position: sticky; top: 105px; overflow: hidden; }
.selected-dish { padding: 18px; color: #fff; background: linear-gradient(135deg, #0b2018, #123729); }
.selected-dish small { color: #91aa9e; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.selected-dish h3 { margin: 7px 0 4px; font-size: 17px; }
.selected-dish p { margin: 0; color: #aabdb4; font-size: 9px; }
.selection-meter { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.selection-meter span { font-size: 8px; }
.selection-meter strong { color: var(--mint); font-size: 12px; }
.pair-options { display: grid; max-height: 460px; gap: 6px; overflow-y: auto; padding: 12px; }
.pair-option { display: grid; grid-template-columns: 36px minmax(0,1fr) 22px; align-items: center; gap: 10px; padding: 8px; cursor: pointer; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 11px; text-align: left; }
.pair-option:hover { background: var(--surface-soft); }
.pair-option.selected { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 25%, var(--border)); }
.pair-option .pairing-thumb { width: 36px; height: 36px; border-radius: 9px; }
.pair-option strong, .pair-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pair-option strong { font-size: 9px; }
.pair-option small { margin-top: 3px; color: var(--text-faint); font-size: 7px; }
.check-circle { display: grid; width: 20px; height: 20px; place-items: center; color: transparent; border: 1px solid var(--border-strong); border-radius: 50%; }
.selected .check-circle { color: #fff; background: var(--brand); border-color: var(--brand); }
.check-circle svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; }

.upsell-modal-head { display: flex; min-width: 0; align-items: center; gap: 12px; }
.upsell-modal-avatar { width: 48px; height: 48px; flex: 0 0 auto; overflow: hidden; background: var(--surface-strong); border-radius: 13px; }
.upsell-modal-avatar img { width: 100%; height: 100%; object-fit: cover; }
.upsell-modal-count { padding: 7px 9px; color: var(--brand); background: var(--brand-soft); border-radius: 9px; font-size: 9px; font-weight: 760; }
.upsell-pick-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.upsell-pick { position: relative; cursor: pointer; padding: 8px; color: var(--text); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 13px; text-align: left; }
.upsell-pick:hover { border-color: var(--border-strong); }
.upsell-pick.selected { background: var(--brand-soft); border-color: var(--brand); box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--brand) 20%,transparent); }
.upsell-pick-image { aspect-ratio: 4/3; overflow: hidden; background: var(--surface-strong); border-radius: 9px; }
.upsell-pick-image img { width: 100%; height: 100%; object-fit: cover; }
.upsell-pick strong, .upsell-pick small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upsell-pick strong { margin-top: 8px; font-size: 9px; }
.upsell-pick small { margin-top: 3px; color: var(--text-faint); font-size: 8px; }
.upsell-pick-number { position: absolute; top: 13px; right: 13px; display: grid; width: 21px; height: 21px; place-items: center; color: #fff; background: var(--brand); border: 2px solid var(--surface); border-radius: 50%; font-size: 8px; font-weight: 800; }

.legacy-upsell-modal {
  width: min(1120px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  border-color: var(--border-strong);
  border-radius: 30px;
}
.legacy-upsell-header {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 28px 48px;
  border-bottom: 1px solid var(--border);
}
.legacy-upsell-title { display: flex; min-width: 0; align-items: center; gap: 24px; }
.legacy-upsell-avatar {
  width: 92px;
  height: 92px;
  flex: 0 0 auto;
  overflow: hidden;
  background: var(--surface-strong);
  border-radius: 50%;
}
.legacy-upsell-avatar img { width: 100%; height: 100%; object-fit: cover; }
.legacy-upsell-title h2 { margin: 0; color: var(--text); font-size: 26px; font-weight: 760; letter-spacing: -.035em; }
.legacy-upsell-title p { margin: 9px 0 0; color: var(--text-faint); font-size: 17px; line-height: 1.35; }
.legacy-upsell-count {
  display: grid;
  min-width: 94px;
  height: 52px;
  place-items: center;
  color: #075f59;
  background: #d9f7f3;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}
.legacy-upsell-head-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
.legacy-upsell-footer { display: flex; min-height: 66px; align-items: center; justify-content: flex-end; gap: 8px; padding: 11px 20px; background: var(--surface-soft); border-top: 1px solid var(--border); }
.legacy-upsell-body {
  max-height: calc(100vh - 188px);
  overflow-y: auto;
  padding: 44px 45px 36px;
  scrollbar-color: #b9c1c8 transparent;
  scrollbar-width: thin;
}
.legacy-upsell-body::-webkit-scrollbar { width: 10px; }
.legacy-upsell-body::-webkit-scrollbar-thumb { background: #b9c1c8; border: 2px solid var(--surface); border-radius: 999px; }
.legacy-pick-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
.legacy-pick {
  position: relative;
  display: flex;
  min-height: 230px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px 18px 22px;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 24px;
  text-align: center;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.legacy-pick:hover { transform: translateY(-2px); border-color: #73d8cd; box-shadow: var(--shadow-sm); }
.legacy-pick.selected { background: #d9f7f3; border: 3px solid #0ebfac; box-shadow: none; }
.legacy-pick-image {
  display: block;
  width: 92px;
  height: 92px;
  overflow: hidden;
  background: var(--surface-strong);
  border-radius: 50%;
}
.legacy-pick-image img { width: 100%; height: 100%; object-fit: cover; }
.legacy-pick strong { display: block; max-width: 100%; margin-top: 17px; overflow: hidden; font-size: 17px; font-weight: 740; text-overflow: ellipsis; white-space: nowrap; }
.legacy-pick small { display: block; margin-top: 10px; color: #8a98a8; font-size: 15px; font-weight: 500; }
.legacy-pick-number {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #fff;
  background: #0ebfac;
  border-radius: 50%;
  box-shadow: 0 7px 16px rgba(14,191,172,.24);
  font-size: 13px;
  font-weight: 800;
}
html.dark .legacy-upsell-count,
html.dark .legacy-pick.selected { color: #9af3e8; background: #123b35; }
html.dark .legacy-pick.selected { border-color: #38d6c3; }

.team-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; padding: 16px 18px; }
.team-toolbar strong { font-size: 12px; }
.team-toolbar p { margin: 4px 0 0; color: var(--text-soft); font-size: 9px; }
.member-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.member-card { padding: 18px; }
.member-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.member-identity { display: flex; min-width: 0; align-items: center; gap: 11px; }
.member-avatar { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; color: var(--avatar-ink,#163522); background: var(--avatar-bg,#d8f4df); border-radius: 13px; font-size: 11px; font-weight: 800; }
.member-name { min-width: 0; }
.member-name strong, .member-name span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-name strong { font-size: 11px; }
.member-name span { margin-top: 4px; color: var(--text-faint); font-size: 8px; }
.role-chip { padding: 5px 7px; color: var(--brand); background: var(--brand-soft); border-radius: 8px; font-size: 8px; font-weight: 700; }
.permission-list { display: grid; gap: 8px; margin: 17px 0 0; padding: 14px 0 0; border-top: 1px solid var(--border); }
.permission-item { display: flex; align-items: center; gap: 7px; color: var(--text-soft); font-size: 8px; }
.permission-item svg { width: 13px; height: 13px; fill: none; stroke: var(--green); stroke-width: 2.3; }
.member-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 15px; color: var(--text-faint); font-size: 8px; }

/* Compact plate library */
.dish-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dish-card { border-radius: 17px; }
.dish-image { aspect-ratio: 4/3; border-radius: 16px 16px 0 0; }
.dish-body { padding: 12px; }
.dish-title { font-size: 11.5px; }
.dish-price { font-size: 10.5px; }
.dish-description { min-height: 29px; margin-top: 7px; font-size: 8.5px; line-height: 1.45; }
.dish-card-meta-row { min-height: 20px; margin-top: 8px; }
.tiny-tag { padding: 3px 6px; font-size: 7px; }
.dish-actions-primary { gap: 5px; margin-top: 10px; padding-top: 10px; }
.dish-action { gap: 4px; padding: 4px 2px; font-size: 8px; }
.dish-action-icon { width: 34px; height: 34px; }
.dish-action-icon svg { width: 17px; height: 17px; }
.dish-status-control { top: 9px; left: 9px; }
.dish-status-button { min-height: 27px; padding-inline: 8px; font-size: 8px; }

/* Promotion center */
.promotion-command-panel { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 13px; margin-bottom: 12px; padding: 14px 15px; background: linear-gradient(115deg,color-mix(in srgb,var(--brand) 8%,var(--surface)),var(--surface) 58%); border: 1px solid color-mix(in srgb,var(--brand) 18%,var(--border)); border-radius: 17px; box-shadow: var(--shadow-sm); }
.promotion-command-icon { display: grid; width: 42px; height: 42px; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 12px; }
.promotion-command-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.promotion-command-copy span,.promotion-command-copy strong,.promotion-command-copy p { display: block; }
.promotion-command-copy span { color: var(--brand); font-size: 7px; font-weight: 780; letter-spacing: .1em; text-transform: uppercase; }
.promotion-command-copy strong { margin-top: 3px; font-size: 11px; }
.promotion-command-copy p { margin: 4px 0 0; color: var(--text-faint); font-size: 8px; line-height: 1.45; }
.promotion-library { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-sm); }
.promotion-library-toolbar { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; border-bottom: 1px solid var(--border); }
.promotion-library-summary { display: flex; align-items: center; gap: 6px; color: var(--text-faint); font-size: 8px; }
.promotion-library-summary i { width: 7px; height: 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb,var(--green) 10%,transparent); }
.promotion-library-summary strong { color: var(--text); font-size: 8px; }
.promotion-list { display: grid; }
.promotion-row { display: grid; grid-template-columns: 92px minmax(260px,1.35fr) minmax(150px,.7fr) 92px auto; align-items: center; gap: 16px; min-height: 128px; padding: 13px 15px; border-bottom: 1px solid var(--border); transition: background 150ms ease; }
.promotion-row:last-child { border-bottom: 0; }
.promotion-row:hover { background: color-mix(in srgb,var(--brand) 2.8%,var(--surface)); }
.promotion-row-preview { display: grid; width: 86px; height: 100px; overflow: hidden; grid-template-rows: 53% 47%; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 7px 18px rgba(18,32,25,.1); }
.promotion-row-preview > img { width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.promotion-row-preview > div { min-width: 0; padding: 7px; color: #17201c; background: #fff; }
.promotion-row-preview > div strong,.promotion-row-preview > div span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.promotion-row-preview > div strong { font-size: 6.5px; }
.promotion-row-preview > div span { margin-top: 3px; color: #748078; font-size: 5.5px; }
.promotion-row-preview.image-only { display: block; }
.promotion-row-preview.image-only > img { width: 100%; height: 100%; object-fit: cover; }
.promotion-row-copy { min-width: 0; }
.promotion-row-title { display: flex; align-items: center; gap: 8px; }
.promotion-row-title h3 { min-width: 0; margin: 0; overflow: hidden; font-size: 11px; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.promotion-row-copy > p { display: -webkit-box; max-width: 520px; margin: 6px 0 0; overflow: hidden; color: var(--text-faint); font-size: 8px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.promotion-row-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.promotion-row-tags span { display: inline-flex; min-height: 23px; align-items: center; gap: 5px; padding: 0 7px; color: var(--text-soft); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 7px; font-size: 7px; }
.promotion-row-tags svg { width: 11px; height: 11px; fill: none; stroke: var(--text-faint); stroke-width: 1.8; }
.promotion-delivery span,.promotion-delivery strong,.promotion-delivery small { display: block; }
.promotion-delivery > span { color: var(--text-faint); font-size: 7px; font-weight: 720; letter-spacing: .08em; text-transform: uppercase; }
.promotion-delivery strong { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 8.5px; }
.promotion-delivery strong svg { width: 14px; height: 14px; fill: none; stroke: var(--brand); stroke-width: 1.9; }
.promotion-delivery small { margin-top: 4px; color: var(--text-faint); font-size: 7px; }
.promotion-publish-control { display: grid; justify-items: center; gap: 6px; }
.promotion-publish-control span { color: var(--text-faint); font-size: 7px; }
.promotion-edit-button { min-width: 82px; }

/* Promotion builder */
.promo-builder-modal { width: min(1120px, calc(100vw - 36px)); max-height: calc(100vh - 36px); }
.promo-builder-body { display: grid; min-height: 0; grid-template-columns: minmax(0,1fr) 365px; }
.promo-editor { max-height: calc(100vh - 190px); overflow-y: auto; padding: 22px 24px 30px; }
.promo-editor-section + .promo-editor-section,
.promo-text-fields + .promo-editor-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.editor-label { display: block; margin-bottom: 9px; color: var(--text-soft); font-size: 9px; font-weight: 700; }
.promo-type-picker { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.promo-type-option { display: grid; grid-template-columns: 32px minmax(0,1fr); padding: 13px; cursor: pointer; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 13px; text-align: left; }
.promo-type-option > svg { grid-row: 1 / span 2; width: 18px; height: 18px; align-self: center; fill: none; stroke: var(--brand); stroke-width: 1.8; }
.promo-type-option strong, .promo-type-option span { display: block; }
.promo-type-option strong { font-size: 10px; }
.promo-type-option span { margin-top: 4px; color: var(--text-faint); font-size: 8px; line-height: 1.4; }
.promo-type-option.selected { background: var(--brand-soft); border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.promo-upload { display: grid; width: 100%; min-height: 145px; overflow: hidden; cursor: pointer; grid-template-columns: 160px 1fr; align-items: center; color: var(--text-soft); background: var(--surface-soft); border: 1px dashed var(--border-strong); border-radius: 14px; text-align: left; }
.promo-upload > img { width: 100%; height: 145px; object-fit: cover; }
.promo-upload > span { display: grid; place-items: center; padding: 18px; text-align: center; }
.promo-upload svg { width: 22px; height: 22px; margin-bottom: 7px; fill: none; stroke: var(--brand); stroke-width: 1.8; }
.promo-upload strong, .promo-upload small { display: block; }
.promo-upload strong { color: var(--text); font-size: 9px; }
.promo-upload small { margin-top: 4px; font-size: 8px; }
.promo-text-fields { display: grid; gap: 13px; margin-top: 20px; }
.promo-text-fields.hidden, .promo-phone-copy.hidden { display: none; }
.promo-delivery-setting { display: grid; grid-template-columns: 36px minmax(0,1fr); align-items: center; gap: 11px; padding: 13px; background: var(--brand-soft); border: 1px solid color-mix(in srgb,var(--brand) 20%,var(--border)); border-radius: 14px; }
.promo-delivery-setting > span { display: grid; width: 36px; height: 36px; place-items: center; color: var(--brand); background: var(--surface); border-radius: 10px; }
.promo-delivery-setting > span svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.promo-delivery-setting > div strong { display: block; font-size: 9px; }
.promo-delivery-setting > div p { margin: 3px 0 0; color: var(--text-faint); font-size: 7.5px; line-height: 1.4; }
.promo-time-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.promo-preview-pane { display: grid; align-content: start; justify-items: center; padding: 22px; background: var(--surface-soft); border-left: 1px solid var(--border); }
.promo-preview-pane > span { color: var(--text-faint); font-size: 8px; font-weight: 760; letter-spacing: .12em; text-transform: uppercase; }
.promo-preview-pane > p { margin: 12px 0 0; color: var(--text-faint); font-size: 8px; text-align: center; }
.promo-phone { position: relative; width: 230px; height: 448px; margin-top: 14px; padding: 12px; overflow: hidden; background: #0d1010; border: 5px solid #252b2a; border-radius: 38px; box-shadow: 0 24px 50px rgba(15,25,20,.22); }
.promo-phone-island { position: absolute; top: 14px; left: 50%; z-index: 5; width: 78px; height: 24px; background: #020303; border-radius: 999px; transform: translateX(-50%); }
.promo-phone-screen { position: relative; height: 100%; overflow: hidden; background: #fff; border-radius: 25px; }
.promo-phone-screen > button { position: absolute; top: 12px; right: 12px; z-index: 5; display: grid; width: 27px; height: 27px; place-items: center; color: #fff; background: rgba(16,23,19,.5); border: 0; border-radius: 50%; }
.promo-phone-screen > img { width: 100%; height: 55%; object-fit: cover; }
.promo-phone-screen.image-only > img { height: 100%; object-fit: contain; background: #eef2ef; }
.promo-phone-copy { padding: 15px; color: #17201c; }
/* El pop-up sale en el menú del cliente, así que se ve con SU tipografía y su
   acento, no con los del panel. brandPreviewVars() inyecta las variables. */
.promo-phone-copy h3 { margin: 0; color: var(--preview-accent, inherit); font-family: var(--preview-font-heading, inherit); font-size: 15px; letter-spacing: -.03em; }
.promo-phone-copy p { margin: 7px 0 0; color: #66716b; font-family: var(--preview-font-body, inherit); font-size: 9px; line-height: 1.45; }
.promo-preview-note { margin: 10px 0 0; color: var(--text-faint); font-size: 8px; text-align: center; }

/* Compact legacy pairing picker */
.legacy-upsell-modal { width: min(560px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 32px)); border-radius: 22px; }
.legacy-upsell-header { min-height: 92px; gap: 16px; padding: 16px 20px; }
.legacy-upsell-title { gap: 12px; }
.legacy-upsell-avatar { width: 58px; height: 58px; }
.legacy-upsell-title h2 { font-size: 17px; }
.legacy-upsell-title p { margin-top: 4px; font-size: 10px; }
.legacy-upsell-count { min-width: 66px; height: 36px; font-size: 12px; }
.legacy-upsell-body { max-height: min(575px, calc(100vh - 190px)); padding: 20px; }
.legacy-pick-grid { gap: 10px; }
.legacy-pick { min-height: 126px; padding: 13px 8px 11px; border-radius: 15px; }
.legacy-pick-image { width: 48px; height: 48px; }
.legacy-pick strong { margin-top: 9px; font-size: 9.5px; }
.legacy-pick small { margin-top: 4px; font-size: 8px; }
.legacy-pick-number { top: 8px; right: 8px; width: 22px; height: 22px; font-size: 8px; }

/* Old team pattern */
/* ---- Equipo ---------------------------------------------------------------
   Antes esta pantalla era un solo botón: no se veía quién tenía acceso. */
.team-panel { padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; }
.team-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.team-panel-head h3 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: -.02em; }
.team-panel-head p { max-width: 460px; margin: 5px 0 0; color: var(--text-soft); font-size: 9px; line-height: 1.55; }
.team-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.team-row { display: flex; align-items: center; gap: 12px; padding: 11px 13px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 14px; flex-wrap: wrap; }
.team-row.pending { border-style: dashed; }
.team-avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; color: #fff; background: var(--brand); border-radius: 11px; font-size: 12px; font-weight: 720; }
.team-avatar.pending { color: var(--text-soft); background: var(--surface-strong); }
.team-avatar svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.team-identity { min-width: 0; flex: 1 1 180px; }
.team-identity strong { display: block; overflow: hidden; font-size: 10px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.team-identity span { color: var(--text-faint); font-size: 8.5px; }
.team-state { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 8px; font-weight: 700; white-space: nowrap; }
.team-state i { width: 6px; height: 6px; border-radius: 50%; }
.team-state.active { color: #17623a; background: #e7f6ec; }
.team-state.active i { background: #17623a; }
.team-state.pending { color: #8a6212; background: #fdf3dd; }
.team-state.pending i { background: #d19a1e; }
html.dark .team-state.active { color: #7fe0a6; background: #17321f; }
html.dark .team-state.pending { color: #f0c86a; background: #33280f; }
.team-action-spacer { width: 1px; }
.team-empty { display: grid; padding: 42px 24px; place-items: center; gap: 6px; color: var(--text-faint); background: var(--surface-soft); border: 1.5px dashed var(--border-strong); border-radius: 18px; text-align: center; }
.team-empty svg { width: 28px; height: 28px; margin-bottom: 4px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.team-empty strong { color: var(--text); font-size: 11px; }
.team-empty p { margin: 0; font-size: 9px; }

/* ---- Invitación: preset de acceso + qué pasa después ----------------------- */
.invite-role-picker { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); }
.invite-role { display: grid; cursor: pointer; align-content: start; gap: 4px; padding: 13px; color: var(--text-soft); background: var(--surface-soft); border: 1.5px solid var(--border); border-radius: 14px; text-align: left; }
.invite-role svg { width: 19px; height: 19px; margin-bottom: 4px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.invite-role strong { color: var(--text); font-size: 10px; }
.invite-role span { font-size: 8.5px; line-height: 1.45; }
.invite-role.selected { color: var(--brand); background: var(--brand-soft); border-color: var(--brand); }
.invite-role.selected strong { color: var(--brand); }
.invite-permissions-wrap.hidden { display: none; }
.invite-next { padding: 13px 15px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 14px; }
.invite-next strong { display: flex; align-items: center; gap: 6px; color: var(--text); font-size: 9px; font-weight: 720; }
.invite-next svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.invite-next ol { margin: 8px 0 0; padding-left: 18px; color: var(--text-soft); font-size: 8.5px; line-height: 1.75; }
.invite-link-box { display: flex; gap: 8px; }
.invite-link-box input { min-width: 0; flex: 1; padding: 10px 12px; color: var(--text); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 11px; font: inherit; font-size: 9px; }
.invite-link-help { margin: 12px 0 0; color: var(--text-faint); font-size: 9px; line-height: 1.6; }
.invite-modal { width: min(570px,100%); }
.invite-form { display: grid; gap: 15px; }
.invite-access-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-top: 4px; }
.invite-access-head strong { font-size: 10px; }
.invite-access-head p { max-width: 390px; margin: 5px 0 0; color: var(--text-soft); font-size: 8px; line-height: 1.5; }
.invite-access-head > span { color: var(--brand); font-size: 9px; font-weight: 750; white-space: nowrap; }
.invite-permissions { display: grid; gap: 8px; }
.invite-modal .permission-toggle { min-height: 70px; padding: 14px; }
.invite-modal [data-permission-card] { cursor: pointer; }

/* Advanced dish editor */
.dish-editor-modal { width: min(1220px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
.dish-editor-content { display: grid; min-height: 0; grid-template-columns: minmax(0,1.55fr) minmax(330px,.75fr); }
.dish-editor-form { max-height: calc(100vh - 205px); overflow-y: auto; padding: 0 24px 30px; }
.editor-section { padding: 20px 0; border-top: 1px solid var(--border); }
.editor-section.first { border-top: 0; }
.editor-section > h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; color: var(--text-faint); font-size: 8px; font-weight: 780; letter-spacing: .1em; text-transform: uppercase; }
.editor-section > h3::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.editor-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 13px; }
.editor-three { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 12px; }
.editor-media-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.editor-media-thumb { width: 62px; height: 62px; overflow: hidden; background: var(--surface-strong); border: 1px dashed var(--border-strong); border-radius: 11px; }
.editor-media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-ready { display: inline-flex; align-items: center; gap: 5px; color: var(--brand); font-size: 8px; font-weight: 700; }
.media-ready svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.editor-help { margin: 8px 0 0; color: var(--text-faint); font-size: 8px; }
.editor-choice-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.editor-choice { display: inline-flex; min-height: 36px; cursor: pointer; align-items: center; gap: 7px; padding: 0 11px; color: var(--text-soft); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 10px; font-size: 8px; font-weight: 650; }
.editor-choice svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.editor-choice.selected { color: var(--brand); background: var(--brand-soft); border-color: color-mix(in srgb,var(--brand) 35%,var(--border)); }.editor-switch-row { display: flex; min-height: 62px; align-items: center; gap: 12px; padding: 12px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 12px; }
.editor-switch-row + .editor-switch-row { margin-top: 8px; }
.editor-switch-row > div { min-width: 0; flex: 1; }
.editor-switch-row strong, .editor-switch-row span { display: block; }
.editor-switch-row strong { font-size: 9px; }
.editor-switch-row span { margin-top: 3px; color: var(--text-faint); font-size: 8px; }
.editor-mini-input { width: 105px; height: 38px; padding: 0 10px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 9px; font-size: 9px; }
.editor-macro-bar { display: flex; height: 8px; margin-top: 12px; overflow: hidden; border-radius: 999px; }
.editor-macro-bar i { width: var(--macro); background: #16314a; }
.editor-macro-bar i:nth-child(2) { background: #e0a93a; }
.editor-macro-bar i:nth-child(3) { background: #5a4636; }
.editor-macro-labels { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; color: var(--text-soft); font-size: 8px; }
.ingredient-wrap { display: flex; flex-wrap: wrap; gap: 7px; }
.ingredient-wrap > span, .ingredient-add { display: inline-flex; min-height: 35px; align-items: center; gap: 8px; padding: 0 10px; color: var(--text); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 10px; font-size: 8px; }
.ingredient-wrap > span button { cursor: pointer; color: var(--text-faint); background: none; border: 0; }
.ingredient-add { cursor: pointer; color: var(--text-faint); background: transparent; border-style: dashed; }
.editor-pairings { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-top: 10px; }
.editor-pairings > span { display: grid; min-width: 0; grid-template-columns: 38px 1fr auto; align-items: center; gap: 8px; padding: 7px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 10px; }
.editor-pairings img { width: 38px; height: 38px; object-fit: cover; border-radius: 8px; }
.editor-pairings b, .editor-pairings small { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.editor-pairings small { color: var(--text-faint); }
.editor-pairings p { grid-column: 1/-1; color: var(--text-faint); font-size: 8px; }
.dish-editor-preview { display: block; padding: 24px; overflow-y: auto; background: var(--surface-soft); border-left: 1px solid var(--border); }
.dish-preview-head { margin-bottom: 14px; }
.dish-preview-head span { display: block; color: var(--text-faint); font-size: 8px; font-weight: 760; letter-spacing: .11em; text-transform: uppercase; }
.dish-preview-head small { color: var(--text-soft); font-size: 9px; }

/* ---- Réplica de la tarjeta real del menú (menu.html, vista grid) -----------
   --preview-accent y --preview-font-* los inyecta brandPreviewVars() con la
   marca del restaurante; sin marca cargada cae al acento del panel. */
.mp-surface {
  --mp-accent: var(--preview-accent, var(--brand));
  width: min(100%, 330px);
  margin: 0 auto;
  font-family: var(--preview-font-body, inherit);
}
.mp-card { overflow: hidden; background: var(--surface); border-radius: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 0 0 1px rgba(0,0,0,.05); }
html.dark .mp-card { box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.06); }
.mp-media { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--surface-strong); }
.mp-media img { width: 100%; height: 100%; object-fit: cover; }
/* Los chips viven en el cuerpo, debajo de la descripción — igual que en
   menu.html. Estaban en absolute sobre la foto y tapaban el plato. Pill de
   trazo fino: el color va en el icono, el texto y el borde, nunca de relleno. */
.mp-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.mp-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  color: var(--mp-accent);
  background: color-mix(in srgb, var(--mp-accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--mp-accent) 34%, transparent);
  border-radius: 999px;
  font-size: 9px; font-weight: 560; line-height: 1.6; white-space: nowrap;
}
.mp-chip .tag-icon { width: 10px; height: 10px; }
.mp-body { padding: 13px; }
.mp-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.mp-title-row h3 { margin: 0; color: var(--text); font-family: var(--preview-font-body, inherit); font-size: 13px; font-weight: 600; line-height: 1.35; }
.mp-price { flex: 0 0 auto; color: var(--mp-accent); font-family: var(--preview-font-heading, inherit); font-size: 13px; font-weight: 600; }
.mp-desc { display: -webkit-box; margin: 5px 0 0; overflow: hidden; color: var(--text-soft); font-size: 11px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.mp-chef { display: flex; align-items: center; gap: 5px; margin-top: 10px; color: var(--mp-accent); font-size: 9px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.mp-chef svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* Lo que el comensal ve al tocar la tarjeta. */
.mp-detail { margin-top: 16px; padding: 14px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: 14px; }
.mp-detail-label { display: block; margin-bottom: 10px; color: var(--text-faint); font-size: 8px; font-weight: 760; letter-spacing: .1em; text-transform: uppercase; }
.mp-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-badge { padding: 3px 9px; color: var(--text-soft); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 999px; font-size: 9px; font-weight: 600; }
.mp-block { margin-top: 12px; }
.mp-block h4 { margin: 0 0 5px; color: var(--text); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.mp-block p { margin: 0; color: var(--text-soft); font-size: 10px; line-height: 1.6; }
/* Los mismos teal/ámbar/rosa que --c-macro-* de menu.html. Los --chart-* del
   panel son naranja/blanco/gris y no se parecen a lo que ve el comensal. */
.mp-macro-bar { display: flex; height: 6px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); }
.mp-macro-bar i:nth-child(1) { background: rgb(32 148 142); }
.mp-macro-bar i:nth-child(2) { background: rgb(198 138 40); }
.mp-macro-bar i:nth-child(3) { background: rgb(201 90 104); }
html.dark .mp-macro-bar i:nth-child(1) { background: rgb(90 200 196); }
html.dark .mp-macro-bar i:nth-child(2) { background: rgb(224 177 95); }
html.dark .mp-macro-bar i:nth-child(3) { background: rgb(232 130 142); }
.mp-macro-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; color: var(--text-faint); font-size: 9px; }
.mp-macro-legend b { color: var(--text); }
.mp-allergens { display: flex; flex-wrap: wrap; gap: 5px; }
.mp-allergens span { padding: 2px 8px; color: #9c3832; background: #fbe9e7; border-radius: 999px; font-size: 9px; font-weight: 600; }
html.dark .mp-allergens span { color: #ff9097; background: #3e2225; }
.dish-editor-footer > span { margin-right: auto; color: var(--text-faint); font-size: 8px; }

/* ---- Organizador de categorías -------------------------------------------- */
.cat-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cat-row { display: grid; align-items: center; gap: 10px; padding: 9px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; grid-template-columns: auto 26px minmax(0,1fr) auto auto auto; }
.cat-row.dragging { opacity: .45; border-style: dashed; }
.cat-row:hover { border-color: var(--border-strong); }
.cat-drag { display: grid; cursor: grab; place-items: center; color: var(--text-faint); }
.cat-drag svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; transform: rotate(90deg); }
.cat-order { display: grid; width: 24px; height: 24px; place-items: center; color: var(--text-soft); background: var(--surface-soft); border-radius: 8px; font-size: 9px; font-weight: 720; }
.cat-name { min-width: 0; padding: 7px 9px; color: var(--text); background: var(--surface-soft); border: 1px solid transparent; border-radius: 9px; font: inherit; font-size: 10px; font-weight: 620; }
.cat-name:focus { border-color: var(--brand); background: var(--surface); outline: none; }
.cat-count { color: var(--text-faint); font-size: 9px; white-space: nowrap; }
.cat-move { display: inline-flex; gap: 3px; }
.cat-move button { display: grid; width: 26px; height: 26px; cursor: pointer; place-items: center; color: var(--text-soft); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 8px; }
.cat-move button:hover:not(:disabled) { color: var(--brand); border-color: var(--brand); }
.cat-move button:disabled { cursor: not-allowed; opacity: .35; }
.cat-move svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.cat-move button[data-cat-move="up"] svg { transform: rotate(180deg); }
.cat-delete { display: grid; width: 28px; height: 28px; cursor: pointer; place-items: center; color: var(--red); background: color-mix(in srgb,var(--red) 8%,transparent); border: 1px solid transparent; border-radius: 9px; }
.cat-delete:hover:not(:disabled) { border-color: color-mix(in srgb,var(--red) 35%,transparent); }
.cat-delete:disabled { cursor: not-allowed; color: var(--text-faint); background: var(--surface-soft); opacity: .6; }
.cat-delete svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.cat-help { display: flex; align-items: center; gap: 7px; margin: 16px 0 0; color: var(--text-faint); font-size: 9px; line-height: 1.5; }
.cat-help svg { width: 14px; height: 14px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }
.cat-empty { margin: 0; padding: 26px; color: var(--text-faint); background: var(--surface-soft); border: 1px dashed var(--border-strong); border-radius: 14px; font-size: 10px; text-align: center; }
@media (max-width: 640px) {
  .cat-row { grid-template-columns: auto minmax(0,1fr) auto; row-gap: 8px; }
  .cat-order, .cat-count { display: none; }
}

.modal-layer { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(5,12,8,.56); backdrop-filter: blur(7px); }
.modal-layer.open { display: flex; animation: fadeIn 150ms ease both; }
.modal {
  width: min(720px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 200ms cubic-bezier(.2,.8,.2,1) both;
}
.modal-wide { width: min(980px, 100%); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 0; font-size: 18px; letter-spacing: -.035em; }
.modal-header p { margin: 6px 0 0; color: var(--text-soft); font-size: 9px; line-height: 1.5; }
.modal-close { display: grid; width: 36px; height: 36px; cursor: pointer; place-items: center; color: var(--text-soft); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 11px; }
.modal-close svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.modal-body { max-height: calc(100vh - 220px); overflow-y: auto; padding: 22px 24px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 16px 24px; background: var(--surface-soft); border-top: 1px solid var(--border); }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.form-field { display: grid; gap: 7px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: var(--text-soft); font-size: 9px; font-weight: 680; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 10px;
}
.form-field input, .form-field select { height: 42px; padding: 0 12px; }
.form-field textarea { min-height: 92px; padding: 11px 12px; resize: vertical; }
.form-section { grid-column: 1/-1; padding-top: 5px; }
.form-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 9px; font-size: 11px; font-weight: 720; }
.choice-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.choice-chip { min-height: 33px; cursor: pointer; padding: 0 10px; color: var(--text-soft); background: var(--surface); border: 1px solid var(--border); border-radius: 9px; font-size: 8px; font-weight: 620; }
.choice-chip.selected { color: var(--brand); background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 30%, var(--border)); }
.upload-zone { display: grid; min-height: 108px; place-items: center; cursor: pointer; color: var(--text-soft); background: var(--surface-soft); border: 1px dashed var(--border-strong); border-radius: 14px; text-align: center; }
.upload-zone svg { width: 24px; height: 24px; margin: 0 auto 8px; fill: none; stroke: var(--brand); stroke-width: 1.8; }
.upload-zone strong { display: block; color: var(--text); font-size: 9px; }
.upload-zone span { display: block; margin-top: 4px; font-size: 8px; }
.permission-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 12px; }
.permission-toggle strong, .permission-toggle span { display: block; }
.permission-toggle strong { font-size: 9px; }
.permission-toggle span { margin-top: 3px; color: var(--text-faint); font-size: 8px; }
.switch { position: relative; width: 38px; height: 22px; flex: 0 0 auto; cursor: pointer; background: #bdc6c1; border: 0; border-radius: 999px; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: left 150ms ease; }
.switch.on { background: var(--brand); }
.switch.on::after { left: 19px; }

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 130; display: grid; gap: 9px; }
.toast { display: flex; max-width: 340px; align-items: center; gap: 10px; padding: 12px 14px; color: #fff; background: #101b16; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; box-shadow: var(--shadow-lg); font-size: 10px; animation: toastIn 180ms ease both; }
.toast svg { width: 17px; height: 17px; fill: none; stroke: var(--mint); stroke-width: 2.2; }

body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed); }
body.sidebar-collapsed .workspace { margin-left: var(--sidebar-collapsed); }
body.sidebar-collapsed .sidebar-brand { justify-content: center; padding-inline: 14px; }
body.sidebar-collapsed .brand-full,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-count,
body.sidebar-collapsed .nav-dot,
body.sidebar-collapsed .status-copy { display: none; }
body.sidebar-collapsed .brand-mark { display: block; }
body.sidebar-collapsed .sidebar-collapse { position: absolute; top: 56px; right: 6px; width: 26px; height: 26px; border-radius: 8px; }
body.sidebar-collapsed .sidebar-collapse svg { width: 15px; transform: rotate(180deg); }
body.sidebar-collapsed .sidebar-nav { padding-inline: 13px; padding-top: 24px; }
body.sidebar-collapsed .nav-link { justify-content: center; padding: 0; }
body.sidebar-collapsed .nav-link::after { content: attr(data-tooltip); position: absolute; left: calc(100% + 13px); z-index: 80; padding: 7px 9px; color: #fff; background: #101813; border: 1px solid rgba(255,255,255,.08); border-radius: 8px; box-shadow: var(--shadow-md); font-size: 9px; font-weight: 600; opacity: 0; pointer-events: none; transform: translateX(-4px); transition: opacity 130ms ease, transform 130ms ease; white-space: nowrap; }
body.sidebar-collapsed .nav-link:hover::after { opacity: 1; transform: translateX(0); }
body.sidebar-collapsed .system-status { justify-content: center; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1220px) {
  .overview-hero-metric { grid-column: span 12; }
  .overview-metric-card { grid-column: span 3; min-height: 168px; }
  .overview-insights-grid { grid-template-columns: minmax(0,1.1fr) minmax(280px,.9fr); }
  .dish-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .dish-control-middle { grid-template-columns: 1fr; gap: 13px; }
  .campaign-grid, .member-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .promotion-row { grid-template-columns: 86px minmax(230px,1.2fr) minmax(135px,.65fr) 82px auto; gap: 12px; }
  .pairing-layout { grid-template-columns: minmax(0,1fr) 340px; }
}

@media (max-width: 980px) {
  .sidebar { width: var(--sidebar-collapsed); }
  .workspace { margin-left: var(--sidebar-collapsed); }
  .sidebar-brand { justify-content: center; padding-inline: 14px; }
  .brand-full, .nav-label, .nav-count, .nav-dot, .status-copy { display: none; }
  .brand-mark { display: block; }
  .sidebar-collapse { display: none; }
  .sidebar-nav { padding-inline: 13px; }
  .nav-link { justify-content: center; padding: 0; }
  .system-status { justify-content: center; }
  .overview-insights-grid { grid-template-columns: 1fr; }
  .pairing-layout { grid-template-columns: 1fr; }
  .pairing-panel { position: static; }
  .promo-builder-body { grid-template-columns: minmax(0,1fr) 310px; }
  .promo-phone { width: 205px; height: 400px; }
  .click-analytics-summary { grid-template-columns: repeat(3,minmax(110px,.45fr)) minmax(190px,1fr); }
}

@media (max-width: 760px) {
  .sidebar { width: min(256px, calc(100vw - 32px)); transform: translateX(-103%); box-shadow: var(--shadow-lg); }
  .workspace, body.sidebar-collapsed .workspace { margin-left: 0; }
  .sidebar-brand, body.sidebar-collapsed .sidebar-brand { justify-content: space-between; padding: 14px 14px 13px 18px; }
  .brand-full, body.sidebar-collapsed .brand-full { display: flex; }
  .brand-mark, body.sidebar-collapsed .brand-mark { display: none; }
  .sidebar-collapse { display: none; }
  .sidebar-nav, body.sidebar-collapsed .sidebar-nav { padding: 15px 11px; }
  .nav-label, .nav-count, .nav-dot, .status-copy,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .nav-count, body.sidebar-collapsed .nav-dot,
  body.sidebar-collapsed .status-copy { display: block; }
  .nav-link, body.sidebar-collapsed .nav-link { justify-content: flex-start; padding: 0 11px; }
  body.sidebar-collapsed .nav-link::after { display: none; }
  .system-status, body.sidebar-collapsed .system-status { justify-content: flex-start; }
  body.mobile-nav-open .sidebar { transform: translateX(0); }
  .mobile-overlay { position: fixed; inset: 0; z-index: 55; display: none; background: rgba(4,10,7,.55); backdrop-filter: blur(3px); }
  body.mobile-nav-open .mobile-overlay { display: block; }
  .mobile-menu-button { display: grid; }
  .topbar { min-height: 64px; gap: 10px; padding: 9px 13px; }
  .breadcrumb { display: none; }
  .topbar-heading h1 { font-size: 19px; }
  .account-copy, .account-button > [data-icon] { display: none; }
  .account-button { min-width: 38px; width: 38px; height: 38px; padding: 3px; border-radius: 11px; }
  .account-avatar { width: 30px; height: 30px; }
  .page-container { padding: 16px 13px 42px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .overview-toolbar { align-items: flex-start; flex-direction: column; }
  .overview-toolbar-actions { width: 100%; justify-content: space-between; }
  .overview-metric-card { grid-column: span 6; min-height: 158px; }
  .overview-panel-head { padding: 16px 16px 0; }
  .overview-ranking,.category-performance { padding-inline: 16px; }
  .dish-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .campaign-grid, .member-grid, .old-team-grid { grid-template-columns: 1fr; }
  .upsell-pick-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .legacy-upsell-modal { width: 100%; max-height: 94vh; border-radius: 24px 24px 0 0; }
  .legacy-upsell-header { min-height: 88px; padding: 15px 18px; }
  .legacy-upsell-avatar { width: 54px; height: 54px; }
  .legacy-upsell-title { gap: 14px; }
  .legacy-upsell-title h2 { font-size: 16px; }
  .legacy-upsell-title p { margin-top: 4px; font-size: 10px; }
  .legacy-upsell-count { min-width: 64px; height: 36px; font-size: 12px; }
  .legacy-upsell-body { max-height: calc(94vh - 88px); padding: 18px; }
  .legacy-pick-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
  .legacy-pick { min-height: 140px; padding: 14px 10px; }
  .legacy-pick-image { width: 54px; height: 54px; }
  .legacy-pick strong { font-size: 10px; }
  .legacy-pick small { font-size: 8px; }
  .toolbar-card { align-items: stretch; flex-direction: column; }
  .search-field { min-width: 100%; }
  .view-switch { align-self: flex-end; }
  .dish-control-panel { padding: 13px; }
  .dish-control-top { grid-template-columns: minmax(0,1fr) auto; }
  .dish-create-actions { grid-template-columns: 1fr; }
  .dish-create-button { min-height: 49px; }
  .modal-layer { align-items: flex-end; padding: 0; }
  .modal, .modal-wide { width: 100%; max-height: 94vh; border-radius: 24px 24px 0 0; }
  .modal-body { max-height: calc(94vh - 155px); }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full, .form-section { grid-column: 1; }
  .promo-builder-modal, .dish-editor-modal { width: 100%; max-height: 94vh; }
  .promo-builder-body { grid-template-columns: 1fr; }
  .promo-preview-pane { display: none; }
  .promo-editor { max-height: calc(94vh - 155px); }
  .dish-editor-content { grid-template-columns: 1fr; }
  .dish-editor-preview { display: none; }
  .dish-editor-form { max-height: calc(94vh - 155px); padding-inline: 17px; }
  .dish-editor-footer > span { display: none; }
  .promotion-command-panel { grid-template-columns: 42px minmax(0,1fr); }
  .promotion-command-panel > .button { width: 100%; grid-column: 1 / -1; }
  .promotion-row { grid-template-columns: 78px minmax(0,1fr) auto; gap: 11px; }
  .promotion-row-preview { width: 74px; height: 88px; grid-row: 1 / span 2; }
  .promotion-row-copy { grid-column: 2; }
  .promotion-delivery { grid-column: 2; }
  .promotion-publish-control { grid-column: 3; grid-row: 2; }
  .promotion-edit-button { grid-column: 3; grid-row: 1; }
  .click-analytics-summary { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .click-search { grid-column: 1 / -1; }
  .click-search input { height: 44px; }
  .click-table { min-width: 720px; }
}

@media (max-width: 460px) {
  .topbar-actions { gap: 6px; }
  .overview-toolbar-actions { align-items: stretch; flex-direction: column; }
  .overview-toolbar-actions .segmented { width: 100%; }
  .overview-toolbar-actions .segment { flex: 1; }
  .overview-toolbar-actions > .button { width: 100%; }
  .overview-hero-metric,.overview-metric-card { grid-column: span 12; }
  .overview-hero-metric { min-height: 194px; }
  .overview-metric-card { min-height: 148px; }
  .overview-hero-footer { flex-direction: column; gap: 3px; }
  .overview-rank-row { grid-template-columns: 20px 36px minmax(0,1fr); }
  .overview-rank-value { display: none; }
  .download-grid { grid-template-columns: 1fr; }
  .upsell-pick-grid { grid-template-columns: 1fr 1fr; }
  .legacy-upsell-header { gap: 12px; padding-inline: 16px; }
  .legacy-upsell-title h2 { font-size: 17px; }
  .legacy-upsell-title p { font-size: 11px; }
  .legacy-upsell-avatar { width: 56px; height: 56px; }
  .legacy-upsell-count { min-width: 62px; height: 38px; font-size: 14px; }
  .legacy-pick-grid { grid-template-columns: 1fr; }
  .modal-header, .modal-body, .modal-footer { padding-inline: 17px; }
  .dish-grid { grid-template-columns: 1fr; }
  .dish-control-top { grid-template-columns: 1fr; }
  .dish-control-view { display: flex; align-items: center; justify-content: space-between; }
  .dish-control-view .dish-control-label { margin: 0; }
  .combination-item-grid { grid-template-columns: 1fr; }
  .promo-type-picker, .promo-time-row, .editor-two, .editor-three { grid-template-columns: 1fr; }
  .promo-upload { grid-template-columns: 1fr; }
  .promo-upload > img { height: 120px; }
  .promotion-library-toolbar { align-items: flex-start; flex-direction: column; }
  .promotion-row { grid-template-columns: 70px minmax(0,1fr); padding: 12px; }
  .promotion-row-preview { width: 68px; height: 82px; }
  .promotion-row-copy { grid-column: 2; }
  .promotion-delivery { grid-column: 1 / -1; padding-top: 4px; }
  .promotion-publish-control { justify-items: start; grid-column: 1; grid-row: auto; }
  .promotion-edit-button { justify-self: end; grid-column: 2; grid-row: auto; }
  .promotion-row-title { align-items: flex-start; flex-direction: column; }
  .click-analytics-summary { grid-template-columns: 1fr 1fr; }
  .click-search { grid-column: 1 / -1; }
  .editor-pairings { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* SABOR 360 brand alignment — mirrors the public site's Manrope, monochrome
   foundation, signature orange, warm neutrals and restrained geometry. */
body {
  background:
    radial-gradient(circle at 100% 0, rgba(255, 76, 0, .045), transparent 28rem),
    var(--bg);
}


.sidebar {
  background:
    radial-gradient(circle at 8% -10%, rgba(255, 76, 0, .055), transparent 31%),
    var(--bg-elevated);
  color: var(--text);
  border-right-color: var(--border);
}
.sidebar-brand { border-bottom-color: var(--border); }
.brand-mark { filter: brightness(0); }
.dark-button { color: var(--text-soft); background: var(--surface); border-color: var(--border); }
.dark-button:hover { color: var(--text); background: var(--surface-soft); border-color: var(--border-strong); }
.nav-link { color: var(--text-soft); border-radius: 9px; }
.nav-link:hover { color: var(--text); background: var(--surface-strong); }
.nav-link.active {
  color: var(--text);
  background: var(--brand-soft);
  box-shadow: inset 3px 0 0 var(--brand);
}
.nav-link.active .nav-icon { color: var(--brand); }
.nav-link.active .nav-count { color: var(--brand); background: var(--surface); }
.nav-count { color: var(--text-soft); background: var(--surface-strong); }
.nav-dot { background: var(--brand); box-shadow: 0 0 0 4px rgba(255,76,0,.14); }
.sidebar-footer { border-top-color: var(--border); }
.system-status { background: rgba(255,255,255,.58); border: 1px solid var(--border); }
.status-copy strong { color: var(--text); }
.status-copy small { color: var(--text-faint); }

.topbar {
  min-height: 76px;
  background: color-mix(in srgb, #fff 92%, transparent);
  border-bottom-color: rgba(18,18,18,.09);
  backdrop-filter: blur(20px);
}
html.dark .topbar { background: color-mix(in srgb, #151515 92%, transparent); }
.topbar-heading h1 { font-family: "Manrope", sans-serif; font-weight: 620; letter-spacing: -.045em; }
.breadcrumb { letter-spacing: .045em; text-transform: uppercase; }
.account-avatar { color: #fff; background: var(--brand); border-radius: 8px; }

.button { border-radius: 999px; }
.button-primary { color: #fff; background: var(--brand); border-color: var(--brand); box-shadow: 0 10px 24px rgba(255, 76, 0, .17); }
.button-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.button-mint { color: #fff; background: var(--brand); border-color: var(--brand); }
.icon-button, .account-button { border-radius: 999px; }
.segmented, .segment { border-radius: 999px; }

.overview-status-dot { background: var(--brand); border-color: rgba(255,76,0,.13); }
.overview-hero-metric {
  background:
    radial-gradient(circle at 96% 0, rgba(255,76,0,.12), transparent 38%),
    linear-gradient(145deg,#fff8f4 0%,#ffefe8 70%,#ffe7dc 100%);
  color: var(--text);
  border-color: rgba(255,76,0,.16);
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(118,49,18,.08);
}
.overview-hero-head > span { color: var(--text-soft); }
.overview-hero-head > b { color: var(--brand); background: rgba(255,255,255,.72); border-color: rgba(255,76,0,.18); }
.overview-hero-metric > p { color: var(--text-soft); }
.overview-hero-footer { color: var(--text-faint); }
.overview-hero-footer b { color: var(--text); }
.overview-hero-chart stop:first-child { stop-color: var(--brand); stop-opacity: .22; }
.overview-hero-chart stop:last-child { stop-color: var(--brand); }
.hero-spark-line { stroke: var(--brand); filter: drop-shadow(0 4px 8px rgba(255,76,0,.28)); }
.overview-metric-card,
.overview-panel,
.dish-card,
.dish-control-panel,
.toolbar-card,
.card { border-radius: var(--radius-lg); }
.overview-metric-card { background: linear-gradient(155deg,var(--surface),color-mix(in srgb,var(--brand) 2.2%,var(--surface))); }
.overview-metric-card::after { position: absolute; top: 0; right: 0; width: 42px; height: 3px; background: var(--brand); content: ""; }
.overview-panel:hover { border-color: rgba(255,76,0,.22); box-shadow: 0 16px 38px rgba(18,18,18,.07); }
.overview-eyebrow, .dish-control-label { color: var(--brand); }

.filter-chip { border-radius: 999px; }
.filter-chip.active { color: #fff; background: var(--brand); border-color: var(--brand); }
.dish-create-button { border-radius: 10px; }
.dish-create-button.combination { color: var(--brand); background: var(--brand-soft); border-color: rgba(255,76,0,.2); }
.dish-image { border-radius: 15px 15px 0 0; }
.promotion-row:hover { background: rgba(255,76,0,.025); }
.click-share b, .switch.on { background: var(--brand); }

.modal { border-radius: 18px; }
.form-field input,
.form-field textarea,
.form-field select,
.search-field input { border-radius: 9px; }
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus,
.search-field input:focus { border-color: rgba(255,76,0,.55); box-shadow: 0 0 0 4px rgba(255,76,0,.08); }

@media (max-width: 760px) {
  .topbar { background: color-mix(in srgb, #fff 95%, transparent); }
  html.dark .topbar { background: color-mix(in srgb, #151515 95%, transparent); }
}

/* Clean, unified KPI cards inspired by the supplied reference. */
.overview-kpi-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.overview-hero-metric,
.overview-metric-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 156px;
  grid-column: auto;
  overflow: hidden;
  flex-direction: column;
  padding: 17px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(18,18,18,.03), 0 8px 22px rgba(18,18,18,.035);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.overview-hero-metric:hover,
.overview-metric-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: 0 2px 4px rgba(18,18,18,.04), 0 12px 28px rgba(18,18,18,.055);
}

.overview-metric-card::after { display: none; }

.overview-metric-top {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.overview-metric-label {
  min-width: 0;
  margin: 0;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: -.012em;
  line-height: 1.35;
}

.overview-metric-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  color: var(--brand);
  background: rgba(255,76,0,.06);
  border: 1px solid rgba(255,76,0,.05);
  border-radius: 8px;
}

.overview-metric-icon svg { width: 14px; height: 14px; }

.overview-hero-value,
.overview-metric-value {
  margin-top: 16px;
  color: var(--text);
  font-size: clamp(24px, 2.05vw, 31px);
  font-weight: 540;
  letter-spacing: -.055em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.overview-metric-foot {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 16px;
}

.overview-trend {
  flex: 0 0 auto;
  padding: 3px 5px;
  font-size: 7px;
  font-weight: 720;
}

.overview-trend svg { width: 8px; height: 8px; }

.overview-metric-note {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  padding: 0;
  color: var(--text-faint);
  font-size: 7px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .overview-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .overview-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 460px) {
  .overview-kpi-grid { grid-template-columns: 1fr; }
  .overview-hero-metric,
  .overview-metric-card { min-height: 148px; }
}

/* White canvas + outlined sections, following the latest dashboard reference. */
body,
.workspace,
.page-container {
  background: var(--surface);
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.topbar {
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}

.overview-toolbar {
  min-height: 62px;
  margin-bottom: 12px;
  padding: 10px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.overview-hero-metric,
.overview-metric-card,
.overview-panel,
.card,
.toolbar-card,
.dish-control-panel,
.dish-card,
.campaign-card,
.pairing-row,
.promotion-command-panel,
.promotion-library,
.old-team-add {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: none;
}

.overview-hero-metric:hover,
.overview-metric-card:hover,
.overview-panel:hover,
.dish-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 8px 22px rgba(18,18,18,.045);
}

.promotion-command-panel {
  background: var(--surface);
  border-color: var(--border);
}

.system-status,
.account-button,
.icon-button,
.segmented,
.toolbar-card,
.dish-control-panel {
  background: var(--surface);
}

.segmented,
.view-switch {
  border: 1px solid var(--border);
}

.overview-kpi-grid,
.overview-insights-grid,
.dish-grid,
.member-grid,
.campaign-grid,
.old-team-grid {
  gap: 12px;
}

.overview-metric-icon,
.promotion-command-icon,
.role-chip {
  border: 1px solid rgba(255,76,0,.1);
}

.overview-metric-card,
.overview-hero-metric,
.overview-panel,
.card,
.toolbar-card,
.dish-control-panel,
.promotion-command-panel,
.promotion-library {
  border-radius: 12px;
}

@media (max-width: 760px) {
  .topbar { background: rgba(255,255,255,.98); }
  .overview-toolbar { align-items: stretch; flex-direction: column; padding: 12px; }
}

/* Category donut visualization. */
.category-chart-panel .overview-panel-head { padding-bottom: 0; }

.category-period-trend {
  flex: 0 0 auto;
  padding-top: 1px;
  text-align: right;
}

.category-period-trend strong,
.category-period-trend span { display: block; }

.category-period-trend strong {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--green);
  font-size: 10px;
  font-weight: 740;
}

.category-period-trend strong svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.category-period-trend span {
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 7px;
}

.category-chart-total {
  padding: 13px 18px 0;
}

.category-chart-total span,
.category-chart-total strong { display: block; }

.category-chart-total span {
  color: var(--text-faint);
  font-size: 8px;
  font-weight: 620;
}

.category-chart-total strong {
  margin-top: 4px;
  font-size: 27px;
  font-weight: 550;
  letter-spacing: -.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.category-chart-layout {
  display: grid;
  grid-template-columns: minmax(124px, .78fr) minmax(160px, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px 18px 17px;
}

.category-donut {
  position: relative;
  width: min(100%, 154px);
  aspect-ratio: 1;
  justify-self: center;
  background: conic-gradient(
    from -90deg,
    var(--chart-1) 0 34%,
    var(--chart-2) 34% 60%,
    var(--chart-3) 60% 77%,
    var(--chart-4) 77% 90%,
    var(--chart-5) 90% 100%
  );
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(18,18,18,.04);
}

.category-donut::before {
  position: absolute;
  inset: 27%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  content: "";
}

.category-donut > div {
  position: absolute;
  inset: 27%;
  z-index: 1;
  display: grid;
  place-content: center;
  text-align: center;
}

.category-donut strong,
.category-donut span { display: block; }

.category-donut strong {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.04em;
}

.category-donut span {
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 6px;
}

.category-chart-panel .category-performance { padding: 0; }
.category-chart-panel .category-performance-row { min-height: 29px; }
.category-chart-panel .category-performance-row > i { border-radius: 50%; }

@media (max-width: 600px) {
  .category-chart-layout { grid-template-columns: 1fr; }
  .category-donut { width: 148px; }
  .category-chart-panel .category-performance { width: 100%; }
}

/* KPI growth now owns the upper-right corner. */
.overview-kpi-growth {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  flex-direction: column;
  gap: 4px;
  text-align: right;
}

.overview-kpi-growth .overview-trend {
  gap: 5px;
  padding: 0;
  color: var(--text);
  background: transparent;
  font-size: 10px;
  font-weight: 720;
}

.overview-kpi-growth .overview-trend svg {
  width: 13px;
  height: 13px;
  padding: 2.5px;
  color: #fff;
  background: var(--green);
  border-radius: 50%;
  stroke-width: 2.4;
}

.overview-kpi-growth .overview-trend.down { color: var(--red); background: transparent; }
.overview-kpi-growth .overview-trend.down svg { background: var(--red); }
.overview-kpi-growth .overview-trend.neutral { color: var(--text-soft); background: transparent; }
.overview-kpi-growth .overview-trend.neutral svg { background: var(--text-faint); }

.overview-kpi-growth small {
  color: var(--text-faint);
  font-size: 6.5px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.overview-metric-foot { padding-top: 13px; }
.overview-metric-foot .overview-metric-note { white-space: normal; }

/* Dish click ranking with plate photos and proportional horizontal bars. */
.dish-click-chart .overview-ranking { padding: 12px 18px 16px; }

.dish-click-chart .overview-rank-row {
  display: grid;
  grid-template-columns: 42px minmax(115px, .8fr) 54px minmax(150px, 1.25fr);
  min-height: 55px;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--border);
}

.dish-click-chart .overview-rank-image {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.dish-click-chart .overview-rank-copy strong { font-size: 9px; font-weight: 650; }
.dish-click-chart .overview-rank-copy span { margin-top: 3px; font-size: 7px; }

.dish-click-chart .overview-rank-value {
  min-width: 0;
  text-align: right;
}

.dish-click-chart .overview-rank-value strong {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: -.02em;
}

.dish-click-chart .overview-rank-value span {
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 6px;
}

@media (max-width: 600px) {
  .dish-click-chart .overview-rank-row {
    grid-template-columns: 40px minmax(0,1fr) auto;
    min-height: 72px;
    gap: 9px;
    padding-block: 8px;
  }
  .dish-click-chart .overview-rank-value { display: block; grid-column: 3; }
}

/* Inline dish analysis: summary KPIs, search and scrollable full ranking. */
.dish-click-scroll-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.dish-click-scroll-controls .icon-button {
  width: 32px;
  height: 32px;
}

.dish-click-scroll-controls .icon-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.dish-click-scroll-controls [data-action="rank-scroll-down"] svg { transform: rotate(180deg); }

.dish-click-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(108px, .45fr)) minmax(210px, 1fr);
  gap: 9px;
  padding: 14px 18px 4px;
}

.dish-click-stat {
  display: flex;
  min-width: 0;
  min-height: 66px;
  justify-content: center;
  flex-direction: column;
  padding: 11px 13px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.dish-click-stat span,
.dish-click-stat strong { display: block; }

.dish-click-stat span {
  color: var(--text-faint);
  font-size: 7px;
  font-weight: 680;
  letter-spacing: .065em;
  text-transform: uppercase;
}

.dish-click-stat strong {
  margin-top: 7px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.overview-dish-search {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 66px;
  align-items: center;
}

.overview-dish-search > svg {
  position: absolute;
  left: 14px;
  z-index: 1;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--text-faint);
  stroke-width: 2;
  pointer-events: none;
}

.overview-dish-search input {
  width: 100%;
  height: 100%;
  padding: 0 14px 0 42px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 9px;
  outline: none;
}

.overview-dish-search input:focus {
  border-color: rgba(255,76,0,.46);
  box-shadow: 0 0 0 4px rgba(255,76,0,.07);
}

.dish-click-chart .overview-ranking {
  max-height: 292px;
  overflow-y: auto;
  margin: 10px 8px 10px 0;
  padding: 0 10px 0 18px;
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
  scroll-behavior: smooth;
}

.dish-click-chart .overview-ranking::-webkit-scrollbar { width: 6px; }
.dish-click-chart .overview-ranking::-webkit-scrollbar-track { background: transparent; }
.dish-click-chart .overview-ranking::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }

.dish-click-empty {
  margin: 10px 18px 18px;
  padding: 24px;
  color: var(--text-faint);
  background: var(--surface-soft);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  font-size: 9px;
  text-align: center;
}

@media (max-width: 1050px) {
  .dish-click-summary { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .overview-dish-search { min-height: 48px; grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .dish-click-summary { grid-template-columns: 1fr 1fr; padding-inline: 14px; }
  .dish-click-stat:last-of-type { grid-column: 1 / -1; }
  .dish-click-chart .overview-ranking { padding-left: 14px; }
}

/* Overview deduplication: four KPIs and purpose-built insight cards. */
.overview-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.overview-insights-grid {
  grid-template-columns: minmax(0, 1.28fr) minmax(330px, .72fr);
  grid-template-rows: auto auto;
  align-items: stretch;
}

.overview-insights-grid > .overview-panel { min-height: 0; }
.dish-click-chart { grid-row: 1 / span 2; }

.dish-ranking-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.dish-ranking-toggle button {
  min-height: 28px;
  cursor: pointer;
  padding: 0 10px;
  color: var(--text-faint);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 650;
}

.dish-ranking-toggle button.active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(18,18,18,.08);
}

.dish-ranking-toggle button:focus-visible { outline-offset: 1px; }

.dish-click-search-row { padding: 14px 18px 2px; }
.dish-click-search-row .overview-dish-search { min-height: 44px; }

.dish-click-chart .overview-ranking {
  max-height: 402px;
  margin-top: 8px;
}

.category-chart-panel .category-chart-layout { padding-top: 16px; }

.promotion-metrics-card .overview-panel-head { padding-bottom: 0; }

.promotion-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 18px 18px;
}

.promotion-metrics-grid > div {
  min-width: 0;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.promotion-metrics-grid span,
.promotion-metrics-grid strong { display: block; }

.promotion-metrics-grid span {
  color: var(--text-faint);
  font-size: 7px;
  font-weight: 650;
}

.promotion-metrics-grid strong {
  margin-top: 7px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

.promotion-metrics-grid > .primary {
  background: var(--brand-soft);
  border-color: rgba(255,76,0,.16);
}

.promotion-metrics-grid > .primary span,
.promotion-metrics-grid > .primary strong { color: var(--brand); }

@media (max-width: 980px) {
  .overview-insights-grid { grid-template-columns: 1fr; grid-template-rows: auto; }
  .dish-click-chart { grid-row: auto; }
}

@media (max-width: 900px) {
  .overview-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .dish-ranking-toggle { align-self: flex-start; }
  .promotion-metrics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  .overview-kpi-grid { grid-template-columns: 1fr; }
}

/* Promotions are operational: active and scheduled campaigns only. */
.promotion-status-content { padding: 14px 18px 18px; }

.promotion-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.promotion-status-grid > div {
  position: relative;
  min-width: 0;
  padding: 12px 12px 11px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.promotion-status-grid i {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 7px;
  height: 7px;
  background: var(--amber);
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb,var(--amber) 10%,transparent);
}

.promotion-status-grid i.active {
  background: var(--green);
  box-shadow: 0 0 0 4px color-mix(in srgb,var(--green) 10%,transparent);
}

.promotion-status-grid strong,
.promotion-status-grid span { display: block; }

.promotion-status-grid strong {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1;
}

.promotion-status-grid span {
  margin-top: 6px;
  color: var(--text-faint);
  font-size: 7px;
  font-weight: 620;
}

.promotion-status-content > p {
  margin: 11px 0 0;
  color: var(--text-faint);
  font-size: 7.5px;
  line-height: 1.5;
}

.promotion-status-content > p strong { color: var(--text-soft); font-size: 10px; }

/* Compact interaction explorer: photo clicks and video plays. */
.dish-click-chart .dish-interaction-head {
  align-items: center;
  padding: 20px 20px 0;
}

.dish-click-chart .dish-interaction-head h3 {
  font-size: 15px;
  font-weight: 680;
}

.dish-click-chart .dish-interaction-head p {
  margin-top: 4px;
  font-size: 8px;
}

.dish-click-chart .dish-ranking-toggle {
  padding: 4px;
  border-radius: 12px;
}

.dish-click-chart .dish-ranking-toggle button {
  min-height: 34px;
  padding-inline: 13px;
  border-radius: 9px;
  font-size: 8.5px;
}

.dish-click-chart .dish-click-search-row { padding: 18px 20px 6px; }
.dish-click-chart .overview-dish-search { height: 56px; min-height: 56px; }

.dish-click-chart .overview-dish-search > svg {
  left: 17px;
  width: 20px;
  height: 20px;
}

.dish-click-chart .overview-dish-search input {
  height: 56px;
  padding-left: 48px;
  background: #fbfbfa;
  border-color: var(--border-strong);
  border-radius: 12px;
  font-size: 12px;
}

.dish-click-chart .overview-ranking {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 9px;
  max-height: 360px;
  margin: 12px 8px 14px 0;
  padding: 0 12px 0 20px;
}

.dish-click-chart .overview-rank-row,
.dish-click-chart .overview-rank-row:last-child {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  grid-template-rows: auto;
  min-height: 72px;
  gap: 10px;
  padding: 11px;
  background: #fbfbfa;
  border: 1px solid var(--border);
  border-radius: 13px;
}

.dish-click-chart .overview-rank-row:hover {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--brand) 24%, var(--border));
}

.dish-click-chart .overview-rank-image {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 11px;
}

.dish-click-chart .overview-rank-copy {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
}

.dish-click-chart .overview-rank-copy strong { font-size: 9.5px; }
.dish-click-chart .overview-rank-copy span { margin-top: 2px; font-size: 7px; }

.dish-click-chart .overview-rank-value {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
}

.dish-click-chart .overview-rank-value strong {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -.025em;
}
.dish-click-chart .overview-rank-value span { font-size: 6.5px; }

.category-chart-panel .category-interaction-head {
  align-items: center;
  padding-top: 18px;
}

.category-mode-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 4px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.category-mode-toggle button {
  min-height: 32px;
  cursor: pointer;
  padding: 0 11px;
  color: var(--text-faint);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 8px;
  font-weight: 650;
}

.category-mode-toggle button.active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(18,18,18,.08);
}

.category-mode-toggle button:focus-visible { outline-offset: 1px; }

@media (max-width: 760px) {
  .dish-click-chart .dish-interaction-head {
    align-items: stretch;
    flex-direction: column;
  }

  .dish-click-chart .dish-ranking-toggle { display: flex; width: 100%; }
  .dish-click-chart .dish-ranking-toggle button { flex: 1; }
  .dish-click-chart .overview-ranking { grid-template-columns: 1fr; max-height: 430px; }

  .category-chart-panel .category-interaction-head {
    align-items: stretch;
    flex-direction: column;
  }

  .category-mode-toggle { display: flex; width: 100%; }
  .category-mode-toggle button { flex: 1; }
}

@media (max-width: 460px) {
  .dish-click-chart .dish-click-search-row { padding-inline: 14px; }
  .dish-click-chart .overview-ranking { padding-left: 14px; }
  .dish-click-chart .dish-ranking-toggle button { padding-inline: 8px; font-size: 7.5px; }
}

/* Compact menu controls: search and creation first, filters second. */
.dish-control-panel-compact {
  padding: 16px;
}

.dish-toolbar-primary {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.dish-control-panel-compact .dish-control-label {
  margin-bottom: 8px;
  font-size: 7.5px;
}

.dish-control-panel-compact .dish-control-search .search-field input {
  height: 46px;
  padding-left: 42px;
  background: #fbfbfa;
  font-size: 10.5px;
}

.dish-control-panel-compact .dish-control-search .search-field svg {
  left: 15px;
  width: 18px;
  height: 18px;
}

.dish-toolbar-actions {
  display: flex;
  gap: 8px;
}

.dish-control-panel-compact .dish-create-button {
  min-width: max-content;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 10px;
}

.dish-control-panel-compact .dish-create-button > svg {
  width: 16px;
  height: 16px;
}

.dish-control-panel-compact .dish-create-button strong { font-size: 8.5px; }

.dish-toolbar-filters {
  display: grid;
  grid-template-columns: minmax(340px, .8fr) minmax(0, 1.2fr);
  align-items: end;
  gap: 22px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.dish-control-panel-compact .dish-control-group .filter-row {
  min-height: 34px;
  align-items: center;
}

.dish-control-panel-compact .dish-control-group .filter-chip,
.dish-control-panel-compact .dish-control-categories .filter-chip {
  height: 34px;
  padding-inline: 12px;
  background: transparent;
}

.dish-control-panel-compact .dish-control-group .filter-chip.active,
.dish-control-panel-compact .dish-control-categories .filter-chip.active {
  color: #fff;
  background: var(--brand);
}

.dish-control-panel-compact .dish-control-categories {
  margin: 0;
  padding: 0;
  border: 0;
}

@media (max-width: 1100px) {
  .dish-toolbar-primary,
  .dish-toolbar-filters { grid-template-columns: 1fr; gap: 13px; }
  .dish-toolbar-actions { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); }
  .dish-control-panel-compact .dish-create-button { min-width: 0; }
}

@media (max-width: 600px) {
  .dish-control-panel-compact { padding: 13px; }
  .dish-toolbar-actions { grid-template-columns: 1fr 1fr; }
  .dish-control-panel-compact .dish-create-button.dish { grid-column: 1 / -1; }
}

/* Promotion gallery: wide imagery and compact campaign controls. */
.promotion-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.promotion-card {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.promotion-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 10px 26px rgba(18,18,18,.06);
}

.promotion-card-media {
  position: relative;
  aspect-ratio: 16 / 8.5;
  overflow: hidden;
  background: var(--surface-soft);
}

.promotion-card-media::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(18,18,18,.18), transparent 42%);
  content: "";
  pointer-events: none;
}

.promotion-card-media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
}

.promotion-card:hover .promotion-card-media > img { transform: scale(1.025); }

.promotion-card-status,
.promotion-card-format {
  position: absolute;
  top: 11px;
  z-index: 1;
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  color: #fff;
  background: rgba(18,18,18,.72);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  font-size: 7px;
  font-weight: 680;
  backdrop-filter: blur(8px);
}

.promotion-card-status { left: 11px; }
.promotion-card-format { right: 11px; }
.promotion-card-status i { width: 6px; height: 6px; background: #f0b642; border-radius: 50%; }
.promotion-card-status.active i { background: #42ce83; }
.promotion-card-status b { font: inherit; }
.promotion-card-format svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.promotion-card-body {
  min-height: 124px;
  padding: 15px 15px 13px;
}

.promotion-card-body h3 {
  margin: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 680;
  letter-spacing: -.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.promotion-card-body > p {
  display: -webkit-box;
  min-height: 24px;
  margin: 6px 0 0;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 8px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.promotion-card-schedule {
  display: inline-flex;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  margin-top: 13px;
  padding: 0 9px;
  color: var(--text-soft);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 7px;
}

.promotion-card-schedule svg { width: 12px; height: 12px; flex: 0 0 auto; fill: none; stroke: var(--text-faint); stroke-width: 1.8; }
.promotion-card-schedule span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.promotion-card-footer {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 15px;
  background: #fbfbfa;
  border-top: 1px solid var(--border);
}

.promotion-card-footer .promotion-publish-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.promotion-card-footer .promotion-edit-button { min-width: 74px; }

@media (max-width: 1180px) {
  .promotion-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .promotion-card-grid { grid-template-columns: 1fr; padding: 10px; }
}

/* Compact promotion list: imagery supports the campaign instead of dominating it. */
.promotion-card-grid {
  grid-template-columns: 1fr;
  gap: 7px;
  padding: 10px;
}

.promotion-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 132px;
  min-height: 104px;
  border-radius: 12px;
}

.promotion-card:hover { transform: none; }

.promotion-card-media {
  min-height: 104px;
  aspect-ratio: auto;
  border-right: 1px solid var(--border);
}

.promotion-card-media::after { display: none; }
.promotion-card:hover .promotion-card-media > img { transform: none; }

.promotion-card-body {
  display: flex;
  min-height: 0;
  justify-content: center;
  flex-direction: column;
  padding: 11px 13px;
}

.promotion-card-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.promotion-card-heading h3 { min-width: 0; font-size: 10px; }

.promotion-card-body > p {
  /* flex:0 0 auto — sin esto el <p> es el amortiguador del flex y los chips lo
     comprimen hasta hacerlo ilegible en vez de empujar la tarjeta hacia abajo. */
  flex: 0 0 auto;
  min-height: 0;
  margin-top: 4px;
  font-size: 7.5px;
}

/* La foto acompaña a la tarjeta cuando crece, en vez de dejar un hueco abajo. */
.promotion-card-media { height: 100%; }

.promotion-card-status,
.promotion-card-format {
  position: static;
  min-height: 23px;
  padding-inline: 7px;
  color: var(--text-soft);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  backdrop-filter: none;
}

.promotion-card-status {
  flex: 0 0 auto;
  color: #1f6e49;
  background: #eef8f2;
  border-color: #dcefe4;
}

.promotion-card-status.scheduled {
  color: #8a6416;
  background: #fff8e9;
  border-color: #f2e5c3;
}

.promotion-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.promotion-card-format,
.promotion-card-schedule {
  display: inline-flex;
  max-width: 100%;
  min-height: 23px;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0 7px;
  border-radius: 7px;
  font-size: 6.5px;
}

.promotion-card-format svg,
.promotion-card-schedule svg {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--text-faint);
  stroke-width: 1.8;
}

.promotion-card-footer {
  min-height: 100%;
  align-items: stretch;
  justify-content: center;
  flex-direction: column;
  padding: 10px;
  border-top: 0;
  border-left: 1px solid var(--border);
}

.promotion-card-footer .promotion-publish-control { justify-content: center; }
.promotion-card-footer .promotion-edit-button { width: 100%; min-height: 32px; }

@media (max-width: 900px) {
  .promotion-card { grid-template-columns: 120px minmax(0, 1fr); }
  .promotion-card-footer {
    grid-column: 1 / -1;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    border-top: 1px solid var(--border);
    border-left: 0;
  }
  .promotion-card-footer .promotion-edit-button { width: auto; }
}

@media (max-width: 560px) {
  .promotion-card { grid-template-columns: 1fr; }
  .promotion-card-media { min-height: 126px; border-right: 0; border-bottom: 1px solid var(--border); }
  .promotion-card-body { padding: 14px; }
}

.overview-toolbar .overview-toolbar-actions { margin-left: auto; }

/* Denser plate library on wide desktop screens. Five cards keep the menu
   scannable while preserving enough room for names, prices and actions. */
@media (min-width: 1400px) {
  .dish-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
  }

  .dish-body { padding: 11px; }
  .dish-actions-primary { gap: 3px; }
  .dish-action-icon { width: 32px; height: 32px; }
}

/* Both category views stay visible; promotions follow the analytics. */
.overview-insights-grid {
  grid-template-rows: auto auto auto;
}

.dish-click-chart { grid-row: 1 / span 2; }

.category-chart-panel .category-interaction-head {
  min-height: 52px;
}

.overview-status-strip {
  grid-column: 1 / -1;
  grid-row: 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.promotion-status-card .promotion-status-grid {
  grid-template-columns: repeat(2, minmax(0, 220px));
}

.dish-status-summary-card .dish-status-counts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.promotion-status-grid i.sold {
  background: var(--red);
  box-shadow: 0 0 0 4px color-mix(in srgb,var(--red) 10%,transparent);
}

@media (max-width: 980px) {
  .dish-click-chart,
  .overview-status-strip { grid-row: auto; }
}

@media (max-width: 700px) {
  .overview-status-strip { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  .dish-status-summary-card .dish-status-counts { grid-template-columns: 1fr; }
}

/* Compact promotion library: two useful cards per row, without oversized art. */
.promotion-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.promotion-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 96px;
  /* minmax y no la altura fija de antes: con 126px clavados y overflow:hidden, en
     cuanto los tres chips envolvían a dos filas el único hijo que podía encogerse
     era la descripción — se aplastaba y se cortaba a media frase. Ahora la tarjeta
     crece lo que necesite. */
  grid-template-rows: minmax(126px, auto);
  min-height: 126px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: none;
}

.promotion-card-media {
  grid-column: 1;
  grid-row: 1;
  width: 104px;
  min-height: 126px;
  overflow: hidden;
  border-right: 1px solid var(--border);
  border-bottom: 0;
}

.promotion-card-media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.promotion-card-body {
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  justify-content: center;
  padding: 13px 14px 10px;
}

.promotion-card-heading h3 { font-size: 10.5px; }
.promotion-card-body > p { margin-top: 5px; font-size: 7.5px; }
.promotion-card-meta { margin-top: 9px; }

.promotion-card-footer {
  grid-column: 3;
  grid-row: 1;
  min-height: 100%;
  align-items: stretch;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 8px 12px;
  background: #fbfbfa;
  border-top: 0;
  border-left: 1px solid var(--border);
}

.promotion-card-footer .promotion-publish-control {
  justify-content: center;
}

.promotion-card-footer .promotion-edit-button {
  width: 100%;
  min-width: 72px;
  min-height: 30px;
}

@media (max-width: 900px) {
  .promotion-card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .promotion-card {
    grid-template-columns: 88px minmax(0, 1fr);
    grid-template-rows: minmax(106px, auto) auto;
    min-height: 154px;
  }

  .promotion-card-media {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 88px;
    min-height: 154px;
    border-right: 1px solid var(--border);
    border-bottom: 0;
  }

  .promotion-card-body { grid-column: 2; padding-inline: 11px; }
  .promotion-card-footer {
    grid-column: 2;
    grid-row: 2;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    padding-inline: 10px;
    border-top: 1px solid var(--border);
    border-left: 0;
  }
  .promotion-card-footer .promotion-publish-control { justify-content: flex-start; }
  .promotion-card-footer .promotion-edit-button { width: auto; min-width: 64px; padding-inline: 9px; }
}

/* Date controls sit directly on the canvas instead of inside an empty card. */
.overview-toolbar {
  min-height: 0;
  justify-content: flex-end;
  margin-bottom: 12px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.custom-date-range-trigger {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-date-range-trigger.active {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: rgba(255,76,0,.24);
}

.custom-date-modal { width: min(520px, 100%); }

@media (max-width: 760px) {
  .overview-toolbar {
    align-items: stretch;
    padding: 0;
    background: transparent;
    border: 0;
  }

  .custom-date-range-trigger { max-width: none; }
}

/* Promotion scheduling: readable day controls and explicit 12-hour time. */
.promotion-card-meta { gap: 5px; }

.promotion-card-time {
  color: var(--text);
  background: var(--surface);
  font-weight: 680;
}

.promotion-card-time svg { stroke: var(--brand); }

.promo-schedule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.promo-day-presets {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 9px;
}

.promo-day-presets button {
  min-height: 27px;
  cursor: pointer;
  padding: 0 8px;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 7px;
  font-weight: 680;
}

.promo-day-presets button:hover,
.promo-day-presets button:focus-visible {
  color: var(--text);
  background: var(--surface);
}

.promo-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.promo-weekdays button {
  min-width: 0;
  min-height: 42px;
  cursor: pointer;
  padding: 0 4px;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 7.5px;
  font-weight: 700;
}

.promo-weekdays button:hover { border-color: var(--border-strong); }

.promo-weekdays button.selected {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 5px 12px rgba(255,76,0,.15);
}

.promo-all-day-row {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.promo-all-day-row strong,
.promo-all-day-row span { display: block; }
.promo-all-day-row strong { font-size: 8.5px; }
.promo-all-day-row span { margin-top: 3px; color: var(--text-faint); font-size: 7px; }

.promo-time-pickers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 10px;
  transition: opacity 150ms ease;
}

.promo-time-pickers.disabled { opacity: .4; }
.promo-time-pickers.disabled select,
.promo-time-pickers.disabled button { pointer-events: none; }

.promo-time-picker {
  min-width: 0;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.promo-time-label {
  display: block;
  margin-bottom: 7px;
  color: var(--text-faint);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.promo-time-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
}
.promo-time-control .promo-meridiem {
  grid-column: 1 / -1;
  margin-top: 6px;
  justify-self: stretch;
}
.promo-time-control .promo-meridiem button { flex: 1; min-width: 0; }

.promo-time-control > b {
  color: var(--text-soft);
  font-size: 12px;
  text-align: center;
}

.promo-time-control select {
  width: 100%;
  height: 36px;
  padding: 0 7px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 8px;
  font-weight: 650;
}

.promo-meridiem {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.promo-meridiem button {
  min-width: 30px;
  height: 28px;
  cursor: pointer;
  padding: 0 5px;
  color: var(--text-faint);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 7px;
  font-weight: 750;
}

.promo-meridiem button.selected {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(18,18,18,.09);
}

@media (max-width: 600px) {
  .promo-schedule-head { align-items: flex-start; flex-direction: column; }
  .promo-day-presets { width: 100%; }
  .promo-day-presets button { flex: 1; }
  .promo-weekdays { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .promo-time-pickers { grid-template-columns: 1fr; }
}
/* Clear, menu-specific tag icons and a denser selection layout. */
.editor-choice-grid.tags {
  display: grid;
  /* auto-fit en vez de 3 fijas: "Especialidad de la casa" y "Recomendación del
     Chef" no caben en un tercio y salían cortadas con puntos suspensivos. */
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 8px;
}

.tag-choice {
  min-width: 0;
  min-height: 48px;
  justify-content: flex-start;
  padding: 7px 10px;
  background: var(--surface);
  border-radius: 11px;
  text-align: left;
}

.tag-choice > span:last-child {
  min-width: 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.tag-choice-icon {
  position: relative;
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  place-items: center;
  color: var(--text-soft);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1;
  transition: transform 150ms ease, color 150ms ease, background 150ms ease, border-color 150ms ease;
}

/* Icono de etiqueta: trazo, no emoji. Hereda currentColor, así que se tiñe con
   el estado del botón (gris apagado / naranja de marca al estar seleccionado). */
.tag-icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tag-choice:hover .tag-choice-icon { transform: scale(1.05); }

/* ---- Etiquetas agrupadas --------------------------------------------------
   Antes eran ocho botones sueltos sin decir para qué servía cada uno. */
.tag-groups { display: grid; gap: 16px; }
.tag-group-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.tag-group-head h4 { margin: 0; color: var(--text); font-size: 9px; font-weight: 760; letter-spacing: .09em; text-transform: uppercase; }
.tag-group-head small { color: var(--text-faint); font-size: 8px; font-weight: 560; }

/* ---- Barra de confirmación de una sección --------------------------------- */
.section-confirm { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); flex-wrap: wrap; }
.section-confirm-summary { min-width: 0; overflow: hidden; color: var(--text-soft); font-size: 9px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.section-confirm.confirmed .section-confirm-summary { color: var(--green, #17623a); }
.section-confirm.confirmed .section-confirm-summary::before { content: "✓ "; font-weight: 800; }
.section-confirm .button { flex: 0 0 auto; }

.tag-choice.selected {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: rgba(255,76,0,.35);
  box-shadow: 0 5px 15px rgba(255,76,0,.06);
}

.tag-choice.selected .tag-choice-icon {
  color: var(--brand);
  background: var(--surface);
  border-color: rgba(255,76,0,.24);
}

@media (max-width: 600px) {
  .editor-choice-grid.tags { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Portion selection uses clear choices instead of a cramped dropdown. */
.editor-portion-card {
  margin-top: 8px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.editor-portion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.editor-portion-head > div { min-width: 0; }
.editor-portion-head strong,
.editor-portion-head span { display: block; }
.editor-portion-head strong { font-size: 9px; }
.editor-portion-head span { margin-top: 3px; color: var(--text-faint); font-size: 8px; }

.portion-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 11px;
}

.portion-choice {
  min-width: 0;
  min-height: 58px;
  cursor: pointer;
  padding: 9px;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: left;
  transition: transform 150ms ease, color 150ms ease, background 150ms ease, border-color 150ms ease;
}

.portion-choice:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.portion-choice strong,
.portion-choice span { display: block; }
.portion-choice strong { font-size: 8.5px; }
.portion-choice span { margin-top: 4px; color: var(--text-faint); font-size: 7px; }

.portion-choice.selected {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: rgba(255,76,0,.35);
}

.portion-choice.selected span { color: color-mix(in srgb,var(--brand) 65%,var(--text-faint)); }

@media (max-width: 460px) {
  .portion-choice-grid { grid-template-columns: 1fr; }
}

/* Clean charcoal navigation: structured like a product shell, branded for Sabor 360. */
.sidebar {
  color: #fff;
  background:
    radial-gradient(circle at 18% -5%, rgba(255,76,0,.1), transparent 29%),
    linear-gradient(180deg, #191b1a 0%, #111312 100%);
  border-right: 1px solid rgba(255,255,255,.08);
  box-shadow: 8px 0 30px rgba(17,19,18,.055);
}

.sidebar-brand {
  min-height: 78px;
  padding: 15px 14px 14px 18px;
  border-bottom-color: rgba(255,255,255,.09);
}

.brand-mark {
  filter: brightness(0) invert(1);
}


.brand-mark { width: 38px; height: 38px; }

.sidebar .dark-button {
  color: rgba(255,255,255,.72);
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.1);
}

.sidebar .dark-button:hover {
  color: #fff;
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.16);
}

.sidebar-context {
  padding: 14px 12px 13px;
  border-bottom: 1px solid rgba(255,255,255,.075);
}

.sidebar-context-label,
.sidebar-section-label {
  display: block;
  margin: 0 8px 8px;
  color: rgba(255,255,255,.42);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .11em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.sidebar-restaurant {
  display: flex;
  width: 100%;
  min-width: 0;
  height: 54px;
  cursor: pointer;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 7px;
  color: #fff;
  background: rgba(255,255,255,.075);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 13px;
  text-align: left;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.sidebar-restaurant:hover {
  background: rgba(255,255,255,.105);
  border-color: rgba(255,255,255,.15);
}

.sidebar-restaurant:active { transform: translateY(1px); }

.sidebar-restaurant-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(255,76,0,.22);
  font-size: 15px;
  font-weight: 750;
}

.sidebar-restaurant-copy {
  min-width: 0;
  flex: 1;
}

.sidebar-restaurant-copy strong,
.sidebar-restaurant-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-restaurant-copy strong { font-size: 11px; font-weight: 680; }
.sidebar-restaurant-copy small { margin-top: 3px; color: rgba(255,255,255,.46); font-size: 8.5px; }
.sidebar-restaurant-chevron { display: grid; width: 15px; height: 15px; flex: 0 0 15px; place-items: center; color: rgba(255,255,255,.55); transform: rotate(90deg); }
.sidebar-restaurant-chevron svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }

.sidebar-nav {
  padding: 17px 12px;
}

.sidebar .nav-link {
  min-height: 46px;
  gap: 12px;
  margin: 2px 0;
  padding: 0 12px;
  color: rgba(255,255,255,.58);
  background: transparent;
  border-radius: 11px;
  box-shadow: none;
}

.sidebar .nav-link:hover {
  color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.055);
}

.sidebar .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.095);
  box-shadow: inset 3px 0 0 var(--brand);
}

.sidebar .nav-link.active .nav-icon { color: var(--brand); }
.sidebar .nav-label { font-size: 11.5px; font-weight: 560; }
.sidebar .nav-link.active .nav-label { font-weight: 700; }

.sidebar .nav-count,
.sidebar .nav-link.active .nav-count {
  min-width: 23px;
  padding: 3px 7px;
  color: #fff;
  background: rgba(255,76,0,.9);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 7px;
  font-size: 9px;
}

.sidebar-footer {
  padding: 12px;
  border-top-color: rgba(255,255,255,.075);
}

.sidebar .system-status {
  min-height: 43px;
  padding: 9px 11px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 11px;
}

.sidebar .status-copy strong { color: rgba(255,255,255,.82); font-size: 10.5px; }

body.sidebar-collapsed .sidebar-context {
  display: grid;
  justify-items: center;
  padding: 13px 10px;
}

body.sidebar-collapsed .sidebar-context-label,
body.sidebar-collapsed .sidebar-section-label,
body.sidebar-collapsed .sidebar-restaurant-copy,
body.sidebar-collapsed .sidebar-restaurant-chevron { display: none; }

body.sidebar-collapsed .sidebar-restaurant {
  width: 44px;
  height: 44px;
  justify-content: center;
  padding: 3px;
  border-radius: 12px;
}

body.sidebar-collapsed .sidebar-restaurant-avatar {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 9px;
}

body.sidebar-collapsed .sidebar-collapse {
  top: 62px;
  right: -1px;
  color: rgba(255,255,255,.74);
  background: #292c2a;
  border-color: rgba(255,255,255,.12);
}

body.sidebar-collapsed .sidebar-nav { padding-top: 14px; }
body.sidebar-collapsed .nav-link { min-height: 46px; border-radius: 12px; }
body.sidebar-collapsed .nav-link.active { box-shadow: inset 0 0 0 1px rgba(255,76,0,.35); }

@media (max-width: 980px) {
  .sidebar-context {
    display: grid;
    justify-items: center;
    padding: 13px 10px;
  }

  .sidebar-context-label,
  .sidebar-section-label,
  .sidebar-restaurant-copy,
  .sidebar-restaurant-chevron { display: none; }

  .sidebar-restaurant {
    width: 44px;
    height: 44px;
    justify-content: center;
    padding: 3px;
    border-radius: 12px;
  }

  .sidebar-restaurant-avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 9px;
  }
}

/* Modern minimal sidebar rebuild. */
:root {
  --sidebar-width: 218px;
  --sidebar-collapsed: 70px;
}

.modern-sidebar {
  width: var(--sidebar-width);
  color: var(--text);
  background: var(--surface);
  border-right: 1px solid #e8e8e5;
  box-shadow: none;
}

.modern-sidebar .sidebar-brand {
  min-height: 72px;
  padding: 12px 12px 11px 17px;
  border-bottom: 0;
}

.modern-sidebar .brand-link {
  cursor: pointer;
  padding: 0;
  background: transparent;
  border: 0;
}

.modern-sidebar .brand-mark { filter: brightness(0); }

.modern-sidebar .brand-mark { width: 34px; height: 34px; }

.modern-sidebar .sidebar-collapse {
  width: 32px;
  height: 32px;
  color: #777873;
  background: #f7f7f5;
  border: 1px solid #e6e6e2;
  border-radius: 9px;
}

.modern-sidebar .sidebar-collapse:hover {
  color: var(--text);
  background: #f0f0ed;
}

.modern-sidebar .sidebar-nav {
  padding: 14px 10px;
}

.modern-sidebar .sidebar-section-label {
  margin: 0 10px 9px;
  color: #aaa9a5;
  font-size: 7.5px;
  font-weight: 760;
  letter-spacing: .12em;
}

.modern-sidebar .nav-link {
  min-height: 44px;
  gap: 11px;
  margin: 2px 0;
  padding: 0 11px;
  color: #6f706d;
  background: transparent;
  border-radius: 11px;
  box-shadow: none;
}

.modern-sidebar .nav-link:hover {
  color: var(--text);
  background: #f7f7f5;
}

.modern-sidebar .nav-link.active {
  color: var(--text);
  background: #fff1eb;
  box-shadow: none;
}

.modern-sidebar .nav-icon,
.modern-sidebar .nav-icon svg {
  width: 19px;
  height: 19px;
}

.modern-sidebar .nav-icon { flex-basis: 19px; }
.modern-sidebar .nav-icon svg { stroke-width: 1.75; }
.modern-sidebar .nav-link.active .nav-icon { color: var(--brand); }
.modern-sidebar .nav-label { font-size: 10px; font-weight: 600; }
.modern-sidebar .nav-link.active .nav-label { font-weight: 720; }

.modern-sidebar .nav-count,
.modern-sidebar .nav-link.active .nav-count {
  min-width: 21px;
  padding: 2px 6px;
  color: var(--brand);
  background: var(--surface);
  border: 1px solid rgba(255,76,0,.18);
  border-radius: 7px;
  font-size: 8px;
}

.modern-sidebar .sidebar-footer {
  padding: 11px 12px;
  border-top: 1px solid #ecece9;
}

.modern-sidebar-status {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
}

.modern-sidebar-status .status-copy strong { color: #2f302e; font-size: 9.5px; }
.modern-sidebar-status .status-copy small { color: #aaa9a5; font-size: 7.5px; }

.workspace { margin-left: var(--sidebar-width); }

.topbar {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px clamp(18px,2.5vw,34px);
}

.topbar-heading-row { display: flex; min-width: 0; align-items: center; gap: 11px; }
.topbar-heading h1 { font-size: 20px; }
.mobile-bottom-nav { display: none !important; }

body.sidebar-collapsed .modern-sidebar { width: var(--sidebar-collapsed); }
body.sidebar-collapsed .workspace { margin-left: var(--sidebar-collapsed); }
body.sidebar-collapsed .modern-sidebar .sidebar-brand { justify-content: center; padding-inline: 10px; }
body.sidebar-collapsed .modern-sidebar .brand-full,
body.sidebar-collapsed .modern-sidebar .nav-label,
body.sidebar-collapsed .modern-sidebar .nav-count,
body.sidebar-collapsed .modern-sidebar .sidebar-section-label,
body.sidebar-collapsed .modern-sidebar .status-copy { display: none; }
body.sidebar-collapsed .modern-sidebar .brand-mark { display: block; }
body.sidebar-collapsed .modern-sidebar .sidebar-collapse {
  position: absolute;
  top: 53px;
  right: -10px;
  width: 24px;
  height: 24px;
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(18,18,18,.09);
}
body.sidebar-collapsed .modern-sidebar .sidebar-collapse svg { width: 13px; transform: rotate(180deg); }
body.sidebar-collapsed .modern-sidebar .sidebar-nav { padding: 17px 10px; }
body.sidebar-collapsed .modern-sidebar .nav-link { justify-content: center; padding: 0; }
body.sidebar-collapsed .modern-sidebar .nav-link.active { box-shadow: inset 0 0 0 1px rgba(255,76,0,.16); }
body.sidebar-collapsed .modern-sidebar-status { justify-content: center; padding-inline: 0; }

@media (max-width: 980px) {
  .modern-sidebar { width: var(--sidebar-collapsed); }
  .workspace { margin-left: var(--sidebar-collapsed); }
  .modern-sidebar .sidebar-brand { justify-content: center; padding-inline: 10px; }
  .modern-sidebar .brand-full,
  .modern-sidebar .nav-label,
  .modern-sidebar .nav-count,
  .modern-sidebar .sidebar-section-label,
  .modern-sidebar .status-copy { display: none; }
  .modern-sidebar .brand-mark { display: block; }
  .modern-sidebar .sidebar-collapse { display: none; }
  .modern-sidebar .sidebar-nav { padding: 14px 10px; }
  .modern-sidebar .nav-link { justify-content: center; padding: 0; }
  .modern-sidebar-status { justify-content: center; padding-inline: 0; }
}

@media (max-width: 760px) {
  .modern-sidebar,
  body.sidebar-collapsed .modern-sidebar {
    width: min(250px,calc(100vw - 28px));
    transform: translateX(-103%);
    box-shadow: 20px 0 50px rgba(18,18,18,.14);
  }

  .workspace,
  body.sidebar-collapsed .workspace { margin-left: 0; }
  .modern-sidebar .sidebar-brand,
  body.sidebar-collapsed .modern-sidebar .sidebar-brand { justify-content: flex-start; padding: 12px 16px; }
  .modern-sidebar .brand-full,
  body.sidebar-collapsed .modern-sidebar .brand-full { display: flex; }
  .modern-sidebar .brand-mark,
  body.sidebar-collapsed .modern-sidebar .brand-mark { display: none; }
  .modern-sidebar .sidebar-collapse { display: none; }
  .modern-sidebar .sidebar-nav,
  body.sidebar-collapsed .modern-sidebar .sidebar-nav { padding: 14px 10px; }
  .modern-sidebar .sidebar-section-label,
  .modern-sidebar .nav-label,
  .modern-sidebar .nav-count,
  .modern-sidebar .status-copy,
  body.sidebar-collapsed .modern-sidebar .sidebar-section-label,
  body.sidebar-collapsed .modern-sidebar .nav-label,
  body.sidebar-collapsed .modern-sidebar .nav-count,
  body.sidebar-collapsed .modern-sidebar .status-copy { display: block; }
  .modern-sidebar .nav-link,
  body.sidebar-collapsed .modern-sidebar .nav-link { justify-content: flex-start; padding: 0 11px; }
  .modern-sidebar-status,
  body.sidebar-collapsed .modern-sidebar-status { justify-content: flex-start; padding: 7px 9px; }
  body.mobile-nav-open .modern-sidebar { transform: translateX(0); }
  .mobile-menu-button { display: grid; }
}

/* Sidebar-free shell: compact desktop tabs and persistent mobile navigation. */
.workspace,
body.sidebar-collapsed .workspace {
  margin-left: 0;
}

.topbar {
  display: grid;
  min-height: 72px;
  grid-template-columns: 148px minmax(420px,1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 9px clamp(18px,2.5vw,36px);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.topbar-brand {
  display: flex;
  width: 142px;
  height: 48px;
  cursor: pointer;
  align-items: center;
  padding: 0;
  background: transparent;
  border: 0;
}

.topbar-brand img {
  width: 132px;
  height: 38px;
  object-fit: contain;
  object-position: left center;
}

.topbar-navigation {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.topbar-navigation .topbar-nav-link {
  width: auto;
  min-height: 42px;
  flex: 0 1 auto;
  gap: 8px;
  margin: 0;
  padding: 0 13px;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-radius: 10px;
  box-shadow: none;
}

.topbar-navigation .topbar-nav-link:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.topbar-navigation .topbar-nav-link.active {
  color: var(--text);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px rgba(255,76,0,.1);
}

.topbar-navigation .topbar-nav-link.active .nav-icon { color: var(--brand); }
.topbar-navigation .nav-icon,
.topbar-navigation .nav-icon svg { width: 18px; height: 18px; }
.topbar-navigation .nav-icon { flex-basis: 18px; }
.topbar-navigation .nav-icon svg { stroke-width: 1.8; }
.topbar-navigation .nav-label { flex: 0 1 auto; font-size: 10px; font-weight: 620; }
.topbar-navigation .topbar-nav-link.active .nav-label { font-weight: 720; }

.topbar-nav-badge {
  display: grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: 6px;
  font-size: 7.5px;
  font-weight: 760;
}

.mobile-bottom-nav { display: none; }

@media (max-width: 980px) {
  .topbar { grid-template-columns: 126px minmax(360px,1fr) auto; gap: 10px; padding-inline: 16px; }
  .topbar-brand { width: 120px; }
  .topbar-brand img { width: 112px; }
  .topbar-navigation .topbar-nav-link { padding-inline: 10px; }
  .topbar-navigation .nav-label { font-size: 9px; }
  .topbar-actions .account-button { min-width: 42px; width: 42px; }
  .topbar-actions .account-copy,
  .topbar-actions .account-button > [data-icon] { display: none; }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 62px;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 7px 13px;
  }

  .topbar-brand { width: 118px; height: 44px; }
  .topbar-brand img { width: 112px; height: 34px; }
  .topbar-navigation { display: none; }

  .page-container {
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }

  .mobile-bottom-nav {
    position: fixed;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    z-index: 70;
    display: grid;
    min-height: 64px;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 3px;
    padding: 6px;
    background: rgba(255,255,255,.94);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 16px 42px rgba(18,18,18,.16);
    backdrop-filter: blur(18px);
  }

  .mobile-bottom-nav .mobile-nav-link {
    display: grid;
    width: 100%;
    min-height: 50px;
    grid-template-rows: 20px auto;
    place-items: center;
    align-content: center;
    gap: 4px;
    margin: 0;
    padding: 4px 2px;
    color: var(--text-faint);
    background: transparent;
    border-radius: 12px;
    box-shadow: none;
  }

  .mobile-bottom-nav .mobile-nav-link.active {
    color: var(--brand);
    background: var(--brand-soft);
  }

  .mobile-bottom-nav .nav-icon,
  .mobile-bottom-nav .nav-icon svg { width: 19px; height: 19px; }
  .mobile-bottom-nav .nav-icon { flex-basis: 19px; }
  .mobile-bottom-nav .nav-label { display: block; flex: none; font-size: 7.5px; font-weight: 680; }
  .mobile-nav-dot { position: absolute; top: 7px; right: calc(50% - 17px); width: 6px; height: 6px; background: var(--brand); border: 2px solid #fff; border-radius: 50%; }
}

/* Promotion preview uses the same iPhone frame as the menu editor. */
.promo-phone {
  position: relative;
  width: min(100%, 300px);
  height: auto;
  aspect-ratio: 390 / 844;
  margin-top: 14px;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 1px dashed var(--border-strong);
  border-radius: 34px;
  box-shadow: 0 12px 32px rgba(18,18,18,.06);
}

.promo-phone-island {
  top: 10px;
  width: 72px;
  height: 18px;
  background: #181818;
}

.promo-phone::after {
  position: absolute;
  bottom: 9px;
  left: 50%;
  z-index: 6;
  width: 88px;
  height: 4px;
  background: #d4d4d1;
  border-radius: 999px;
  content: "";
  transform: translateX(-50%);
}

.promo-phone-screen {
  height: 100%;
  border-radius: 33px;
}

.promo-phone-screen > button {
  top: 34px;
  right: 14px;
}

.promo-phone-screen > img { height: 54%; }
.promo-phone-copy { padding: 18px; }
.promo-phone-copy h3 { font-size: 17px; }
.promo-phone-copy p { font-size: 9.5px; }

@media (max-width: 980px) and (min-width: 761px) {
  .promo-builder-body { grid-template-columns: minmax(0,1fr) 348px; }
  .promo-preview-pane { padding-inline: 23px; }
  .promo-phone { width: 300px; }
}

/* Keep promotion artwork inside a modal, while preserving the exact light phone shell. */
.promo-preview-pane {
  min-height: 0;
  overflow: hidden;
  grid-template-rows: auto minmax(0,1fr);
  gap: 12px;
}

.promo-builder-modal {
  display: grid;
  height: min(860px, calc(100vh - 36px));
  max-height: calc(100vh - 36px);
  grid-template-rows: auto minmax(0,1fr) auto;
}

.promo-builder-body {
  min-height: 0;
  overflow: hidden;
}

.promo-editor {
  min-height: 0;
  max-height: none;
}

.promo-phone {
  display: block;
  width: auto;
  height: min(100%, 650px);
  max-width: 100%;
  aspect-ratio: 390 / 844;
  align-self: center;
  justify-self: center;
  margin: 0;
  padding: 0;
  background: #fff;
  border: 1px dashed #d4d4cf;
  border-radius: 34px;
  box-shadow: 0 12px 32px rgba(18,18,18,.06);
}

.promo-phone::after { display: none; }

.promo-phone-island {
  top: 10px;
  z-index: 10;
  width: 72px;
  height: 18px;
  background: #181818;
  border-radius: 999px;
}

.promo-phone-home {
  position: absolute;
  bottom: 9px;
  left: 50%;
  z-index: 10;
  width: 88px;
  height: 4px;
  background: #d4d4d1;
  border-radius: 999px;
  transform: translateX(-50%);
}

.promo-phone-screen {
  position: absolute;
  inset: 0;
  height: auto;
  overflow: hidden;
  background: #fff;
  border-radius: 33px;
}

.promo-phone-popup {
  position: absolute;
  top: 50%;
  right: 4%;
  left: 4%;
  z-index: 4;
  display: flex;
  flex-direction: column;
  max-height: 92%;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(18,18,18,.08);
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(18,18,18,.2);
  transform: translateY(-50%);
}

.promo-phone-popup > button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  display: grid;
  width: 28px;
  height: 28px;
  cursor: pointer;
  place-items: center;
  color: #fff;
  background: rgba(18,18,18,.66);
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
}

.promo-phone-popup > img {
  display: block;
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  object-fit: cover;
}

.promo-phone-copy {
  flex-shrink: 0;
  padding: 17px 17px 19px;
  color: var(--text);
  background: #fff;
}

.promo-phone-copy h3 { margin: 0; font-size: 15px; font-weight: 640; line-height: 1.15; letter-spacing: -.02em; }
.promo-phone-copy p { margin: 6px 0 0; color: var(--text-soft); font-size: 10px; line-height: 1.45; }

.promo-phone-screen.image-only .promo-phone-popup > img {
  width: 100%;
  height: auto;
  max-height: none;          /* lo limita el max-height del popup, igual que el real */
  object-fit: contain;
  background: #fff;
}

@media (max-height: 760px) and (min-width: 761px) {
  .promo-phone-copy { padding: 13px 14px 15px; }
}
/* Inline ingredient creation keeps the editor fast and compact. */
.ingredient-wrap {
  align-items: center;
}

.ingredient-wrap > .ingredient-chip {
  padding-right: 6px;
  background: var(--surface);
}

.ingredient-chip b {
  font-size: 8px;
  font-weight: 560;
}

.ingredient-wrap > .ingredient-chip button {
  display: grid;
  width: 22px;
  height: 22px;
  padding: 0;
  place-items: center;
  border-radius: 7px;
  font-size: 15px;
  line-height: 1;
}

.ingredient-wrap > .ingredient-chip button:hover {
  color: #a32a1c;
  background: #fff0ed;
}

.ingredient-add {
  gap: 6px;
  color: var(--brand);
  border-color: rgba(255,76,0,.3);
  font-weight: 650;
}

.ingredient-add svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.ingredient-add:hover {
  background: var(--brand-soft);
  border-color: rgba(255,76,0,.48);
}

.ingredient-entry {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--brand);
  border-radius: 10px;
  box-shadow: 0 0 0 3px rgba(255,76,0,.08);
}

.ingredient-entry[hidden] { display: none; }

.ingredient-entry input {
  width: 150px;
  height: 36px;
  padding: 0 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 9px;
}

.ingredient-entry button {
  display: grid;
  width: 32px;
  height: 32px;
  cursor: pointer;
  place-items: center;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--border);
}

.ingredient-entry button:hover { color: var(--text); background: var(--surface-soft); }
.ingredient-entry .ingredient-confirm { color: var(--brand); }
.ingredient-entry svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }

.ingredient-help {
  margin: 8px 0 0;
  color: var(--text-faint);
  font-size: 7.5px;
}

/* Light sidebar: keep the reference's proportions and hierarchy, not its color. */
:root {
  --sidebar-width: 236px;
  --sidebar-collapsed: 72px;
}

.sidebar {
  color: var(--text);
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: none;
}

.sidebar-brand {
  min-height: 74px;
  padding: 13px 13px 12px 17px;
  border-bottom-color: var(--border);
}

.brand-mark { filter: brightness(0); }

.brand-mark { width: 35px; height: 35px; }

.sidebar .dark-button {
  width: 34px;
  height: 34px;
  color: var(--text-soft);
  background: var(--surface-soft);
  border-color: var(--border);
  border-radius: 10px;
}

.sidebar .dark-button:hover {
  color: var(--text);
  background: var(--surface-strong);
  border-color: var(--border-strong);
}

.sidebar-context {
  padding: 12px 11px;
  border-bottom-color: var(--border);
}

.sidebar-context-label,
.sidebar-section-label {
  margin: 0 8px 8px;
  color: var(--text-faint);
  font-size: 8px;
  letter-spacing: .1em;
}

.sidebar-restaurant {
  height: 50px;
  gap: 9px;
  padding: 6px 9px 6px 6px;
  color: var(--text);
  background: var(--surface-soft);
  border-color: var(--border);
  border-radius: 11px;
  box-shadow: none;
}

.sidebar-restaurant:hover {
  background: var(--surface-strong);
  border-color: var(--border-strong);
}

.sidebar-restaurant-avatar {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  border-radius: 9px;
  box-shadow: none;
  font-size: 13px;
}

.sidebar-restaurant-copy strong { font-size: 10.5px; font-weight: 680; }
.sidebar-restaurant-copy small { color: var(--text-faint); font-size: 8px; }
.sidebar-restaurant-chevron { color: var(--text-faint); }

.sidebar-nav { padding: 14px 11px; }

.sidebar .nav-link {
  min-height: 44px;
  gap: 11px;
  margin: 2px 0;
  padding: 0 11px;
  color: #70716e;
  border-radius: 10px;
}

.sidebar .nav-icon {
  width: 19px;
  height: 19px;
  flex-basis: 19px;
}

.sidebar .nav-icon svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.75;
}

.sidebar .nav-label { font-size: 10.5px; font-weight: 570; }

.sidebar .nav-link:hover {
  color: var(--text);
  background: #f7f7f5;
}

.sidebar .nav-link.active {
  color: var(--text);
  background: #fff0ea;
  box-shadow: inset 2px 0 0 var(--brand);
}

.sidebar .nav-link.active .nav-icon { color: var(--brand); }
.sidebar .nav-link.active .nav-label { font-weight: 700; }

.sidebar .nav-count,
.sidebar .nav-link.active .nav-count {
  min-width: 21px;
  padding: 2px 6px;
  color: var(--brand);
  background: var(--surface);
  border: 1px solid rgba(255,76,0,.2);
  border-radius: 7px;
  font-size: 8px;
}

.sidebar-footer {
  padding: 10px 11px;
  border-top-color: var(--border);
}

.sidebar .system-status {
  min-height: 40px;
  padding: 8px 10px;
  background: var(--surface-soft);
  border-color: var(--border);
  border-radius: 10px;
}

.sidebar .status-copy strong { color: var(--text); font-size: 9.5px; }

body.sidebar-collapsed .sidebar-collapse {
  top: 58px;
  right: -1px;
  color: var(--text-soft);
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 3px 10px rgba(18,18,18,.08);
}

body.sidebar-collapsed .sidebar-restaurant {
  width: 42px;
  height: 42px;
}

body.sidebar-collapsed .sidebar-restaurant-avatar {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}

@media (max-width: 980px) {
  .sidebar-restaurant {
    width: 42px;
    height: 42px;
  }

  .sidebar-restaurant-avatar {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }
}

body.sidebar-collapsed .nav-link { min-height: 44px; }
body.sidebar-collapsed .nav-link.active { box-shadow: inset 0 0 0 1px rgba(255,76,0,.24); }

@media (max-width: 760px) {
  .sidebar { width: min(254px, calc(100vw - 28px)); }

  .sidebar-restaurant,
  body.sidebar-collapsed .sidebar-restaurant {
    width: 100%;
    height: 50px;
  }

  .sidebar-restaurant-avatar,
  body.sidebar-collapsed .sidebar-restaurant-avatar {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }
}

@media (max-width: 760px) {
  .sidebar { width: min(270px, calc(100vw - 28px)); }

  .sidebar-context,
  body.sidebar-collapsed .sidebar-context {
    display: block;
    padding: 14px 12px 13px;
  }

  .sidebar-context-label,
  .sidebar-section-label,
  .sidebar-restaurant-copy,
  .sidebar-restaurant-chevron,
  body.sidebar-collapsed .sidebar-context-label,
  body.sidebar-collapsed .sidebar-section-label,
  body.sidebar-collapsed .sidebar-restaurant-copy,
  body.sidebar-collapsed .sidebar-restaurant-chevron { display: block; }

  .sidebar-restaurant,
  body.sidebar-collapsed .sidebar-restaurant {
    width: 100%;
    height: 54px;
    justify-content: flex-start;
    padding: 7px 10px 7px 7px;
  }

  .sidebar-restaurant-copy,
  body.sidebar-collapsed .sidebar-restaurant-copy { display: block; }

  .sidebar-restaurant-chevron,
  body.sidebar-collapsed .sidebar-restaurant-chevron { display: grid; }

  .sidebar-restaurant-avatar,
  body.sidebar-collapsed .sidebar-restaurant-avatar {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 10px;
  }
}

/* Final sidebar cascade: supersedes the discarded sidebar experiments above. */
:root {
  --sidebar-width: 218px;
  --sidebar-collapsed: 70px;
}

.modern-sidebar.sidebar { width: var(--sidebar-width); background: var(--surface); border-right-color: #e8e8e5; box-shadow: none; }
.modern-sidebar .nav-link { min-height: 44px; gap: 11px; margin: 2px 0; padding: 0 11px; color: #6f706d; background: transparent; border-radius: 11px; box-shadow: none; }
.modern-sidebar .nav-link:hover { color: var(--text); background: #f7f7f5; }
.modern-sidebar .nav-link.active { color: var(--text); background: #fff1eb; box-shadow: none; }
.modern-sidebar .nav-link.active .nav-icon { color: var(--brand); }
.modern-sidebar .nav-label { font-size: 10px; font-weight: 600; }
.modern-sidebar .nav-link.active .nav-label { font-weight: 720; }
.modern-sidebar .nav-count,
.modern-sidebar .nav-link.active .nav-count { min-width: 21px; padding: 2px 6px; color: var(--brand); background: var(--surface); border: 1px solid rgba(255,76,0,.18); border-radius: 7px; font-size: 8px; }

body.sidebar-collapsed .modern-sidebar.sidebar { width: var(--sidebar-collapsed); }

@media (max-width: 980px) {
  .modern-sidebar.sidebar { width: var(--sidebar-collapsed); }
}

@media (max-width: 760px) {
  .modern-sidebar.sidebar,
  body.sidebar-collapsed .modern-sidebar.sidebar {
    width: min(250px,calc(100vw - 28px));
    transform: translateX(-103%);
  }

  body.mobile-nav-open .modern-sidebar.sidebar { transform: translateX(0); }
  .modern-sidebar .sidebar-brand,
  body.sidebar-collapsed .modern-sidebar .sidebar-brand { justify-content: flex-start; padding: 12px 16px; }
  .modern-sidebar .sidebar-nav,
  body.sidebar-collapsed .modern-sidebar .sidebar-nav { padding: 14px 10px; }
  .modern-sidebar .nav-link,
  body.sidebar-collapsed .modern-sidebar .nav-link { justify-content: flex-start; padding: 0 11px; }
  .modern-sidebar .sidebar-section-label,
  .modern-sidebar .nav-label,
  .modern-sidebar .nav-count,
  .modern-sidebar .status-copy,
  body.sidebar-collapsed .modern-sidebar .sidebar-section-label,
  body.sidebar-collapsed .modern-sidebar .nav-label,
  body.sidebar-collapsed .modern-sidebar .nav-count,
  body.sidebar-collapsed .modern-sidebar .status-copy { display: block; }
  .modern-sidebar .brand-full,
  body.sidebar-collapsed .modern-sidebar .brand-full { display: flex; }
  .modern-sidebar .brand-mark,
  body.sidebar-collapsed .modern-sidebar .brand-mark { display: none; }
}

/* Shell positioning must win over the removed top-navigation experiment. */
.app-shell > .workspace {
  width: auto;
  min-width: 0;
  margin-left: var(--sidebar-width);
}

.app-shell .topbar {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px clamp(18px,2.5vw,34px);
}

body.sidebar-collapsed .app-shell > .workspace {
  margin-left: var(--sidebar-collapsed);
}

@media (max-width: 980px) {
  .app-shell > .workspace,
  body.sidebar-collapsed .app-shell > .workspace {
    margin-left: var(--sidebar-collapsed);
  }
}

@media (max-width: 760px) {
  .app-shell > .workspace,
  body.sidebar-collapsed .app-shell > .workspace {
    width: 100%;
    margin-left: 0;
  }

  .app-shell .topbar {
    display: flex;
    min-height: 64px;
    padding: 9px 13px;
  }

  .app-shell .page-container {
    padding-bottom: 42px;
  }
}

/* ==========================================================================
   LOGIN DEL PANEL DE CLIENTE — tarjeta centrada sobre degradado naranja + arcos.
   Va al final del archivo a propósito: por orden de cascada gana a .button y a
   la pasada de marca posterior, que si no le pisarían el alto y el radio al CTA.
   Todos los ids y la estructura respetan el contrato de app.js.
   ========================================================================== */

.client-login {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 28px;
  background:
    radial-gradient(125% 92% at 50% -18%,
      color-mix(in srgb, var(--brand) 16%, transparent) 0%,
      color-mix(in srgb, var(--brand) 5%, transparent) 38%,
      transparent 68%),
    linear-gradient(180deg, color-mix(in srgb, var(--brand-soft) 42%, var(--bg)) 0%, var(--bg) 58%);
}

/* malla sutil */
.client-login::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .3;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(circle at 50% 26%, #000, transparent 70%);
          mask-image: radial-gradient(circle at 50% 26%, #000, transparent 70%);
}

/* arcos tenues de fondo */
.client-login::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(closest-side, transparent 79%, color-mix(in srgb, var(--brand) 9%, transparent) 79.6%, transparent 81%) 50% 62%/1300px 1300px no-repeat,
    radial-gradient(closest-side, transparent 79%, color-mix(in srgb, var(--brand) 6%, transparent) 79.6%, transparent 81%) 50% 62%/1750px 1750px no-repeat;
}

/* Wordmark suelto arriba a la izquierda.
   OJO: el trazo fino del "360" mide 3px sobre 1186px de ancho. Por debajo de
   ~200px de ancho cae bajo 1 píxel físico y el "360" se deshace. No lo achiques. */
.client-login-mark {
  position: absolute;
  top: 26px;
  left: 28px;
  z-index: 2;
  width: 264px;
  aspect-ratio: 1186 / 248;
  pointer-events: none;
  background: var(--brand);
  -webkit-mask: url("assets/sabor360-wordmark.png") left center/contain no-repeat;
          mask: url("assets/sabor360-wordmark.png") left center/contain no-repeat;
}

/* ---- Tarjeta ---- */
.client-login-box {
  position: relative;
  z-index: 2;
  width: 392px;
  max-width: 94vw;
  padding: 30px 30px 26px;
  text-align: center;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--brand) 12%, var(--border));
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  animation: clientLoginRise 500ms cubic-bezier(.2,.8,.3,1);
}
@keyframes clientLoginRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---- Ícono en cuadro redondeado ---- */
.client-login-badge {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto 15px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 14px;
}
.client-login-badge-mark {
  display: block;
  width: 26px;
  aspect-ratio: 424 / 248;
  background: currentColor;
  -webkit-mask: url("assets/sabor360-icon.png") center/contain no-repeat;
          mask: url("assets/sabor360-icon.png") center/contain no-repeat;
}

/* ---- Títulos (receta tipográfica del propio panel) ---- */
.client-login-title {
  margin: 0;
  color: var(--text);
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -.045em;
  line-height: 1.08;
}
.client-login-sub {
  max-width: 290px;
  margin: 7px auto 20px;
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.6;
}

/* ---- Estado "Preparando tu panel…" (#clientLoginChecking) ---- */
.client-login-status {
  display: flex;
  min-height: 168px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 620;
}
.client-login-status strong { font-weight: 620; }
.client-login-ring {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 2px solid var(--border-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: clientLoginSpin .75s linear infinite;
}
/* Reutiliza @keyframes clientLoginSpin, definido más arriba en este mismo archivo. */

/* ---- Formulario (#clientLoginForm) ---- */
.client-login-fields { display: block; }

/* campo con icono adentro */
.client-login-inp {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  margin-bottom: 9px;
  padding: 0 13px;
  color: var(--text-faint);
  background: var(--surface-strong);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: text;
  transition: border-color 150ms ease, background 150ms ease;
}
/* El input lleva outline:0, que gana al anillo global de :focus-visible (misma
   especificidad, va después en el archivo). El indicador de foco lo pone el
   contenedor: borde a color pleno + halo, visible con ratón y con teclado. */
.client-login-inp:focus-within {
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent);
}
.client-login-inp > svg,
.client-login-eye svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.client-login-inp input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  color: var(--text);
  background: none;
  border: 0;
  outline: 0;
  font-size: 11px;
}
/* Aquí el placeholder es la ÚNICA etiqueta visible del campo, así que tiene que
   leerse: --text-faint da 2.88:1 sobre --surface-strong, por debajo del 4.5:1
   mínimo. Con .62 de alfa sube a 5.02:1. */
.client-login-inp input::placeholder { color: rgba(18, 18, 18, .62); }
html.dark .client-login-inp input::placeholder { color: rgba(245, 245, 244, .58); }
.client-login-inp input[name="license"] { text-transform: uppercase; letter-spacing: .035em; }
/* La licencia se escribe en mayúsculas, pero el placeholder no debe gritar. */
.client-login-inp input[name="license"]::placeholder { text-transform: none; letter-spacing: 0; }
.client-login-inp input:disabled { cursor: wait; opacity: .6; }

/* autofill de Chrome: el input es transparente, sin esto sale un bloque de color */
.client-login-inp input:-webkit-autofill,
.client-login-inp input:-webkit-autofill:hover,
.client-login-inp input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--surface-strong) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-out 0s;
}
.client-login-inp:focus-within input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
}

/* ojito */
.client-login-eye {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 2px;
  color: var(--text-faint);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 150ms ease;
}
.client-login-eye:hover { color: var(--text-soft); }

/* ---- Error (#clientLoginError) ---- */
.client-login-alert {
  min-height: 16px;
  margin: 3px 0 0;
  color: var(--red);
  font-size: 9px;
  font-weight: 620;
  line-height: 1.45;
  text-align: left;
}

/* ---- Botón principal (#clientLoginSubmit) ----
   Hereda la píldora, el naranja y la sombra de .button + .button-primary. */
.client-login-cta {
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  justify-content: center;
  padding-inline: 16px;
  font-size: 10px;
}
.client-login-cta:disabled { cursor: wait; opacity: .68; transform: none; }

/* ---- Pie ---- */
.client-login-note {
  margin: 16px 0 0;
  color: var(--text-faint);
  font-size: 9px;
  line-height: 1.55;
  text-align: center;
}

/* ==================== TEMA OSCURO — selector real: html.dark ==================== */
html.dark .client-login {
  background:
    radial-gradient(125% 92% at 50% -18%,
      rgba(255, 106, 43, .20) 0%,
      rgba(255, 106, 43, .06) 38%,
      transparent 68%),
    linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg) 58%);
}
html.dark .client-login::before { opacity: .45; }
html.dark .client-login::after {
  background:
    radial-gradient(closest-side, transparent 79%, rgba(255, 106, 43, .14) 79.6%, transparent 81%) 50% 62%/1300px 1300px no-repeat,
    radial-gradient(closest-side, transparent 79%, rgba(255, 106, 43, .09) 79.6%, transparent 81%) 50% 62%/1750px 1750px no-repeat;
}
/* --red NO se redefine en html.dark (#c4433b sobre #1a1a1a queda flojo).
   Se corrige localmente para no alterar el resto del panel. */
html.dark .client-login-alert { color: #e06a62; }

/* ==================== MÓVIL / PANTALLAS BAJAS ==================== */
@media (max-width: 520px) {
  .client-login { padding: 20px; }
  .client-login-mark { top: 20px; left: 20px; width: 204px; }
}
@media (max-width: 460px) {
  .client-login-box { width: 100%; padding: 28px 22px 24px; }
  .client-login-title { font-size: 26px; }
}
@media (max-height: 760px) {
  .client-login { align-items: start; padding-top: 96px; padding-bottom: 40px; }
}
@media (max-height: 620px) {
  .client-login { padding-top: 24px; }
  .client-login-mark { display: none; }
}



/* ==========================================================================
   TEMA OSCURO — pasada de armazón.
   Contexto: hasta hoy html.dark no se aplicaba nunca (app.js no tenía interruptor),
   así que el oscuro jamás se había renderizado. Las pasadas de rediseño "lienzo
   blanco" hardcodearon colores claros en vez de usar tokens, y por eso el oscuro
   no llegaba al armazón.
   Los `background: #fff` se pasaron a var(--surface) —idéntico en claro, correcto
   en oscuro—. Aquí quedan los literales que NO coinciden con ningún token: en vez
   de cambiarlos en claro (y arriesgar el tema que ve el cliente), se sobrescriben
   solo en oscuro.
   ========================================================================== */

/* --- Navegación lateral --- */
html.dark .modern-sidebar .nav-link:hover,
html.dark .sidebar .nav-link:hover { background: var(--surface-strong); }
html.dark .modern-sidebar .nav-link.active,
html.dark .sidebar .nav-link.active { color: var(--text); background: var(--brand-soft); }
html.dark .modern-sidebar .nav-link.active .nav-count,
html.dark .sidebar .nav-link.active .nav-count { color: var(--brand); background: var(--bg); }

/* --- Botón de contraer --- */
html.dark .modern-sidebar .sidebar-collapse { background: var(--surface-strong); }
html.dark .modern-sidebar .sidebar-collapse:hover { background: var(--border-strong); }

/* --- Superficies sutiles (#fbfbfa en claro) --- */
/* OJO: la regla clara pone #fbfbfa en DOS selectores (`.overview-rank-row` y
   `.overview-rank-row:last-child`). Aquí solo se corregía el `:last-child`, así
   que en oscuro todas las demás filas se quedaban con la tarjeta casi blanca y
   el texto claro encima: ilegible. Hacen falta los dos. */
html.dark .dish-click-chart .overview-dish-search input,
html.dark .dish-click-chart .overview-rank-row,
html.dark .dish-click-chart .overview-rank-row:last-child,
html.dark .dish-control-panel-compact .dish-control-search .search-field input,
html.dark .promotion-card-footer { background: var(--surface-soft); }

/* --- Equipo --- */
html.dark .member-avatar { color: var(--brand); background: var(--brand-soft); }

/* --- Estado de promociones --- */
html.dark .promotion-card-status { color: #8be1aa; background: #173323; }
html.dark .promotion-card-status.scheduled { color: #e6c879; background: #352d1a; }
/* --- Ingredientes --- */
html.dark .ingredient-wrap > .ingredient-chip button:hover { color: var(--brand); background: var(--brand-soft); }

/* --- El wordmark de la barra hereda currentColor y ya sigue al tema --- */
html.dark .brand-mark { filter: brightness(0) invert(1); }

/* --- Login en oscuro: la tarjeta y los campos necesitan silueta propia.
       Sobre #101010 el borde heredado queda en ~1.75:1 y la sombra negra no
       se ve, así que la tarjeta "flota" sin límite. --- */
html.dark .client-login-box {
  border-color: var(--border-strong);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .04);
}
html.dark .client-login-inp { border-color: var(--border); }
html.dark .client-login-inp:focus-within { border-color: var(--brand); }

/* ============================================================================
   CINTA DEL DEMO DE VENDEDORES
   ----------------------------------------------------------------------------
   Se pinta desde app.js (paintDemoRibbon) como primer hijo de .workspace, así
   que queda POR ENCIMA de la topbar sticky y no se va con el scroll de la ruta.
   Ámbar y no rojo a propósito: no es un error, es un "ojo, esto es real".
   ========================================================================== */
.demo-ribbon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 11px clamp(18px, 2.5vw, 34px);
  background: color-mix(in srgb, var(--amber) 12%, var(--bg));
  border-bottom: 1px solid color-mix(in srgb, var(--amber) 34%, transparent);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.45;
}
.demo-ribbon-pill {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--amber);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.demo-ribbon-copy { flex: 1 1 320px; margin: 0; color: var(--text-soft); }
.demo-ribbon-copy strong { color: var(--text); font-weight: 650; }
.demo-ribbon-copy a { color: var(--amber); font-weight: 600; text-underline-offset: 3px; }
.demo-ribbon-actions { display: flex; flex-shrink: 0; gap: 8px; margin-left: auto; }
.demo-ribbon-actions .button { padding: 7px 13px; font-size: 12.5px; }

/* En pantalla chica la cinta se apila: el texto completo primero y los botones
   a lo ancho, para que no se corten con el botón de menú móvil. */
@media (max-width: 720px) {
  .demo-ribbon { align-items: flex-start; }
  .demo-ribbon-actions { width: 100%; margin-left: 0; }
  .demo-ribbon-actions .button { flex: 1; justify-content: center; }
}

/* El ámbar claro sobre #101010 pierde contraste; se sube el mezclado y se
   aclara el texto del enlace para no bajar de 4.5:1. */
html.dark .demo-ribbon { background: color-mix(in srgb, var(--amber) 20%, var(--bg)); }
html.dark .demo-ribbon-copy a { color: #e6b44a; }
