/* ============================================================
   FacturAR – Global Styles
   ============================================================ */

:root {
  --bg:         #f4f6f9;
  --surface:    #ffffff;
  --sidebar-bg: #1a2236;
  --sidebar-txt:#c8d3e8;
  --sidebar-act:#3b82f6;
  --primary:    #3b82f6;
  --primary-dk: #2563eb;
  --success:    #22c55e;
  --warning:    #f59e0b;
  --danger:     #ef4444;
  --text:       #1e293b;
  --text-muted: #64748b;
  --border:     #e2e8f0;
  --radius:     8px;
  --shadow:     0 2px 8px rgba(0,0,0,.08);
  --sidebar-w:  240px;
  --topbar-h:   60px;
  --font:       'Poppins', sans-serif;
}

*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html { font-size:15px; }
body { font-family:var(--font); color:var(--text); background:var(--bg); }
a { color:var(--primary); text-decoration:none; }
a:hover { text-decoration:underline; }
input,select,textarea,button { font-family:inherit; font-size:inherit; }

.hidden     { display:none !important; }
.mt-2       { margin-top:.75rem; }
.text-muted { color:var(--text-muted); font-size:.875rem; }
.text-danger{ color:var(--danger); }
.flex { display:flex; }
.gap-2 { gap:.5rem; }

/* ── PDF Template Selector ── */
.pdf-tpl-card {
  border: 2px solid var(--border); border-radius: 10px; padding: .5rem;
  cursor: pointer; transition: all .2s; text-align: center; background: var(--surface);
}
.pdf-tpl-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.pdf-tpl-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,.2); }
.pdf-tpl-card.active::after { content: '✓'; position: absolute; top: 4px; right: 8px; color: var(--primary); font-weight: 700; font-size: .85rem; }
.pdf-tpl-card { position: relative; }
.pdf-tpl-preview { height: 80px; border-radius: 6px; margin-bottom: .4rem; border: 1px solid var(--border); }
.pdf-tpl-card span { font-size: .82rem; font-weight: 600; color: var(--text); }

/* ── Dashboard Shortcuts ── */
.dash-shortcuts {
  display: flex; gap: .65rem; flex-wrap: wrap; margin-bottom: 1.25rem;
}
.dash-shortcut {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .7rem 1.4rem; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dk, #2563eb) 100%);
  color: #fff; font-weight: 600; font-size: .9rem;
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: 0 4px 14px rgba(37,99,235,.25);
  cursor: pointer; transition: all .3s ease;
  font-family: inherit;
}
.dash-shortcut:hover {
  box-shadow: 0 8px 24px rgba(37,99,235,.35);
  transform: translateY(-2px);
}
.dash-shortcut:active { transform: scale(.96); }

/* Icon animation — slide up on hover */
.dash-shortcut-icon {
  position: relative; width: 20px; height: 20px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1;
}
.dash-shortcut-icon i {
  transition: transform .35s cubic-bezier(.4,.2,.2,1);
}
.dash-shortcut:hover .dash-shortcut-icon i {
  transform: translateY(-2px) scale(1.1);
}

/* Label shift on hover */
.dash-shortcut-label {
  transition: transform .3s ease;
}
.dash-shortcut:hover .dash-shortcut-label {
  transform: translateX(3px);
}

/* Shine sweep on hover */
.dash-shortcut-shine {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.18) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: none;
}
.dash-shortcut:hover .dash-shortcut-shine {
  transform: translateX(120%);
  transition: transform .8s ease;
}

