/* Capta — estilo inspirado en shadcn/ui (tema zinc) */
:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --accent: 240 4.8% 95.9%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  --destructive: 0 72% 51%;
  --ring: 240 5.9% 10%;
  --radius: .5rem;

  --blue: 217 91% 60%;
  --amber: 38 92% 50%;
  --violet: 262 83% 58%;
  --green: 142 71% 40%;
  --red: 0 72% 51%;
}

* { box-sizing: border-box; border-color: hsl(var(--border)); }
html { color-scheme: light; background: hsl(240 4.8% 97.5%); }
html, body { margin: 0; }
body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px; line-height: 1.5;
  background: hsl(240 4.8% 97.5%); color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: inherit; }
.muted { color: hsl(var(--muted-foreground)); }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.wrap { flex-wrap: wrap; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mb-4 { margin-bottom: 16px; }
.p-4 { padding: 16px; } .p-6 { padding: 24px; }
.icon { width: 16px; height: 16px; flex: none; }
.icon-sm { width: 14px; height: 14px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: none; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; background: hsl(var(--background)); border-right: 1px solid hsl(var(--border));
  padding: 14px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; font-weight: 700; font-size: 16px; text-decoration: none; }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); display: grid; place-items: center; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 11.5px; font-weight: 500; color: hsl(var(--muted-foreground)); padding: 14px 10px 4px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: calc(var(--radius) - 2px); color: hsl(var(--muted-foreground)); text-decoration: none; font-weight: 500; }
