/* EcomSales · sistema de diseño del panel. Tema claro, acento verde azulado y ámbar. */
:root {
  --bg: #f5f6f8; --card: #ffffff; --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --line: #e6e8ec; --line-2: #f1f3f6;
  --brand: #0f766e; --brand-2: #14b8a6; --brand-soft: #e6f6f4; --accent: #f59e0b; --accent-soft: #fef3c7;
  --danger: #dc2626; --danger-soft: #fee2e2; --ok: #16a34a; --ok-soft: #dcfce7; --warn: #d97706; --warn-soft: #fef3c7; --info: #2563eb; --info-soft: #dbeafe; --violet: #7c3aed; --violet-soft: #ede9fe;
  --radius: 12px; --radius-s: 8px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.08); --shadow-2: 0 10px 30px rgba(16,24,40,.14);
  --side-w: 236px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; }
a { color: var(--brand); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; } .tiny-text { font-size: 11px; } .error { color: var(--danger); min-height: 1em; }
.right { text-align: right; margin-left: auto; } .center { text-align: center; } .mt { margin-top: 12px; } .mb { margin-bottom: 12px; } .ml { margin-left: 8px; } .nowrap { white-space: nowrap; }
.pos { color: var(--ok); } .neg { color: var(--danger); } .warn { color: var(--warn); } .b { font-weight: 600; }
code { background: #eef2f7; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
kbd { background: #f1f5f9; border: 1px solid #cbd5e1; border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; font-size: 12px; font-family: inherit; }
h1 { font-size: 22px; margin: 0 0 2px; font-weight: 700; } h2 { font-size: 15px; margin: 0 0 10px; font-weight: 700; } h3 { font-size: 13px; margin: 0 0 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.loading { padding: 40px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; } @keyframes spin { to { transform: rotate(360deg); } }

/* ---- login ---- */
.login { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(320px, 5fr) minmax(360px, 6fr); background: var(--bg, #f5f6f8); overflow: auto; }
.auth-hero { background: linear-gradient(150deg, #0b5f58 0%, #0f766e 55%, #14b8a6 100%); color: #fff; padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.auth-hero .logo { color: #fff; } .auth-hero .logo-mark { background: #fff; color: var(--brand); }
.auth-hero h1 { font-size: 30px; line-height: 1.2; margin: 0; max-width: 460px; }
.auth-hero ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; max-width: 460px; } .auth-hero li { padding-left: 26px; position: relative; opacity: .95; } .auth-hero li::before { content: '✓'; position: absolute; left: 0; font-weight: 800; }
.auth-side { display: grid; place-items: center; padding: 24px; }
.auth-card { width: 420px; max-width: 100%; padding: 28px; } .auth-card h2 { margin: 6px 0 2px; font-size: 22px; } .auth-card .btn.big { width: 100%; margin-top: 14px; padding: 11px; font-size: 15px; }
body .auth-card .auth-logo { display: none; } .auth-switch { text-align: center; margin: 16px 0 0; font-size: 13px; color: var(--muted); } .auth-switch a { font-weight: 600; }
.notice { background: var(--accent-soft); border: 1px solid #fde68a; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 8px 0; }
@media (max-width: 820px) { .login { grid-template-columns: 1fr; } .auth-hero { display: none; } body .auth-card .auth-logo { display: flex; } }
.logo { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.logo-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 800; font-size: 18px; }

/* ---- armazón ---- */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
body.nav-min .app { grid-template-columns: 64px 1fr; }
.sidebar { background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: hidden; }
.brand { padding: 14px 14px 8px; font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.brand .icon-btn { margin-left: auto; }
body.nav-min .brand-name, body.nav-min .tenant, body.nav-min .nav-label, body.nav-min .nl, body.nav-min .sidebar-foot #userBadge { display: none; }
body.nav-min #nav a { justify-content: center; padding: 10px 0; }
.tenant { display: flex; gap: 10px; align-items: center; padding: 8px 14px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
.tenant .flag { font-size: 20px; }
#nav { display: flex; flex-direction: column; padding: 4px 10px; overflow: auto; flex: 1; }
.nav-group { margin-bottom: 8px; }
.nav-label { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #94a3b8; padding: 8px 10px 4px; }
#nav a { display: flex; align-items: center; gap: 10px; color: var(--ink-2); padding: 7px 10px; border-radius: 8px; font-size: 13.5px; position: relative; }
#nav a .ni { width: 20px; text-align: center; font-size: 14px; opacity: .85; }
#nav a:hover { background: #f1f5f9; color: var(--ink); }
#nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
#nav a .badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; border-radius: 999px; padding: 1px 6px; }
.sidebar-foot { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line-2); }
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 10px 26px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.crumb { font-weight: 700; min-width: 120px; color: var(--ink-2); }
.gsearch { position: relative; flex: 1; max-width: 560px; }
.gsearch .gs-icon { position: absolute; left: 10px; top: 8px; color: var(--muted); }
.gsearch input { padding-left: 30px; background: #f8fafc; }
.gs-results { position: absolute; top: 40px; left: 0; right: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-2); z-index: 40; max-height: 420px; overflow: auto; }
.gs-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 12px 4px; font-weight: 700; }
.gs-results a { display: flex; gap: 8px; align-items: center; padding: 8px 12px; color: var(--ink); } .gs-results a:hover { background: #f8fafc; }
.top-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.icon-btn { background: transparent; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font: inherit; color: var(--ink-2); padding: 6px 9px; position: relative; }
.icon-btn:hover { background: #f1f5f9; }
.bell-count { position: absolute; top: -4px; right: -2px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 5px; min-width: 16px; text-align: center; }
.bell-count.crit { background: var(--danger); }
main { padding: 20px 26px 60px; max-width: 1480px; min-width: 0; width: 100%; }
@media (max-width: 900px) { .app { grid-template-columns: 1fr; } .sidebar { position: relative; height: auto; } main { padding: 14px; } .topbar { padding: 8px 14px; } }

/* ---- piezas base ---- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; border: 1px solid var(--line-2); }
.card.flat { box-shadow: none; }
.card.pad0 { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; font-weight: 500; }
label.check { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink); font-size: 13px; } label.check input { width: auto; }
.help { font-size: 11px; color: var(--muted); margin-top: 3px; font-weight: 400; } .req { color: var(--danger); }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--card); color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(20,184,166,.15); }
input.invalid, select.invalid, textarea.invalid { border-color: var(--danger); }
textarea { min-height: 70px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; } .form-grid > label { margin-top: 8px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); background: var(--card); border-radius: 8px; cursor: pointer; font: inherit; color: var(--ink); white-space: nowrap; line-height: 1.2; }
.btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); } .btn.primary:hover { background: #0d5f58; }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.danger { color: var(--danger); border-color: #fecaca; } .btn.danger-solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.success { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.tiny { padding: 4px 8px; font-size: 12px; } .btn.small { padding: 6px 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.link, button.link { background: none; border: none; color: var(--brand); padding: 4px 6px; cursor: pointer; font: inherit; text-align: left; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { width: auto; min-width: 140px; }
.toolbar.right { justify-content: flex-end; }
.grid { display: grid; gap: 14px; } .grid.c2 { grid-template-columns: repeat(2, 1fr); } .grid.c3 { grid-template-columns: repeat(3, 1fr); } .grid.c4 { grid-template-columns: repeat(4, 1fr); } .grid.c5 { grid-template-columns: repeat(5, 1fr); } .grid.c6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1200px) { .grid.c4, .grid.c5, .grid.c6 { grid-template-columns: repeat(3, 1fr); } .grid.c3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 800px) { .grid.c2, .grid.c3, .grid.c4, .grid.c5, .grid.c6 { grid-template-columns: 1fr; } }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; border: 1px solid var(--line-2); position: relative; }
.kpi .kl { color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; } .kpi .ki { font-size: 16px; }
.kpi .kv { font-size: 24px; font-weight: 700; margin-top: 2px; } .kpi .ks { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi .l { color: var(--muted); font-size: 12px; } .kpi .v { font-size: 24px; font-weight: 700; margin-top: 2px; } .kpi .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.ok .kv { color: var(--ok); } .kpi.bad .kv { color: var(--danger); } .kpi.warn .kv { color: var(--warn); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } @media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }
.split.wide-left { grid-template-columns: 2fr 1fr; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr.row:hover { background: #f8fafc; cursor: pointer; }
tr.selected { background: var(--brand-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { text-align: right; white-space: nowrap; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: #eef2f7; color: #334155; margin: 1px 2px 1px 0; white-space: nowrap; }
.tag.s-nuevo { background: var(--info-soft); color: #1e40af; } .tag.s-en_confirmacion { background: var(--warn-soft); color: #92400e; } .tag.s-confirmado { background: var(--ok-soft); color: #166534; }
.tag.s-en_dropi, .tag.s-despachado { background: var(--violet-soft); color: #5b21b6; } .tag.s-en_ruta { background: #e0f2fe; color: #075985; } .tag.s-novedad { background: #ffedd5; color: #9a3412; }
.tag.s-entregado { background: var(--ok); color: #fff; } .tag.s-devuelto { background: var(--danger); color: #fff; } .tag.s-cancelado { background: #e5e7eb; color: #374151; }
.tag.risk-malo { background: var(--danger-soft); color: #991b1b; } .tag.risk-bueno { background: var(--ok-soft); color: #166534; } .tag.risk-regular { background: var(--warn-soft); color: #92400e; }
.tag.warnt { background: var(--warn-soft); color: #92400e; } .tag.okt { background: var(--ok-soft); color: #166534; } .tag.badt { background: var(--danger-soft); color: #991b1b; } .tag.infot { background: var(--info-soft); color: #1e40af; } .tag.brandt { background: var(--brand-soft); color: var(--brand); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 0 0; flex-wrap: wrap; } .pager select { width: auto; padding: 3px 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; } .dot.ok { background: var(--ok); } .dot.bad { background: var(--danger); } .dot.warn { background: var(--warn); }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 12px; flex: none; }
.avatar.big { width: 44px; height: 44px; font-size: 14px; }
.bar { height: 8px; background: #eef2f7; border-radius: 999px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--brand-2); }
.bar.ok i { background: var(--ok); } .bar.warn i { background: var(--warn); } .bar.bad i { background: var(--danger); }
.bars { display: flex; align-items: flex-end; gap: 4px; } .bars > div { flex: 1; background: var(--brand-2); border-radius: 3px 3px 0 0; min-width: 6px; } .bars .b { flex: 1; border-radius: 3px 3px 0 0; min-width: 6px; }
.alert { padding: 10px 12px; border-radius: 8px; margin-bottom: 8px; font-size: 13px; background: #f8fafc; border: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.alert.warn { background: #fffbeb; border-color: #fde68a; } .alert.critical, .alert.bad { background: #fef2f2; border-color: #fecaca; } .alert.ok { background: #f0fdf4; border-color: #bbf7d0; } .alert.info { background: #eff6ff; border-color: #bfdbfe; }
.toast { position: fixed; bottom: 20px; right: 20px; background: #111827; color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow-2); z-index: 100; max-width: 420px; }
.toast.err { background: var(--danger); }
pre { background: #0f172a; color: #e2e8f0; padding: 10px; border-radius: 8px; overflow: auto; font-size: 12px; }
.steps { display: flex; flex-wrap: wrap; gap: 6px; } .steps span { background: #eef2f7; border-radius: 6px; padding: 3px 8px; font-size: 11px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin: 0; color: var(--ink); font-size: 13px; }
.switch input { display: none; } .switch .sl { width: 36px; height: 20px; background: #cbd5e1; border-radius: 999px; position: relative; transition: .15s; }
.switch .sl::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + .sl { background: var(--ok); } .switch input:checked + .sl::after { left: 18px; }

/* pestañas, chips */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tab { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--ink); } .tab.active { color: var(--brand); border-color: var(--brand); font-weight: 600; }
.tab .count { background: #eef2f7; border-radius: 999px; padding: 0 7px; font-size: 11px; color: var(--ink-2); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: 12.5px; color: var(--ink-2); }
.pills.small .pill { padding: 3px 9px; font-size: 11.5px; }
.pill b { margin-left: 4px; } .pill.active { background: var(--brand); color: #fff; border-color: var(--brand); } .pill:hover:not(.active) { background: #f8fafc; }
.counters { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; padding: 10px 0 4px; }
.counter { text-align: center; padding: 6px 8px; border-radius: 8px; cursor: pointer; min-width: 78px; border: 1px solid transparent; }
.counter:hover { background: #f8fafc; } .counter.active { background: var(--brand-soft); border-color: #99e2d8; }
.counter .cn { font-size: 17px; font-weight: 700; } .counter .cn small { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.counter .cm { font-size: 11px; color: var(--muted); } .counter .cl { font-size: 11px; color: var(--ink-2); margin-top: 2px; }
.counter.sep { border-left: 1px solid var(--line); border-radius: 0; margin-left: 6px; padding-left: 16px; }
.collapse > summary { cursor: pointer; font-size: 12px; color: var(--muted); list-style: none; padding: 8px 0; } .collapse > summary::before { content: "▸ "; } .collapse[open] > summary::before { content: "▾ "; }
.metrics-period { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 18px; align-items: center; padding: 8px 0 4px; }
@media (max-width: 900px) { .metrics-period { grid-template-columns: 1fr; } }
.metric-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.metric-big { font-size: 30px; font-weight: 800; }
.goal { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 10px 14px; text-align: center; min-width: 150px; }
.goal .tag { margin-top: 6px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ei { font-size: 38px; margin-bottom: 6px; } .empty h3 { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 15px; } .empty p { margin: 4px auto 14px; max-width: 480px; }
.bulk-bar { display: flex; gap: 8px; align-items: center; background: var(--brand-soft); border: 1px solid #99e2d8; border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
.filters-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; padding: 10px 0 4px; }
.search-wrap { position: relative; flex: 1; min-width: 240px; } .search-wrap input { width: 100%; padding-left: 30px; } .search-wrap::before { content: "⌕"; position: absolute; left: 10px; top: 7px; color: var(--muted); }

/* modal, cajón, menú, popover */
.modal-back { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal { background: var(--card); border-radius: 14px; width: 560px; max-width: 100%; max-height: 92vh; display: flex; flex-direction: column; box-shadow: var(--shadow-2); animation: pop .15s ease-out; }
.modal.wide { width: 860px; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); } .modal-head h2 { margin: 0; font-size: 16px; }
.modal-body { padding: 14px 18px; overflow: auto; } .modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 4px; } .section-title:first-child { margin-top: 0; }
.drawer-back { position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 60; }
.drawer { position: absolute; right: 0; top: 0; bottom: 0; background: var(--card); box-shadow: var(--shadow-2); display: flex; flex-direction: column; max-width: 100%; animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-body { padding: 14px 18px; overflow: auto; flex: 1; }
.menu-pop { position: absolute; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-2); z-index: 80; min-width: 200px; padding: 4px; }
.menu-pop button { display: flex; gap: 8px; width: 100%; text-align: left; background: none; border: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; font: inherit; color: var(--ink); }
.menu-pop button:hover { background: #f1f5f9; } .menu-pop button.danger { color: var(--danger); } .menu-pop button[disabled] { opacity: .45; cursor: not-allowed; } .menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.popover { position: absolute; z-index: 70; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2); }
.daterange { display: grid; grid-template-columns: 170px 1fr; right: 0; top: 40px; width: 420px; }
.daterange .presets { border-right: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; } .daterange .presets .link { padding: 6px 8px; border-radius: 6px; color: var(--ink); } .daterange .presets .link:hover { background: #f1f5f9; } .daterange .presets .link.active { color: var(--brand); font-weight: 600; }
.daterange .custom { padding: 10px 12px; }
.kbd-table td { padding: 6px 10px; }

/* chat */
.chat3 { display: grid; grid-template-columns: 320px 1fr 300px; gap: 0; height: calc(100vh - 118px); min-height: 520px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (max-width: 1100px) { .chat3 { grid-template-columns: 280px 1fr; } .chat3 .chat-side { display: none; } }
.chat-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.chat-list .cl-head { padding: 10px 12px; border-bottom: 1px solid var(--line-2); } .chat-list .cl-head .filters { display: flex; gap: 4px; margin-top: 6px; } .chat-list .cl-head .filters select { width: auto; min-width: 0; padding: 6px 6px; }
.chat-list .cl-items { overflow: auto; flex: 1; }
.chat-list .item { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; align-items: flex-start; }
.chat-list .item:hover { background: #f8fafc; } .chat-list .item.active { background: var(--brand-soft); }
.chat-list .item .t { flex: 1; min-width: 0; } .chat-list .item .n { display: flex; justify-content: space-between; gap: 6px; } .chat-list .item .n b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list .item .lm { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list .item .small .tag { font-size: 10px; padding: 1px 6px; }
.chat-list .unread { background: var(--brand); color: #fff; border-radius: 999px; font-size: 10px; padding: 1px 6px; }
.chat-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.chat-head .who { flex: 1; min-width: 200px; } .chat-head .who b { white-space: nowrap; } .chat-head .toolbar { flex: none; }
.chat-head .sub { font-size: 12px; color: var(--muted); }
.bubbles { flex: 1; min-height: 0; overflow: auto; padding: 14px; background: #efeae2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Ccircle cx='20' cy='20' r='1.2' fill='%23d9d2c5'/%3E%3Ccircle cx='80' cy='70' r='1.2' fill='%23d9d2c5'/%3E%3C/svg%3E"); display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 72%; padding: 8px 10px; border-radius: 10px; background: var(--card); box-shadow: 0 1px 1px rgba(0,0,0,.08); font-size: 13px; white-space: pre-wrap; position: relative; }
.bubble.out { align-self: flex-end; background: #d9fdd3; } .bubble.sys { align-self: center; background: #fdf6d8; font-size: 11px; color: #7c5a00; max-width: 80%; text-align: center; }
.bubble .meta { font-size: 10px; color: var(--muted); margin-top: 3px; text-align: right; }
.bubble .btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; } .bubble .btns span { background: var(--card); border: 1px solid #cbd5e1; border-radius: 6px; padding: 2px 8px; font-size: 11px; color: var(--info); }
.day-sep { align-self: center; background: var(--card); border-radius: 6px; padding: 2px 8px; font-size: 11px; color: var(--muted); }
.compose { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line-2); align-items: center; } .compose input { flex: 1; }
.compose-note { padding: 6px 12px; font-size: 12px; background: var(--warn-soft); color: #92400e; border-top: 1px solid #fde68a; }
.chat-side { border-left: 1px solid var(--line); overflow: auto; padding: 14px; font-size: 13px; }
.chat-side h3 { margin-top: 14px; } .chat-side h3:first-child { margin-top: 0; }

/* tablero kanban */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kcol { flex: 0 0 250px; background: #f1f3f6; border-radius: 12px; padding: 10px; min-height: 200px; border: 2px solid transparent; }
.kcol.over { border-color: var(--brand-2); background: #e6f6f4; }
.kcol .kh { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 13px; margin-bottom: 8px; } .kcol .kh small { color: var(--muted); font-weight: 500; }
.kcard { background: var(--card); border-radius: 10px; padding: 10px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: grab; border: 1px solid var(--line-2); font-size: 12.5px; }
.kcard:active { cursor: grabbing; } .kcard.dragging { opacity: .5; }
.kcard .kt { display: flex; justify-content: space-between; font-weight: 600; } .kcard .ks { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.kcard .ktags { margin-top: 6px; }
.pipe-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pipe-card { background: var(--card); border-radius: 12px; border: 1px solid var(--line-2); box-shadow: var(--shadow); padding: 12px; border-top: 4px solid var(--brand-2); }
.pipe-card .ph { display: flex; justify-content: space-between; font-weight: 700; } .pipe-card .pn { font-size: 24px; font-weight: 800; } .pipe-card .pl { font-size: 12px; color: var(--muted); }
.pipe-card ul { list-style: none; padding: 0; margin: 8px 0 0; font-size: 12px; } .pipe-card li { padding: 3px 0; border-top: 1px dashed var(--line); display: flex; justify-content: space-between; }

/* línea de tiempo */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; } .timeline li { padding: 6px 0 6px 22px; position: relative; font-size: 12.5px; border-bottom: 1px dashed var(--line-2); }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-2); } .timeline li .when { color: var(--muted); font-size: 11px; }

/* celular de vista previa */
.phone { width: 300px; border: 8px solid #1f2937; border-radius: 28px; background: #efeae2; overflow: hidden; margin: 0 auto; }
.phone-top { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: #075e54; color: #fff; font-size: 12px; } .pav { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #25d366; font-weight: 700; }
.phone-screen { padding: 14px 10px; min-height: 260px; }
.wa-bubble { background: #fff; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; box-shadow: 0 1px 1px rgba(0,0,0,.1); white-space: pre-wrap; }
.wa-head { font-weight: 700; margin-bottom: 4px; } .wa-foot { color: var(--muted); font-size: 11px; margin-top: 4px; } .wa-time { text-align: right; font-size: 10px; color: var(--muted); margin-top: 4px; }
.wa-bubble .var { background: var(--info-soft); color: #1e40af; border-radius: 4px; padding: 0 4px; font-size: 11px; }
.wa-btns div { background: #fff; color: #00a5f4; text-align: center; border-radius: 8px; padding: 7px; margin-top: 4px; font-size: 12.5px; }

/* gráficos */
.chart svg { width: 100%; height: auto; } .chart .grid { stroke: #eef2f7; } .chart .axis { font-size: 10px; fill: #94a3b8; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 6px; } .legend.col { flex-direction: column; gap: 4px; }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; } .legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.donut { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; } .donut .dn { font-size: 22px; font-weight: 700; fill: var(--ink); }
.donut-empty { padding: 40px 10px; text-align: center; }
.gauge { text-align: center; } .gauge .gv { font-size: 18px; font-weight: 700; fill: var(--ink); }

/* editor de flujos */
.flow-editor { display: grid; grid-template-columns: 230px 1fr 320px; gap: 0; height: calc(100vh - 130px); min-height: 560px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.flow-palette { border-right: 1px solid var(--line); overflow: auto; padding: 10px; }
.flow-palette h3 { margin: 10px 0 6px; } .pal-item { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; cursor: grab; font-size: 12.5px; display: flex; gap: 8px; align-items: center; background: var(--card); }
.pal-item:hover { border-color: var(--brand-2); background: #f8fafc; } .pal-item .pi { width: 22px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; color: #fff; font-size: 12px; }
.flow-canvas { position: relative; overflow: auto; background: #fafbfc; background-image: radial-gradient(#e2e8f0 1px, transparent 1px); background-size: 18px 18px; }
.flow-canvas.over { background-color: #f0fdfa; }
.node { position: absolute; width: 230px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); cursor: grab; user-select: none; }
.node.selected { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,118,110,.18); }
.node .nh { padding: 6px 10px; color: #fff; border-radius: 10px 10px 0 0; font-size: 11.5px; font-weight: 600; display: flex; justify-content: space-between; }
.node .nb { padding: 8px 10px; font-size: 12px; } .node .nb .muted { font-size: 11px; }
.node .port { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2px solid var(--brand); left: 50%; transform: translateX(-50%); } .node .port.in { top: -6px; } .node .port.out { bottom: -6px; }
.node .port.yes { left: 30%; background: var(--ok); border-color: var(--ok); } .node .port.no { left: 70%; background: var(--danger); border-color: var(--danger); }
.flow-config { border-left: 1px solid var(--line); overflow: auto; padding: 14px; }
.flow-simple { max-width: 720px; margin: 0 auto; }
.fs-step { display: grid; grid-template-columns: 34px 1fr; gap: 10px; margin-bottom: 10px; }
.fs-step .no { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 12px; margin-top: 8px; }
.fs-step .box { background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; }
.fs-step .box .ft { font-weight: 700; } .fs-step .box .fs { font-size: 12px; color: var(--muted); }
.fs-msg { background: #d9fdd3; border-radius: 8px; padding: 8px 10px; margin-top: 8px; font-size: 12.5px; white-space: pre-wrap; }
.fs-msg .var { background: var(--info-soft); color: #1e40af; border-radius: 4px; padding: 0 4px; font-size: 11px; }
.fs-cond { background: #fdf2f8; color: #9d174d; border-radius: 6px; padding: 4px 8px; font-size: 12px; display: inline-block; margin-top: 6px; }

/* ajustes: conexiones */
.conn { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--card); margin-bottom: 8px; }
.conn .ci { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--line-2); font-size: 18px; } .conn .ct { flex: 1; } .conn .ct .small { color: var(--muted); }
.onboard { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } @media (max-width: 800px) { .onboard { grid-template-columns: 1fr; } }
.ob-step { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--card); }
.ob-step .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #eef2f7; font-weight: 700; font-size: 12px; flex: none; } .ob-step.done .n { background: var(--ok); color: #fff; }
.notif { display: flex; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--card); margin-bottom: 8px; align-items: flex-start; } .notif.unread { border-left: 4px solid var(--accent); }
.notif .ni { font-size: 20px; } .notif .nt { flex: 1; }
.hero { background: linear-gradient(120deg, #e6f6f4, #fff 60%, #fef3c7); border-radius: 16px; padding: 24px 26px; margin-bottom: 16px; border: 1px solid var(--line-2); }
.hero h1 { font-size: 26px; } .hero .chips { margin-top: 10px; }
.hero .ask { display: flex; gap: 8px; max-width: 620px; margin-top: 12px; }
.rent-table td { padding: 5px 8px; } .rent-table tr.total td { border-top: 2px solid var(--ink); font-weight: 700; }
.op-card { text-align: center; padding: 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--card); } .op-card .ov { font-size: 22px; font-weight: 800; } .op-card .ol { color: var(--muted); font-size: 12px; }

/* Tema oscuro (Ajustes → Perfil → Interfaz) */
body.theme-dark { --bg: #0f1419; --card: #161c24; --ink: #e6edf3; --ink-2: #c9d1d9; --muted: #8b98a5; --line: #263040; --line-2: #1e2733; --brand-soft: #0f2f2b; --accent-soft: #3a2c08; --danger-soft: #3a1414; --ok-soft: #0f2d1a; --warn-soft: #3a2c08; --info-soft: #0f2340; --violet-soft: #261a44; background: var(--bg); color: var(--ink); }
body.theme-dark .bubble { background: #1f2937; color: var(--ink); } body.theme-dark .bubble.out { background: #134e4a; } body.theme-dark .bubbles { background: #0b1016; }
body.theme-dark input, body.theme-dark select, body.theme-dark textarea { background: #0f1419; color: var(--ink); border-color: var(--line); }
.md h2, .md h3 { margin: 12px 0 6px } .md ul { margin: 4px 0 8px 18px } .md p { margin: 6px 0 }

/* ---- PWA / móvil ---- */
.menu-btn { display: none; font-size: 18px; }
.nav-backdrop { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 29; }
.install-bar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; background: #111827; color: #fff; padding: 10px 12px; border-radius: 12px; display: flex; gap: 10px; align-items: center; font-size: 13px; box-shadow: var(--shadow-2); }
.install-bar .icon-btn { color: #fff; }
.chat-back { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 270px; height: 100vh; z-index: 30; transform: translateX(-100%); transition: transform .18s ease; box-shadow: var(--shadow-2); }
  body.nav-open .sidebar { transform: translateX(0); } body.nav-open .nav-backdrop { display: block; }
  body.nav-min .app { grid-template-columns: 1fr; } body.nav-min .brand-name, body.nav-min .tenant, body.nav-min .nav-label, body.nav-min .nl, body.nav-min .sidebar-foot #userBadge { display: initial; }
  .menu-btn { display: inline-block; } .crumb { min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .gsearch { max-width: none; } .gsearch input { font-size: 16px; }
  main { padding: 12px 12px 90px; }
  .card.pad0 { overflow-x: auto; -webkit-overflow-scrolling: touch; } .card.pad0 table { min-width: 720px; }
  .toolbar { flex-wrap: wrap; } .page-head { flex-wrap: wrap; gap: 8px; }
  .kpi .kv { font-size: 22px; }
  .modal { width: 96vw !important; max-width: 96vw; max-height: 92vh; } .drawer { width: 100vw !important; }
  input, select, textarea { font-size: 16px; }
  .bulk-bar { flex-wrap: wrap; }
}
@media (max-width: 700px) {
  .chat3 { grid-template-columns: 1fr !important; height: calc(100vh - 110px); }
  .chat3 .chat-side { display: none; } .chat3 .chat-pane { display: none; } .chat3 .chat-list { display: flex; border-right: 0; }
  body.chat-open .chat3 .chat-list { display: none; } body.chat-open .chat3 .chat-pane { display: flex; flex-direction: column; min-height: 0; }
  .chat-back { display: inline-block; margin-right: 4px; }
  .chat-head .toolbar { flex-wrap: wrap; } .compose { flex-wrap: wrap; } .compose input { min-width: 0; flex: 1 1 100%; }
  .grid.c6, .grid.c5, .grid.c4, .grid.c3, .grid.c2 { grid-template-columns: 1fr 1fr; }
}
@media (display-mode: standalone) { .topbar { padding-top: max(10px, env(safe-area-inset-top)); } }

/* Tema oscuro: el banner de bienvenida conserva sus degradados pero en tonos oscuros (antes quedaba claro con letras claras). */
body.theme-dark .hero { background: linear-gradient(120deg, var(--brand-soft), var(--card) 60%, var(--accent-soft)); }

/* Tema oscuro: nodos del editor de flujos (SVG con relleno blanco fijo). */
body.theme-dark svg [fill="#fff"] { fill: var(--card); }
body.theme-dark svg text { fill: var(--ink); }

/* ---- asistente de configuración (pantalla completa) ---- */
.wizard { position: fixed; inset: 0; z-index: 60; background: var(--bg, #f5f6f8); display: grid; grid-template-columns: 300px 1fr; }
.wz-side { background: var(--card); border-right: 1px solid var(--line); overflow: auto; padding: 18px 14px 24px; }
.wz-side .logo { font-size: 18px; margin-bottom: 14px; }
.wz-group { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 16px 8px 6px; }
.wz-item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.wz-item:hover { background: var(--brand-soft); } .wz-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.wz-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; font-size: 11px; color: #fff; }
.wz-item.done .wz-dot { background: var(--ok, #10b981); border-color: var(--ok, #10b981); } .wz-item.skipped .wz-dot { border-style: dashed; } .wz-item.active .wz-dot { border-color: var(--brand); }
.wz-main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.wz-top { display: flex; align-items: center; gap: 14px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--card); }
.wz-top .bar { flex: 1; height: 8px; border-radius: 99px; background: var(--line-2, #eef2f7); overflow: hidden; } .wz-top .bar i { display: block; height: 100%; background: var(--brand); transition: width .3s; }
.wz-body { flex: 1; overflow: auto; padding: 28px; }
.wz-grid { max-width: 1040px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; } .wz-grid.with-video { grid-template-columns: minmax(0, 1fr) 320px; }
.wz-step h1 { margin: 0 0 4px; font-size: 26px; } .wz-step .sub { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
.wz-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; } .wz-form .full { grid-column: 1 / -1; } @media (max-width: 700px) { .wz-form { grid-template-columns: 1fr; } }
.wz-info p { font-size: 15px; line-height: 1.55; margin: 0 0 12px; } .wz-info ul { padding-left: 20px; }
.wz-video { border: 2px dashed var(--line); border-radius: 14px; min-height: 180px; display: grid; place-items: center; text-align: center; padding: 16px; color: var(--muted); align-self: start; background: var(--card); }
.wz-foot { display: flex; align-items: center; gap: 10px; padding: 14px 28px; border-top: 1px solid var(--line); background: var(--card); } .wz-foot .grow { flex: 1; }
.wz-alert { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; border-radius: 10px; padding: 9px 12px; font-size: 13px; margin: 14px 0 0; }
.wz-msg { margin-top: 12px; font-size: 13px; } .wz-soon { background: var(--accent-soft); border: 1px solid #fde68a; border-radius: 12px; padding: 14px; font-size: 14px; }
.wz-menu { display: none; }
@media (max-width: 820px) { .wizard { grid-template-columns: 1fr; } .wz-side { display: none; position: fixed; inset: 0 40px 0 0; z-index: 61; box-shadow: var(--shadow); } .wizard.open .wz-side { display: block; } .wz-menu { display: inline-flex; } .wz-grid.with-video { grid-template-columns: 1fr; } .wz-body, .wz-top, .wz-foot { padding-left: 16px; padding-right: 16px; } }

.cx-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .cx-copy .toolbar { flex-wrap: nowrap; } .cx-copy input { flex: 1; min-width: 0; font-family: ui-monospace, monospace; font-size: 12px; }

/* =====================================================================================================================
   Piel "panel limpio" (estructura y densidad tipo iComfly; marca y color propios de EcomSales).
   Va al final a propósito: ajusta variables y piezas sin tocar la lógica. El tema oscuro (body.theme-dark) sigue mandando.
   ===================================================================================================================== */
:root {
  --bg: #ffffff; --card: #ffffff; --ink: #111827; --ink-2: #374151; --muted: #6b7280; --line: #e5e7eb; --line-2: #f3f4f6;
  --brand: #0f766e; --brand-2: #14b8a6; --brand-soft: #ecfdf5;
  --radius: 12px; --radius-s: 8px; --shadow: none; --shadow-2: 0 12px 32px rgba(17,24,39,.14);
  --side-w: 184px; --hover: #f3f4f6;
}
body { font-size: 13px; line-height: 1.5; -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
h1 { font-size: 24px; letter-spacing: -.01em; margin: 0; } h2 { font-size: 15px; } h3 { font-size: 11.5px; letter-spacing: .05em; }
.ico { flex: none; vertical-align: middle; }
body.theme-dark { --hover: #1e2733; }

/* barra lateral: fija, blanca, iconos de línea */
.sidebar { background: var(--card); border-right: 1px solid var(--line); }
.brand { padding: 16px 14px 6px; gap: 8px; font-size: 17px; letter-spacing: -.01em; }
.brand .logo-mark { width: 26px; height: 26px; font-size: 14px; border-radius: 8px; display: inline-grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; }
.brand .icon-btn { margin-left: auto; padding: 4px; color: var(--muted); }
.tenant { display: flex; align-items: center; gap: 8px; margin: 6px 12px 10px; padding: 7px 8px; border: 0; border-radius: 8px; cursor: default; }
.tenant:hover { background: var(--hover); }
.tenant .flag { font-size: 16px; line-height: 1; } .tenant-txt { min-width: 0; flex: 1; } .tenant b { font-size: 12.5px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tenant .small { display: none; } .tenant-chev { color: var(--muted); display: inline-flex; }
#nav { padding: 2px 10px 8px; gap: 0; }
.nav-group { margin: 0; } .nav-group + .nav-group { border-top: 1px solid var(--line-2); margin-top: 6px; padding-top: 6px; }
.nav-label { display: none; }
#nav a { gap: 10px; padding: 8px 10px; margin: 1px 0; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
#nav a .ni { width: 18px; display: inline-flex; opacity: 1; color: var(--muted); } #nav a .ni .ico { width: 17px; height: 17px; }
#nav a:hover { background: var(--hover); color: var(--ink); }
#nav a.active { background: var(--hover); color: var(--ink); font-weight: 600; } #nav a.active .ni { color: var(--ink); }
.sidebar-foot { border-top: 1px solid var(--line-2); padding: 8px 10px 12px; gap: 6px; }
#userBadge { font-size: 12px; line-height: 1.3; padding: 0 4px; } #userBadge b { font-weight: 600; }
.sidebar-foot #tickBtn { background: transparent; border-color: transparent; color: var(--muted); justify-content: flex-start; padding: 4px; font-size: 11.5px; }
.logout { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: 8px; color: #dc2626; font: inherit; font-weight: 500; cursor: pointer; text-align: left; }
.logout:hover { background: #fef2f2; } body.theme-dark .logout:hover { background: #3a1414; }
body.nav-min .app { grid-template-columns: 60px 1fr; } body.nav-min .tenant-txt, body.nav-min .tenant-chev, body.nav-min .logout .nl, body.nav-min .brand-name { display: none; }
body.nav-min .tenant { justify-content: center; margin: 6px 8px; } body.nav-min .logout { justify-content: center; }

/* cabecera: búsqueda ligera a la izquierda, acciones en píldora a la derecha */
.topbar { background: var(--card); border-bottom: 1px solid var(--line-2); padding: 10px 28px; gap: 12px; }
.crumb { display: none; }
.gsearch { max-width: 420px; } .gsearch .gs-icon { top: 8px; left: 11px; display: inline-flex; color: var(--muted); } .gsearch input { padding-left: 32px; background: var(--line-2); border-color: transparent; border-radius: 999px; height: 34px; }
.gsearch input:focus { background: var(--card); }
.top-actions { gap: 8px; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.pill-btn:hover { background: var(--hover); } .pill-btn .ico { color: var(--brand); }
.icon-btn { border-radius: 999px; padding: 7px; color: var(--ink-2); display: inline-flex; } .icon-btn:hover { background: var(--hover); }
.bell-count { background: var(--brand); top: -3px; right: -3px; }
main { padding: 24px 32px 64px; max-width: 1560px; }
.page-head { margin-bottom: 18px; align-items: flex-start; } .page-head .muted { font-size: 13px; margin-top: 2px; }

/* piezas: tarjetas con borde fino (sin sombra), botones, campos */
.card, .kpi { box-shadow: none; border: 1px solid var(--line); border-radius: 12px; }
.card { padding: 18px; } .card-head { margin-bottom: 12px; }
.kpi { padding: 14px 16px; } .kpi .kl, .kpi .l { font-size: 12px; color: var(--muted); } .kpi .kv, .kpi .v { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.btn { border-radius: 8px; padding: 7px 12px; font-size: 13px; font-weight: 500; border: 1px solid var(--line); background: var(--card); }
.btn:hover { background: var(--hover); border-color: #d1d5db; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.primary:hover { background: #0b625b; border-color: #0b625b; }
.btn.success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; } .btn.success:hover { background: #d1fae5; }
.btn.small { padding: 5px 10px; font-size: 12.5px; } .btn.tiny { padding: 3px 8px; font-size: 12px; }
input, select, textarea { border-radius: 8px; border-color: var(--line); padding: 8px 10px; font-size: 13px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,118,110,.12); }
label { color: var(--ink-2); font-size: 12px; font-weight: 500; }
.hero { background: var(--card) !important; border: 1px solid var(--line); border-radius: 14px; box-shadow: none; text-align: left; }
.hero h1 { font-size: 26px; }

/* pestañas (subrayado), tablas, etiquetas */
.tabs { gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { padding: 10px 14px; font-size: 13px; font-weight: 500; color: var(--muted); } .tab:hover { color: var(--ink); } .tab.active { color: var(--ink); border-color: var(--brand); font-weight: 600; }
.tab .count { background: var(--line-2); font-size: 11px; }
table { font-size: 13px; }
th { font-size: 11px; font-weight: 600; letter-spacing: .05em; color: var(--muted); background: transparent; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); } tbody tr:last-child td { border-bottom: 0; }
tr.row:hover { background: #fafafa; } body.theme-dark tr.row:hover { background: #1a222c; }
.card.pad0 { border-radius: 12px; } .card.pad0 th { background: #fafafa; } body.theme-dark .card.pad0 th { background: #121820; }
.tag { padding: 2px 9px; font-size: 11.5px; font-weight: 500; border-radius: 999px; }
.tag.okt, .tag.s-confirmado { background: #ecfdf5; color: #047857; } .tag.warnt { background: #fffbeb; color: #b45309; } .tag.badt { background: #fef2f2; color: #b91c1c; }
.tag.s-entregado { background: #ecfdf5; color: #047857; } .tag.s-devuelto { background: #fef2f2; color: #b91c1c; } .tag.s-cancelado { background: var(--line-2); color: #4b5563; }
body.theme-dark .tag.okt, body.theme-dark .tag.s-confirmado, body.theme-dark .tag.s-entregado { background: #0f2d1a; color: #86efac; }

/* ventanas, menús, estados vacíos */
.modal, .modal-card { border-radius: 16px; box-shadow: var(--shadow-2); }
.menu-pop { border-radius: 10px; box-shadow: var(--shadow-2); border: 1px solid var(--line); }
.empty { border: 1px dashed var(--line); border-radius: 12px; background: transparent; }
.counter { border-radius: 10px; }
.toast { border-radius: 10px; }

/* entrada y asistente con la misma piel */
.login { background: #fff; } .auth-card { border: 1px solid var(--line); border-radius: 16px; }
.wz-side, .wz-top, .wz-foot { background: var(--card); } .wizard { background: var(--card); } .wz-item.active { background: var(--hover); color: var(--ink); } .wz-item:hover { background: var(--hover); }
.wz-card, .wz-video { border-radius: 14px; }

@media (max-width: 900px) { .topbar { padding: 8px 14px; } main { padding: 14px; } .pill-btn .pl { display: none; } }
.hero > div { justify-content: center !important; text-align: center; position: relative; } .hero #dr { position: absolute; right: 0; top: 0; } .hero .chips { justify-content: center; }
.hero { padding: 26px 24px 22px; }
.sidebar-foot { padding-top: 6px; } #userBadge { display: flex; gap: 6px; align-items: baseline; } #userBadge .small { font-size: 11px; }
#nav a { padding: 7px 10px; }
.tab .ti, .menu-pop button span, .btn .ico { display: inline-flex; align-items: center; } .tab .ti .ico { color: var(--muted); } .tab.active .ti .ico { color: var(--brand); }
