/* SCENTSMTY BUSINESS MANAGER — sistema de diseño
   Neutros para la estructura; color solo para estados, alertas y acciones. */
:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #fafaf9;
  --line: #e9e9e6;
  --line-strong: #d9d9d5;
  --text: #111111;
  --text-2: #4b4b48;
  --muted: #8b8b86;
  --ink: #0f0f10;
  --ink-2: #1b1b1d;
  --focus: rgba(17, 17, 17, .12);

  --series-1: #2a78d6; --series-2: #eb6834;

  --good: #18794e; --good-bg: #edf7f1; --good-line: #cfe9db;
  --warn: #8a5a00; --warn-bg: #fdf6e7; --warn-line: #f1e0b6;
  --bad: #b42318; --bad-bg: #fdf1f0; --bad-line: #f5d0cc;
  --info: #1f4f8f; --info-bg: #eff4fb; --info-line: #d5e2f3;

  --radius: 10px; --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 16, 16, .04);
  --shadow-lg: 0 18px 48px rgba(16, 16, 16, .18);
  --sidebar: 252px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13.5px; line-height: 1.45; color: var(--text);
  font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
.hidden { display: none !important; }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.012em; }
.muted { color: var(--muted); }
.error { color: var(--bad); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
small { font-size: 12px; }
.ico { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ico.sm { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- Estructura ---------- */
.layout { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
main { padding: 0 32px 56px; min-width: 0; }

/* ---------- Menú lateral ---------- */
.sidebar { background: var(--ink); color: #c9c9c4; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; border-right: 1px solid #000; }
.brand { display: flex; gap: 11px; align-items: center; padding: 20px 18px 18px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand b { display: block; color: #fff; font-size: 13px; letter-spacing: .14em; font-weight: 600; }
.brand small { display: block; color: #85857f; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; margin-top: 2px; }
.logo { width: 32px; height: 32px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); color: #fff; display: grid; place-items: center;
  font-family: Georgia, 'Times New Roman', serif; font-size: 17px; background: linear-gradient(180deg, #1d1d20, #121214); }
#nav { flex: 1; overflow-y: auto; padding: 10px 10px 14px; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 4px; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #6f6f6a; padding: 0 10px 6px; }
#nav a { display: flex; align-items: center; gap: 11px; color: #b9b9b3; padding: 8px 10px; border-radius: 7px; font-size: 13px; text-decoration: none; position: relative; }
#nav a .ico { color: #8a8a84; }
#nav a:hover { color: #fff; background: rgba(255,255,255,.045); }
#nav a:hover .ico { color: #d6d6d0; }
#nav a.active { color: #fff; background: rgba(255,255,255,.07); }
#nav a.active .ico { color: #fff; }
#nav a.active::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: #fff; }
.sidebar-foot { padding: 12px 14px 16px; border-top: 1px solid rgba(255,255,255,.06); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.live { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: #85857f; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: #55554f; }
.live.on i { background: #3fb67a; box-shadow: 0 0 0 3px rgba(63,182,122,.14); }
.sidebar-foot .btn { background: transparent; color: #b9b9b3; border-color: rgba(255,255,255,.14); }
.sidebar-foot .btn:hover { color: #fff; border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.04); }

/* ---------- Encabezado de página ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(246,246,244,.92); backdrop-filter: saturate(1.4) blur(8px);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 22px 0 16px; margin-bottom: 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.crumb { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; margin-bottom: 4px; }
.topbar h1 { font-size: 21px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--text); padding: 0 13px; border-radius: 8px; font: inherit; font-weight: 500; font-size: 13px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { border-color: #bdbdb7; background: var(--surface-2); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #2a2a2d; border-color: #2a2a2d; }
.btn.gold { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad-line); background: var(--bad-bg); }
.btn.ghost { background: transparent; }
.btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Formularios ---------- */
input, select, textarea { font: inherit; font-size: 13px; height: 36px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface);
  color: var(--text); width: 100%; transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; padding: 9px 11px; resize: vertical; }
select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8b86' 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; }
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--ink); padding: 0; }
input[type=file] { padding: 6px 8px; }
input::placeholder { color: #a9a9a4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #8f8f8a; box-shadow: 0 0 0 3px var(--focus); }
input:disabled { background: var(--surface-2); color: var(--muted); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-2); font-weight: 500; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 16px; }
.grid-form .wide { grid-column: 1 / -1; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters > * { width: auto; }
.filters input[type=search] { min-width: 280px; padding-left: 34px; background: var(--surface) 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='%238b8b86' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center; }
.filters label { min-width: 150px; }
.filters .muted { font-size: 12.5px; align-self: center; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 11px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--text-2); border-radius: 6px; white-space: nowrap; }
.seg button:hover { background: var(--surface-2); color: var(--text); }
.seg button.on { background: var(--ink); color: #fff; }
details summary { cursor: pointer; font-weight: 500; font-size: 13px; color: var(--text-2); padding: 6px 0; }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.card h3 { font-size: 13.5px; margin-bottom: 14px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card h3 small { font-weight: 400; color: var(--muted); }
.card h3 small a { color: var(--text-2); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 13px; box-shadow: var(--shadow); min-width: 0; }
.kpi .l { color: var(--muted); font-size: 12px; font-weight: 500; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.kpi .v { font-size: 22px; font-weight: 600; margin-top: 8px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .s { color: var(--muted); font-size: 12px; margin-top: 4px; min-height: 17px; }
.kpi .s a { color: var(--text-2); }
.kpi.hl { background: var(--ink); color: #fff; border-color: var(--ink); }
.kpi.hl .l, .kpi.hl .s { color: #9c9c96; }
.kpi .neg { color: var(--bad); }
.kpi.hl .neg { color: #ff9d92; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; padding: 1px 6px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--good); background: var(--good-bg); }
.delta.down { color: var(--bad); background: var(--bad-bg); }
.delta.flat { color: var(--muted); background: var(--surface-2); }
.kpi.hl .delta.up { color: #7fdcae; background: rgba(127,220,174,.12); }
.kpi.hl .delta.down { color: #ffb2a8; background: rgba(255,178,168,.12); }
.kpi.hl .delta.flat { color: #9c9c96; background: rgba(255,255,255,.06); }
.periods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.row2 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 14px; }
.row-eq { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.chart-box { position: relative; height: 260px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); margin: -6px 0 10px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.section-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 22px 0 10px; font-weight: 600; }
@media (max-width: 1180px) { .row2, .row-eq { grid-template-columns: 1fr; } .periods { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; }
  #nav { display: flex; flex-wrap: wrap; gap: 2px; } .nav-group { display: contents; } .nav-label { display: none; } #nav a.active::before { display: none; }
  main { padding: 0 16px 40px; } .filters input[type=search] { min-width: 0; width: 100%; }
}

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 11px 14px; border-bottom: 1px solid #f0f0ed; text-align: left; vertical-align: middle; }
th { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; background: var(--surface-2); white-space: nowrap;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .08s; }
tbody tr:hover { background: #fbfbfa; }
tr.click { cursor: pointer; }
td b { font-weight: 600; }
td small { color: var(--muted); }
tfoot td { font-weight: 600; background: var(--surface-2); }
.card table th { background: transparent; position: static; padding: 8px 8px; }
.card td { padding: 9px 8px; }
.card th:first-child, .card td:first-child { padding-left: 0; }
.card th:last-child, .card td:last-child { padding-right: 0; }
.modal-card table th { background: transparent; position: static; padding: 8px 10px; }
.modal-card td { padding: 9px 10px; }
.prod { display: flex; gap: 11px; align-items: center; min-width: 210px; }
.thumb { width: 34px; height: 34px; border-radius: 7px; background: #f1f1ee; border: 1px solid var(--line); object-fit: cover; display: grid; place-items: center;
  color: var(--text-2); font-weight: 600; font-size: 11.5px; letter-spacing: .02em; flex: none; }
.prod b { display: block; font-weight: 600; }
.prod small { color: var(--muted); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 14px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); }
.src { display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 5px; margin-left: 6px; vertical-align: 1px; }

/* ---------- Etiquetas de estado (siempre texto + color) ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 500; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); line-height: 1.5; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge.good { background: var(--good-bg); color: var(--good); border-color: var(--good-line); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.badge.info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }

/* ---------- Ventanas ---------- */
.modal { position: fixed; inset: 0; background: rgba(15,15,16,.38); display: grid; place-items: start center; padding: 48px 16px; overflow-y: auto; z-index: 50; animation: fade .12s ease-out; }
.modal-card { background: var(--surface); border-radius: 14px; width: min(940px, 100%); padding: 24px 28px 22px; position: relative; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.modal-card h2 { font-size: 17px; margin: -2px 0 18px; padding: 0 36px 16px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.modal-card h2 small { font-weight: 400; font-size: 13px; }
.modal-card h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 10px; font-weight: 600; }
.modal-x { position: absolute; top: 18px; right: 18px; width: 30px; height: 30px; border-radius: 7px; border: 0; background: transparent; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.modal-x:hover { background: var(--surface-2); color: var(--text); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; align-items: center; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.detail-grid > div { background: var(--surface); padding: 10px 13px; }
.detail-grid span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.detail-grid b { font-variant-numeric: tabular-nums; font-weight: 600; }
.lines td input { height: 32px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Acceso ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 32px; width: 380px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-lg); }
.auth-card h2 { text-align: center; font-size: 17px; }
.auth-card .btn { height: 38px; }
.brand.big { justify-content: center; border: 0; padding: 0 0 6px; }
.brand.big b { color: var(--text); }
.brand.big .logo { color: var(--text); background: #fff; border-color: var(--line-strong); }

/* ---------- Avisos ---------- */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: #f1f1ee; padding: 12px 16px 12px 14px; border-radius: 10px; z-index: 60; max-width: 440px;
  box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; font-size: 13px; animation: fade .15s ease-out; }
.toast .ico { margin-top: 1px; color: #7fdcae; }
.toast.err { background: #fff; color: var(--text); border: 1px solid var(--bad-line); border-left: 3px solid var(--bad); }
.toast.err .ico { color: var(--bad); }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.note { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: var(--text-2); font-size: 12.5px; line-height: 1.6;
  display: flex; gap: 10px; align-items: flex-start; }
.note > .ico { margin-top: 2px; color: var(--muted); }
.note.warn { background: var(--warn-bg); border-color: var(--warn-line); color: #5f4100; }
.note.warn > .ico { color: var(--warn); }
.note code, .code { background: #efefec; padding: 1px 6px; border-radius: 5px; font-size: 12px; word-break: break-all; font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
.steps { margin: 4px 0 0; padding-left: 18px; line-height: 1.9; color: var(--text-2); }
.list-mini { display: flex; flex-direction: column; }
.list-mini > div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f0f0ed; align-items: center; }
.list-mini > div:last-child { border: 0; }
.list-mini b { font-variant-numeric: tabular-nums; }

/* Indicadores compactos (Envíos, Decants) */
.kpis.compact { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.kpis.compact .kpi { padding: 12px 14px 11px; }
.kpis.compact .v { font-size: 19px; margin-top: 6px; }
.kpis.compact .s { min-height: 0; }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
td a, .list-mini a { text-decoration: none; }
td a:hover, .list-mini a:hover { text-decoration: underline; text-decoration-color: var(--line-strong); }

.me { margin-bottom: 6px; line-height: 1.25; }
.me b { display: block; color: #fff; font-size: 12.5px; font-weight: 600; }
.me small { color: #85857f; font-size: 11px; }

/* Desglose de venta */
.bd { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 4px; }
.bd-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; border-bottom: 1px solid #f0f0ed; font-variant-numeric: tabular-nums; }
.bd-row span small, .bd-row b small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.bd-row:last-child { border-bottom: 0; }
.bd-sub { background: var(--surface-2); font-weight: 600; }
.bd-total { background: var(--ink); color: #fff; font-size: 15px; }
.bd-total b small { color: #a9a9a3; }
.bd-total .error { color: #ff9d92; }
.bd-est .bd-total { background: #2a2a2d; }

/* ---- Centro de Inteligencia ---- */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert-row { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.alert-row.bad { background: var(--bad-bg); border-color: var(--bad-line); } .alert-row.bad > .ico { color: var(--bad); }
.alert-row.warn { background: var(--warn-bg); border-color: var(--warn-line); } .alert-row.warn > .ico { color: var(--warn); }
.alert-row.info > .ico { color: var(--info); }
.alert-row small { color: var(--text-2); }
.chat-card { display: flex; flex-direction: column; height: calc(100vh - 220px); min-height: 460px; padding: 0; }
.chat { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.chat-empty { margin: auto; max-width: 620px; text-align: center; }
.chat-empty h4 { font-size: 16px; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--text-2); }
.chip:hover { background: var(--surface-2); color: var(--text); }
.msg { display: flex; flex-direction: column; max-width: 78%; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.bot { align-self: flex-start; }
.msg .bubble { padding: 10px 14px; border-radius: 12px; line-height: 1.55; }
.msg.user .bubble { background: var(--ink); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.msg.bot .bubble { background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.bot.err .bubble { background: var(--bad-bg); border-color: var(--bad-line); }
.msg .bubble p { margin: 0 0 6px; } .msg .bubble p:last-child { margin: 0; }
.msg .bubble ul { margin: 4px 0 8px 18px; padding: 0; } .msg .bubble h4 { margin: 8px 0 4px; font-size: 13.5px; }
.msg .src { margin-top: 4px; font-size: 11.5px; }
.chat-input { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-input textarea { flex: 1; resize: none; border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 11px; font: inherit; min-height: 40px; max-height: 160px; }
.dots { display: inline-flex; gap: 3px; margin-right: 6px; vertical-align: middle; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: dot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
pre.report { white-space: pre-wrap; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12.5px; line-height: 1.6; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; max-height: 62vh; overflow: auto; }

/* ---- Centro de Seguridad e inicio de sesión ---- */
label.check { display: flex; flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 500; cursor: pointer; }
label.check input { width: auto; height: auto; margin-top: 2px; }
.auth-card small.muted { display: block; margin: -4px 0 12px; font-size: 11.5px; line-height: 1.45; }
.qr { width: 190px; height: 190px; margin: 6px 0 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.qr svg { width: 100%; height: 100%; display: block; }
ol.steps { margin: 6px 0 8px 18px; padding: 0; line-height: 1.6; }
.perm-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 10px 0; }
.good-ico { color: var(--good); } .bad-ico { color: var(--bad); }
td.diff div { font-size: 12px; line-height: 1.5; word-break: break-word; } td.diff s { color: var(--muted); }
pre.codes { font-size: 15px; letter-spacing: 1px; columns: 2; }

/* Logo SCENTS Monterrey: el fondo negro de la imagen se funde con la barra oscura; en la pantalla de acceso se invierte */
.brand-logo { display: block; width: 132px; height: auto; filter: contrast(1.6); mix-blend-mode: screen; }
.brand small { margin-top: 6px; }
.brand.big { flex-direction: column; gap: 4px; }
.brand.big .brand-logo { width: 190px; filter: invert(1) contrast(1.6); mix-blend-mode: multiply; }

/* ---------- Chatbot ---------- */
.nav-count { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #c8372d; color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.nav-count[hidden] { display: none; }
.chat-split { display: grid; grid-template-columns: 340px 1fr; gap: 14px; align-items: start; }
.chat-list { padding: 6px; max-height: calc(100vh - 230px); overflow-y: auto; }
.chat-row { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 10px 12px; border-radius: 8px; cursor: pointer; border-bottom: 1px solid var(--line); }
.chat-row:hover { background: var(--surface-2); } .chat-row.on { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--ink); }
.chat-row-top { display: flex; justify-content: space-between; gap: 8px; } .chat-row-msg { font-size: 12.5px; color: var(--text-2); margin: 3px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.chat-detail { display: flex; flex-direction: column; min-height: 420px; }
.chat-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.chat-alert { margin: 10px 0 0; padding: 9px 12px; border-radius: 8px; background: var(--bad-bg); color: var(--bad); font-size: 13px; }
.chat-note { margin: 10px 0 0; padding: 9px 12px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.chat-msgs { flex: 1; overflow-y: auto; max-height: calc(100vh - 400px); min-height: 200px; padding: 12px 2px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 82%; } .chat-msg small { font-size: 11px; margin-top: 3px; }
.chat-msg.user { align-self: flex-end; align-items: flex-end; }
.chat-bub { padding: 9px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; line-height: 1.45; }
.chat-msg.user .chat-bub { background: var(--ink); color: #fff; } .chat-msg.admin .chat-bub { background: #f4ede1; border: 1px solid #d8c39c; }
.chat-who { display: block; font-weight: 700; color: #8c6b3e; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.chat-sys { align-self: center; font-size: 11.5px; color: var(--muted); }
.chat-cards { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; } .chat-cards a, .chat-cards span { font-size: 12px; padding: 3px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); color: inherit; text-decoration: none; }
.chat-reply { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; } .chat-reply textarea { flex: 1; resize: vertical; }
@media (max-width: 980px) { .chat-split { grid-template-columns: 1fr; } .chat-list { max-height: 320px; } }
.kb-list { display: grid; gap: 10px; } .kb-item { padding: 14px 16px; } .kb-item.off { opacity: .75; border-style: dashed; }
.kb-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; } .kb-item h4 { margin: 6px 0 0; font-size: 14px; }
.kb-item p { margin: 8px 0 6px; font-size: 13px; color: var(--text-2); white-space: pre-wrap; }
/* Desglose de ganancia (dashboard) */
.kpi-click { cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.kpi-click:hover { border-color: var(--ink); box-shadow: var(--shadow-lg); }
.kpi-click .s u { text-underline-offset: 2px; }
#modalBody tr.clickable { cursor: pointer; }
#modalBody tr.clickable:hover td { background: var(--surface-2); }
#modalBody tr.tot td { border-top: 2px solid var(--ink); }
/* Gastos personales (apartado privado) */
.pv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pv-private { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.pv-private .ico { width: 14px; height: 14px; }
.pv-lock { max-width: 440px; margin: 40px auto; text-align: center; padding: 30px 30px 24px; }
.pv-lock h2 { margin: 10px 0 6px; font-size: 20px; }
.pv-lock .grid-form { text-align: left; margin-top: 18px; }
.pv-lock-ico { width: 52px; height: 52px; border-radius: 14px; background: var(--ink); color: #fff; display: grid; place-items: center; margin: 0 auto; }
.pv-lock-ico .ico { width: 24px; height: 24px; }
.pv-month { font-size: 15px; min-width: 150px; text-align: center; align-self: center; }
.pv-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 0; }
.pv-bar { display: block; height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 2px 0 6px; }
.pv-bar i { display: block; height: 100%; border-radius: 99px; background: #14a38b; }
.pv-bar i.cerca { background: #e8a317; }
.pv-bar i.excedido { background: var(--bad); }
.pv-bud { padding: 8px 0; border-bottom: 1px solid #f0f0ed; }
.pv-bud:last-child { border: 0; }
.pv-bud > div { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.pv-alerts { display: grid; gap: 8px; margin-bottom: 14px; }
.pv-donut { display: grid; grid-template-columns: 1fr; gap: 12px; }
.pv-donut .list-mini span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-box.sm { height: 180px; }
.pv-bin { width: 130px; text-align: right; }
.pv-matrix td, .pv-matrix th { white-space: nowrap; }
.pv-files { display: flex; gap: 12px; flex-wrap: wrap; }
.pv-file { width: 150px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: grid; gap: 6px; }
.pv-file small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.pv-thumb { height: 100px; border-radius: 7px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.pv-thumb img { width: 100%; height: 100%; object-fit: cover; }
#view tr.clickable { cursor: pointer; }
#view tr.clickable:hover td { background: var(--surface-2); }
@media (max-width: 720px) { .pv-lock { margin: 16px auto; padding: 22px 18px; } }
/* Ventas por redes sociales */
.rs-origin { display: flex; flex-wrap: wrap; gap: 8px; }
.rs-chip input { position: absolute; opacity: 0; pointer-events: none; }
.rs-chip span { display: inline-flex; align-items: center; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; font-size: 13px; background: var(--surface); }
.rs-chip input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.rs-chip input:focus-visible + span { outline: 2px solid #2a78d6; outline-offset: 2px; }
.rs-line { display: grid; grid-template-columns: minmax(220px, 1fr) 80px 120px 110px 140px 34px; gap: 8px; align-items: end; padding: 8px 0; border-bottom: 1px solid #f0f0ed; }
.rs-line label { font-size: 12px; }
.rs-imp { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding-bottom: 6px; }
.rs-imp b { font-variant-numeric: tabular-nums; }
.rs-del { height: 34px; }
.rs-table td small { line-height: 1.35; }
.rs-detail p { margin: 0 0 6px; line-height: 1.5; }
.rs-actions { flex-wrap: wrap; }
@media (max-width: 760px) {
  .rs-line { grid-template-columns: 1fr 1fr; }
  .rs-line .rs-prod { grid-column: 1 / -1; }
  .rs-imp { grid-column: 1 / 2; align-items: flex-start; }
  .rs-del { grid-column: 2 / 3; justify-self: end; }
  .rs-detail { grid-template-columns: 1fr; }
}
