:root {
  color-scheme: light;
  --bg: #F3F5F9;
  --surface: #FFFFFF;
  --surface-2: #E8ECF3;
  --surface-3: #F8FAFC;
  --ink: #0A1222;
  --ink-2: #344054;
  --muted: #5B6578;
  --line: #DDE3EC;
  --line-strong: #C5CEDB;
  --mint: #1E9E62;
  --mint-dark: #1C6B4F;
  --mint-soft: #E4F1EA;
  --coral: #B4527A;
  --coral-soft: #F9E9EE;
  --amber: #C2630F;
  --amber-soft: #FFF0DC;
  --lavender: #1E3A6E;
  --lavender-soft: #E4EAF5;
  --primary: #1E3A6E;
  --primary-hover: #16305C;
  --blue: #1F4E8C;
  --blue-soft: #E8F0FA;
  --shadow-sm: 0 1px 2px rgba(10, 18, 34, .04), 0 8px 24px rgba(10, 18, 34, .05);
  --shadow-md: 0 18px 55px rgba(10, 18, 34, .12);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --font-display: "Lora", Georgia, serif;
  --font-body: "Manrope", system-ui, sans-serif;
}

/* Weaktony: azul oscuro con blanco (claro) y azul oscuro con negro (oscuro) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; --bg: #05080E; --surface: #0C1322; --surface-2: #141E33; --surface-3: #09101C; --ink: #EEF2F8; --ink-2: #B9C3D3; --muted: #8692A8; --line: #1D2940; --line-strong: #2B3A57; --mint: #36B978; --mint-dark: #86D6AD; --mint-soft: #13332A; --coral: #E58AAE; --coral-soft: #3D2232; --amber: #F2C98A; --amber-soft: #3F3020; --lavender: #8DB1F0; --lavender-soft: #15264A; --blue: #8DB5E2; --blue-soft: #18294A; --primary: #2B5299; --primary-hover: #3461B0; --shadow-sm: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(2,6,16,.3); --shadow-md: 0 18px 55px rgba(2,6,16,.55); }
}

[data-theme="dark"] { color-scheme: dark; --bg: #05080E; --surface: #0C1322; --surface-2: #141E33; --surface-3: #09101C; --ink: #EEF2F8; --ink-2: #B9C3D3; --muted: #8692A8; --line: #1D2940; --line-strong: #2B3A57; --mint: #36B978; --mint-dark: #86D6AD; --mint-soft: #13332A; --coral: #E58AAE; --coral-soft: #3D2232; --amber: #F2C98A; --amber-soft: #3F3020; --lavender: #8DB1F0; --lavender-soft: #15264A; --blue: #8DB5E2; --blue-soft: #18294A; --primary: #2B5299; --primary-hover: #3461B0; --shadow-sm: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(2,6,16,.3); --shadow-md: 0 18px 55px rgba(2,6,16,.55); }

[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, select, input, textarea { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid rgba(25, 184, 137, .38); outline-offset: 3px; }
::selection { background: var(--mint-soft); color: var(--mint-dark); }

.app-shell { display: flex; min-height: 100vh; }
.page-wrap:focus, .page-wrap:focus-visible { outline: none; }
.sidebar { width: 238px; min-height: 100vh; background: var(--surface); border-right: 1px solid var(--line); padding: 28px 14px 18px; display: flex; flex-direction: column; flex: 0 0 238px; }
.brand { display: inline-flex; align-items: center; gap: 10px; padding: 0 12px; min-height: 38px; width: max-content; }
.brand-mark { width: 27px; height: 27px; display: inline-flex; position: relative; transform: rotate(-1deg); }
.brand-mark i { display: block; width: 12px; height: 27px; background: var(--mint); border-radius: 9px 3px 9px 3px; transform: skewX(-25deg) rotate(19deg); position: absolute; }
.brand-mark i:first-child { left: 2px; background: var(--ink); }
.brand-mark i:last-child { right: 1px; }
.brand-word { font-family: var(--font-display); font-size: 20px; font-weight: 800; letter-spacing: -.055em; }
.brand-word > span { color: var(--mint); }
.sidebar-kicker { margin: 48px 14px 12px; color: var(--muted); font-size: 10px; line-height: 1; font-weight: 800; letter-spacing: .14em; }
.side-nav { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 48px; border-radius: 12px; padding: 0 12px; color: var(--ink-2); font-size: 14px; font-weight: 600; transition: background .18s ease, color .18s ease, transform .18s ease; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); transform: translateX(2px); }
.nav-item.active { background: var(--mint-soft); color: var(--mint-dark); font-weight: 700; }
.nav-icon { width: 20px; display: inline-flex; justify-content: center; font-size: 21px; line-height: 1; }
/* Fase 24: el menú muestra el camino del cliente, paso a paso (1 a 4), y las herramientas aparte */
.nav-group-label { margin: 14px 12px 4px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.nav-group-label:first-child { margin-top: 0; }
.nav-step { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 99px; border: 1.5px solid currentColor; font-size: 11px; font-weight: 800; line-height: 1; }
.nav-item.active .nav-step { background: var(--mint-dark); border-color: var(--mint-dark); color: #fff; }
.nav-count { margin-left: auto; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--mint); color: #fff; font-size: 11px; font-weight: 700; }
.nav-count.soft { background: var(--surface-2); color: var(--ink-2); }
.nav-item.active .nav-count { background: var(--mint); color: #fff; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 14px; }
.help-card { display: flex; align-items: center; gap: 9px; text-align: left; width: 100%; padding: 14px 11px; color: var(--ink); background: var(--lavender-soft); border-radius: 14px; font-size: 13px; }
.help-card > span:nth-child(2) { display: grid; gap: 2px; flex: 1; }
.help-card strong { font-size: 12px; font-weight: 700; }
.help-card small { color: var(--ink-2); font-size: 10px; }
.help-spark { color: var(--lavender); font-size: 17px; }
.system-pill { display: flex; align-items: center; gap: 8px; color: var(--ink-2); padding: 0 12px; font-size: 12px; }
.system-pill .icon-button { margin-left: auto; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px var(--mint-soft); display: inline-block; }
.main-content { min-width: 0; width: calc(100% - 238px); }
.topbar { display: flex; height: 80px; align-items: center; justify-content: space-between; padding: 0 44px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); }
.breadcrumb { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.breadcrumb strong { color: var(--ink); font-weight: 600; }
.crumb-divider { color: var(--line-strong); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.quick-search { display: flex; align-items: center; gap: 8px; height: 40px; min-width: 205px; padding: 0 10px 0 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: left; font-size: 12px; }
.quick-search > span:first-child { font-size: 19px; line-height: 1; color: var(--ink-2); }
kbd { border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--muted); padding: 3px 5px; border-radius: 5px; font: 10px var(--font-body); margin-left: auto; white-space: nowrap; }
.icon-button { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; color: var(--ink-2); background: transparent; font-size: 20px; position: relative; }
.icon-button:hover { background: var(--surface-2); color: var(--ink); }
.icon-button.has-dot::after { content: ""; position: absolute; top: 9px; right: 9px; width: 5px; height: 5px; background: var(--coral); border-radius: 50%; border: 2px solid var(--bg); }
.icon-button.tiny { width: 26px; height: 26px; font-size: 18px; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; background: var(--ink); color: var(--surface); border: 2px solid var(--surface); border-radius: 50%; font-size: 11px; font-weight: 800; letter-spacing: .03em; }
.avatar-small { width: 34px; height: 34px; }
.mobile-topbar, .bottom-nav { display: none; }
.page-wrap { width: 100%; max-width: 1280px; padding: 40px 44px 80px; margin: 0 auto; }

.eyebrow { color: var(--muted); font-size: 10px; line-height: 1; font-weight: 800; letter-spacing: .13em; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 28px; }
.page-heading h1 { margin: 0 0 6px; font: 700 clamp(27px, 3vw, 38px)/1.12 var(--font-display); letter-spacing: -.055em; }
.page-heading p { margin: 0; color: var(--ink-2); font-size: 14px; }
.page-heading-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.button { min-height: 44px; display: inline-flex; justify-content: center; align-items: center; gap: 9px; padding: 0 16px; border-radius: 10px; font-weight: 700; font-size: 13px; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; white-space: nowrap; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-primary { background: var(--ink); color: var(--surface); box-shadow: 0 5px 12px rgba(10, 18, 34,.13); }
.button-primary:hover { box-shadow: 0 8px 18px rgba(10, 18, 34,.18); }
.button-mint { background: var(--mint); color: #06372a; }
.button-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.button-soft { background: var(--surface-2); color: var(--ink); }
.button-ghost { background: transparent; color: var(--ink-2); padding-inline: 10px; }
.button-danger { background: var(--coral-soft); color: var(--coral); }
.button-full { width: 100%; }
.button-icon { font-size: 19px; line-height: 1; }

.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.metric-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 17px 17px 15px; box-shadow: var(--shadow-sm); }
.metric-head { display: flex; justify-content: space-between; align-items: center; color: var(--ink-2); font-size: 11px; font-weight: 600; }
.metric-icon { width: 28px; height: 28px; display: grid; place-items: center; background: var(--surface-2); border-radius: 8px; color: var(--ink-2); font-size: 15px; }
.metric-card strong { display: block; margin: 15px 0 5px; font: 700 23px/1 var(--font-display); letter-spacing: -.06em; }
.metric-card small { color: var(--muted); font-size: 11px; }
.metric-card small.positive { color: var(--mint-dark); }
.metric-card small.warning { color: var(--amber); }
.progress-bar { height: 5px; overflow: hidden; background: var(--surface-2); border-radius: 99px; }
.progress-bar > span { display: block; height: 100%; background: var(--mint); border-radius: inherit; }
.metric-card .progress-bar { margin-top: 15px; }

.review-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); align-items: start; gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.batch-card { padding: 20px; margin-bottom: 18px; }
.batch-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.batch-top h2 { margin: 4px 0 5px; font: 700 19px var(--font-display); letter-spacing: -.04em; }
.batch-top p { margin: 0; color: var(--ink-2); font-size: 13px; }
.batch-status { display: inline-flex; align-items: center; gap: 6px; color: var(--mint-dark); background: var(--mint-soft); border-radius: 99px; padding: 6px 9px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.batch-status .status-dot { width: 6px; height: 6px; box-shadow: none; }
.batch-progress { margin: 20px 0 16px; }
.progress-label { display: flex; justify-content: space-between; color: var(--ink-2); font-size: 11px; margin-bottom: 8px; }
.batch-actions { display: flex; align-items: center; gap: 9px; }
.batch-actions .button { min-height: 40px; }
.card-section-label { display: flex; align-items: center; gap: 8px; margin: 25px 0 12px; }
.card-section-label h2 { margin: 0; font: 700 15px var(--font-display); letter-spacing: -.03em; }
.card-section-label span { color: var(--muted); font-size: 11px; }
.review-card { padding: 21px; overflow: hidden; position: relative; }
.review-card::before { content: ""; position: absolute; top: 0; left: 0; bottom: 0; width: 4px; background: var(--mint); }
.client-card-head { display: flex; gap: 14px; align-items: flex-start; }
.client-avatar { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; flex: 0 0 auto; color: var(--ink); font: 800 19px var(--font-display); border: 1px solid rgba(10, 18, 34,.07); overflow: hidden; }
.client-avatar img { width: 100%; height: 100%; object-fit: cover; }
.client-heading { min-width: 0; flex: 1; }
.client-heading-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.client-heading h3 { margin: 1px 0 5px; font: 700 18px/1.2 var(--font-display); letter-spacing: -.045em; }
.priority-badge { display: inline-flex; align-items: center; min-height: 21px; padding: 0 7px; border-radius: 6px; font-size: 10px; font-weight: 800; }
.priority-a { background: var(--mint-soft); color: var(--mint-dark); }
.priority-b { background: var(--blue-soft); color: var(--blue); }
.priority-c { background: var(--amber-soft); color: var(--amber); }
.priority-d { background: var(--coral-soft); color: var(--coral); }
.score { display: flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.score strong { color: var(--ink); font-weight: 800; }
.client-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--ink-2); font-size: 12px; }
.client-meta span { display: inline-flex; align-items: center; gap: 4px; }
.client-reason { padding: 12px 13px; margin: 17px 0; border-radius: 11px; background: var(--surface-3); color: var(--ink-2); font-size: 13px; }
.client-reason strong { color: var(--ink); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.reason-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 0 9px; border-radius: 99px; background: var(--mint-soft); color: var(--mint-dark); font-size: 11px; font-weight: 600; }
.reason-chip.negative { background: var(--coral-soft); color: var(--coral); }
.reason-chip.neutral { background: var(--surface-2); color: var(--ink-2); }
.photo-row { display: flex; gap: 7px; margin-top: 15px; overflow: hidden; }
.photo-tile { width: 65px; height: 54px; display: grid; place-items: center; border-radius: 9px; flex: 0 0 auto; overflow: hidden; background: var(--surface-2); color: var(--muted); font-size: 18px; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-more { width: auto; padding: 0 10px; color: var(--ink-2); font-size: 11px; }
.details-collapse { margin-top: 17px; border-top: 1px solid var(--line); padding-top: 13px; }
.details-collapse summary { display: flex; justify-content: space-between; cursor: pointer; color: var(--ink-2); font-size: 11px; font-weight: 700; list-style: none; }
.details-collapse summary::-webkit-details-marker { display: none; }
.details-collapse summary::after { content: "⌄"; color: var(--muted); font-size: 16px; line-height: 11px; }
.details-collapse[open] summary::after { transform: rotate(180deg); }
.tech-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 12px; }
.tech-stat { padding: 10px; background: var(--surface-3); border-radius: 9px; }
.tech-stat small, .tech-stat strong { display: block; }
.tech-stat small { color: var(--muted); font-size: 10px; }
.tech-stat strong { margin-top: 3px; font-size: 12px; }
.card-actions { display: flex; gap: 9px; margin-top: 20px; }
.card-actions .button { flex: 1; min-width: 0; }
.button-reject { background: var(--coral-soft); color: var(--coral); }
.button-approve { background: var(--mint); color: #06372a; }
.undo-row { display: flex; justify-content: flex-end; margin-top: 10px; }
.undo-button { color: var(--muted); background: transparent; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.review-side { display: grid; gap: 18px; }
.mini-panel { padding: 19px; }
.mini-panel h3 { margin: 0 0 14px; font: 700 15px var(--font-display); letter-spacing: -.035em; }
.mini-panel h3 span { color: var(--muted); font: 500 11px var(--font-body); float: right; margin-top: 3px; }
.activity-list { display: grid; gap: 16px; }
.activity-item { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; }
.activity-icon { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: var(--mint-soft); color: var(--mint-dark); }
.activity-item:nth-child(2) .activity-icon { background: var(--lavender-soft); color: var(--lavender); }
.activity-item:nth-child(3) .activity-icon { background: var(--amber-soft); color: var(--amber); }
.activity-item p { margin: 0; color: var(--ink-2); line-height: 1.35; }
.activity-item strong { color: var(--ink); }
.activity-item time { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.learning-strip { display: flex; align-items: center; gap: 13px; padding: 15px; background: var(--lavender-soft); border-radius: 13px; }
.learning-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; background: var(--primary); color: #fff; border-radius: 10px; }
.learning-strip p { margin: 0; color: var(--ink-2); font-size: 12px; line-height: 1.35; }
.learning-strip strong { color: var(--ink); }

.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px; margin-bottom: 17px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.search-input { min-width: 190px; flex: 1; position: relative; }
.search-input span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; }
.form-control, .search-input input, .select-control, textarea { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-3); padding: 0 12px; color: var(--ink); }
.search-input input { padding-left: 37px; }
.form-control::placeholder, .search-input input::placeholder, textarea::placeholder { color: var(--muted); }
.select-control { min-width: 125px; width: auto; }
.client-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.learning-layout .client-grid { grid-template-columns: 1fr; }
.approved-card { padding: 18px; }
.approved-card .client-card-head { gap: 11px; }
.approved-card .client-avatar { width: 45px; height: 45px; border-radius: 13px; font-size: 16px; }
.approved-card .client-heading h3 { font-size: 15px; }
.approved-card .card-actions { flex-wrap: wrap; }
.approved-card .card-actions .button { flex: 1 1 calc(33% - 8px); font-size: 11px; padding-inline: 9px; }
.status-select { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-3); padding: 0 9px; font-size: 11px; font-weight: 600; }
.note-input { min-height: 50px; resize: vertical; margin-top: 13px; padding-top: 10px; font-size: 12px; }
.contact-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.contact-link { min-height: 30px; display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border-radius: 7px; background: var(--surface-2); color: var(--ink-2); font-size: 11px; font-weight: 600; }
.contact-link:hover { color: var(--ink); background: var(--line); }

.learning-layout { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; align-items: start; }
.rating-summary { display: grid; grid-template-columns: 130px 1fr; gap: 24px; align-items: center; padding: 22px; margin-bottom: 18px; }
.rating-big strong { display: block; font: 800 45px/1 var(--font-display); letter-spacing: -.08em; }
.stars { display: inline-flex; gap: 2px; color: #f2b83f; letter-spacing: 1px; font-size: 16px; }
.rating-big .stars { margin: 8px 0 3px; }
.rating-big small { color: var(--muted); font-size: 11px; }
.rating-bars { display: grid; gap: 8px; }
.rating-row { display: grid; grid-template-columns: 38px 1fr 30px; align-items: center; gap: 8px; color: var(--ink-2); font-size: 11px; }
.rating-row .progress-bar { height: 7px; }
.rating-row .progress-bar span { background: #f2b83f; }
.segmented { display: flex; gap: 4px; padding: 4px; margin-bottom: 15px; background: var(--surface-2); border-radius: 10px; }
.segmented button { flex: 1; min-height: 36px; color: var(--ink-2); background: transparent; border-radius: 7px; font-size: 11px; font-weight: 700; }
.segmented button.active { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm); }
.insight-panel { padding: 20px; }
.insight-panel h3 { margin: 0; font: 700 17px var(--font-display); letter-spacing: -.04em; }
.insight-panel > p { color: var(--ink-2); font-size: 13px; margin: 8px 0 20px; }
.insight-line { display: flex; gap: 10px; padding: 13px 0; border-top: 1px solid var(--line); }
.insight-line > span { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; background: var(--lavender-soft); color: var(--lavender); border-radius: 8px; }
.insight-line strong { display: block; font-size: 12px; }
.insight-line p { margin: 3px 0 0; color: var(--ink-2); font-size: 11px; line-height: 1.35; }
.rubro-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rubro-row:last-child { border-bottom: 0; }
.rubro-row strong { font-size: 12px; }
.rubro-row small { display: block; color: var(--muted); font-size: 10px; }
.rubro-score { color: var(--mint-dark); font-weight: 800; font-size: 13px; }

.form-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr); gap: 18px; align-items: start; }
.form-card { padding: 23px; }
.form-card h2 { margin: 0 0 5px; font: 700 18px var(--font-display); letter-spacing: -.04em; }
.form-card > p { margin: 0 0 22px; color: var(--ink-2); font-size: 13px; }
.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; }
.field-label { color: var(--ink-2); font-size: 12px; font-weight: 700; }
.field-hint { color: var(--muted); font-size: 10px; }
textarea { padding-top: 11px; min-height: 90px; resize: vertical; }
.form-footer { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 21px; padding-top: 18px; border-top: 1px solid var(--line); }
.bookmark-card { padding: 21px; background: var(--ink); color: #fff; border-radius: var(--radius-lg); position: relative; overflow: hidden; }
.bookmark-card::after { content: ""; position: absolute; width: 150px; height: 150px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; right: -55px; top: -60px; }
.bookmark-card .eyebrow { color: rgba(255,255,255,.55); }
.bookmark-card h3 { margin: 10px 0 7px; font: 700 19px var(--font-display); letter-spacing: -.045em; }
.bookmark-card p { color: rgba(255,255,255,.7); font-size: 12px; line-height: 1.45; margin: 0 0 18px; }
.bookmark-code { overflow: hidden; padding: 11px; border-radius: 9px; background: rgba(255,255,255,.09); color: rgba(255,255,255,.75); font: 10px/1.4 monospace; white-space: nowrap; text-overflow: ellipsis; }
.bookmark-card .button { margin-top: 15px; background: var(--mint); color: #06372a; }

.template-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.template-card { padding: 20px; }
.template-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.template-top h3 { margin: 0; font: 700 15px var(--font-display); letter-spacing: -.03em; }
.template-top p { margin: 5px 0 0; color: var(--ink-2); font-size: 11px; }
.template-label { display: inline-flex; padding: 5px 7px; border-radius: 6px; background: var(--lavender-soft); color: var(--lavender); font-size: 9px; font-weight: 800; letter-spacing: .06em; white-space: nowrap; }
.template-card textarea { min-height: 125px; margin: 17px 0 10px; font-size: 13px; line-height: 1.5; }
.template-footer { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; }
.template-footer .button { min-height: 34px; font-size: 11px; }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .4fr); gap: 18px; align-items: start; }
.settings-list { display: grid; gap: 10px; }
.settings-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.settings-group summary { display: flex; align-items: center; gap: 12px; cursor: pointer; min-height: 62px; padding: 0 18px; list-style: none; }
.settings-group summary::-webkit-details-marker { display: none; }
.settings-group summary::after { content: "＋"; margin-left: auto; color: var(--muted); font-size: 19px; }
.settings-group[open] summary::after { content: "−"; }
.settings-group summary strong { display: block; font-size: 13px; }
.settings-group summary small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.settings-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); }
.settings-content { padding: 0 18px 20px; border-top: 1px solid var(--line); }
.settings-content .form-grid { margin-top: 18px; }
.switch-field { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.switch-field:last-child { border-bottom: 0; }
.switch-field strong { display: block; font-size: 12px; }
.switch-field small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.switch { position: relative; width: 41px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-strong); transition: .18s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: white; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.switch input:checked + span { background: var(--mint); }
.switch input:checked + span::before { transform: translateX(17px); }
.usage-card { padding: 20px; }
.usage-card h3 { margin: 0 0 17px; font: 700 15px var(--font-display); letter-spacing: -.03em; }
.usage-item { padding: 14px 0; border-top: 1px solid var(--line); }
.usage-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 11px; }
.usage-top span { color: var(--ink-2); }
.usage-top strong { font-size: 11px; }
.usage-item .progress-bar { height: 7px; }
.activity-log { margin-top: 18px; padding: 20px; }
.activity-log h3 { margin: 0 0 14px; font: 700 15px var(--font-display); }
.log-line { display: flex; gap: 9px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 11px; }
.log-line time { color: var(--muted); white-space: nowrap; }
.log-line span { color: var(--ink-2); }

