:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --text: #1c2333;
  --muted: #6b7489;
  --border: #e3e7ef;
  --side: #141b2d;
  --side-text: #aab3c7;
  --side-active: #2f6bff;
  --primary: #2f6bff;
  --primary-dark: #1f54d6;
  --blue: #2f6bff;
  --green: #12a05c;
  --amber: #e08a00;
  --red: #d63d4a;
  --side-w: 248px;
  --top-h: 60px;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
}
.ico { width: 20px; height: 20px; flex: none; }

/* ------------------------------------------------------------ Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border: 0; border-radius: 10px; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--text); background: transparent; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { border: 1px solid var(--border); background: var(--surface); }
.btn-ghost:hover { background: var(--bg); }
.btn-block { width: 100%; padding: 12px; margin-top: 18px; }
.icon-btn { display: none; border: 0; background: none; padding: 8px; border-radius: 8px; cursor: pointer; color: var(--text); }

/* ------------------------------------------------------------ Estructura */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; grid-template-rows: var(--top-h) 1fr; height: 100vh; overflow: hidden; }

.sidebar { grid-row: 1 / 3; background: var(--side); overflow-y: auto; padding: 20px 12px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; margin-bottom: 2px;
  border-radius: 10px; color: var(--side-text); text-decoration: none; font-weight: 500;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: var(--side-active); color: #fff; }

.topbar {
  grid-column: 2; display: flex; align-items: center; gap: 12px;
  padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 700; font-size: 17px; display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1 1 0; width: 0; }   /* ocupa lo que sobra y se recorta con «…» */
.topbar-empresa { flex: 0 1 auto; min-width: 0; }
.topbar-title #pageTitle { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sus-chip .corto, .soporte-chip .corto { display: none; }
.sus-chip { background: #fff6e5; color: #9a5b00; border: 1px solid #f6d7a3; border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.sus-chip.urgente { background: #fde8e8; color: #b42318; border-color: #f5b5b0; }
.sus-chip.activo { background: #e2f6ec; color: #0c7541; border-color: #a9e2c4; }   /* plan activo: verde */
.plan-box { border: 1px solid var(--border); border-left: 5px solid var(--green); border-radius: 12px; padding: 6px 14px; }
.plan-box.urgente { border-left-color: var(--red, #d92d20); }
.plan-box .totals-row { padding: 7px 0; border-bottom: 1px solid var(--border); }
.plan-box .totals-row:last-child { border-bottom: 0; }
/* Modo demo del negocio principal (config/local.php → demo_principal) */
.demo-chip { flex: none; display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 99px; background: #e4edfc; color: #1c5cab; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.demo-chip .corto { display: none; }
.soporte-chip { background: #fde8e8; color: #b42318; border: 1px solid #f5b5b0; border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.topbar-empresa { color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.topbar-sep { color: var(--border); font-weight: 400; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.topbar-right > * { flex: none; white-space: nowrap; }   /* con la insignia del plan no se parten en dos líneas: se recorta el título */
.topbar-right form { margin: 0; }
.app-name { font-weight: 800; letter-spacing: .02em; color: var(--primary); padding-right: 16px; border-right: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.brand-ico { width: 26px; height: 26px; border-radius: 7px; flex: none; }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--text); }
.user-chip small { color: var(--muted); background: var(--bg); padding: 2px 8px; border-radius: 99px; font-size: 12px; }
.user-name { font-weight: 600; }

.content { grid-column: 2; overflow-y: auto; padding: 28px; transition: opacity .12s; }
.content.loading { opacity: .55; }

.page-title { margin: 0 0 4px; font-size: 26px; }
.page-sub { margin: 0 0 24px; color: var(--muted); }

/* ------------------------------------------------------------ Tarjetas */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat { position: relative; }
.stat-icon {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); margin-bottom: 14px;
}
.stat-label { color: var(--muted); font-weight: 600; font-size: 13px; }
.stat-value { font-size: 30px; font-weight: 800; margin: 4px 0; letter-spacing: -.01em; }
.stat-note { color: var(--muted); font-size: 13px; }
.accent-blue  { --accent: var(--blue); }
.accent-green { --accent: var(--green); }
.accent-amber { --accent: var(--amber); }
.accent-red   { --accent: var(--red); }

.empty { text-align: center; color: var(--muted); padding: 80px 20px; }
.empty .ico { width: 48px; height: 48px; opacity: .5; }
.empty h2 { color: var(--text); margin: 12px 0 4px; }

/* ------------------------------------------------------------ Login */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 36px 32px; box-shadow: 0 10px 40px rgba(20,27,45,.08); }
.login-logo { display: block; width: 84px; height: 84px; margin: 0 auto 10px; border-radius: 20px; box-shadow: 0 8px 22px rgba(47,107,255,.28); }
.login-brand { font-size: 30px; font-weight: 800; color: var(--primary); text-align: center; }
.login-sub { text-align: center; color: var(--muted); margin: 4px 0 24px; }
.login-card label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 6px; }
.login-card input { width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; }
.login-card input:focus { outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); border-color: var(--primary); }
.alert { background: #fdecee; color: #a52834; border: 1px solid #f5c2c7; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.alert.ok { background: #e2f6ec; color: #0c7541; border-color: #b5e5cb; }
.login-help { font-size: 14px; color: var(--muted); margin: 14px 0 0; }
.login-card .alert + .btn { margin-top: 14px; }

/* ------------------------------------------------------------ Móvil */
.scrim { display: none; }
/* Pantallas medianas: con la insignia del plan, «ADA Sistem» queda solo con su icono y se oculta el rol, para que se lea el título */
@media (max-width: 1400px) { .app-name-txt, .user-chip small { display: none; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .icon-btn { display: inline-flex; }
  .topbar, .content { grid-column: 1; }
  .topbar { padding: 0 12px; }
  .content { padding: 18px 14px; }
  .sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: var(--side-w); transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .scrim.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 20; }
  .btn-ghost span, .user-chip small, .app-name, .topbar-empresa, .topbar-sep { display: none; }
  .user-name { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-right { gap: 10px; }
  /* Avisos de la barra (plan, modo soporte): versión corta, si no la barra se sale de la pantalla y el celular aleja el zoom */
  .sus-chip .largo, .soporte-chip .largo, .demo-chip .largo { display: none; }
  .sus-chip .corto, .soporte-chip .corto, .demo-chip .corto { display: inline; }
  .sus-chip, .soporte-chip, .demo-chip { padding: 3px 9px; font-size: 12px; }
}
@media (max-width: 380px) { .user-name { display: none; } }   /* celulares angostos: solo el icono del usuario */

/* ------------------------------------------------------------ Módulos: cabecera, panel, tabla */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .page-sub { margin-bottom: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cards-sm { margin-bottom: 20px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.cards-sm .stat-value { font-size: 24px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px; border-bottom: 1px solid var(--border); }
.grow { flex: 1 1 240px; }

.input {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  font: inherit; color: var(--text); min-width: 0;
}
.input:focus { outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); border-color: var(--primary); }
.input.v-error, .input.v-error:focus { border-color: #d64545; outline-color: color-mix(in srgb, #d64545 35%, transparent); }   /* validar.js: formato no válido */
.input[readonly] { background: var(--bg); color: var(--muted); }
.input-sm { padding: 5px 8px; font-size: 13px; border-radius: 8px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-compact th, .table-compact td { padding: 8px 10px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--primary) 4%, transparent); }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table th.num { text-align: right; }
.table .mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: var(--muted); }
.table .row-actions { text-align: right; white-space: nowrap; }
.table .td-empty { text-align: center; color: var(--muted); padding: 40px 14px; }
.row-off td { opacity: .55; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--bg); color: var(--muted); }
.badge.red   { background: #fdecee; color: #a52834; }
.badge.amber { background: #fff3dc; color: #9a5b00; }
.badge.green { background: #e2f6ec; color: #0c7541; }
.text-red { color: var(--red); font-weight: 600; }
.text-green { color: var(--green); font-weight: 600; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 14px; color: var(--muted); font-size: 14px; }
.pager:empty { display: none; }
.pager div { display: flex; gap: 8px; }

.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b92e3a; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ------------------------------------------------------------ Modal */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(20,27,45,.5); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0,0,0,.3); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal.wide { max-width: 820px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-head .x { border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.confirm-msg { margin: 0; line-height: 1.5; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 13px; }
.field .hint { color: var(--muted); font-size: 12px; }
.form-grid .modal-actions { grid-column: 1 / -1; margin-top: 6px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

.cat-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.cat-row .input { flex: 1; }
.cat-row .count { color: var(--muted); font-size: 12px; white-space: nowrap; min-width: 70px; text-align: right; }
.modal-sub { margin: 0 0 14px; color: var(--muted); }

/* ------------------------------------------------------------ Avisos */
#toasts { position: fixed; z-index: 100; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #143d2a; color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 340px; transition: opacity .25s, transform .25s; }
.toast.error { background: #7d1f28; }
.toast.out { opacity: 0; transform: translateY(6px); }

@media (max-width: 860px) {
  .cards-sm { gap: 10px; margin-bottom: 14px; }
  .cards-sm .card { padding: 12px 14px; }
  .cards-sm .stat-icon { display: none; }
  .cards-sm .stat-value { font-size: 20px; margin: 2px 0 0; }
  .page-head { margin-bottom: 14px; }
}

/* ------------------------------------------------------------ Ventas (punto de venta) */
[hidden] { display: none !important; }
.tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px; gap: 4px; }
.tab { border: 0; background: none; padding: 8px 18px; border-radius: 9px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tab.active { background: var(--primary); color: #fff; }

.pos { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr); gap: 18px; align-items: start; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 14px; max-height: calc(100vh - 290px); min-height: 200px; overflow-y: auto; align-content: start; }
.prod { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 12px; cursor: pointer; font: inherit; color: var(--text); display: flex; flex-direction: column; gap: 4px; }
.prod:hover:not(:disabled) { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.prod:disabled { opacity: .5; cursor: not-allowed; }
.prod .p-name { font-weight: 600; line-height: 1.25; }
.prod .p-price { font-weight: 800; color: var(--primary); }
.prod .p-stock { font-size: 12px; color: var(--muted); }
.prod-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 30px 0; }

.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.cart-head h3 { margin: 0; font-size: 17px; }
.cart-section { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.cart-section:last-child { border-bottom: 0; }
.cart-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }

.client-pick { position: relative; }
.client-pick .row { display: flex; gap: 8px; }
.client-pick .input { flex: 1; }
.chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary-dark); padding: 8px 12px; border-radius: 10px; font-weight: 600; flex: 1; min-width: 0; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; }
.suggest { position: absolute; z-index: 10; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.15); max-height: 240px; overflow-y: auto; }
.suggest button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; font: inherit; cursor: pointer; color: var(--text); }
.suggest button:hover { background: var(--bg); }
.suggest small { color: var(--muted); }
.suggest .none { padding: 10px 12px; color: var(--muted); }

.cart-items { max-height: 300px; overflow-y: auto; }
.cart-empty { text-align: center; color: var(--muted); padding: 28px 16px; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.line .l-name { font-weight: 600; grid-column: 1; }
.line .l-total { font-weight: 700; text-align: right; }
.line .l-sub { color: var(--muted); font-size: 13px; }
.line .l-ctl { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.line .qty { width: 64px; text-align: center; padding: 5px 4px; }
.line button.step, .line button.rm { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; width: 28px; height: 28px; cursor: pointer; font-size: 16px; line-height: 1; color: var(--text); }
.line button.rm { color: var(--red); margin-left: 4px; }

.totals-row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; }
.totals-row .input { width: 120px; text-align: right; padding: 5px 8px; }
.total-big { font-size: 26px; font-weight: 800; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border-radius: 10px; padding: 3px; gap: 3px; margin-bottom: 10px; }
.seg button { border: 0; background: none; padding: 8px; border-radius: 8px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay-note { margin-top: 8px; font-size: 14px; }
.pay-note.warn { color: var(--amber); font-weight: 600; }
.btn-lg { padding: 14px 18px; font-size: 17px; }
.btn-lg.btn-block { margin-top: 0; }

.sale-ok { text-align: center; }
.sale-ok .big { font-size: 32px; font-weight: 800; margin: 6px 0; }
.sale-ok .ok-mark { width: 56px; height: 56px; border-radius: 50%; background: #e2f6ec; color: var(--green); display: grid; place-items: center; margin: 0 auto 10px; font-size: 30px; }
.sale-ok .modal-actions { justify-content: center; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 20px; margin-bottom: 16px; }
.kv div span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.detail-totals { margin-left: auto; max-width: 280px; margin-top: 12px; }
.detail-totals .totals-row.strong { font-weight: 800; font-size: 17px; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; }
.filters-date { display: flex; align-items: center; gap: 6px; }
.filters-date label { color: var(--muted); font-size: 13px; }
.summary-line { padding: 10px 14px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--border); }
.summary-line strong { color: var(--text); }

@media (max-width: 1000px) { .pos { grid-template-columns: minmax(0, 1fr); } .prod-grid { max-height: 320px; } }

/* El botón Cobrar siempre visible aunque la venta sea larga */
.pos > .panel:last-child .cart-section:last-child { position: sticky; bottom: 0; background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 -6px 12px -8px rgba(0,0,0,.15); }

/* ------------------------------------------------------------ Cuentas por cobrar / pagar */
.acct-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.acct-name { font-size: 20px; }
.muted { color: var(--muted); font-size: 14px; }
.acct-total { text-align: right; }
.acct-total span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.acct-total strong { font-size: 28px; font-weight: 800; }
.modal h4 { margin: 20px 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pay-all { display: grid; grid-template-columns: 140px 160px 1fr auto; gap: 10px; align-items: end; background: var(--bg); border-radius: 12px; padding: 14px; margin-top: 16px; }
.pay-all .hint { grid-column: 1 / -1; color: var(--muted); font-size: 12px; margin-top: -2px; }
@media (max-width: 640px) { .pay-all { grid-template-columns: 1fr; } }
.paid-list { text-align: left; margin: 14px auto 0; max-width: 340px; font-size: 14px; }
.paid-list div { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dashed var(--border); }

/* ------------------------------------------------------------ Compras */
.line .cost { width: 92px; text-align: right; padding: 5px 6px; }
.line .l-x { color: var(--muted); font-size: 13px; }
.line .l-unit { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.line .l-unit small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.line .l-ctl.wide { gap: 10px; align-items: flex-end; }

/* ------------------------------------------------------------ Mi cuenta (chip de usuario clicable) */
button.user-chip { border: 0; background: none; font: inherit; cursor: pointer; padding: 6px 8px; border-radius: 10px; }
button.user-chip:hover { background: var(--bg); }

/* ------------------------------------------------------------ Usuarios y Ajustes */
.badge.blue { background: #e4edfc; color: #1c5cab; }
.settings { max-width: 760px; }
.settings .panel { margin-bottom: 18px; }
.panel-head { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.panel-head h3 { margin: 0; font-size: 16px; }
.panel-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.panel-body { padding: 18px; }
.sched-row { display: grid; grid-template-columns: 110px 90px 1fr; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }
.sched-row:last-child { border-bottom: 0; }
.sched-row .day { font-weight: 600; }
.sched-row .times { display: flex; align-items: center; gap: 8px; }
.sched-row .times .input { width: 130px; padding: 6px 8px; }
.sched-row .closed { color: var(--muted); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { width: 18px; height: 18px; accent-color: var(--primary); }
.preview { border: 1px dashed var(--border); border-radius: 12px; padding: 14px; text-align: center; font-family: "Courier New", monospace; font-size: 13px; line-height: 1.5; background: var(--bg); }
.preview h1 { font-size: 16px; margin: 0; }
.preview p { margin: 1px 0; }
.form-bar { display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
@media (max-width: 560px) { .sched-row { grid-template-columns: 1fr 1fr; } .sched-row .times { grid-column: 1 / -1; } }

/* ------------------------------------------------------------ Reportes y gráficos */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.filters .presets { display: flex; flex-wrap: wrap; gap: 6px; }
.chipbtn { border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: 6px 14px; font: inherit; font-size: 14px; cursor: pointer; color: var(--text); }
.chipbtn:hover { background: var(--bg); }
.chipbtn.on { background: var(--text); border-color: var(--text); color: #fff; font-weight: 600; }
.filters .range { display: flex; align-items: center; gap: 6px; margin-left: 6px; color: var(--muted); font-size: 13px; }
.filters .range .input { padding: 6px 8px; }
#rep-body { position: relative; transition: opacity .12s; }
#rep-body.loading { opacity: .55; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; margin-top: 18px; }
.rep-grid .panel { margin: 0; }

.chart-card { margin-top: 18px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px 0; }
.chart-head h3 { margin: 0; font-size: 16px; }
.chart-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.chart-body { padding: 18px; }
.empty-chart { text-align: center; color: var(--muted); padding: 50px 0; }

/* gráficos: fichas de color de la paleta de referencia (superficie clara) */
.viz { --v-ink: #0b0b0b; --v-ink2: #52514e; --v-muted: #898781; --v-grid: #e1e0d9; --v-base: #c3c2b7; --v-s1: #2a78d6; --v-s1-hover: #5598e7; position: relative; }
.viz-col { position: relative; height: 240px; margin: 26px 0 0 58px; }
.viz-col .grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--v-grid); }
.viz-col .grid.base { border-top-color: var(--v-base); }
.viz-col .grid span { position: absolute; right: calc(100% + 8px); transform: translateY(-50%); font-size: 12px; color: var(--v-muted); white-space: nowrap; }
.viz-col .bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.viz-col .slot { position: relative; flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; }
.viz-col .bar { width: min(100%, 24px); background: var(--v-s1); border-radius: 4px 4px 0 0; transition: background .1s; }
.viz-col .slot:hover .bar, .viz-col .slot:focus-visible .bar { background: var(--v-s1-hover); }
.viz-col .slot:focus-visible { box-shadow: 0 0 0 2px var(--primary) inset; border-radius: 4px; }
.viz-col .cap { position: absolute; transform: translateY(-4px); font-size: 12px; font-weight: 700; color: var(--v-ink); white-space: nowrap; pointer-events: none; }
.viz-x { display: flex; gap: 2px; margin: 8px 0 0 58px; }
.viz-x span { flex: 1 1 0; min-width: 0; text-align: center; font-size: 11px; color: var(--v-muted); white-space: nowrap; overflow: visible; }

.hbars { display: flex; flex-direction: column; gap: 10px; }
.hrow { display: grid; grid-template-columns: minmax(80px, 34%) 1fr; gap: 12px; align-items: center; outline: none; }
.hrow .lab { color: var(--v-ink2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrow .track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hrow .hb { height: 16px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--v-s1); transition: background .1s; }
.hrow:hover .hb, .hrow:focus-visible .hb { background: var(--v-s1-hover); }
.hrow .val { font-size: 13px; font-weight: 700; color: var(--v-ink); white-space: nowrap; }
.hrow:focus-visible { box-shadow: 0 0 0 2px var(--primary); border-radius: 6px; }

.viz-tip { position: absolute; z-index: 20; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 8px 12px; font-size: 13px; white-space: nowrap; transform: translate(-50%, -100%); }
.viz-tip[hidden] { display: none; }
.viz-tip strong { display: block; font-size: 15px; color: var(--v-ink); }
.viz-tip span { color: var(--v-ink2); display: block; }
.viz-tip em { color: var(--v-muted); font-style: normal; display: block; margin-top: 2px; }

/* Vista previa de facturas */
.doc-frame { width: 100%; height: 62vh; min-height: 380px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.doc-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.badge.gray { background: #eceef3; color: #4b5263; }
.badge.violet { background: #efe7fd; color: #5b2bb5; }   /* Salón: pedido del menú en línea */

/* ------------------------------------------------------------ Áreas del menú (encabezado plegable + sus opciones) */
.nav-area {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; margin-bottom: 2px;
  border: 0; border-radius: 10px; background: none; color: var(--side-text); font: inherit; font-weight: 600; text-align: left; cursor: pointer;
}
.nav-area:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-area.current { color: #fff; }
.nav-area > span:first-of-type { flex: 1; }
.nav-area-chev { display: grid; place-items: center; }
.nav-area-chev .ico { width: 16px; height: 16px; transition: transform .15s; }
.nav-area[aria-expanded="false"] .nav-area-chev .ico { transform: rotate(-90deg); }
.nav-sub { margin: 0 0 6px 22px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.14); }
.nav-sub[hidden] { display: none; }
.nav-link.sub { padding: 8px 12px; font-size: 14px; }
.nav-link.sub .ico { width: 18px; height: 18px; }

/* ------------------------------------------------------------ Comida (restaurante por mesas) */
.chips-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chips-row:empty { display: none; }
.mesas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.mesa { text-align: left; font: inherit; color: var(--text); cursor: pointer; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 3px; min-height: 130px; }
.mesa:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); border-color: var(--primary); }
.mesa .m-name { font-size: 18px; font-weight: 800; }
.mesa .m-sub { color: var(--muted); font-size: 13px; }
.mesa .m-est { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--green); margin-top: 4px; }
.mesa .m-total { font-size: 20px; font-weight: 800; }
.mesa .m-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.mesa.ocupada { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 7%, var(--surface)); }
.mesa.ocupada .m-est { color: var(--amber); }
.mesa.cuenta { border-color: var(--red); background: color-mix(in srgb, var(--red) 6%, var(--surface)); }
.mesa.cuenta .m-est { color: var(--red); }
.mesa.listo { box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 45%, transparent); }

.seg3 { grid-template-columns: repeat(3, 1fr); }
.seg4 { grid-template-columns: repeat(4, 1fr); }
.cart-items.tall { max-height: calc(100vh - 590px); min-height: 150px; }
#vOrden .pos > .panel:last-child .cart-section:last-child { position: static; box-shadow: none; }
.orden-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.oline { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.oline .o-price { font-weight: 700; text-align: right; }
.oline .o-nota { color: var(--muted); font-size: 13px; font-style: italic; }
.oline .o-ctl { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.oline .o-ctl:empty { display: none; }
.oline .qn { min-width: 26px; text-align: center; font-weight: 700; }
.oline button.step, .oline button.rm { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; width: 28px; height: 28px; cursor: pointer; font-size: 16px; line-height: 1; color: var(--text); }
.oline button.rm { color: var(--red); }
.oline.st-servido { opacity: .6; }
.oline.st-listo { background: color-mix(in srgb, var(--green) 8%, transparent); }
.cobro .totals-row .input { width: 120px; text-align: right; padding: 5px 8px; }

.tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.ticket { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ticket header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ticket header strong { font-size: 18px; display: block; }
.ticket header small { color: var(--muted); font-size: 12px; }
.ticket .tk-time { font-weight: 800; font-size: 16px; white-space: nowrap; }
.ticket ul { list-style: none; margin: 0; padding: 0; }
.ticket li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.ticket li.done { opacity: .6; }
.ticket .tk-item { display: flex; gap: 10px; align-items: flex-start; }
.ticket .tk-q { font-size: 20px; font-weight: 800; min-width: 26px; text-align: center; }
.ticket .tk-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ticket .o-nota { color: var(--red); font-weight: 600; font-size: 13px; }
.ticket footer { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 14px; }
.ticket.tk-ambar { border-color: var(--amber); }
.ticket.tk-ambar .tk-time { color: var(--amber); }
.ticket.tk-rojo { border-color: var(--red); }
.ticket.tk-rojo .tk-time { color: var(--red); }
.ticket.tk-listo { border-color: var(--green); }

/* ------------------------------------------------------------ Etiquetas de productos (Ajustes e Inventario) */
.et-prev { margin-top: 18px; padding: 18px; background: var(--bg); border-radius: 12px; text-align: center; overflow-x: auto; }
.et-prev .muted { margin-top: 10px; }

/* ------------------------------------------------------------ Escáner con cámara (solo celular/tableta) */
.scan-wrap { position: relative; display: flex; }
.scan-wrap > .input { flex: 1; padding-right: 50px; }
.scan-wrap input[type=search]::-webkit-search-cancel-button { display: none; }
.scan-btn { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 10px; cursor: pointer;
  background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); display: grid; place-items: center; }
.scan-btn:active { background: color-mix(in srgb, var(--primary) 25%, transparent); }
.scan-btn svg { width: 22px; height: 22px; }
.scan-box { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; }
.scan-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-guide { position: absolute; left: 8%; right: 8%; top: 28%; bottom: 28%; border: 2px solid rgba(255,255,255,.9); border-radius: 10px; box-shadow: 0 0 0 999px rgba(0,0,0,.38); pointer-events: none; }
.scan-guide::after { content: ''; position: absolute; left: 5%; right: 5%; top: 50%; height: 2px; background: #ff3b3b; animation: scanline 1.5s ease-in-out infinite alternate; }
@keyframes scanline { from { top: 12%; } to { top: 88%; } }
.scan-msg { margin: 12px 0 0; text-align: center; font-weight: 600; }
.scan-msg.warn { color: var(--amber); }
.scan-nota { margin: 8px 0 0; text-align: center; font-size: 13px; }

/* ------------------------------------------------------------ Facturación electrónica (e-CF) */
.ecf-cert { padding: 12px 14px; background: var(--bg); border-radius: 12px; }
.ecf-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.pay-note.ok { color: var(--green); font-weight: 600; }
.ecf-qrbox { margin-top: 14px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.ecf-qr { width: 150px; height: 150px; flex: none; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
.ecf-qr path { fill: #000; }
.ecf-xml { width: 100%; margin-top: 8px; font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.rep-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.rep-2col .panel { margin: 0; }
@media (max-width: 860px) { .rep-2col { grid-template-columns: 1fr; } }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--border); background: var(--bg); }
/* A.horaPicker(): hora en 12 h (hora : minutos a. m./p. m.) */
.hora12 { display: flex; align-items: center; gap: 4px; }
.hora12 .input { width: auto; min-width: 0; padding-left: 8px; padding-right: 8px; }
/* Ajustes → logo de la empresa */
.logo-box { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.logo-prev { width: 180px; height: 72px; border: 1px dashed var(--border); border-radius: 10px; display: grid; place-items: center; background: #fff; overflow: hidden; }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* A.fotoCampo(): foto de un producto o plato (Inventario, Carta y mesas) */
.foto-campo { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.foto-prev { width: 96px; height: 96px; border: 1px dashed var(--border); border-radius: 12px; display: grid; place-items: center; background: #fff; overflow: hidden; font-size: 12px; }
.foto-prev img { width: 100%; height: 100%; object-fit: cover; }
.foto-mini { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; vertical-align: middle; margin-right: 8px; background: #f1f3f7; }
/* Campana de avisos del restaurante y de la tienda en línea (assets/js/avisos.js) */
.avisos-chip { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: none; color: var(--muted); cursor: pointer; position: relative; }
.avisos-chip.on { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.avisos-chip:not(.on)::after { content: ''; position: absolute; width: 22px; height: 2px; background: currentColor; transform: rotate(-45deg); border-radius: 2px; }
.avisos-opciones { display: flex; flex-direction: column; gap: 10px; }
.avisos-op { align-items: flex-start !important; }
.avisos-op span { display: flex; flex-direction: column; }
.avisos-op small { color: var(--muted); font-weight: 400; }
.avisos-caja { position: fixed; right: 16px; bottom: 16px; z-index: 70; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.aviso { pointer-events: auto; position: relative; background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--primary); border-radius: 12px; padding: 12px 34px 12px 14px; box-shadow: 0 10px 30px rgba(20, 30, 60, .22); cursor: pointer; display: flex; flex-direction: column; gap: 3px; animation: aviso-entra .25s ease-out; }
.aviso b { font-size: 14.5px; }
.aviso span { color: var(--muted); font-size: 13px; }
.aviso-comanda { border-left-color: var(--amber); }
.aviso-listo { border-left-color: var(--green); }
.aviso-tienda { border-left-color: #7c3aed; }
.aviso-x { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 20px; color: var(--muted); cursor: pointer; line-height: 1; }
@keyframes aviso-entra { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Punto de venta → Pedidos en línea (pedidos de la tienda pública) */
.tab-num { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 99px; background: #7c3aed; color: #fff; font-size: 11.5px; font-weight: 700; }
.ped-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.ped { border: 1px solid var(--border); border-left: 5px solid #7c3aed; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); min-width: 0; }
.ped-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ped-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ped-meta { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.ped-items { margin: 2px 0; padding-left: 18px; font-size: 13.5px; }
.ped-nota { font-size: 12.5px; background: var(--bg); border-radius: 8px; padding: 6px 8px; overflow-wrap: anywhere; }
.ped-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.ped-foot .total-big { font-size: 20px; }
.ped-foot .actions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 480px) { .ped-lista { grid-template-columns: 1fr; } }
/* Punto de venta: «+ Envío a domicilio» (abre la casilla del costo de envío) */
.link-btn { border: 0; background: none; padding: 4px 0; color: var(--primary); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.login-demo { background: #e4edfc; color: #1c3f73; border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 0 0 16px; text-align: center; }
.login-demo strong { display: block; color: #1c5cab; }
.login-demo a { font-weight: 700; }
/* Configuración → Balanza: la estructura de la etiqueta */
.bal-estructura { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; font-family: ui-monospace, Consolas, monospace; font-size: 18px; font-weight: 700; }
.bal-estructura span { display: flex; flex-direction: column; align-items: center; padding: 8px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); }
.bal-estructura small { font-family: inherit; font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 2px; font-family: system-ui, sans-serif; }
.bal-estructura .b-pre { background: #eaf0ff; border-color: #c9d8ff; }
.bal-estructura .b-plu { background: #e3f7ec; border-color: #b4e6c9; }
.bal-estructura .b-val { background: #fff4e0; border-color: #f3d6a1; }
.bal-resultado { margin-top: 8px; font-size: 14px; }

/* Configuración → Tienda en línea: temas */
.ti-temas { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.ti-tema { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 10px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface); }
.ti-tema input { position: absolute; opacity: 0; pointer-events: none; }
.ti-tema:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.ti-tema:focus-within { outline: 2px solid color-mix(in srgb, var(--primary) 40%, transparent); }
.ti-tema small { color: var(--muted); font-size: 12px; }
.ti-muestra { display: block; height: 58px; border-radius: 8px; margin-bottom: 6px; background: var(--c); border: 1px solid var(--border); position: relative; overflow: hidden; }
.ti-muestra i { position: absolute; left: 0; right: 0; top: 0; height: 24px; background: linear-gradient(135deg, var(--a), var(--b)); }
.ti-muestra b { position: absolute; left: 10px; bottom: 8px; width: 46%; height: 12px; border-radius: 6px; background: var(--b); }

/* Gastos: total calculado (neto + ITBIS) */
.gas-total { padding: 9px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); font-weight: 800; font-size: 16px; }

/* Configuración → Empresa: qué sale en el recibo de 80 mm */
.rc-opciones { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 8px; }

/* Asistente de ayuda (assets/js/ayuda.js) */
.ayuda-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border); background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.ayuda-btn:hover, .ayuda-btn.on { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); background: color-mix(in srgb, var(--primary) 8%, transparent); }
@media (max-width: 1100px) { .ayuda-btn { width: 36px; padding: 0; justify-content: center; } .ayuda-btn-txt { display: none; } }
.ayuda-panel { position: fixed; right: 16px; bottom: 16px; top: 76px; z-index: 60; width: 390px; max-width: calc(100vw - 32px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 18px 50px rgba(16, 24, 40, .22); overflow: hidden; }
.ayuda-panel[hidden] { display: none; }
.ayuda-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; color: #fff; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #000)); }
.ayuda-head strong { display: block; font-size: 15px; }
.ayuda-head small { opacity: .85; font-size: 12px; }
.ayuda-x { width: 32px; height: 32px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .18); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.ayuda-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.ayuda-msg { max-width: 88%; padding: 10px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.ayuda-msg p { margin: 0 0 6px; } .ayuda-msg p:last-child { margin-bottom: 0; }
.ayuda-msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.ayuda-msg.yo { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.ayuda-msg ol { margin: 6px 0 8px; padding-left: 20px; } .ayuda-msg li { margin: 3px 0; }
.ayuda-nota { color: var(--muted); font-size: 13px; }
.ayuda-msg .btn { margin: 2px 0 6px; }
.ayuda-util { font-size: 13px; color: var(--muted); border-top: 1px dashed var(--border); padding-top: 6px; margin-top: 4px; }
.ayuda-sub { font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
.ayuda-chips { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 6px; }
.ayuda-chip { text-align: left; font: inherit; font-size: 13px; color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border)); border-radius: 10px; padding: 6px 10px; cursor: pointer; }
.ayuda-chip:hover { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); }
.ayuda-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: var(--surface); }
.ayuda-form .input { flex: 1; min-width: 0; }
.ayuda-pie { padding: 0 12px 8px; background: var(--surface); text-align: right; }
.ayuda-escribiendo { display: inline-flex; gap: 4px; } .ayuda-escribiendo i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: ayuda-pulso 1s infinite ease-in-out; }
.ayuda-escribiendo i:nth-child(2) { animation-delay: .15s; } .ayuda-escribiendo i:nth-child(3) { animation-delay: .3s; }
@keyframes ayuda-pulso { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (max-width: 640px) { .ayuda-panel { inset: 0; width: auto; max-width: none; border-radius: 0; top: 0; } }

/* Panel central: pestañas (Principal, Correos, Demos, Ayuda, Bitácora) */
.c-tabs-wrap { position: sticky; top: 0; z-index: 5; margin: 0 -4px 18px; padding: 8px 4px; background: var(--bg); overflow-x: auto; scrollbar-width: none; }
.c-tabs-wrap::-webkit-scrollbar { display: none; }
.c-tabs { white-space: nowrap; }
.c-tabs .tab { display: inline-flex; align-items: center; }
.c-correo { margin-bottom: 14px; }
.c-correo-fila { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.c-correo-fila > div { flex: 1; min-width: 240px; }
.c-correo-fila h3 { margin: 0 0 4px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.c-correo-fila p { margin: 0; font-size: 14px; }
/* que el contenido no se corra al cambiar entre pestañas largas y cortas */
html:has(.central-main) { scrollbar-gutter: stable; }