.nav-link:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
.nav-link.active { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
.sidebar-footer { border-top: 1px solid hsl(var(--border)); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 0 6px; min-width: 0; }
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.user-meta strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { color: hsl(var(--muted-foreground)); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 32px; height: 32px; border-radius: 999px; flex: none; background: hsl(var(--muted)); border: 1px solid hsl(var(--border)); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 24px; background: hsl(var(--background)); border-bottom: 1px solid hsl(var(--border)); position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-size: 18px; flex: 1; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.menu-btn { display: none; }
.content { padding: 24px; max-width: 1500px; width: 100%; margin: 0 auto; }
.sidebar-backdrop { display: none; }

/* ---------- Componentes ---------- */
.card { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 4px); box-shadow: 0 1px 2px rgb(0 0 0 / .04); }
.card-header { padding: 16px 20px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-header h3 { margin: 0; }
.card-header p { color: hsl(var(--muted-foreground)); font-size: 12.5px; }
.card-body { padding: 16px 20px 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid hsl(var(--border)); display: flex; gap: 8px; justify-content: flex-end; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; cursor: pointer;
  height: 36px; padding: 0 14px; border-radius: calc(var(--radius) - 2px); font: inherit; font-weight: 500; text-decoration: none;
  border: 1px solid transparent; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); transition: background .15s, opacity .15s;
}
.btn:hover { opacity: .9; }
.btn:focus-visible, .input:focus-visible, .select:focus-visible, .select-trigger:focus-visible, textarea:focus-visible { outline: 2px solid hsl(var(--ring) / .25); outline-offset: 1px; }
.btn-outline { background: hsl(var(--background)); color: hsl(var(--foreground)); border-color: hsl(var(--input)); }
.btn-outline:hover { background: hsl(var(--accent)); opacity: 1; }
.btn-ghost { background: transparent; color: hsl(var(--foreground)); }
.btn-ghost:hover { background: hsl(var(--accent)); opacity: 1; }
.btn-danger { background: hsl(var(--destructive)); color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-icon { width: 36px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.label .req { color: hsl(var(--destructive)); }
.input, .select, textarea, .select-trigger {
  width: 100%; height: 36px; padding: 0 12px; font: inherit; color: inherit; background: hsl(var(--background));
  border: 1px solid hsl(var(--input)); border-radius: calc(var(--radius) - 2px); box-shadow: 0 1px 2px rgb(0 0 0 / .04);
}
.input-sm { height: 32px; }
textarea { height: auto; min-height: 84px; padding: 8px 12px; resize: vertical; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.select-trigger { display: flex; align-items: center; justify-content: space-between; gap: 6px; cursor: pointer; text-align: left; }
.input::placeholder, textarea::placeholder { color: hsl(var(--muted-foreground)); }
.input:disabled, .select:disabled, textarea:disabled { background: hsl(var(--muted)); cursor: not-allowed; opacity: .8; }
.field { margin-bottom: 14px; }
.hint { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 4px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid .field { margin-bottom: 0; }
.span-2 { grid-column: span 2; }
.section-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: hsl(var(--muted-foreground)); margin: 22px 0 10px; }
.section-title:first-child { margin-top: 0; }

.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 500; border: 1px solid transparent; white-space: nowrap; }
.badge-nuevo { background: hsl(var(--blue) / .12); color: hsl(217 80% 38%); }
.badge-en_gestion { background: hsl(var(--amber) / .15); color: hsl(32 90% 33%); }
.badge-pendiente_pago { background: hsl(var(--violet) / .12); color: hsl(262 60% 45%); }
.badge-matriculado { background: hsl(var(--green) / .14); color: hsl(142 65% 26%); }
.badge-perdido { background: hsl(var(--red) / .1); color: hsl(0 65% 42%); }
.badge-outline { border-color: hsl(var(--border)); color: hsl(var(--foreground)); background: transparent; }
.badge-muted { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }

.alert { padding: 10px 14px; border-radius: var(--radius); border: 1px solid hsl(var(--border)); background: hsl(var(--background)); margin-bottom: 16px; }
.alert-success { border-color: hsl(var(--green) / .4); background: hsl(var(--green) / .08); }
.alert-error { border-color: hsl(var(--red) / .4); background: hsl(var(--red) / .07); color: hsl(0 65% 35%); }
.alert-warning { border-color: hsl(var(--amber) / .5); background: hsl(var(--amber) / .1); }

/* Tablas */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 500; color: hsl(var(--muted-foreground)); padding: 10px 14px; border-bottom: 1px solid hsl(var(--border)); white-space: nowrap; font-size: 12.5px; }
.table td { padding: 11px 14px; border-bottom: 1px solid hsl(var(--border)); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: hsl(var(--muted) / .5); }
.table td.actions { text-align: right; white-space: nowrap; }
.empty { padding: 36px 16px; text-align: center; color: hsl(var(--muted-foreground)); }

/* Tabs / segmented */
.segmented { display: inline-flex; padding: 3px; background: hsl(var(--muted)); border-radius: var(--radius); gap: 2px; }
.segmented a, .segmented button { border: 0; background: transparent; font: inherit; font-weight: 500; padding: 5px 12px; border-radius: calc(var(--radius) - 3px); color: hsl(var(--muted-foreground)); text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.segmented .on { background: hsl(var(--background)); color: hsl(var(--foreground)); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }

/* Dialog */
.dialog-overlay { position: fixed; inset: 0; background: rgb(0 0 0 / .5); z-index: 100; display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.dialog-overlay.open { display: flex; }
.dialog { background: hsl(var(--background)); border-radius: calc(var(--radius) + 4px); border: 1px solid hsl(var(--border)); width: 100%; max-width: 560px; box-shadow: 0 20px 50px rgb(0 0 0 / .2); }
.dialog-lg { max-width: 720px; }
.dialog-header { padding: 20px 24px 0; display: flex; justify-content: space-between; gap: 12px; }
.dialog-header p { color: hsl(var(--muted-foreground)); font-size: 13px; margin-top: 2px; }
.dialog-body { padding: 18px 24px; }
.dialog-footer { padding: 0 24px 20px; display: flex; justify-content: flex-end; gap: 8px; }

/* Combo / popover (selector de prefijo) */
.combo { position: relative; }
.popover { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; width: 260px; background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); box-shadow: 0 10px 30px rgb(0 0 0 / .14); padding: 6px; }
.popover[hidden] { display: none; }
.combo-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 240px; overflow-y: auto; }
.combo-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: calc(var(--radius) - 3px); cursor: pointer; font-size: 13.5px; }
.combo-list li.hl, .combo-list li:hover { background: hsl(var(--accent)); }
.combo-list li.sel .icon { visibility: visible; }
.combo-list li .icon { visibility: hidden; }
.combo-empty { padding: 14px; text-align: center; color: hsl(var(--muted-foreground)); font-size: 13px; }
.phone-field { display: flex; gap: 8px; }
.phone-trigger { width: 140px; flex: none; }
.phone-field .input { min-width: 0; }
.phone-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast { background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 10px 30px rgb(0 0 0 / .15); animation: pop .18s ease-out; }
.toast strong { display: block; margin-bottom: 2px; }
.toast.error { border-color: hsl(var(--red) / .5); }
.toast ul { margin: 4px 0 0; padding-left: 18px; }
.toast a { text-decoration: underline; font-weight: 500; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Kanban ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; }
.toolbar .search { position: relative; }
.toolbar .search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: hsl(var(--muted-foreground)); }
.toolbar .search .input { padding-left: 32px; min-width: 230px; }
.kanban { display: grid; grid-template-columns: repeat(5, minmax(240px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.kcol { background: hsl(var(--muted) / .7); border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); display: flex; flex-direction: column; min-height: 200px; max-height: calc(100vh - 210px); }
.kcol.over { outline: 2px dashed hsl(var(--ring) / .35); outline-offset: -4px; background: hsl(var(--accent)); }
.kcol-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 8px; }
.kcol-head .dot { width: 8px; height: 8px; border-radius: 99px; display: inline-block; margin-right: 8px; }
.kcol-head strong { font-weight: 600; }
.kcol-head small { display: block; color: hsl(var(--muted-foreground)); font-size: 11.5px; }
.kcol-body { padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 60px; }
.kcard { background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 11px 12px; cursor: grab; box-shadow: 0 1px 2px rgb(0 0 0 / .05); }
.kcard.readonly { cursor: default; }
.kcard:hover { border-color: hsl(var(--ring) / .35); }
.kcard.dragging { opacity: .4; }
.kcard a.name { font-weight: 600; text-decoration: none; display: block; }
.kcard a.name:hover { text-decoration: underline; }
.kcard .meta { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; color: hsl(var(--muted-foreground)); font-size: 12.5px; }
.kcard .meta span { display: flex; gap: 6px; align-items: center; min-width: 0; }
.kcard .meta span > :last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kcard .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; font-size: 12px; color: hsl(var(--muted-foreground)); }
.kcard .incomplete { color: hsl(32 90% 33%); }