.client-dialog { border: 0; width: min(720px, calc(100% - 28px)); max-height: min(88vh, 760px); padding: 0; color: var(--ink); background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-md); }
.client-dialog::backdrop { background: rgba(6, 10, 20, .42); backdrop-filter: blur(5px); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 23px 24px 17px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 7px 0 0; font: 700 22px var(--font-display); letter-spacing: -.05em; }
.dialog-body { padding: 22px 24px 26px; overflow-y: auto; }
.dialog-brand { display: flex; align-items: flex-start; gap: 14px; }
.dialog-brand .client-avatar { width: 68px; height: 68px; font-size: 22px; }
.dialog-brand h3 { margin: 1px 0 5px; font: 700 18px var(--font-display); }
.dialog-brand p { margin: 0; color: var(--ink-2); font-size: 13px; }
.color-swatches { display: flex; gap: 6px; margin-top: 10px; }
.color-swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.dialog-section { margin-top: 22px; }
.dialog-section h4 { margin: 0 0 9px; font: 700 12px var(--font-display); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.dialog-section p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.55; }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.product-card { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-3); }
.product-card img { width: 100%; height: 92px; display: block; object-fit: cover; }
.product-card div { padding: 9px; }
.product-card strong, .product-card small { display: block; }
.product-card strong { font-size: 11px; }
.product-card small { margin-top: 3px; color: var(--mint-dark); font-size: 10px; font-weight: 700; }
.dialog-actions { display: flex; gap: 9px; margin-top: 22px; }