/* ── Buttons ── */
.btn {
  display:inline-flex; align-items:center; gap:.4rem;
  padding:.55rem 1.1rem; border-radius:var(--radius);
  font-weight:500; cursor:pointer; border:none; transition:.15s;
}
.btn-primary   { background:var(--primary); color:#fff; }
.btn-primary:hover   { background:var(--primary-dk); }
.btn-secondary { background:#e2e8f0; color:var(--text); }
.btn-secondary:hover { background:#cbd5e1; }
.btn-ghost     { background:transparent; color:var(--text-muted); }
.btn-ghost:hover     { background:#f1f5f9; }
.btn-danger    { background:var(--danger); color:#fff; }
.btn-danger:hover    { background:#dc2626; }
.btn-sm   { padding:.35rem .8rem; font-size:.82rem; }
.btn-full { width:100%; justify-content:center; }
.btn:disabled { opacity:.5; cursor:not-allowed; }

/* ── Forms ── */
.form-group { margin-bottom:1rem; }
.form-group label { display:block; font-weight:500; margin-bottom:.35rem; font-size:.88rem; }
.form-group input,
.form-group select,
.form-group textarea {
  width:100%; padding:.55rem .8rem;
  border:1.5px solid var(--border); border-radius:var(--radius);
  background:var(--surface); transition:.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline:none; border-color:var(--primary); }
.form-row { margin-bottom:.75rem; }
.checkbox-label { display:flex; align-items:center; gap:.5rem; cursor:pointer; }
.form-row-2 { display:grid; grid-template-columns:1fr 1fr; gap:.75rem; }
.form-row-4 { display:grid; grid-template-columns:1fr 1fr 1fr 1fr; gap:.75rem; align-items:flex-end; }

.form-section-title {
  font-size:.78rem; font-weight:700; text-transform:uppercase;
  letter-spacing:.07em; color:var(--primary);
  padding:.5rem .75rem; background:#eff6ff;
  border-left:3px solid var(--primary);
  border-radius:0 var(--radius) var(--radius) 0;
  margin-bottom:1rem;
}

/* ── Alerts ── */
.alert { padding:.75rem 1rem; border-radius:var(--radius); margin-top:.75rem; font-size:.9rem; }
.alert-error   { background:#fee2e2; color:#b91c1c; border:1px solid #fca5a5; }
.alert-success { background:#dcfce7; color:#15803d; border:1px solid #86efac; }

/* ── Cards ── */
.card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:1.25rem; box-shadow:var(--shadow);
  overflow: visible;
}
.card-divider { border:none; border-top:1px solid var(--border); margin:.75rem 0; }
.card-footer {
  display:flex; justify-content:space-between; align-items:center;
  padding-top:.75rem; border-top:1px solid var(--border);
}

/* ── Auth (split-screen) ── */
.auth-body {
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:var(--bg);
}
.auth-split {
  display:flex; width:100%; max-width:1000px; min-height:600px;
  border-radius:16px; overflow:hidden;
  box-shadow:0 20px 60px rgba(0,0,0,.12);
}
/* Left side: forms */
.auth-form-side {
  flex:1; background:var(--surface); display:flex; align-items:center; justify-content:center;
  padding:2.5rem 2.5rem;
}
.auth-form-inner { width:100%; max-width:380px; }
.auth-logo { display:flex; align-items:center; gap:.6rem; margin-bottom:2rem; }
.auth-logo-img { width:36px; height:36px; object-fit:contain; }
.auth-logo-text { font-size:1.35rem; font-weight:700; color:var(--text); letter-spacing:-.02em; }
.auth-title { font-size:1.6rem; font-weight:700; color:var(--text); margin-bottom:.35rem; }
.auth-subtitle { font-size:.88rem; color:var(--text-muted); margin-bottom:1.5rem; }
.auth-switch-link { color:var(--primary); font-weight:600; text-decoration:none; }
.auth-switch-link:hover { text-decoration:underline; }
.auth-input {
  width:100%; padding:.65rem .85rem; border:1.5px solid var(--border);
  border-radius:var(--radius); background:var(--surface); font-size:.92rem;
  transition:border-color .15s; outline:none;
}
.auth-input:focus { border-color:var(--primary); }
.auth-input::placeholder { color:#a0aec0; }
.auth-password-wrap { position:relative; }
.auth-password-wrap .auth-input { padding-right:2.5rem; }
.auth-eye-btn {
  position:absolute; right:.6rem; top:50%; transform:translateY(-50%);
  background:none; border:none; cursor:pointer; color:var(--text-muted);
  font-size:1rem; padding:2px; display:flex; align-items:center;
}
.auth-eye-btn:hover { color:var(--text); }
.auth-options {
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:1.25rem; font-size:.84rem;
}
.auth-remember { display:flex; align-items:center; gap:.4rem; color:var(--text-muted); cursor:pointer; }
.auth-remember input { accent-color:var(--primary); width:15px; height:15px; }
.auth-forgot { color:var(--text-muted); font-weight:500; text-decoration:none; }
.auth-forgot:hover { color:var(--primary); text-decoration:underline; }
.auth-submit {
  padding:.75rem; font-size:.95rem; font-weight:600;
  border-radius:var(--radius); margin-top:.25rem;
}
.auth-panel { display:none; }
.auth-panel.active { display:block; }
.auth-form.active { display:block; }
/* Right side: brand */
.auth-brand-side {
  flex:1; background:linear-gradient(160deg,#1a2236 0%,#1e3a5f 50%,#1a2236 100%);
  display:flex; align-items:center; justify-content:center;
  padding:2.5rem; position:relative; overflow:hidden;
}
.auth-brand-side::before {
  content:''; position:absolute; top:-50%; right:-30%; width:80%; height:200%;
  background:radial-gradient(ellipse, rgba(59,130,246,.12) 0%, transparent 70%);
  pointer-events:none;
}
.auth-brand-content { position:relative; z-index:1; max-width:380px; }
.auth-brand-logo { height:48px; margin-bottom:1.75rem; display:block; }
.auth-brand-title {
  font-size:1.6rem; font-weight:700; color:#fff; line-height:1.3; margin-bottom:.75rem;
}
.auth-brand-desc {
  font-size:.9rem; color:rgba(255,255,255,.7); line-height:1.6; margin-bottom:2rem;
}
.auth-features { display:flex; flex-direction:column; gap:1rem; }
.auth-feature {
  display:flex; align-items:flex-start; gap:.75rem;
  padding:.85rem 1rem; border-radius:var(--radius);
  background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.08);
  transition:background .2s;
}
.auth-feature:hover { background:rgba(255,255,255,.1); }
.auth-feature-icon {
  width:36px; height:36px; border-radius:8px;
  background:rgba(59,130,246,.2); color:#60a5fa;
  display:flex; align-items:center; justify-content:center;
  font-size:1rem; flex-shrink:0;
}
.auth-feature-title { font-size:.88rem; font-weight:600; color:#fff; margin-bottom:.15rem; }
.auth-feature-desc { font-size:.78rem; color:rgba(255,255,255,.55); }
/* Responsive */
@media (max-width: 768px) {
  .auth-split { flex-direction:column; max-width:100%; border-radius:0; min-height:100vh; }
  .auth-brand-side { display:none; }
  .auth-form-side { padding:2rem 1.5rem; }
}

/* ── App Layout ── */
.app-body { display:flex; min-height:100vh; }

/* ── Preloader global ─────────────────────────────────────── */
.page-preloader {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  height: 3px;
  pointer-events: none;
}
.page-preloader.hidden { display: none; }
.preloader-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa, #93c5fd);
  background-size: 200% 100%;
  animation: preloader-slide 1.2s ease-in-out infinite;
  border-radius: 0 2px 2px 0;
}
@keyframes preloader-slide {
  0%   { width: 0%;   margin-left: 0; }
  50%  { width: 70%;  margin-left: 0; }
  100% { width: 0%;   margin-left: 100%; }
}

/* ── Sidebar rediseñado ───────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: #0f172a;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform .25s;
  border-right: 1px solid rgba(255,255,255,.06);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand-logo {
  width: 32px; height: 32px;
  background: rgba(59,130,246,.15);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-name {
  font-weight: 700;
  font-size: 1rem;
  color: #f1f5f9;
  letter-spacing: -.01em;
  flex: 1;
}
.sidebar-close {
  margin-left: auto;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  display: none;
  padding: .25rem;
  border-radius: 4px;
  line-height: 1;
}
.sidebar-close:hover { color: #f1f5f9; background: rgba(255,255,255,.07); }

.sidebar-nav {
  flex: 1;
  padding: .75rem 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

/* Etiquetas de sección */
.nav-section-label {
  padding: .9rem 1.25rem .3rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #334155;
}

/* Items del nav */
.nav-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem 1.25rem;
  color: #64748b;
  font-size: .855rem;
  font-weight: 500;
  transition: all .15s;
  border-left: 2px solid transparent;
  margin: .05rem .5rem;
  border-radius: 6px;
  text-decoration: none;
}
.nav-item:hover {
  background: rgba(255,255,255,.05);
  color: #e2e8f0;
  text-decoration: none;
}
.nav-item.active {
  background: rgba(59,130,246,.12);
  color: #60a5fa;
  border-left-color: #3b82f6;
  border-radius: 0 6px 6px 0;
  margin-left: 0;
  padding-left: calc(1.25rem - 0px);
}
.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  flex-shrink: 0;
  opacity: .7;
  font-size: 16px;
  line-height: 1;
}
.nav-icon i { display: flex; align-items: center; }
.nav-item.active .nav-icon,
.nav-item:hover .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.07);
}
.user-info {
  font-size: .78rem;
  color: #64748b;
  margin-bottom: .6rem;
  line-height: 1.4;
}
.user-info strong { color: #94a3b8; }

.sidebar-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:99; }

.main-content { margin-left:var(--sidebar-w); flex:1; display:flex; flex-direction:column; min-height:100vh; }

.topbar {
  height:var(--topbar-h); display:flex; align-items:center; gap:1rem;
  padding:0 1.5rem; background:var(--surface);
  border-bottom:1px solid var(--border); position:sticky; top:0; z-index:50;
}
.hamburger { display:none; background:none; border:none; font-size:1.3rem; cursor:pointer; }
.topbar-title { font-weight:600; font-size:1.05rem; flex:1; }
.topbar-actions { display:flex; align-items:center; gap:.75rem; }
.notification-bell { font-size:1.2rem; cursor:pointer; }

.page-content { padding:1.5rem; flex:1; }
.page { display:none; }
.page.active { display:block; }
.page-heading { font-size:1.4rem; font-weight:700; margin-bottom:1.25rem; }
.page-header  { display:flex; align-items:center; justify-content:space-between; margin-bottom:1rem; }
.page-header .page-heading { margin-bottom:0; }
.page-header-actions { display:flex; gap:.5rem; }

/* ── Stats ── */
.stats-grid {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:1rem; margin-bottom:1.5rem;
}
.stat-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:1.1rem; box-shadow:var(--shadow);
  display:flex; align-items:center; gap:1rem;
}
.stat-icon  { font-size:2rem; }
.stat-value { font-size:1.5rem; font-weight:700; }
.stat-label { font-size:.78rem; color:var(--text-muted); margin-top:.15rem; }
.dashboard-grid { display:grid; grid-template-columns:1fr 1fr; gap:1rem; margin-bottom:1.25rem; }

/* Accent cards (dashboard) */
.stat-card-accent { position:relative; overflow:hidden; transition:transform .15s ease, box-shadow .15s ease; }
.stat-card-accent:hover { transform:translateY(-2px); box-shadow:0 8px 24px rgba(0,0,0,.08); }
.stat-card-accent::before {
  content:''; position:absolute; left:0; top:0; bottom:0; width:4px; border-radius:4px 0 0 4px;
}
.stat-card-accent .stat-icon {
  width:46px; height:46px; border-radius:12px;
  display:flex; align-items:center; justify-content:center; font-size:1.4rem;
}
.stat-accent-blue::before   { background:#3b82f6; }
.stat-accent-blue .stat-icon   { background:rgba(59,130,246,.12); color:#2563eb; }
.stat-accent-green::before  { background:#10b981; }
.stat-accent-green .stat-icon  { background:rgba(16,185,129,.12); color:#059669; }
.stat-accent-amber::before  { background:#f59e0b; }
.stat-accent-amber .stat-icon  { background:rgba(245,158,11,.14); color:#d97706; }
.stat-accent-red::before    { background:#ef4444; }
.stat-accent-red .stat-icon    { background:rgba(239,68,68,.12); color:#dc2626; }
.stat-accent-purple::before { background:#8b5cf6; }
.stat-accent-purple .stat-icon { background:rgba(139,92,246,.12); color:#7c3aed; }

/* Banner modo transformación */
.venta-convert-banner {
  display:flex; align-items:center; gap:.75rem;
  padding:.75rem .95rem; margin-bottom:1rem;
  background:#fef3c7; border:1px solid #fde68a; border-radius:var(--radius);
  color:#78350f; font-size:.88rem;
}
.venta-convert-banner strong { color:#78350f; }

/* Sticky summary del popup de venta */
.venta-sticky {
  position:sticky; top:0; z-index:5;
  display:flex; align-items:center; gap:1rem;
  padding:.55rem .9rem; margin:-1rem -1rem 1rem;
  background:linear-gradient(180deg, rgba(59,130,246,.08), rgba(59,130,246,.04));
  border-bottom:1px solid var(--border);
  backdrop-filter:blur(6px);
}
.venta-sticky-item { display:flex; flex-direction:column; line-height:1.1; }
.venta-sticky-label { font-size:.65rem; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); font-weight:600; }
.venta-sticky-item strong { font-size:.95rem; color:var(--text); }
.venta-sticky-item strong.pend-danger { color:#dc2626; }
.venta-sticky-item strong.pend-ok { color:#059669; }
.venta-sticky-sep { width:1px; align-self:stretch; background:var(--border); }

/* Atajos de teclado — hint del popup */
.venta-hotkeys {
  display:flex; gap:.75rem; flex-wrap:wrap;
  margin-top:1rem; padding:.55rem .75rem;
  background:var(--bg-muted,#f9fafb); border:1px dashed var(--border); border-radius:var(--radius);
  font-size:.75rem; color:var(--text-muted);
}
.venta-hotkeys kbd {
  display:inline-block; padding:.1rem .4rem; margin:0 .15rem;
  font-family:inherit; font-size:.7rem; font-weight:600;
  background:var(--surface); color:var(--text);
  border:1px solid var(--border); border-radius:4px;
  box-shadow:0 1px 0 rgba(0,0,0,.04);
}

/* Keypad POS */
.pos-keypad {
  display:grid; gap:.3rem; margin-top:.6rem; padding:.55rem;
  background:var(--bg-muted,#f9fafb); border:1px solid var(--border); border-radius:8px;
  max-width:260px;
}
.pos-keypad.hidden { display:none; }
.pos-keypad-row { display:grid; grid-template-columns:repeat(4,1fr); gap:.3rem; }
.pos-keypad button {
  padding:.65rem 0; font-size:1rem; font-weight:600;
  background:var(--surface); border:1px solid var(--border); border-radius:6px;
  cursor:pointer; color:var(--text);
  transition:all .1s ease;
}
.pos-keypad button:hover { background:rgba(59,130,246,.1); border-color:var(--primary); color:var(--primary); }
.pos-keypad button:active { transform:scale(.96); }
.pos-keypad .pos-k-action {
  background:var(--primary); color:#fff; border-color:var(--primary);
}
.pos-keypad .pos-k-action:hover { background:#1d4ed8; color:#fff; }

/* +/- buttons en items de venta */
.qty-minus, .qty-plus {
  width:24px; height:24px; padding:0;
  border:1px solid var(--border); background:var(--surface);
  border-radius:5px; cursor:pointer; font-size:.9rem; font-weight:600;
  display:inline-flex; align-items:center; justify-content:center;
  transition:all .1s ease; color:var(--text);
}
.qty-minus:hover, .qty-plus:hover { background:rgba(59,130,246,.12); border-color:var(--primary); color:var(--primary); }

/* Warning de stock insuficiente en sugerencias */
.resultado-stock-bajo { opacity:.72; }
.resultado-stock-badge {
  display:inline-block; font-size:.68rem; font-weight:600;
  padding:.1rem .45rem; border-radius:999px;
  background:#fef3c7; color:#92400e; border:1px solid #fde68a;
  margin-left:.35rem;
}
.resultado-stock-badge.no-stock {
  background:#fee2e2; color:#991b1b; border-color:#fecaca;
}

/* Tabs de carga de ítems en Nueva Venta */
.venta-items-tabs {
  display:grid; grid-template-columns:1fr 1fr;
  background:var(--bg-muted,#f9fafb);
  border-bottom:1px solid var(--border);
}
.venta-tab {
  display:flex; flex-direction:column; align-items:flex-start; gap:.1rem;
  padding:.65rem .9rem;
  border:none; background:transparent; cursor:pointer;
  border-right:1px solid var(--border);
  transition:background .12s ease, color .12s ease;
  text-align:left; position:relative;
}
.venta-tab:last-child { border-right:none; }
.venta-tab i { font-size:.95rem; color:var(--text-muted); }
.venta-tab span { font-weight:600; font-size:.85rem; color:var(--text); }
.venta-tab small { font-size:.7rem; color:var(--text-muted); }
.venta-tab:hover { background:rgba(59,130,246,.05); }
.venta-tab.active {
  background:var(--surface);
  box-shadow:inset 0 -3px 0 var(--primary);
}
.venta-tab.active i,
.venta-tab.active span { color:var(--primary); }
.venta-panel.hidden { display:none; }
@media (max-width: 560px) {
  .venta-items-tabs { grid-template-columns:1fr; }
  .venta-tab { border-right:none; border-bottom:1px solid var(--border); }
  .venta-tab:last-child { border-bottom:none; }
}

/* Paginacion de tablas */
.table-pagination {
  display:flex; justify-content:space-between; align-items:center;
  padding:.75rem 1rem; gap:.75rem;
  border-top:1px solid var(--border); background:var(--surface);
  flex-wrap:wrap;
}
.table-pagination:empty { display:none; }
.pagination-info { color:var(--text-muted); font-size:.82rem; }
.pagination-info strong { color:var(--text); }
.pagination-controls { display:flex; align-items:center; gap:.25rem; }
.pagination-btn {
  min-width:32px; height:32px; padding:0 .55rem;
  background:var(--surface); border:1px solid var(--border); border-radius:6px;
  cursor:pointer; font-size:.85rem; font-weight:500; color:var(--text);
  display:inline-flex; align-items:center; justify-content:center;
  transition:all .12s ease;
}
.pagination-btn:hover:not(:disabled):not(.active) { background:var(--bg-muted,#f3f4f6); border-color:var(--primary); color:var(--primary); }
.pagination-btn.active {
  background:var(--primary); border-color:var(--primary); color:#fff;
}
.pagination-btn:disabled { opacity:.4; cursor:not-allowed; }
.pagination-ellipsis { color:var(--text-muted); padding:0 .25rem; font-size:.85rem; }

/* Navegacion por teclado en listas */
[data-arrow-item] { transition:background-color .1s ease; cursor:pointer; }
[data-arrow-item][data-arrow-active] {
  background:rgba(59,130,246,.12) !important;
  outline:2px solid rgba(59,130,246,.45);
  outline-offset:-2px;
}

/* Dashboard section header */
.dash-section-header {
  display:flex; justify-content:space-between; align-items:center;
  margin:1.75rem 0 .85rem;
  padding-bottom:.5rem; border-bottom:1px solid var(--border);
}
.dash-section-title {
  margin:0; font-size:1.05rem; font-weight:700; display:flex; align-items:center; gap:.5rem;
  color:var(--text);
}
.dash-section-title i { color:var(--primary); }
.dash-section-link {
  font-size:.82rem; color:var(--primary); text-decoration:none; font-weight:600;
  display:inline-flex; align-items:center; gap:.3rem;
}
.dash-section-link:hover { text-decoration:underline; }

.mini-list { display:flex; flex-direction:column; gap:.4rem; margin-top:.75rem; }
.mini-item {
  display:flex; justify-content:space-between; align-items:center;
  padding:.4rem .6rem; border-radius:6px; font-size:.85rem;
  background:#f8fafc; border:1px solid var(--border);
}

/* ── Filters ── */
.filters-bar {
  display:flex; flex-wrap:wrap; gap:.75rem; align-items:flex-end;
  margin-bottom:1rem; padding:.85rem 1rem;
  overflow: visible;
  position: relative;
  z-index: 10;
}
.filter-group { position: relative; }
.filter-group label { display:block; font-size:.78rem; font-weight:500; margin-bottom:.2rem; color:var(--text-muted); }
.filter-group input,
.filter-group select {
  padding:.4rem .6rem; border:1.5px solid var(--border);
  border-radius:var(--radius); font-size:.85rem; background:var(--surface);
}
.filter-group input[type="date"] {
  position: relative;
  z-index: 11;
  min-width: 140px;
  -webkit-appearance: none;
  appearance: none;
}
.filter-group input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 14px;
  width: 20px;
  height: 20px;
  opacity: .6;
}
.filter-group input[type="date"]::-webkit-datetime-edit {
  padding: 0;
}
.filter-group input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
}

.bulk-actions {
  display:flex; align-items:center; gap:.75rem;
  padding:.6rem 1rem; background:#eff6ff;
  border:1px solid #bfdbfe; border-radius:var(--radius);
  margin-bottom:.75rem; font-size:.88rem; font-weight:500;
}

/* ── Table ── */
.table-container { overflow-x:auto; padding:0; }
.data-table { width:100%; border-collapse:collapse; font-size:.87rem; }
.data-table thead tr { background:#f8fafc; }
.data-table th {
  text-align:left; padding:.75rem 1rem;
  font-size:.78rem; font-weight:600; text-transform:uppercase;
  letter-spacing:.04em; color:var(--text-muted);
  border-bottom:2px solid var(--border); white-space:nowrap;
}
.data-table td { padding:.7rem 1rem; border-bottom:1px solid var(--border); vertical-align:middle; }
.data-table tbody tr:hover { background:#f8fafc; }
.data-table tbody tr:last-child td { border-bottom:none; }
.table-empty { text-align:center; padding:2rem; color:var(--text-muted); }
/* El td de acciones NO debe tener display:flex — el flex va en el div interno */
.actions-cell { padding:.7rem 1rem; vertical-align:middle; white-space:nowrap; }
.actions-cell-wrap { display:flex; gap:.35rem; align-items:center; flex-wrap:nowrap; }

/* Acciones compactas alineadas a la derecha (Comprobantes, etc.) */
.actions-inline {
  display:inline-flex; gap:.3rem; align-items:center; justify-content:flex-end;
  flex-wrap:nowrap; width:100%;
}
.actions-inline .btn-sm { padding:.3rem .55rem; min-width:auto; }
.btn.btn-icon {
  width:30px; height:30px; padding:0;
  display:inline-flex; align-items:center; justify-content:center;
  flex-shrink:0;
}
.btn.btn-icon i { font-size:.9rem; margin:0; }

/* ── Badges ── */
.badge {
  display:inline-flex; align-items:center;
  padding:.2rem .55rem; border-radius:999px;
  font-size:.75rem; font-weight:600;
}
.badge-success { background:#dcfce7; color:#15803d; }
.badge-warning { background:#fef9c3; color:#854d0e; }
.badge-danger  { background:#fee2e2; color:#b91c1c; }
.badge-info    { background:#dbeafe; color:#1d4ed8; }
.badge-neutral { background:#f1f5f9; color:#475569; }

.table-pagination {
  display:flex; justify-content:flex-end; align-items:center;
  gap:.5rem; padding:.75rem 1rem; border-top:1px solid var(--border);
}

/* ── Connections ── */
.connections-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); gap:1.25rem; }
.connection-card { position:relative; }
.connection-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:.75rem; }
.conn-logo { max-height:32px; object-fit:contain; }
.conn-logo-text { font-size:1.4rem; font-weight:800; color:#00599c; }
.conn-badge {
  font-size:.75rem; font-weight:600; padding:.2rem .6rem;
  border-radius:999px; background:#f1f5f9; color:var(--text-muted);
}
.conn-badge.connected  { background:#dcfce7; color:#15803d; }
.conn-badge.configured { background:#dbeafe; color:#1d4ed8; }
.conn-desc    { color:var(--text-muted); font-size:.875rem; margin-bottom:1rem; }
.conn-detail  { font-size:.85rem; margin-bottom:.35rem; }
.conn-actions { display:flex; gap:.5rem; margin-top:1rem; flex-wrap:wrap; }

.settings-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:1.25rem; }

/* ── Modal ── */
.modal-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,.5);
  z-index:200; display:flex; align-items:center; justify-content:center; padding:1rem;
}
.modal, .modal-box {
  background:var(--surface); border-radius:10px;
  width:100%; max-width:560px; max-height:90vh;
  display:flex; flex-direction:column; box-shadow:0 20px 60px rgba(0,0,0,.2);
}
.large-modal  { max-width:780px; }
.modal-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:1.1rem 1.25rem; border-bottom:1px solid var(--border);
  font-weight:600; font-size:1rem;
}
.modal-close  { background:none; border:none; cursor:pointer; font-size:1.1rem; color:var(--text-muted); }
.modal-body   { padding:1.25rem; overflow-y:auto; flex:1; }
.modal-footer { display:flex; justify-content:flex-end; gap:.5rem; padding:1rem 1.25rem; border-top:1px solid var(--border); }

.detail-section { margin-bottom:1.25rem; }
.detail-section h4 { font-size:.85rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-muted); margin-bottom:.6rem; }
.detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:.4rem .75rem; }
.detail-row { font-size:.88rem; }
.detail-row strong { color:var(--text-muted); font-weight:500; }
.items-table { width:100%; font-size:.85rem; border-collapse:collapse; }
.items-table th,
.items-table td { padding:.45rem .6rem; border-bottom:1px solid var(--border); text-align:left; }
.items-table tfoot td { font-weight:600; border-top:2px solid var(--border); }

/* ── Toast ── */
.toast-container { position:fixed; bottom:1.5rem; right:1.5rem; z-index:1000; display:flex; flex-direction:column; gap:.5rem; }
.toast {
  min-width:240px; padding:.75rem 1.1rem; border-radius:var(--radius);
  background:var(--text); color:#fff; font-size:.88rem; box-shadow:var(--shadow);
  animation:slideIn .2s; display:flex; align-items:center; gap:.5rem;
}
.toast-success { background:#15803d; }
.toast-error   { background:#b91c1c; }
.toast-warning { background:#92400e; }
@keyframes slideIn { from { transform:translateX(100%); opacity:0; } to { transform:translateX(0); opacity:1; } }

.spinner {
  border:3px solid var(--border); border-top-color:var(--primary);
  border-radius:50%; width:24px; height:24px; animation:spin .7s linear infinite; display:inline-block;
}
@keyframes spin { to { transform:rotate(360deg); } }

/* ── Usuarios – Form crear ───────────────────────────────────── */
.role-select {
  padding:.35rem .6rem; font-size:.82rem;
  border:1.5px solid var(--border); border-radius:var(--radius);
  background:var(--surface); cursor:pointer;
}
.user-create-grid {
  display:grid;
  grid-template-columns:1fr 1fr 1fr 1fr;
  gap:.75rem;
  align-items:flex-end;
}
.user-create-grid .form-group { margin-bottom:0; }

/* ── Role Info Popup ─────────────────────────────────────────── */
.role-info-section {
  padding:.75rem; background:#f8fafc;
  border-radius:var(--radius); border:1px solid var(--border); margin-bottom:.5rem;
}
.role-info-title { font-weight:700; font-size:.82rem; text-transform:uppercase; letter-spacing:.05em; margin-bottom:.5rem; }
.role-info-item  { font-size:.88rem; color:var(--text-muted); padding:.2rem 0; }

/* ── Permisos personalizados ─────────────────────────────────── */
.perm-group {
  margin-bottom:1rem;
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  background:var(--surface);
}
.perm-group-title {
  display:flex; justify-content:space-between; align-items:center;
  font-weight:700; font-size:.82rem;
  color:var(--text);
  padding:.6rem .85rem;
  background:var(--bg-muted,#f9fafb);
  border-bottom:1px solid var(--border);
}
.perm-group-title > span:first-child { display:flex; align-items:center; gap:.5rem; }
.perm-group-title i.perm-group-icon {
  width:26px; height:26px; border-radius:7px;
  background:rgba(59,130,246,.12); color:#2563eb;
  display:inline-flex; align-items:center; justify-content:center;
  font-size:.82rem;
}
.perm-group-toggle {
  font-size:.7rem; color:var(--primary); cursor:pointer; font-weight:600;
  padding:.2rem .45rem; border-radius:5px;
}
.perm-group-toggle:hover { background:rgba(59,130,246,.12); }
.perm-group-body {
  display:grid; grid-template-columns:repeat(2, 1fr); gap:.15rem .85rem;
  padding:.5rem .85rem .65rem;
}
.perm-item {
  display:flex; align-items:center; gap:.5rem;
  padding:.35rem 0; font-size:.85rem; cursor:pointer;
  color:var(--text);
}
.perm-item input { width:16px; height:16px; cursor:pointer; accent-color:var(--primary); flex-shrink:0; }
.perm-item:hover { color:var(--primary); }
.perm-item.perm-item-strong { font-weight:600; }
@media (max-width: 640px) {
  .perm-group-body { grid-template-columns:1fr; }
}

/* ── Access Denied ───────────────────────────────────────────── */
#accessDeniedPage { display:none; }
#accessDeniedPage.active {
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  min-height:60vh; text-align:center;
}

/* ── Factura Manual ──────────────────────────────────────────── */
.manual-invoice-grid { display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
.fm-field, .fm-select {
  width:100%; padding:.55rem .8rem;
  border:1.5px solid var(--border); border-radius:var(--radius);
  background:var(--surface); transition:.15s; font-size:.9rem;
}
.fm-field:focus, .fm-select:focus { outline:none; border-color:var(--primary); }
.fm-input {
  padding:.4rem .6rem; border:1.5px solid var(--border);
  border-radius:var(--radius); background:var(--surface);
  font-size:.85rem; transition:.15s; width:100%;
}
.fm-input:focus { outline:none; border-color:var(--primary); }
.fm-input-sm { width:80px; text-align:center; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width:1100px) {
  .user-create-grid { grid-template-columns:1fr 1fr; }
}
@media (max-width:768px) {
  #page-reports [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
  .sidebar { transform:translateX(-100%); }
  .sidebar.open { transform:translateX(0); }
  .sidebar.open + .sidebar-overlay,
  .sidebar-overlay.open { display:block; }
  .sidebar-close { display:block; }
  .hamburger     { display:block; }
  .main-content  { margin-left:0; }
  .dashboard-grid      { grid-template-columns:1fr; }
  .stats-grid          { grid-template-columns:1fr 1fr; }
  .filters-bar         { flex-direction:column; align-items:stretch; }
  .filter-group input,
  .filter-group select { width:100%; }
  .data-table          { min-width:600px; }
  .detail-grid         { grid-template-columns:1fr; }
  .form-row-2          { grid-template-columns:1fr; }
  .form-row-4          { grid-template-columns:1fr 1fr; }
  .user-create-grid    { grid-template-columns:1fr; }
  .manual-invoice-grid { grid-template-columns:1fr; }
}
@media (max-width:480px) {
  .stats-grid          { grid-template-columns:1fr; }
  .connections-grid    { grid-template-columns:1fr; }
  .form-row-4          { grid-template-columns:1fr; }
}

/* ── Productos / Stock ───────────────────────────────────────── */
.ml-item-row {
  display:flex; justify-content:space-between; align-items:center;
  padding:.6rem .75rem; border-radius:var(--radius);
  border:1px solid var(--border); margin-bottom:.4rem;
  font-size:.88rem; background:#f8fafc;
}
.ml-item-row:hover { background:#eff6ff; }

/* ── Productos: fix botones cortados ────────────────────────── */
#page-products .data-table th:last-child,
#page-products .data-table td:last-child {
  min-width: 270px;
  white-space: nowrap;
}
#page-products .data-table { min-width: 1000px; }
.actions-cell-wrap { flex-wrap: nowrap !important; white-space: nowrap; }

/* ── Buscador de productos ───────────────────────────────────── */
.products-toolbar {
  display: flex;
  gap: .75rem;
  align-items: center;
  margin-bottom: 1rem;
}
.products-search {
  flex: 1;
  position: relative;
}
.products-search input {
  width: 100%;
  padding: .5rem 1rem .5rem 2.25rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  background: #fff;
  outline: none;
  transition: border-color .15s;
}
.products-search-lg input {
  padding: .7rem 1.2rem .7rem 2.5rem;
  font-size: 1rem;
}
.products-search input:focus { border-color: var(--primary); }
.products-search .search-icon {
  position: absolute;
  left: .7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .9rem;
  pointer-events: none;
}
.products-search kbd {
  position: absolute;
  right: .6rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: .7rem;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: .1rem .35rem;
  color: var(--text-muted);
}

/* ── Fila resaltada por teclado ──────────────────────────────── */
.data-table tbody tr.kb-active {
  background: #eff6ff !important;
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

/* ── Panel de métricas / gráfico ─────────────────────────────── */
.stock-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.metric-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.metric-card .metric-label {
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .35rem;
}
.metric-card .metric-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}
.metric-card .metric-sub {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .25rem;
}
.metric-card.metric-danger .metric-value { color: #b91c1c; }
.metric-card.metric-success .metric-value { color: #15803d; }

/* Gráfico de barras inline ──────────────────────────────────── */
.stock-chart-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.stock-chart-wrap h4 {
  font-size: .85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 1rem;
}
.bar-chart { display: flex; flex-direction: column; gap: .6rem; }
.bar-row { display: flex; align-items: center; gap: .75rem; font-size: .82rem; }
.bar-row .bar-label { width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.bar-row .bar-track { flex: 1; height: 10px; background: #f1f5f9; border-radius: 99px; overflow: hidden; }
.bar-row .bar-fill  { height: 100%; border-radius: 99px; background: var(--primary); transition: width .4s; }
.bar-row .bar-fill.bar-low { background: #ef4444; }
.bar-row .bar-val   { width: 60px; text-align: right; color: var(--text-muted); font-size: .8rem; }

/* ── Columna ganancia ─────────────────────────────────────────── */
.pct-ganancia { font-size: .78rem; font-weight: 700; padding: .15rem .45rem; border-radius: 999px; display: inline-block; }
.pct-ganancia.positivo { background: #dcfce7; color: #15803d; }
.pct-ganancia.negativo { background: #fee2e2; color: #b91c1c; }

/* ── Atajo de teclado hint ────────────────────────────────────── */
.kb-hint {
  font-size: .75rem;
  color: var(--text-muted);
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}
.kb-hint kbd {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: .1rem .35rem;
  font-size: .7rem;
  font-family: monospace;
}


/* ── IVA por ítem en factura manual ─────────────────────────── */
.fm-iva-select {
  font-size: .82rem;
  padding: .3rem .5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
.fm-iva-select:focus { outline: none; border-color: var(--primary); }

/* Desglose IVA en totales */
#fmDesglose {
  border-bottom: 1px solid var(--border);
  margin-bottom: .25rem;
  padding-bottom: .25rem;
}

/* ── Productos: fix botones cortados ────────────────────────── */
#page-products .data-table th:last-child,
#page-products .data-table td:last-child {
  min-width: 270px;
  white-space: nowrap;
}
#page-products .data-table { min-width: 1020px; }

/* ── Usuarios: fix botones cortados ─────────────────────────── */
#page-users .data-table { min-width: 900px; table-layout: fixed; }
#page-users .data-table th:nth-child(1),
#page-users .data-table td:nth-child(1) { width: 160px; }
#page-users .data-table th:nth-child(2),
#page-users .data-table td:nth-child(2) { width: 220px; }
#page-users .data-table th:nth-child(3),
#page-users .data-table td:nth-child(3) { width: 160px; }
#page-users .data-table th:nth-child(4),
#page-users .data-table td:nth-child(4) { width: 80px; }
#page-users .data-table th:nth-child(5),
#page-users .data-table td:nth-child(5) { width: 80px; }
#page-users .data-table th:nth-child(6),
#page-users .data-table td:nth-child(6) { width: 80px; }
#page-users .data-table th:last-child,
#page-users .data-table td:last-child    { width: 220px; min-width: 220px; }

/* ── Actions cell global ─────────────────────────────────────── */
/* El td mantiene display:table-cell — el flex está en .actions-cell-wrap */
.actions-cell {
  vertical-align: middle;
  white-space: nowrap;
}
.actions-cell-wrap {
  display: flex;
  gap: .3rem;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.actions-cell-wrap .btn { flex-shrink: 0; }

/* ── IVA por ítem en factura manual ─────────────────────────── */
.fm-iva-select {
  font-size: .82rem;
  padding: .3rem .5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
.fm-iva-select:focus { outline: none; border-color: var(--primary); }
#fmDesglose {
  border-bottom: 1px solid var(--border);
  margin-bottom: .25rem;
  padding-bottom: .25rem;
}

/* ── Logo sidebar ─────────────────────────────────────────── */
.brand-logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* ═══════════════════════════════════════════════════════════════
   FACTURACIÓN MASIVA
   ═══════════════════════════════════════════════════════════════ */

/* Barra de acciones masivas */
.bulk-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem 1rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .75rem;
  flex-wrap: wrap;
}
.bulk-left  { display: flex; align-items: center; gap: .5rem; }
.bulk-right {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: .35rem .75rem;
}
.bulk-right.hidden { display: none; }
#selectedCount { font-size: .84rem; font-weight: 600; color: #1d4ed8; }

/* Barra de progreso */
.bulk-progress-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.bulk-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 999px;
  transition: width .3s ease;
}

/* Items de error */
.bulk-error-item {
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: .5rem .75rem;
  font-size: .82rem;
}
.bulk-error-order {
  font-weight: 700;
  color: #b91c1c;
  margin-bottom: .15rem;
}
.bulk-error-msg { color: #7f1d1d; }

/* ═══════════════════════════════════════════════════════════════
   PANEL ESTADO DE SERVICIOS — Dashboard
   ═══════════════════════════════════════════════════════════════ */

.services-status-card { padding: 1.1rem 1.25rem; }

.services-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .65rem;
}

.service-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem .9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafafa;
  transition: border-color .2s;
}
.service-item:hover { border-color: #cbd5e1; }

/* Indicador circular animado */
.service-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background .3s;
}
.svc-ok      { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.15); }
.svc-error   { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.15); }
.svc-warning { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.15); }
.svc-loading {
  background: #94a3b8;
  animation: svc-pulse 1.2s ease-in-out infinite;
}
@keyframes svc-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .35; }
}

.service-info { flex: 1; min-width: 0; }
.service-name {
  font-size: .84rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .1rem;
}
.service-detail {
  font-size: .76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badges */
.service-badge {
  font-size: .7rem;
  font-weight: 700;
  padding: .18rem .5rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.svc-badge-ok      { background: #dcfce7; color: #15803d; }
.svc-badge-error   { background: #fee2e2; color: #b91c1c; }
.svc-badge-warning { background: #fef9c3; color: #854d0e; }
.svc-badge-loading { background: #f1f5f9; color: #64748b; }

.services-footer {
  margin-top: .75rem;
  padding-top: .6rem;
  border-top: 1px solid var(--border);
  font-size: .75rem;
  color: var(--text-muted);
  text-align: right;
}

/* ── Toolbar de logs ─────────────────────────────────────────── */
.logs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 0 .85rem;
  gap: .75rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: .5rem;
}


/* ── Selector de empresa (agregar al final de styles.css) ──── */
.empresa-selector {
  padding: .75rem 1rem;
  border-top: 1px solid rgba(255,255,255,.1);
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: .5rem;
}
.empresa-selector-label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.45);
  margin-bottom: .3rem;
}
.empresa-selector-current {
  font-size: .8rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: .4rem;
}
.empresa-select {
  width: 100%;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  color: #fff;
  font-size: .78rem;
  padding: .3rem .5rem;
  margin-bottom: .4rem;
  cursor: pointer;
}
.empresa-select option { color: #1e293b; background: #fff; }
.btn-xs {
  font-size: .72rem;
  padding: .2rem .6rem;
  width: 100%;
  opacity: .75;
  justify-content: center;
}
.btn-xs:hover { opacity: 1; }

/* Modal nueva empresa */
#nuevaEmpresaModal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
#nuevaEmpresaModal.hidden { display: none; }
.empresa-modal-box {
  background: var(--bg-card, #fff);
  border-radius: 12px;
  padding: 1.5rem;
  width: 340px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.empresa-modal-box h3 { margin: 0 0 1rem; font-size: 1rem; }
.empresa-modal-box .form-group { margin-bottom: .8rem; }
.empresa-modal-box label { font-size: .78rem; color: var(--text-muted); display: block; margin-bottom: .25rem; }
.empresa-modal-box input {
  width: 100%; padding: .5rem .75rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px; font-size: .875rem;
  box-sizing: border-box;
}
.empresa-modal-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; }


/* ── Empresa topbar ── */
.empresa-topbar {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: .3rem .6rem;
}
.empresa-topbar-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.empresa-topbar-label {
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}
.empresa-topbar-nombre {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.empresa-topbar-select {
  border: none;
  background: transparent;
  font-size: .78rem;
  color: var(--text);
  cursor: pointer;
  max-width: 30px;
  padding: 0;
}

/* ============================================================
   MÓDULO CLONAR ML — namespace .mlc-*
   ============================================================ */
.mlc-section { --mlc-card: var(--surface); --mlc-card-2: var(--bg, #f8fafc); --mlc-border: var(--border); --mlc-accent: var(--primary, #3b82f6); --mlc-success: #22c55e; --mlc-warning: #f59e0b; --mlc-danger: #ef4444; --mlc-yellow: #ffe404; }

.mlc-card {
  background: var(--mlc-card); border: 1px solid var(--mlc-border);
  border-radius: 14px; padding: 20px 24px; margin-bottom: 20px;
}
.mlc-card-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; font-size: 14px; color: var(--text);
  text-transform: uppercase; letter-spacing: .04em; font-weight: 600;
}
.mlc-meta { color: var(--text-muted); font-size: 13px; }
.mlc-meta strong { color: var(--mlc-accent); font-size: 16px; }

/* Account cards */
.mlc-accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.mlc-account-card {
  background: var(--mlc-card-2); border: 1px solid var(--mlc-border); border-radius: 12px;
  padding: 16px; position: relative; cursor: pointer; transition: all .25s;
}
.mlc-account-card:hover { border-color: var(--mlc-accent); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(59,130,246,.15); }
.mlc-account-card.source { border-color: var(--mlc-accent); box-shadow: 0 0 0 2px rgba(59,130,246,.4); }
.mlc-account-card.source::before {
  content: 'ORIGEN'; position: absolute; top: -8px; right: 12px;
  background: var(--mlc-accent); color: #fff; font-size: 9px; font-weight: 700;
  padding: 3px 8px; border-radius: 5px; letter-spacing: .08em;
}
.mlc-account-card.dest { border-color: var(--mlc-success); box-shadow: 0 0 0 2px rgba(34,197,94,.4); }
.mlc-account-card.dest::before {
  content: 'DESTINO'; position: absolute; top: -8px; right: 12px;
  background: var(--mlc-success); color: #fff; font-size: 9px; font-weight: 700;
  padding: 3px 8px; border-radius: 5px; letter-spacing: .08em;
}
.mlc-account-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mlc-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.mlc-dot.green { background: var(--mlc-success); box-shadow: 0 0 8px rgba(34,197,94,.6); }
.mlc-dot.red { background: var(--mlc-danger); }
.mlc-account-nick { font-weight: 700; font-size: 15px; color: var(--text); }
.mlc-account-id { font-size: 11px; color: var(--text-muted); font-family: monospace; }
.mlc-account-email { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.mlc-account-actions { margin-top: 12px; display: flex; gap: 6px; align-items: center; }
.mlc-tag {
  display: inline-block; padding: 4px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.mlc-tag-source { background: rgba(59,130,246,.18); color: var(--mlc-accent); border: 1px solid var(--mlc-accent); }
.mlc-tag-dest   { background: rgba(34,197,94,.18); color: var(--mlc-success); border: 1px solid var(--mlc-success); }
.btn-success { background: var(--mlc-success, #22c55e); color: #fff; }
.btn-success:hover { background: #16a34a; }

.mlc-add-account-card {
  background: transparent; border: 2px dashed var(--mlc-border);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 28px 16px; min-height: 140px;
}
.mlc-add-account-card:hover { border-color: var(--mlc-yellow); }
.mlc-add-account-card .mlc-plus { font-size: 32px; color: var(--mlc-yellow); line-height: 1; margin-bottom: 6px; font-weight: 700; }
.mlc-add-account-card .mlc-add-label { font-size: 13px; color: var(--text-muted); }

/* Selector source → dest */
.mlc-selector-bar {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 16px; background: var(--mlc-card-2); border-radius: 10px;
}
.mlc-selector-side {
  flex: 1; max-width: 280px; padding: 14px 18px; border-radius: 9px;
  border: 1.5px dashed var(--mlc-border); text-align: center;
  font-size: 13px; color: var(--text-muted);
}
.mlc-selector-side.set { border-style: solid; }
.mlc-selector-side.source.set { border-color: var(--mlc-accent); color: var(--mlc-accent); }
.mlc-selector-side.dest.set { border-color: var(--mlc-success); color: var(--mlc-success); }
.mlc-selector-arrow { font-size: 20px; color: var(--text-muted); }

/* Search / filters bar */
.mlc-filters-bar { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.mlc-search-bar { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; }
.mlc-search-input {
  flex: 1; padding: 10px 14px; background: var(--mlc-card-2);
  border: 1px solid var(--mlc-border); border-radius: 9px;
  color: var(--text); font-family: inherit; font-size: 14px;
}
.mlc-search-input:focus { outline: none; border-color: var(--mlc-accent); }

/* Items table */
.mlc-table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--mlc-border); }
.mlc-section table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mlc-section th { background: var(--mlc-card-2); text-align: left; padding: 12px 14px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; font-size: 11px; letter-spacing: .04em; border-bottom: 1px solid var(--mlc-border); }
.mlc-section td { padding: 12px 14px; border-bottom: 1px solid var(--mlc-border); }
.mlc-section tr:hover td { background: rgba(59,130,246,.05); }
.mlc-section tr.selected td { background: rgba(59,130,246,.1); }
.mlc-thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: var(--mlc-card-2); display: block; }
.mlc-title-cell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mlc-badge { display: inline-block; padding: 3px 8px; border-radius: 5px; font-size: 10px; font-weight: 600; text-transform: uppercase; }
.mlc-badge-active { background: rgba(34,197,94,.15); color: var(--mlc-success); }
.mlc-badge-paused { background: rgba(245,158,11,.15); color: var(--mlc-warning); }
.mlc-badge-closed { background: rgba(148,163,184,.15); color: var(--text-muted); }

/* Toolbar */
.mlc-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; margin-top: 14px; }

/* Action bar (siempre visible arriba de la tabla) */
.mlc-action-bar {
  display: flex; align-items: center; gap: .5rem;
  padding: .85rem 1rem; margin-bottom: 1rem;
  background: var(--mlc-card-2); border: 1px solid var(--mlc-border);
  border-radius: 10px; flex-wrap: wrap;
}
.mlc-action-bar .btn-primary { font-weight: 700; }
.mlc-action-bar .btn-primary:disabled { background: #94a3b8; cursor: not-allowed; opacity: .7; }

/* Tabs de filtro */
.mlc-tabs {
  display: flex; gap: .4rem; margin-bottom: 12px; flex-wrap: wrap;
  border-bottom: 1px solid var(--mlc-border); padding-bottom: 0;
}
.mlc-tab {
  background: transparent; border: 1px solid transparent; color: var(--text-muted);
  padding: 8px 14px; border-radius: 8px 8px 0 0; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .15s; margin-bottom: -1px;
}
.mlc-tab:hover { color: var(--text); background: var(--mlc-card-2); }
.mlc-tab.active {
  color: var(--mlc-accent);
  border: 1px solid var(--mlc-border); border-bottom-color: var(--mlc-card);
  background: var(--mlc-card);
}
.mlc-tab-count {
  display: inline-block; padding: 1px 7px; border-radius: 99px;
  background: var(--mlc-border); color: var(--text); font-size: 10px; font-weight: 700;
  min-width: 18px; text-align: center;
}
.mlc-tab.active .mlc-tab-count { background: var(--mlc-accent); color: #fff; }

/* Row ya clonada */
.mlc-section tr.mlc-cloned td { opacity: .55; }
.mlc-section tr.mlc-cloned .mlc-title-cell::after {
  content: ' ✅'; color: var(--mlc-success);
}

/* Pagination */
.mlc-pagination { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.mlc-pagination button {
  background: var(--mlc-card-2); border: 1px solid var(--mlc-border); color: var(--text);
  padding: 7px 12px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.mlc-pagination button:disabled { opacity: .4; cursor: not-allowed; }
.mlc-pagination button.active { background: var(--mlc-accent); border-color: var(--mlc-accent); color: #fff; }

/* Progress overlay */
.mlc-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.75); backdrop-filter: blur(8px);
  z-index: 9999; display: none; align-items: center; justify-content: center;
}
.mlc-overlay.active { display: flex; }
.mlc-overlay-box {
  background: var(--mlc-card); border: 1px solid var(--mlc-border); border-radius: 14px;
  padding: 28px; width: 90%; max-width: 560px;
}
.mlc-overlay-box h3 { font-size: 18px; margin-bottom: 12px; }
.mlc-progress-bar { height: 8px; background: var(--mlc-card-2); border-radius: 99px; overflow: hidden; margin: 14px 0; }
.mlc-progress-fill { height: 100%; background: linear-gradient(90deg, var(--mlc-accent), var(--mlc-success)); width: 0%; transition: width .3s; border-radius: 99px; }
.mlc-log-box {
  background: #0a0e1a; border: 1px solid var(--mlc-border); border-radius: 8px;
  padding: 12px; height: 220px; overflow-y: auto; font-family: monospace;
  font-size: 11px; color: #94a3b8;
}
.mlc-log-line { padding: 2px 0; }
.mlc-log-line.ok { color: var(--mlc-success); }
.mlc-log-line.err { color: var(--mlc-danger); }

/* Stat cards */
.mlc-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.mlc-stat-card {
  background: var(--mlc-card-2); border: 1px solid var(--mlc-border); border-radius: 12px;
  padding: 18px; text-align: center;
}
.mlc-stat-value { font-size: 32px; font-weight: 800; }
.mlc-stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.mlc-stat-card.ok .mlc-stat-value { color: var(--mlc-success); }
.mlc-stat-card.err .mlc-stat-value { color: var(--mlc-danger); }

.mlc-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 14px; }
.mlc-spinner {
  width: 32px; height: 32px; border: 3px solid var(--mlc-card-2);
  border-top-color: var(--mlc-accent); border-radius: 50%;
  animation: mlc-spin .8s linear infinite; margin: 20px auto;
}
@keyframes mlc-spin { to { transform: rotate(360deg); } }

@media (max-width: 768px) {
  .mlc-stats-grid { grid-template-columns: 1fr; }
  .mlc-selector-bar { flex-direction: column; }
  .mlc-selector-arrow { transform: rotate(90deg); }
  .mlc-title-cell { max-width: 180px; }
}

/* ============================================================
   CHATBOT FLOTANTE
   ============================================================ */
.chatbot-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 900;
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--primary, #3b82f6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; cursor: pointer;
  box-shadow: 0 0 0 0 rgba(59,130,246,.4), 0 6px 24px rgba(59,130,246,.35);
  transition: all .25s;
  animation: chatbot-pulse 2.5s ease-in-out infinite;
}
.chatbot-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 8px rgba(59,130,246,.15), 0 8px 32px rgba(59,130,246,.5);
  animation: none;
}
.chatbot-fab.active { display: none; }
.chatbot-fab-dot {
  position: absolute; top: 2px; right: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #ef4444;
  border: 2px solid var(--surface, #0f172a);
  animation: chatbot-dot-pulse 2s ease-in-out infinite;
}
@keyframes chatbot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,.3), 0 6px 24px rgba(59,130,246,.35); }
  50% { box-shadow: 0 0 0 10px rgba(59,130,246,0), 0 6px 24px rgba(59,130,246,.35); }
}
@keyframes chatbot-dot-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.chatbot-panel {
  position: fixed; bottom: 24px; right: 24px; z-index: 901;
  width: 380px; max-height: 560px; height: 80vh;
  background: var(--surface, #fff); border: 1px solid var(--border, #e5e7eb);
  border-radius: 16px; box-shadow: 0 12px 48px rgba(0,0,0,.18);
  display: flex; flex-direction: column;
  overflow: hidden; transition: all .3s;
}
.chatbot-panel.hidden { display: none; }

.chatbot-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: var(--primary, #3b82f6); color: #fff;
  flex-shrink: 0;
}
.chatbot-header-info { display: flex; align-items: center; gap: 10px; }
.chatbot-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.chatbot-header-title { font-weight: 700; font-size: 14px; }
.chatbot-header-sub { font-size: 11px; opacity: .8; }
.chatbot-close {
  background: none; border: none; color: #fff; font-size: 18px;
  cursor: pointer; opacity: .8; padding: 4px;
}
.chatbot-close:hover { opacity: 1; }

.chatbot-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}

.chatbot-msg { display: flex; gap: 8px; max-width: 90%; }
.chatbot-msg.bot { align-self: flex-start; }
.chatbot-msg.user { align-self: flex-end; flex-direction: row-reverse; }

.chatbot-msg-bubble {
  padding: 10px 14px; border-radius: 14px;
  font-size: 13px; line-height: 1.5;
  word-break: break-word; white-space: pre-wrap;
}
.chatbot-msg.bot .chatbot-msg-bubble {
  background: var(--bg, #f3f4f6); color: var(--text, #1f2937);
  border-bottom-left-radius: 4px;
}
.chatbot-msg.user .chatbot-msg-bubble {
  background: var(--primary, #3b82f6); color: #fff;
  border-bottom-right-radius: 4px;
}

.chatbot-quick-actions {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px;
}
.chatbot-quick-btn {
  padding: 6px 12px; border-radius: 99px;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--surface, #fff); color: var(--primary, #3b82f6);
  font-size: 11px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.chatbot-quick-btn:hover {
  background: var(--primary, #3b82f6); color: #fff;
  border-color: var(--primary, #3b82f6);
}

.chatbot-input-wrap {
  display: flex; gap: 8px; padding: 12px 14px;
  border-top: 1px solid var(--border, #e5e7eb);
  flex-shrink: 0;
}
.chatbot-input {
  flex: 1; padding: 10px 14px;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 99px; font-size: 13px;
  font-family: inherit; outline: none;
  background: var(--surface, #fff); color: var(--text, #1f2937);
}
.chatbot-input:focus { border-color: var(--primary, #3b82f6); }
.chatbot-send {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary, #3b82f6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer; border: none;
  transition: background .15s; flex-shrink: 0;
}
.chatbot-send:hover { background: var(--primary-dk, #2563eb); }

.chatbot-typing {
  display: flex; gap: 4px; padding: 10px 14px;
  background: var(--bg, #f3f4f6); border-radius: 14px;
  border-bottom-left-radius: 4px; width: fit-content;
}
.chatbot-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted, #94a3b8);
  animation: chatbot-dot .8s ease-in-out infinite;
}
.chatbot-typing span:nth-child(2) { animation-delay: .15s; }
.chatbot-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chatbot-dot {
  0%, 100% { opacity: .3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 500px) {
  .chatbot-panel { width: calc(100vw - 16px); right: 8px; bottom: 8px; max-height: 85vh; }
  .chatbot-fab { bottom: 16px; right: 16px; width: 50px; height: 50px; font-size: 20px; }
}

/* ══ CAJA DIARIA ══ */
.caja-estado-banner {
  padding:.65rem 1rem; border-radius:var(--radius);
  font-weight:600; font-size:.88rem;
  display:flex; align-items:center; gap:.5rem;
  margin-bottom:1rem;
}
.caja-estado-banner i { font-size:1rem; }
.caja-abierta {
  background:#dcfce7; color:#166534;
  border:1.5px solid #86efac;
}
.caja-cerrada {
  background:#fef2f2; color:#991b1b;
  border:1.5px solid #fca5a5;
}
.caja-desglose-grid {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:.6rem;
}
.caja-medio-item {
  display:flex; justify-content:space-between; align-items:center;
  padding:.55rem .85rem; background:var(--bg);
  border:1px solid var(--border); border-radius:var(--radius);
  font-size:.85rem;
}
.caja-medio-label { color:var(--text-muted); display:flex; align-items:center; gap:.35rem; }
.caja-medio-label i { font-size:.85rem; }
.caja-medio-valor { font-weight:700; color:var(--text); }
.caja-monto-positivo { color:var(--success); font-weight:600; }
.caja-monto-negativo { color:var(--danger); font-weight:600; }
.caja-check-label {
  display:flex; align-items:center; gap:.5rem;
  font-size:.88rem; cursor:pointer; padding:.25rem 0;
}
.caja-check-label i { font-size:.85rem; color:var(--text-muted); }
.caja-check-label input[type="checkbox"] {
  width:16px; height:16px; accent-color:var(--primary);
}
.caja-checks-list {
  display:flex; flex-direction:column; gap:.35rem;
  padding:.5rem .75rem; background:var(--bg);
  border:1px solid var(--border); border-radius:var(--radius);
}

/* ══ REPORT TABS ══ */
.report-tab {
  padding:.65rem 1.25rem; border:none; background:transparent;
  color:var(--text-muted); font-weight:500; font-size:.88rem;
  cursor:pointer; border-bottom:2px solid transparent;
  transition:.15s; display:inline-flex; align-items:center; gap:.4rem;
  margin-bottom:-2px; border-radius:6px 6px 0 0;
}
.report-tab:hover { color:var(--text); background:var(--bg); border-radius:6px 6px 0 0; }
.report-tab.active {
  color:var(--primary); border-bottom-color:var(--primary); font-weight:600;
}

/* ══ WIZARD (Servicio tecnico) ══ */
.wizard-modal .wizard-progress {
  padding:1rem 1.25rem .75rem;
  border-bottom:1px solid var(--border);
  background:var(--bg);
}
.wizard-progress-track {
  height:4px; background:var(--border); border-radius:2px;
  overflow:hidden; margin-bottom:.85rem;
}
.wizard-progress-bar {
  height:100%; background:var(--primary);
  transition:width .3s ease;
}
.wizard-steps-list {
  display:flex; justify-content:space-between; gap:.25rem;
  overflow-x:auto;
}
.wizard-step-dot {
  display:flex; flex-direction:column; align-items:center; gap:.25rem;
  min-width:48px; text-align:center; position:relative;
  flex:1;
}
.wizard-step-dot span {
  width:28px; height:28px; border-radius:50%;
  background:var(--border); color:var(--text-muted);
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:.82rem;
  transition:.2s;
}
.wizard-step-dot small {
  font-size:.7rem; color:var(--text-muted);
  font-weight:500;
  white-space:nowrap;
}
.wizard-step-dot.active span {
  background:var(--primary); color:#fff;
  box-shadow:0 0 0 4px rgba(59,130,246,.15);
}
.wizard-step-dot.active small { color:var(--primary); font-weight:600; }
.wizard-step-dot.done span { background:var(--success); color:#fff; }
.wizard-step-dot.done small { color:var(--success); }

.wizard-body { padding:1.5rem 1.5rem 1rem; }
.wizard-step { display:none; animation:wizard-fade .25s ease; }
.wizard-step.active { display:block; }
@keyframes wizard-fade {
  from { opacity:0; transform:translateX(8px); }
  to   { opacity:1; transform:translateX(0); }
}
.wizard-step-title {
  font-size:1.1rem; font-weight:700; margin:0 0 .35rem;
  color:var(--text); display:flex; align-items:center; gap:.4rem;
}
.wizard-step-title i { color:var(--primary); }
.wizard-step-desc {
  font-size:.85rem; color:var(--text-muted); margin-bottom:1.25rem;
}

.wizard-checks {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr));
  gap:.5rem;
}
.wizard-check {
  display:flex; align-items:center; gap:.5rem;
  padding:.55rem .8rem; border:1.5px solid var(--border);
  border-radius:var(--radius); cursor:pointer;
  background:var(--surface); transition:.15s;
  font-size:.87rem;
}
.wizard-check:hover { border-color:var(--primary); background:var(--bg); }
.wizard-check input[type="checkbox"] {
  width:16px; height:16px; accent-color:var(--primary);
  cursor:pointer;
}
.wizard-check input[type="checkbox"]:checked + span { font-weight:600; color:var(--primary); }

.wizard-footer {
  display:flex; align-items:center; gap:.5rem;
}

.wizard-resumen {
  background:var(--bg); border:1px solid var(--border);
  border-radius:var(--radius); padding:1.25rem;
}
.wizard-resumen-section {
  margin-bottom:1rem; padding-bottom:.85rem;
  border-bottom:1px solid var(--border);
}
.wizard-resumen-section:last-child { border-bottom:none; margin-bottom:0; padding-bottom:0; }
.wizard-resumen-section h5 {
  font-size:.78rem; font-weight:700; text-transform:uppercase;
  letter-spacing:.05em; color:var(--text-muted); margin:0 0 .5rem;
  display:flex; align-items:center; gap:.35rem;
}
.wizard-resumen-section h5 i { color:var(--primary); }
.wizard-resumen-row {
  display:flex; justify-content:space-between;
  padding:.25rem 0; font-size:.87rem;
}
.wizard-resumen-row strong { color:var(--text); font-weight:600; }
.wizard-resumen-row span { color:var(--text-muted); }
.wizard-resumen-tags {
  display:flex; flex-wrap:wrap; gap:.35rem; margin-top:.25rem;
}
.wizard-resumen-tag {
  padding:.15rem .55rem; border-radius:999px;
  background:var(--surface); border:1px solid var(--border);
  font-size:.78rem; color:var(--text);
}

@media (max-width: 640px) {
  .wizard-step-dot small { display:none; }
  .wizard-footer { flex-wrap:wrap; }
}