/* ---------- Dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
@media (min-width: 1250px) { .stats { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 520px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { padding: 16px 18px; }
.stat .top { display: flex; justify-content: space-between; align-items: center; color: hsl(var(--muted-foreground)); font-size: 13px; font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; }
.stat .sub { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 2px; }
.dash-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 14px; margin-bottom: 14px; }
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-row { display: grid; grid-template-columns: 130px 1fr 112px; gap: 12px; align-items: center; }
.funnel-row .bar-track { height: 38px; background: hsl(var(--muted)); border-radius: 6px; overflow: hidden; position: relative; }
.funnel-row .bar { height: 100%; border-radius: 6px; display: flex; align-items: center; padding-left: 12px; color: #fff; font-weight: 600; min-width: 36px; white-space: nowrap; transition: width .4s; }
.funnel-row .rate { text-align: right; font-size: 12px; color: hsl(var(--muted-foreground)); line-height: 1.3; }
.funnel-row .rate b { color: hsl(var(--foreground)); font-size: 13.5px; }
.bg-nuevo { background: hsl(var(--blue)); } .bg-en_gestion { background: hsl(var(--amber)); } .bg-pendiente_pago { background: hsl(var(--violet)); } .bg-matriculado { background: hsl(var(--green)); } .bg-perdido { background: hsl(var(--red)); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 8px; }
.bars .b { flex: 1; background: hsl(var(--primary)); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; opacity: .85; }
.bars .b:hover { opacity: 1; }
.bars .b::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: hsl(var(--primary)); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; white-space: nowrap; display: none; z-index: 5; }
.bars .b:hover::after { display: block; }
.bars-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: hsl(var(--muted-foreground)); margin-top: 6px; }
.progress { height: 6px; background: hsl(var(--muted)); border-radius: 99px; overflow: hidden; min-width: 60px; }
.progress > i { display: block; height: 100%; background: hsl(var(--primary)); border-radius: 99px; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid hsl(var(--border)); }
.list-plain li:last-child { border-bottom: 0; }

/* ---------- Lead detalle ---------- */
.lead-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); gap: 16px; align-items: start; }
.stepper { display: flex; gap: 6px; flex-wrap: wrap; }
.step { border: 1px solid hsl(var(--border)); background: hsl(var(--background)); border-radius: 999px; padding: 5px 14px; font: inherit; font-weight: 500; cursor: pointer; color: hsl(var(--muted-foreground)); }
.step:hover { background: hsl(var(--accent)); }
.step.current { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: transparent; cursor: default; }
.checklist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 14px; }
.checklist li { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.checklist .ok { color: hsl(var(--green)); } .checklist .no { color: hsl(var(--muted-foreground)); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 28px; }
.timeline li::before { content: ''; position: absolute; left: 9px; top: 20px; bottom: 0; width: 1px; background: hsl(var(--border)); }
.timeline li:last-child::before { display: none; }
.timeline .ico { position: absolute; left: 0; top: 0; width: 19px; height: 19px; border-radius: 99px; background: hsl(var(--muted)); border: 1px solid hsl(var(--border)); display: grid; place-items: center; color: hsl(var(--muted-foreground)); }
.timeline .ico .icon { width: 11px; height: 11px; }
.timeline .head { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: hsl(var(--muted-foreground)); }
.timeline .head strong { color: hsl(var(--foreground)); font-weight: 600; }
.timeline .body { margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.sale-box { background: hsl(var(--muted) / .6); border-radius: var(--radius); padding: 12px 14px; margin-top: 12px; }
.sale-box .row { display: flex; justify-content: space-between; padding: 2px 0; }
.sale-box .total { font-weight: 700; font-size: 16px; border-top: 1px solid hsl(var(--border)); margin-top: 6px; padding-top: 8px; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: hsl(var(--muted) / .5); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand { justify-content: center; padding-bottom: 20px; font-size: 20px; }
.demo-box { margin-top: 16px; font-size: 12.5px; color: hsl(var(--muted-foreground)); }
.demo-box code { background: hsl(var(--muted)); padding: 1px 5px; border-radius: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 1320px) { .lead-layout { grid-template-columns: 1fr; } }
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; z-index: 90; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgb(0 0 0 / .4); z-index: 80; }
  .menu-btn { display: inline-flex; }
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .funnel-row { grid-template-columns: 90px 1fr 70px; }
}

.incomplete { color: hsl(32 90% 33%); }
.row-inactive td { opacity: .55; }
.kcol .badge-muted { background: hsl(var(--background)); border-color: hsl(var(--border)); }

.funnel-row .bar.empty-bar { min-width: 0; padding: 0; }
.funnel-row .bar-track .zero { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-weight: 600; color: hsl(var(--muted-foreground)); }

.bars .b { max-width: 16px; }
.bars { justify-content: space-between; }

[hidden] { display: none !important; }

/* Catálogos: acciones por fila, interruptor y diálogo compacto */
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: hsl(var(--muted-foreground)); margin-bottom: 4px; }
.help-dot { width: 18px; height: 18px; border-radius: 99px; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; }
.btn-danger-outline { color: hsl(var(--destructive)); border-color: hsl(var(--destructive) / .35); background: hsl(var(--destructive) / .05); }
.btn-danger-outline:hover { background: hsl(var(--destructive) / .12) !important; }
.table td.actions .btn + form, .table td.actions form + .btn { margin-left: 4px; }
.dialog-sm { max-width: 420px; }
.dialog-header h3 { font-size: 17px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--muted) / .5); font-size: 13px; font-weight: 500; cursor: pointer; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 36px; height: 20px; border-radius: 99px; background: hsl(var(--input)); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .3); transition: transform .15s; }
.switch:checked { background: hsl(var(--primary)); }
.switch:checked::after { transform: translateX(16px); }
.switch:focus-visible { outline: 2px solid hsl(var(--ring) / .35); outline-offset: 2px; }