.toast-region { position: fixed; z-index: 30; right: 22px; bottom: 22px; display: grid; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: min(360px, calc(100vw - 28px)); padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-md); font-size: 12px; animation: toast-in .22s ease both; }
.toast.success::before { content: "✓"; color: var(--mint-dark); font-weight: 800; }
.toast.error::before { content: "!"; color: var(--coral); font-weight: 800; }
@keyframes toast-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
.command-palette[hidden] { display: none; }
.command-palette { position: fixed; z-index: 40; inset: 0; display: grid; place-items: start center; padding-top: 14vh; }
.palette-backdrop { position: absolute; inset: 0; background: rgba(6, 10, 20,.38); backdrop-filter: blur(3px); }
.palette-card { position: relative; width: min(540px, calc(100% - 28px)); padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow-md); }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 10px; border-bottom: 1px solid var(--line); }
.palette-input > span { color: var(--muted); font-size: 19px; }
.palette-input input { width: 100%; height: 49px; border: 0; outline: 0; background: transparent; }
.palette-results { padding: 6px; display: grid; gap: 3px; }
.palette-result { display: flex; align-items: center; gap: 9px; padding: 10px; border-radius: 8px; color: var(--ink-2); cursor: pointer; font-size: 12px; }
.palette-result:hover { background: var(--surface-2); color: var(--ink); }
.palette-result b { margin-left: auto; font-size: 11px; color: var(--muted); }
.more-menu[hidden] { display: none; }
.more-menu { position: fixed; z-index: 35; inset: 0; display: flex; align-items: flex-end; justify-content: center; }
.more-menu-backdrop { position: absolute; inset: 0; background: rgba(6, 10, 20,.35); backdrop-filter: blur(3px); }
.more-menu-card { position: relative; width: min(430px, calc(100% - 28px)); margin-bottom: 78px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-md); }
.more-menu-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 9px 11px; border-bottom: 1px solid var(--line); font: 700 13px var(--font-display); }
.more-menu-card a { display: flex; align-items: center; gap: 11px; min-height: 58px; padding: 8px 10px; border-radius: 10px; color: var(--ink-2); }
.more-menu-card a:hover { background: var(--surface-2); color: var(--ink); }
.more-menu-card a > span:nth-child(2) { display: grid; gap: 1px; flex: 1; }
.more-menu-card a strong { color: var(--ink); font-size: 12px; }
.more-menu-card a small { color: var(--muted); font-size: 10px; }
.more-menu-card a b { color: var(--muted); }

.login-body { min-height: 100vh; background: var(--bg); }
.login-layout { display: grid; grid-template-columns: minmax(340px, .95fr) minmax(440px, 1.05fr); min-height: 100vh; }
.login-aside { position: relative; overflow: hidden; background: var(--ink); color: #fff; }
.login-aside::before, .login-aside::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; pointer-events: none; }
.login-aside::before { width: 470px; height: 470px; right: -175px; bottom: -130px; }
.login-aside::after { width: 690px; height: 690px; right: -280px; bottom: -245px; }
.login-aside-inner { min-height: 100vh; display: flex; flex-direction: column; padding: 43px 54px; position: relative; z-index: 1; }
.brand-light .brand-mark i:first-child { background: #fff; }
.brand-light .brand-word { color: #fff; }
.login-quote { max-width: 440px; margin: auto 0; padding: 10vh 0 15vh; }
.quote-mark { display: block; color: var(--mint); font: 800 75px/0.7 Georgia, serif; }
.login-quote h1 { margin: 24px 0 20px; max-width: 430px; font: 700 clamp(31px, 4vw, 49px)/1.08 var(--font-display); letter-spacing: -.07em; }
.login-quote p { max-width: 350px; margin: 0; color: rgba(255,255,255,.63); font-size: 15px; line-height: 1.55; }
.login-aside-footer { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.57); font-size: 11px; }
.login-aside-footer .status-dot { background: var(--mint); box-shadow: 0 0 0 4px rgba(25,184,137,.15); }
.login-card-wrap { display: grid; place-items: center; padding: 35px; }
.login-card { width: min(390px, 100%); }
.mobile-login-brand { display: none; align-items: center; gap: 10px; margin-bottom: 60px; }
.login-card h2 { margin: 17px 0 6px; font: 700 32px var(--font-display); letter-spacing: -.06em; }
.login-intro { color: var(--ink-2); margin: 0 0 32px; font-size: 14px; }
#loginForm { display: grid; gap: 9px; }
.password-field { position: relative; }
.password-field input { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-3); padding: 0 48px 0 12px; color: var(--ink); }
.password-field input { padding-right: 48px; }
.password-toggle { position: absolute; top: 4px; right: 4px; width: 38px; height: 38px; border-radius: 8px; color: var(--muted); background: transparent; }
.password-toggle:hover { background: var(--surface-2); }
.field-error { min-height: 18px; margin: 0; color: var(--coral); font-size: 11px; }
.login-note { display: flex; gap: 9px; margin-top: 24px; padding: 12px; background: var(--surface-2); border-radius: 9px; color: var(--ink-2); font-size: 11px; line-height: 1.4; }
.login-note > span:first-child { color: var(--mint-dark); font-weight: 800; }
.demo-hint { margin-top: 25px; text-align: center; color: var(--muted); font-size: 10px; }

.empty-state { padding: 42px 20px; text-align: center; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.empty-state .empty-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 12px; color: var(--mint-dark); background: var(--mint-soft); border-radius: 15px; font-size: 22px; }
.empty-state h3 { margin: 0 0 5px; font: 700 17px var(--font-display); }
.empty-state p { max-width: 300px; margin: 0 auto 17px; color: var(--ink-2); font-size: 12px; }