.table th.text-right { text-align: right; }

@media print {
  .sidebar, .topbar-actions, .noprint, .menu-btn, .toasts, .dialog-overlay { display: none !important; }
  .app { display: block; } .topbar { position: static; border: 0; }
  body { background: #fff; } .card { box-shadow: none; }
}

/* ---------- Editor de landings ---------- */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.builder-form { display: flex; flex-direction: column; gap: 16px; padding-bottom: 76px; }
.builder-actions { position: sticky; bottom: 0; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 12px 0; background: linear-gradient(to top, hsl(240 4.8% 97.5%) 70%, transparent); }
.builder-preview { position: sticky; top: 76px; }
.preview-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.preview-frame { background: hsl(var(--muted)); border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); height: calc(100vh - 170px); min-height: 420px; overflow: auto; display: flex; justify-content: center; }
.preview-frame iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.preview-frame.mobile { padding: 12px 0; }
.preview-frame.mobile iframe { border: 1px solid hsl(var(--border)); border-radius: 18px; max-width: 100%; }
.share { display: flex; gap: 6px; margin-bottom: 10px; }
.benefit-list { display: flex; flex-direction: column; gap: 8px; }
.benefit-row { display: grid; grid-template-columns: 18px 1fr 1.6fr; gap: 8px; align-items: center; }
.color-input { width: 44px; height: 36px; padding: 2px; border: 1px solid hsl(var(--input)); border-radius: calc(var(--radius) - 2px); background: hsl(var(--background)); cursor: pointer; }
.swatches { display: flex; gap: 6px; }
.swatch { width: 24px; height: 24px; border-radius: 99px; border: 2px solid hsl(var(--background)); box-shadow: 0 0 0 1px hsl(var(--border)); cursor: pointer; padding: 0; }
@media (max-width: 1100px) { .builder { grid-template-columns: 1fr; } .builder-preview { position: static; order: -1; } .preview-frame { height: 480px; } }
@media (max-width: 600px) { .benefit-row { grid-template-columns: 1fr; } .benefit-row > span { display: none; } }

/* ---------- Editor de landings: secciones ---------- */
.sections { display: flex; flex-direction: column; gap: 12px; }
.sec { box-shadow: none; background: hsl(var(--muted) / .35); }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 10px 16px; cursor: pointer; }
.sec-head strong { font-size: 14px; }
.sec-tools { display: flex; gap: 2px; }
.sec-tools .up { transform: rotate(180deg); }
.sec-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.sec.collapsed .sec-body { display: none; }
.sec .field { margin-bottom: 0; }
.sec-style { border-top: 1px dashed hsl(var(--border)); padding-top: 10px; }
.sec-style summary { cursor: pointer; font-weight: 500; font-size: 13px; color: hsl(var(--muted-foreground)); }
.items { display: flex; flex-direction: column; gap: 10px; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 8px; align-items: start; padding: 12px; background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); }
.item .rm-item { order: 2; }
.item-fields { display: flex; flex-direction: column; gap: 10px; order: 1; }
.add-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.bg-group { display: flex; flex-direction: column; gap: 10px; }
.range { width: 100%; accent-color: hsl(var(--primary)); }