@media (max-width: 1080px) {
  .page-wrap { padding-inline: 28px; }
  .topbar { padding-inline: 28px; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .metric-grid .metric-card:nth-child(4), .metric-grid .metric-card:nth-child(5) { display: none; }
}
@media (max-width: 820px) {
  .sidebar { display: none; }
  .main-content { width: 100%; padding-top: 64px; padding-bottom: 69px; }
  .mobile-topbar { position: fixed; z-index: 20; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 17px; background: color-mix(in srgb, var(--bg) 94%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
  .mobile-topbar .brand { padding: 0; }
  .mobile-topbar .brand-word { font-size: 18px; }
  .mobile-topbar .brand-mark { transform: scale(.86); transform-origin: left center; margin-right: -3px; }
  .topbar { display: none; }
  .bottom-nav { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; height: calc(65px + env(safe-area-inset-bottom)); display: flex; align-items: flex-start; justify-content: space-around; padding: 7px 7px env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 94%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
  .bottom-item { position: relative; min-width: 56px; min-height: 50px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 5px; color: var(--muted); background: transparent; border-radius: 10px; font-size: 20px; }
  .bottom-item small { font-size: 9px; font-weight: 700; }
  .bottom-item.active { color: var(--mint-dark); background: var(--mint-soft); }
  .bottom-item b { position: absolute; top: 1px; right: 5px; min-width: 14px; height: 14px; display: grid; place-items: center; border-radius: 99px; background: var(--mint); color: #fff; font-size: 8px; }
  .page-wrap { padding: 25px 17px 33px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 17px; margin-bottom: 22px; }
  .page-heading-actions { width: 100%; }
  .page-heading-actions .button { flex: 1; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; margin-bottom: 18px; }
  .metric-grid .metric-card:nth-child(4), .metric-grid .metric-card:nth-child(5) { display: block; }
  .metric-card { padding: 13px; }
  .metric-card strong { margin-top: 11px; font-size: 20px; }
  .metric-card:nth-child(n+4) { display: none; }
  .review-layout, .learning-layout, .form-layout, .settings-grid { grid-template-columns: 1fr; }
  .review-side { display: none; }
  .review-card { padding: 18px 16px; }
  .batch-card { padding: 17px; }
  .batch-actions .button { flex: 1; }
  .batch-actions { flex-wrap: wrap; }
  .kbd-hint { width: 100%; text-align: center; }
  .client-grid, .template-grid { grid-template-columns: 1fr; }
  .filter-bar { align-items: stretch; padding: 9px; }
  .search-input { min-width: 100%; flex-basis: 100%; }
  .select-control { flex: 1; min-width: 0; }
  .approved-card .card-actions .button { flex-basis: calc(50% - 6px); }
  .rating-summary { grid-template-columns: 1fr; gap: 20px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .dialog-head { padding: 19px 17px 14px; }
  .dialog-body { padding: 18px 17px 22px; }
  .toast-region { right: 14px; bottom: 80px; }
}
@media (max-width: 520px) {
  .page-heading h1 { font-size: 29px; }
  .page-heading p { font-size: 13px; }
  .button { padding-inline: 12px; }
  .tech-grid { grid-template-columns: repeat(2, 1fr); }
  .tech-stat:last-child { grid-column: 1/-1; }
  .client-heading h3 { font-size: 16px; }
  .login-layout { display: block; }
  .login-aside { display: none; }
  .login-card-wrap { min-height: 100vh; padding: 32px 23px; align-items: start; }
  .login-card { padding-top: 10vh; }
  .mobile-login-brand { display: flex; margin-bottom: 56px; }
  .login-card h2 { font-size: 29px; }
}
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="on"]) *, :root:not([data-motion="on"]) *::before, :root:not([data-motion="on"]) *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; }
}

/* Capa de marca Weaktony */
.brand-logo { display: block; width: 150px; height: auto; max-height: 40px; object-fit: contain; object-position: left center; }
.brand-light .brand-logo { width: 172px; max-height: 44px; }
.mobile-login-brand .brand-logo { width: 132px; max-height: 34px; }
.page-heading h1, .login-quote h1 { font-family: var(--font-display); font-weight: 500; letter-spacing: -.045em; }
.page-heading h1 { font-style: normal; }
.button-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 18px rgba(30, 58, 110, .22); }
.button-primary:hover { background: var(--primary-hover); box-shadow: 0 11px 24px rgba(30, 58, 110, .28); }
.nav-item.active { background: var(--lavender-soft); color: var(--lavender); }
.nav-count, .nav-item.active .nav-count { background: var(--primary); color: #fff; }
.progress-fill, .progress-bar span { background: var(--lavender); }
.status-dot { background: var(--mint); box-shadow: 0 0 0 4px var(--mint-soft); }
.bottom-item.active { color: var(--lavender); background: var(--lavender-soft); }
.bottom-item.active b { background: var(--primary); }
.login-quote h1 { color: #F3F5F9; }
.login-quote h1 em, .login-quote h1 i { color: #8DB1F0; }


/* ===== Integración con el panel real: piezas que el diseño base no traía ===== */
:focus-visible { outline: 3px solid color-mix(in srgb, var(--lavender) 55%, transparent); outline-offset: 3px; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 60; background: var(--ink); color: var(--surface); padding: 10px 14px; border-radius: 10px; font-weight: 700; }
.skip-link:focus { left: 8px; }
.logo-on-dark { display: none !important; }
[data-theme="dark"] .logo-on-light { display: none !important; }
[data-theme="dark"] .logo-on-dark { display: block !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-on-light { display: none !important; } :root:not([data-theme="light"]) .logo-on-dark { display: block !important; } }
.button[disabled] { opacity: .55; cursor: default; transform: none; }
.button-mint { color: #fff; background: var(--mint-dark); }
[data-theme="dark"] .button-mint { color: #0b2a1d; background: var(--mint); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .button-mint { color: #0b2a1d; background: var(--mint); } }
.button-mint svg { flex: 0 0 auto; }

/* Avatar: iniciales debajo y logo encima */
.client-avatar { position: relative; }
.client-avatar img { position: absolute; inset: 0; z-index: 1; }

/* Calificación */
.rate-box { margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: var(--surface-3); border: 1px dashed var(--line-strong); }
.rate-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.rate-label { color: var(--ink-2); font-size: 12px; font-weight: 700; }
.star-button { min-width: 40px; min-height: 40px; padding: 0; background: transparent; color: var(--line-strong); font-size: 26px; line-height: 1; border-radius: 8px; transition: transform .12s, color .12s; }
.star-button:hover { transform: scale(1.12); }
.star-button.filled { color: #E8A317; }
.rate-hint { color: var(--muted); font-size: 12px; font-weight: 700; }
.rate-hint.good { color: var(--mint-dark); } .rate-hint.bad { color: var(--coral); }
.rate-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rate-tags button { min-height: 32px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.rate-tags button.on.g { background: var(--mint-soft); border-color: var(--mint); color: var(--mint-dark); }
.rate-tags button.on.b { background: var(--coral-soft); border-color: var(--coral); color: var(--coral); }
.rate-note { margin-top: 10px; background: var(--surface); }

/* Avisos de presupuesto y barras */
.alert-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 18px; border-radius: 14px; font-size: 13px; }
.alert-banner a { margin-left: auto; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.alert-banner.warn { background: var(--amber-soft); color: var(--amber); }
.alert-banner.bad { background: var(--coral-soft); color: var(--coral); }
.progress-bar > span.warn { background: var(--amber) !important; }
.progress-bar > span.bad { background: var(--coral) !important; }
.icon-button.has-dot::after { background: var(--amber); }

/* Barra lateral */
.side-budget { display: grid; gap: 6px; padding: 12px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--line); }
.side-budget:hover { border-color: var(--line-strong); }
.side-budget-row { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-2); margin-top: 4px; }
.side-budget-row b { color: var(--ink); }
.side-logout { justify-content: flex-start; color: var(--muted); }

/* Tarjetas */
.client-bio { margin: 0 0 4px; color: var(--ink-2); font-size: 13px; line-height: 1.45; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.review-card.is-approved::before { background: var(--mint); }
.review-card.is-rejected { opacity: .7; }
.review-card.is-rejected::before { background: var(--coral); }
.review-card .card-actions .button { min-height: 52px; font-size: 14px; }
.card-actions-wrap { flex-wrap: wrap; align-items: center; margin-top: 10px; }
.card-actions-wrap .button { flex: 1 1 auto; }
.client-status-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.client-status-row .field-label { margin: 0; }
.client-status-row .status-select { flex: 1; min-height: 40px; font-size: 13px; }
.photo-tile { transition: transform .15s; }
.photo-tile:hover { transform: scale(1.04); }
.details-collapse .chips { margin-top: 12px; }
.mini-panel h3 a { float: right; margin-top: 3px; color: var(--lavender); font: 700 11px var(--font-body); }
.load-more { display: flex; justify-content: center; margin: 22px 0 10px; }
.segmented { flex-wrap: wrap; }
.segmented button { min-height: 40px; font-size: 12px; }

/* Calificados */
.rubro-score .up { color: var(--mint-dark); } .rubro-score .down { color: var(--coral); }
.rating-big .stars { color: #E8A317; font-size: 18px; }

/* Mensajes y agregar */
.vars-hint { margin: -10px 0 18px; padding: 12px 14px; border-radius: 12px; background: var(--lavender-soft); color: var(--ink-2); font-size: 12px; }
.vars-hint code { padding: 2px 6px; border-radius: 6px; background: var(--surface); color: var(--lavender); font-size: 11px; }
.vars-hint a { color: var(--lavender); font-weight: 700; word-break: break-all; }
.bookmark-tip { margin: 14px 0 0 !important; font-size: 11px !important; }
.bookmark-card .bookmark-copy { margin-top: 6px; background: transparent; color: rgba(255,255,255,.8); }

/* Ajustes */
.city-title { margin: 16px 0 8px; font: 700 12px var(--font-body); color: var(--ink-2); }
.city-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.city-chip { position: relative; }
.city-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.city-chip span { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-size: 12px; font-weight: 600; cursor: pointer; }
.city-chip input:checked + span { background: var(--lavender-soft); border-color: var(--lavender); color: var(--lavender); }
.city-chip input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--lavender) 55%, transparent); outline-offset: 2px; }
.kv-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin-top: 16px; font-size: 13px; }
.kv-list span { color: var(--muted); }
.kv-list b { font-weight: 600; color: var(--ink); }
.usage-item small { display: block; margin-top: 6px; }

/* Ficha */
.product-card { display: block; color: inherit; transition: transform .15s; }
.product-card:hover { transform: translateY(-2px); }
.product-card img { height: 140px; }
.product-cat { color: var(--muted) !important; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 9px !important; margin: 0 0 3px !important; }
.product-desc { margin: 5px 0 0 !important; font-size: 11px !important; line-height: 1.35 !important; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dialog-section .button { margin-top: 10px; }
.dialog-actions { flex-wrap: wrap; }

/* Buscador rápido */
.palette-result { width: 100%; text-align: left; background: transparent; border: 0; }
.palette-result small { color: var(--muted); }

@media (max-width: 820px) {
  .page-wrap { padding-top: 18px; }
  .client-status-row { flex-wrap: wrap; }
  .kv-list { grid-template-columns: 1fr; gap: 2px; }
  .kv-list b { margin-bottom: 8px; }
  .product-card img { height: 120px; }
}

/* Superficies siempre oscuras (no cambian con el tema) */
.login-aside, .bookmark-card { background: radial-gradient(120% 90% at 85% 100%, #13284D 0%, #0A1222 45%, #05080E 100%) !important; color: #F3F5F9; }
.bookmark-card .button:not(.bookmark-copy) { background: #8DB1F0; color: #05080E; }
[hidden] { display: none !important; }
.review-layout > *, .learning-layout > *, .settings-grid > *, .form-layout > * { min-width: 0; }
.activity-item p, .log-line span, .client-reason, .kv-list b { overflow-wrap: anywhere; }
.flag { display: inline-grid; place-items: center; min-width: 22px; height: 16px; padding: 0 4px; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); font: 800 9px var(--font-body); letter-spacing: .04em; vertical-align: 1px; }
.rating-row { grid-template-columns: 96px 1fr 30px; }
#view:focus { outline: none; }
@media (max-width: 820px) { .metric-grid .metric-card { display: block !important; } .metric-grid .metric-card:last-child { grid-column: 1 / -1; } }
.client-grid, .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { min-width: 0; }
@media (max-width: 820px) {
  .client-grid, .template-grid { grid-template-columns: minmax(0, 1fr); }
  .filter-bar .select-control { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .approved-card .card-actions .button, .card-actions-wrap .button { flex: 1 1 calc(50% - 6px); white-space: normal; text-align: center; }
  .client-heading h3 { overflow-wrap: anywhere; }
}

/* ===== Legibilidad: el diseño base usaba letra de 9-11 px y se veía pegada ===== */
body { font-size: 15px; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; word-spacing: .02em; }
.brand { gap: 10px; }
.brand-icon { width: 34px; height: 34px; border-radius: 9px; display: block; flex: 0 0 auto; }
.brand-word { font: 600 25px/1 var(--font-display); letter-spacing: -.02em; color: var(--ink); }
.brand-word > span { color: var(--lavender); }
.brand-light .brand-word { color: #F3F5F9; }
.mobile-topbar .brand-icon { width: 30px; height: 30px; }
.mobile-topbar .brand-word { font-size: 22px; }
.mobile-login-brand { gap: 10px; }
.page-heading h1 { letter-spacing: -.025em; line-height: 1.15; }
.login-quote h1 { letter-spacing: -.03em; }
.client-heading h3, .batch-top h2, .mini-panel h3, .insight-panel h3, .form-card h2, .template-top h3, .usage-card h3, .activity-log h3, .dialog-head h2, .dialog-brand h3, .card-section-label h2, .empty-state h3 { letter-spacing: -.015em; }
.metric-card strong { letter-spacing: -.02em; }
.eyebrow { font-size: 11px; letter-spacing: .1em; }
.sidebar-kicker { font-size: 11px; letter-spacing: .1em; }
.nav-item { font-size: 15px; }
.breadcrumb { font-size: 14px; }
.quick-search { font-size: 13px; }
kbd { font-size: 11px; }
.metric-head { font-size: 13px; }
.metric-card small { font-size: 12.5px; }
.batch-top p, .client-reason { font-size: 14px; }
.client-meta { font-size: 13px; }
.score { font-size: 13px; }
.priority-badge { font-size: 11px; min-height: 22px; }
.reason-chip { font-size: 12.5px; min-height: 28px; }
.contact-link { font-size: 13px; min-height: 32px; }
.photo-more { font-size: 12px; }
.details-collapse summary { font-size: 13px; }
.tech-stat small { font-size: 11.5px; } .tech-stat strong { font-size: 13.5px; }
.approved-card .client-heading h3 { font-size: 17px; }
.approved-card .card-actions .button { font-size: 13px; }
.status-select, .note-input { font-size: 13.5px; }
.segmented button { font-size: 13px; }
.rating-row { font-size: 13px; }
.rating-big small { font-size: 12.5px; }
.insight-line strong { font-size: 13.5px; } .insight-line p { font-size: 13px; }
.rubro-row strong { font-size: 13.5px; } .rubro-row small { font-size: 12px; } .rubro-score { font-size: 14px; }
.dialog-section h4 { font-size: 12.5px; }
.dialog-section p { font-size: 14px; }
.field-label { font-size: 13px; }
.field-hint { font-size: 12px; }
.form-control, .search-input input, .select-control, textarea { font-size: 14px; }
.settings-group summary strong { font-size: 15px; } .settings-group summary small { font-size: 12.5px; }
.switch-field strong { font-size: 14px; } .switch-field small { font-size: 12.5px; }
.usage-top, .usage-top strong { font-size: 13px; }
.log-line { font-size: 12.5px; }
.template-top h3 { font-size: 16px; } .template-top p { font-size: 13px; } .template-label { font-size: 10.5px; }
.template-footer { font-size: 12px; }
.product-card strong { font-size: 13px; } .product-card small { font-size: 12px; }
.bookmark-card p { font-size: 13.5px; }
.toast { font-size: 14px; }
.login-note { font-size: 12.5px; }
.palette-result { font-size: 14px; }
.side-budget-row { font-size: 12.5px; }
.system-pill { font-size: 13px; }
@media (max-width: 820px) { .bottom-item small { font-size: 11px; } }

/* ===== Movimiento: una misma forma cambia de estado, con resorte suave (un rebote como máximo) ===== */
:root { --spring: cubic-bezier(.3, 1.25, .5, 1); --spring-soft: cubic-bezier(.35, 1.12, .5, 1); --out: cubic-bezier(.2, .8, .2, 1); }
.button { transition: transform .32s var(--spring), border-radius .32s var(--spring), background-color .2s var(--out), box-shadow .2s var(--out), color .15s; position: relative; }
.button:active { transform: scale(.97); }
/* Botón -> cargador -> check */
.button.is-busy, .button.is-done { color: transparent !important; pointer-events: none; border-radius: 999px; }
.button.is-busy > *, .button.is-done > * { opacity: 0; }
.button.is-busy::after, .button.is-done::after { content: ""; position: absolute; left: 50%; top: 50%; color: var(--ink); }
.button-primary.is-busy::after, .button-primary.is-done::after, .button-mint.is-busy::after, .button-mint.is-done::after, .button-approve.is-busy::after, .button-approve.is-done::after { color: #fff; }
.button.is-busy::after { width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite, pop-in .28s var(--spring) both; }
.button.is-done::after { width: 7px; height: 13px; margin: -9px 0 0 -4px; border: solid currentColor; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); animation: check-in .34s var(--spring) both; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop-in { from { opacity: 0; scale: .4; } to { opacity: 1; scale: 1; } }
@keyframes check-in { from { opacity: 0; scale: .3; } to { opacity: 1; scale: 1; } }

/* Pestañas con indicador líquido */
.segmented { position: relative; flex-wrap: nowrap; isolation: isolate; }
.segmented button { position: relative; z-index: 1; background: transparent !important; box-shadow: none !important; white-space: normal; line-height: 1.2; transition: color .2s; }
.segmented button.active { color: var(--ink); }
.seg-ind { position: absolute; z-index: 0; border-radius: 7px; background: var(--surface); box-shadow: var(--shadow-sm); pointer-events: none; }

/* Interruptor: la perilla se estira al presionar */
.switch span { transition: background-color .25s var(--out); }
.switch span::before { transition: transform .38s var(--spring), width .2s var(--spring-soft), left .2s var(--spring-soft); }
.switch:active span::before { width: 24px; }
.switch input:checked + span::before { transform: translateX(17px); }
.switch:active input:checked + span::before { left: -3px; }

/* Avisos emergentes */
.toast { animation: toast-spring .42s var(--spring) both; transform-origin: bottom right; }
@keyframes toast-spring { from { opacity: 0; transform: translateY(14px) scale(.94); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }

/* Estrellas: pequeño impulso solo en la que acabas de calificar */
.rated-now .star-button.filled { animation: star-pop .36s var(--spring) both; }
.rated-now .star-button.filled:nth-child(2) { animation-delay: .03s; } .rated-now .star-button.filled:nth-child(3) { animation-delay: .06s; }
.rated-now .star-button.filled:nth-child(4) { animation-delay: .09s; } .rated-now .star-button.filled:nth-child(5) { animation-delay: .12s; }
@keyframes star-pop { 0% { transform: scale(.6); } 100% { transform: scale(1); } }
.rated-now .rate-tags { animation: content-in .3s var(--out) both; }

/* Tarjetas: entran suaves, salen hacia el lado de la decisión */
.view-enter > section > * { animation: content-in .3s var(--out) both; }
.view-enter > section > *:nth-child(2) { animation-delay: .04s; } .view-enter > section > *:nth-child(3) { animation-delay: .08s; }
@keyframes content-in { from { opacity: 0; transform: translateY(8px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
.review-card { transition: transform .26s var(--out), opacity .22s var(--out); }
.review-card.leave-right { transform: translateX(40px) rotate(1.5deg); opacity: 0; }
.review-card.leave-left { transform: translateX(-40px) rotate(-1.5deg); opacity: 0; }
.card.approved-card, .metric-card { transition: transform .3s var(--spring), box-shadow .2s var(--out); }
@media (hover: hover) { .card.approved-card:hover, .metric-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); } }
.client-dialog[open] { animation: dialog-in .36s var(--spring) both; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.palette-card, .more-menu-card { animation: dialog-in .3s var(--spring) both; }
.progress-bar > span { transition: width .6s var(--spring-soft); }
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }

/* ===== Animaciones del escenario ===== */
/* Fondo pixel art en Revisión */
.main-content { position: relative; isolation: isolate; }
.pixel-bg { position: fixed; z-index: -1; top: 0; right: 0; width: calc(100% - 238px); height: 100vh; object-fit: cover; image-rendering: pixelated; opacity: .3; pointer-events: none; }
[data-theme="dark"] .pixel-bg { opacity: .32; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pixel-bg { opacity: .32; } }
@media (max-width: 820px) { .pixel-bg { width: 100%; } }
#view .card, #view .metric-card { background-color: var(--surface); }

/* Capas a pantalla completa (intro y resumen) */
.motion-overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: #E9EDF4; animation: overlay-in .35s var(--out) both; }
.motion-overlay.is-leaving { animation: overlay-out .38s var(--out) both; }
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes overlay-out { to { opacity: 0; transform: scale(1.02); } }
.intro-canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.intro-title { position: absolute; left: clamp(20px, 5vw, 64px); top: clamp(20px, 6vh, 64px); max-width: 560px; padding: 18px 22px; border-radius: 18px; background: rgba(243, 245, 249, .9); color: #0A1222; }
.intro-title .eyebrow { color: #5B6578; }
.intro-title h1 { margin: 8px 0 0; font: 600 clamp(24px, 3.4vw, 40px)/1.15 var(--font-display); letter-spacing: -.02em; }
.overlay-controls { position: absolute; right: clamp(16px, 4vw, 48px); bottom: clamp(16px, 5vh, 48px); display: flex; gap: 10px; }
.overlay-controls .button-secondary { background: #fff; color: #0A1222; border-color: #C5CEDB; }
.resumen-overlay { background: #0A1222; grid-template-rows: 1fr auto; padding: clamp(10px, 3vw, 36px); gap: 14px; }
.resumen-stage { width: 100%; height: 100%; display: grid; place-items: center; min-height: 0; }
.resumen-stage canvas { width: min(100%, calc((100vh - 120px) * 16 / 9)); aspect-ratio: 16 / 9; height: auto; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.resumen-bar { width: min(100%, 980px); display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 999px; background: rgba(255,255,255,.08); color: #F3F5F9; }
.resumen-bar .icon-button { color: #F3F5F9; font-size: 18px; }
.resumen-bar .icon-button:hover { background: rgba(255,255,255,.12); color: #fff; }
.resumen-bar input[type=range] { flex: 1; accent-color: #8DB1F0; min-height: 30px; }

/* Ficha: el botón se transforma en la ficha */
.morph { position: fixed; z-index: 70; overflow: hidden; box-shadow: var(--shadow-md); border: 1px solid var(--line); display: grid; place-items: center; pointer-events: none; }
.morph > * { grid-area: 1 / 1; transition: opacity .16s, filter .16s, transform .22s var(--spring); }
.morph-spin { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid #fff; border-right-color: transparent; opacity: 0; animation: spin .7s linear infinite; }
.morph-pill { display: flex; align-items: center; gap: 12px; opacity: 0; filter: blur(4px); transform: scale(.9); white-space: nowrap; max-width: 100%; padding: 0 16px; }
.morph-pill img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.morph-pill b { font: 600 17px var(--font-display); overflow: hidden; text-overflow: ellipsis; }
.morph.st-loading .morph-spin { opacity: 1; }
.morph.st-circle .morph-pill, .morph.st-pill .morph-pill { opacity: 1; filter: none; transform: none; }
.morph.st-circle .morph-pill b { display: none; }
.morph.st-card .morph-pill { opacity: 0; filter: blur(4px); }
.morph.st-gone { opacity: 0; transition: opacity .18s; }
.client-dialog.morph-target { opacity: 0; animation: none !important; }
.client-dialog.morph-target::backdrop { opacity: 0; }
.client-dialog.sections-in { animation: none; }
.client-dialog.sections-in .dialog-brand, .client-dialog.sections-in .kv-list, .client-dialog.sections-in .dialog-section, .client-dialog.sections-in .dialog-actions { animation: content-in .32s var(--out) both; }
.client-dialog.sections-in .kv-list { animation-delay: .06s; }
.client-dialog.sections-in .dialog-section:nth-of-type(1) { animation-delay: .12s; }
.client-dialog.sections-in .dialog-section:nth-of-type(2) { animation-delay: .18s; }
.client-dialog.sections-in .dialog-section:nth-of-type(3) { animation-delay: .24s; }
.client-dialog.sections-in .dialog-section:nth-of-type(4) { animation-delay: .3s; }
.client-dialog.sections-in .product-card { animation: card-drop .36s var(--spring) both; }
.client-dialog.sections-in .product-card:nth-child(1) { animation-delay: .32s; } .client-dialog.sections-in .product-card:nth-child(2) { animation-delay: .35s; }
.client-dialog.sections-in .product-card:nth-child(3) { animation-delay: .38s; } .client-dialog.sections-in .product-card:nth-child(4) { animation-delay: .41s; }
.client-dialog.sections-in .product-card:nth-child(5) { animation-delay: .44s; } .client-dialog.sections-in .product-card:nth-child(6) { animation-delay: .47s; }
.client-dialog.sections-in .product-card:nth-child(n+7) { animation-delay: .5s; }
@keyframes card-drop { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }
.overlay-controls .button-primary { background: var(--primary) !important; color: #fff !important; }
@media (orientation: portrait) { .intro-canvas { object-fit: contain; } .intro-overlay { background: #F3F5F9; } .intro-title { left: 16px; right: 16px; } }

/* ===== Webs de los clientes (Clientes, editor, plantillas) ===== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.site-url { color: var(--lavender); font-weight: 600; overflow-wrap: anywhere; }
.site-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 0 4px; color: var(--ink-2); font-size: 13px; }
.site-stats b { color: var(--ink); font-variant-numeric: tabular-nums; }
.site-stats .warn b { color: var(--amber); }
.site-card .card-actions .button { flex: 1 1 calc(50% - 8px); }
.scan-card { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; margin-top: 18px; padding: 18px; }
.scan-card h3 { margin: 0 0 4px; font: 700 17px var(--font-display); }
.scan-card p { margin: 0; color: var(--ink-2); }
.scan-card .card-actions { grid-column: 1 / -1; margin-top: 4px; }
.switch-field > span:first-child { display: grid; gap: 2px; }
#addForm .switch-field { margin-top: 18px; border-bottom: 0; }

.editor .phone-wrap { display: grid; place-items: center; padding: 8px 0 22px; }
.phone { --w: 390px; --h: 800px; --k: min(1, calc((100vw - 48px) / 414px)); position: relative; width: calc((var(--w) + 24px) * var(--k)); height: calc((var(--h) + 24px) * var(--k)); border-radius: calc(46px * var(--k)); background: #05080E; box-shadow: 0 0 0 1px var(--line-strong), 0 30px 80px -30px rgba(2, 6, 16, .55); }
@media (min-width: 821px) { .phone { --k: min(1, calc((100vh - 220px) / 824px)); } }
.phone iframe { position: absolute; left: calc(12px * var(--k)); top: calc(12px * var(--k)); width: var(--w); height: var(--h); border: 0; border-radius: 34px; background: #0B0C10; transform: scale(var(--k)); transform-origin: 0 0; }
.phone-notch { position: absolute; z-index: 2; left: 50%; top: calc(20px * var(--k)); width: calc(110px * var(--k)); height: calc(26px * var(--k)); border-radius: 99px; background: #05080E; transform: translateX(-50%); }
.chat { max-width: 760px; margin: 0 auto; padding: 18px; }
.chat-log { display: grid; gap: 10px; max-height: 46vh; overflow-y: auto; padding: 2px 2px 8px; }
.chat-hint { margin: 0; color: var(--ink-2); }
.chat-ideas { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.chat-ideas button { cursor: pointer; border: 0; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 16px; animation: content-in .28s var(--out) both; }
.bubble p { margin: 0; white-space: pre-line; }
.bubble.me { justify-self: end; background: var(--primary); color: #fff; border-bottom-right-radius: 6px; }
.bubble.ai { justify-self: start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.bubble .chips { margin-top: 8px; }
.bubble.typing p { color: var(--ink-2); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.chat-form { display: flex; gap: 10px; align-items: flex-end; margin-top: 10px; }
.chat-form textarea { flex: 1; min-height: 52px; font-size: 16px; }
.template-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tpl-card { display: grid; gap: 10px; align-content: start; padding: 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-3); }
.tpl-card.current { border-color: var(--lavender); box-shadow: 0 0 0 2px var(--lavender-soft); }
.tpl-shot { position: relative; aspect-ratio: 390 / 640; overflow: hidden; border-radius: 12px; background: #0B0C10; }
.tpl-shot iframe { position: absolute; left: 0; top: 0; width: 390px; height: 640px; border: 0; transform: scale(var(--k, .44)); transform-origin: 0 0; pointer-events: none; }
.tpl-info { display: grid; gap: 2px; }
.tpl-info small { color: var(--ink-2); font-size: 12.5px; line-height: 1.35; }
/* Títulos de las dos partes de la ventana: tema de temporada y estilos */
.tpl-sec { margin: 6px 0 10px; font-size: 15px; }
.tpl-sec small { display: block; margin-top: 2px; color: var(--ink-2); font-size: 12.5px; font-weight: 400; }
.season-gallery { margin-bottom: 22px; }
#siteDialog { width: min(980px, calc(100% - 28px)); }

/* Celular: el iPhone hace zoom solo al tocar un campo con letra menor a 16 px y la página queda movida.
   Por eso en pantallas táctiles todos los campos usan 16 px, y los botones chicos crecen para el dedo. */
@media (max-width: 820px), (pointer: coarse) {
  .form-control, .search-input input, .select-control, textarea, select, input:not([type=checkbox]):not([type=radio]):not([type=range]) { font-size: 16px; }
  .template-card textarea { font-size: 16px; }
  .icon-button.tiny { width: 40px; height: 40px; }
  .switch { width: 52px; height: 32px; }
  .switch span::before { width: 26px; height: 26px; }
  .switch input:checked + span::before { transform: translateX(20px); }
  .site-url { display: inline-block; padding: 10px 0; margin: -10px 0; }
}

/* Colores de la web (fase 15) */
.pal-layout { display: grid; gap: 16px; }
.pal-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(130px, 42%), 1fr)); gap: 10px; align-content: start; }
.pal-opt { display: grid; gap: 8px; padding: 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-3); color: inherit; text-align: left; cursor: pointer; transition: border-color .2s, box-shadow .2s, transform .2s; }
@media (hover: hover) and (pointer: fine) { .pal-opt:hover { transform: translateY(-2px); } }
.pal-opt[aria-checked="true"] { border-color: var(--lavender); box-shadow: 0 0 0 2px var(--lavender-soft); }
.pal-sw { position: relative; display: block; height: 56px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgb(127 127 127 / .25); overflow: hidden; }
.pal-sw i { position: absolute; left: 10px; bottom: 10px; width: 54%; height: 18px; border-radius: 99px; }
.pal-sw b { position: absolute; right: 10px; top: 10px; width: 22px; height: 22px; border-radius: 50%; opacity: .55; }
.pal-name { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; font-weight: 600; font-size: .92rem; }
.pal-name small { color: var(--lavender); font-weight: 700; font-size: .75rem; }
.pal-custom { display: grid; gap: 12px; margin-top: 14px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-3); animation: pal-abrir .28s cubic-bezier(.2, .8, .2, 1); }
.pal-custom[hidden] { display: none; }
.pal-custom .field-hint { margin: 0; }
/* Cada color: cuadro, nombre con para qué sirve, código; debajo el aviso si sus letras no se leen */
.pal-group { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.pal-group legend { padding: 0; margin-bottom: 2px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pal-field { display: grid; grid-template-columns: 46px minmax(0, 1fr) 104px; gap: 4px 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: border-color .15s ease; }
.pal-field input[type="color"] { width: 46px; height: 46px; padding: 3px; border-radius: 10px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.pal-field-txt { display: grid; gap: 1px; min-width: 0; cursor: pointer; }
.pal-field-txt b { font-size: .92rem; color: var(--ink); }
.pal-field-txt small { font-size: .78rem; line-height: 1.3; color: var(--muted); }
.pal-hex { min-height: 44px; padding: 0 8px; font: 600 15px/1 ui-monospace, "SF Mono", Consolas, monospace; text-transform: lowercase; text-align: center; }
.pal-aviso { grid-column: 1 / -1; margin: 2px 0 0; font-size: .84rem; font-weight: 600; color: var(--coral); }
.pal-aviso:empty { display: none; }
.pal-field.pal-mal { border-color: var(--coral); }
.pal-arreglar { margin-left: 4px; padding: 4px 10px; min-height: 32px; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font: inherit; font-size: .82rem; cursor: pointer; }
.pal-estado { display: grid; gap: 8px; }
.pal-estado p { margin: 0; font-size: .9rem; font-weight: 600; }
.pal-estado-ok { color: var(--mint-dark); }
/* Mensaje para el grupo de WhatsApp de los clientes, debajo del estado de los activos */
.aviso-clientes { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.aviso-clientes textarea { resize: vertical; line-height: 1.5; }
.pal-estado-mal { color: var(--coral); }
.pal-estado-suave { color: var(--amber); font-weight: 500 !important; }
@media (max-width: 420px) { .pal-field { grid-template-columns: 46px minmax(0, 1fr); } .pal-hex { grid-column: 1 / -1; } }
@keyframes pal-abrir { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .pal-custom { animation: none; } }
.pal-preview { display: grid; gap: 12px; align-content: start; }
.pal-preview .tpl-shot { max-width: 300px; width: 100%; justify-self: center; }
@media (min-width: 760px) { .pal-layout { grid-template-columns: 1fr 280px; } .pal-layout > .pal-list, .pal-layout > .pal-custom { grid-column: 1; } .pal-preview { grid-column: 2; grid-row: 1 / span 2; } }
@media (max-width: 759px) { .pal-preview .button { position: sticky; bottom: 8px; z-index: 1; } }

/* Escribirle al cliente: lista de mensajes para elegir y caja para editar */
.msg-list { display: grid; gap: 8px; max-height: min(32vh, 380px); overflow-y: auto; padding: 2px 4px 2px 0; overscroll-behavior: contain; }
.msg-group { margin: 8px 0 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.msg-group:first-child { margin-top: 0; }
.msg-option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-3); cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.msg-option input { margin-top: 3px; accent-color: var(--primary); flex: none; width: 18px; height: 18px; }
.msg-option span { display: grid; gap: 4px; min-width: 0; }
.msg-option b { font-size: 15px; color: var(--ink); }
.msg-option small { font-size: 13px; line-height: 1.45; color: var(--ink-2); white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.msg-option:has(input:checked) { border-color: var(--primary); background: var(--lavender-soft); }
.msg-option:has(input:checked) small { -webkit-line-clamp: unset; display: block; }
.msg-option:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .msg-option:hover { border-color: var(--line-strong); } }
.msg-edit { margin-top: 16px; }
.msg-edit textarea { font-size: 16px; line-height: 1.45; min-height: 110px; }
.msg-footer { position: sticky; bottom: -26px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin: 14px 0 0; padding: 12px 0 4px; background: var(--surface); }
.msg-footer .button { flex: 1 1 auto; justify-content: center; }

/* ---------- Actividad (Maestro): qué hizo cada activo en un día ---------- */
.act-dias { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.act-dias .button { flex: 0 0 auto; }
.act-off { opacity: .45; pointer-events: none; }
.act-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.act-chip { display: inline-flex; gap: 6px; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; font-weight: 600; }
.act-chip b { font-weight: 800; }
.act-chip.on { background: var(--blue-soft); color: var(--blue); }
.act-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.act-card { padding: 16px; min-width: 0; }
.act-vacio { background: var(--surface-3); box-shadow: none; }
.act-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.act-head .client-avatar { width: 44px; height: 44px; border-radius: 13px; font-size: 16px; background: var(--blue-soft); }
.act-quien { min-width: 0; }
.act-quien h3 { margin: 0; font: 700 17px/1.2 var(--font-display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.act-quien small { color: var(--muted); font-size: 13px; }
.act-lista { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 2px; }
.act-mov { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.act-ico { font-size: 18px; line-height: 1.3; text-align: center; }
.act-txt { display: grid; gap: 2px; min-width: 0; font-size: 14px; }
.act-txt strong { font-weight: 700; overflow-wrap: anywhere; }
.act-txt small { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.act-hora { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.act-grid { transition: opacity .15s var(--out); }
.act-cargando { opacity: .55; }
.act-enter > * { animation: content-in .2s var(--out) both; }
.act-enter > *:nth-child(2) { animation-delay: .03s; } .act-enter > *:nth-child(3) { animation-delay: .06s; } .act-enter > *:nth-child(n+4) { animation-delay: .09s; }
@media (max-width: 820px) { .act-grid { grid-template-columns: minmax(0, 1fr); } .act-dias .button { flex: 1 1 0; } }
@media (prefers-reduced-motion: reduce) { :root:not([data-motion="on"]) .act-enter > * { animation: none; } }

/* ---------- Finanzas (Maestro): ingresos, gastos y ganancia del mes ---------- */
.fin-resumen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
.fin-num { padding: 16px; display: grid; gap: 4px; min-width: 0; }
.fin-num small { color: var(--muted); font-size: 13px; font-weight: 700; }
.fin-num strong { font: 700 clamp(22px, 2.6vw, 30px)/1.1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fin-negativo strong { color: var(--coral); }
.fin-seccion { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 26px 0 12px; }
.fin-seccion h2 { margin: 0; font: 700 20px var(--font-display); letter-spacing: -.02em; }
.fin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.fin-card { padding: 16px; min-width: 0; }
.fin-vacio { background: var(--surface-3); box-shadow: none; }
.fin-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fin-quien { min-width: 0; }
.fin-quien h3 { margin: 0; font: 700 17px/1.2 var(--font-display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.fin-quien small, .fin-nada { color: var(--muted); font-size: 13px; }
.fin-total { font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-lista { list-style: none; margin: 12px 0 0; padding: 0; }
.fin-gastos { margin: 0; }
.fin-fila { display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.fin-gastos .fin-fila:first-child { border-top: 0; }
.fin-txt { display: grid; gap: 3px; min-width: 0; flex: 1 1 200px; }
.fin-txt strong { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fin-txt small { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.fin-marca { justify-self: start; padding: 2px 8px; border-radius: 99px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 700; }
.fin-acciones { display: flex; gap: 4px; }
.fin-card-pie { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.fin-nada { margin: 10px 0 0; }
.fin-cuerpo { transition: opacity .15s var(--out); }
.fin-cargando { opacity: .55; }
.fin-form { display: grid; gap: 14px; }
/* En el teléfono los botones quedan a la vista aunque el formulario sea largo. La ventana del Maestro se desplaza entera
   (no su cuerpo), así que el cuerpo no recorta y el pie se pega al borde de abajo de la ventana */
.dialog-body:has(.fin-form) { overflow: visible; }
.fin-form .form-footer { position: sticky; bottom: 0; margin-top: 4px; padding: 12px 0; background: var(--surface); }
.fin-moneda { border: 0; padding: 0; margin: 0; display: flex; gap: 4px 18px; flex-wrap: wrap; }
.fin-moneda legend { padding: 0; }
.fin-moneda label, .fin-check { display: flex; gap: 10px; align-items: center; min-height: 44px; cursor: pointer; }
.fin-check { align-items: flex-start; padding: 8px 0; }
.fin-check span { display: grid; gap: 2px; }
.fin-check small { color: var(--muted); font-size: 13px; }
.fin-equivale { margin: 0; min-height: 1.5em; color: var(--ink-2); font-weight: 700; }
.fin-fijo { margin: 6px 0 0; font-weight: 700; }
@media (max-width: 820px) {
  .fin-resumen { grid-template-columns: minmax(0, 1fr); }
  .fin-num { grid-template-columns: 1fr auto; align-items: baseline; }
  .fin-grid { grid-template-columns: minmax(0, 1fr); }
  .fin-seccion .button { flex: 1 1 auto; }
}
