/* ========================================================
   ROLOVA 3D - Dark Glassmorphism + Neon Blue/Cyan
   ======================================================== */

/* ── Categorías de producto — modal admin ── */
.edit-cats-list {
  display: flex; flex-wrap: wrap; gap: .4rem;
  padding: .5rem;
  background: rgba(15,23,42,.5);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 140px;
  overflow-y: auto;
}
.edit-cat-check {
  display: none;
}
.edit-cat-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .3rem .75rem;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: rgba(56,189,248,.04);
  color: var(--text-secondary);
  font-size: .78rem; font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: all .15s;
  white-space: nowrap;
}
.edit-cat-chip:hover {
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  background: rgba(56,189,248,.08);
}
.edit-cat-chip.selected {
  background: rgba(56,189,248,.18);
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  font-weight: 600;
}
.edit-cat-chip.selected::before {
  content: '✓ ';
  font-size: .7rem;
}
.chip-qty-ctrl {
  display: inline-flex; align-items: center; gap: .2rem;
  margin-left: .4rem;
  background: rgba(56,189,248,.15);
  border-radius: 12px;
  padding: 0 .25rem;
}
.chip-qty-btn {
  background: none; border: none; color: var(--neon-blue);
  font-size: .85rem; font-weight: 700; cursor: pointer;
  padding: 0 .25rem; line-height: 1.4;
  border-radius: 8px;
  transition: background .1s;
}
.chip-qty-btn:hover { background: rgba(56,189,248,.25); }
.chip-qty-val {
  font-size: .8rem; font-weight: 700; color: var(--neon-blue);
  min-width: 1rem; text-align: center;
}

/* ── Tipo de producto — botones toggle ── */
.edit-tipo-btns { display: flex; gap: .5rem; }
.edit-tipo-btn {
  padding: .35rem .9rem; border-radius: 20px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted); font-size: .82rem; cursor: pointer;
  transition: all .15s;
}
.edit-tipo-btn:hover { border-color: var(--neon-blue); color: var(--neon-blue); }
.edit-tipo-btn.active {
  background: var(--neon-blue); border-color: var(--neon-blue);
  color: #0f172a; font-weight: 600;
}

/* ── Tags en tabla admin ── */
.cat-prod-tags { display: flex; flex-wrap: wrap; gap: .2rem; margin-top: .2rem; }
.cat-prod-tag {
  display: inline-block; padding: .1rem .45rem;
  border-radius: 12px; font-size: .7rem; font-weight: 500;
  background: rgba(56,189,248,.12); color: var(--neon-blue);
  border: 1px solid rgba(56,189,248,.25);
}
.cat-tipo-tag {
  display: inline-block; padding: .1rem .45rem;
  border-radius: 12px; font-size: .7rem; font-weight: 500;
  border: 1px solid rgba(167,139,250,.3);
}
.cat-tipo-estandar { background: rgba(100,116,139,.15); color: #94a3b8; }
.cat-tipo-personalizable { background: rgba(167,139,250,.15); color: #a78bfa; }

/* ── Tags catálogo público ── */
.pub-tag-prod {
  background: rgba(56,189,248,.12); color: var(--neon-blue, #38bdf8);
  border: 1px solid rgba(56,189,248,.25);
}
.pub-tag-tipo {
  background: rgba(167,139,250,.15); color: #a78bfa;
  border: 1px solid rgba(167,139,250,.3);
}

/* Column manager modal */
.dba-col-section {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(15,23,42,.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.dba-col-section-title {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--neon-cyan);
  margin-bottom: .75rem;
}
.dba-col-section-title .material-symbols-outlined { font-size: 1rem; }
.dba-col-row {
  display: flex;
  align-items: center;
  gap: .5rem;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --neon-blue: #38bdf8;
  --neon-cyan: #22d3ee;
  --neon-purple: #818cf8;
  --accent-gradient: linear-gradient(135deg, var(--neon-blue), var(--neon-cyan));
  --primary: #3b82f6;
  --primary-light: rgba(59,130,246,.15);
  --success: #22c55e;
  --success-light: rgba(34,197,94,.12);
  --danger: #ef4444;
  --danger-light: rgba(239,68,68,.12);
  --warning: #f59e0b;
  --warning-light: rgba(245,158,11,.12);
  --bg-body: #0b0f1a;
  --bg-surface: rgba(15,23,42,.65);
  --bg-card: rgba(30,41,59,.55);
  --bg-input: rgba(15,23,42,.6);
  --bg-hover: rgba(56,189,248,.06);
  --border: rgba(56,189,248,.12);
  --border-strong: rgba(56,189,248,.25);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;
  --glass-bg: rgba(15,23,42,.5);
  --glass-border: rgba(56,189,248,.15);
  --glass-blur: blur(16px);
  --glass-blur-heavy: blur(24px);
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 2px 8px rgba(0,0,0,.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,.35);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.4);
  --shadow-glow: 0 0 20px rgba(56,189,248,.15);
  --transition: .25s cubic-bezier(.4,0,.2,1);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(56,189,248,.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(129,140,248,.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(34,211,238,.04) 0%, transparent 40%);
  background-attachment: fixed;
}

.hidden { display: none !important; }
.mt-1 { margin-top: 1.5rem; }
.text-muted { color: var(--text-muted); font-size: .875rem; }
code {
  background: rgba(56,189,248,.1); padding: 2px 8px; border-radius: 6px;
  font-size: .85em; color: var(--neon-cyan); border: 1px solid var(--glass-border);
}

.screen { min-height: 100vh; }
.screen.active { display: flex; }

/* LOGIN */
.login-container { margin: auto; width: 100%; max-width: 420px; padding: 2rem 1.5rem; position: relative; z-index: 10; }
.login-ambient { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ambient-orb {
  position: absolute; border-radius: 50%; mix-blend-mode: screen;
  filter: blur(100px); opacity: .2;
}
.ambient-orb-1 { top: 25%; left: 25%; width: 200px; height: 200px; background: var(--neon-blue); animation: orbFloat 8s ease-in-out infinite alternate; }
.ambient-orb-2 { bottom: 25%; right: 25%; width: 280px; height: 280px; background: var(--neon-cyan); animation: orbFloat 10s ease-in-out infinite alternate-reverse; }
@keyframes orbFloat {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(30px, -20px) scale(1.15); }
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo-img {
  width: 120px; height: auto;
  filter: drop-shadow(0 0 28px rgba(56,189,248,.35));
  margin-bottom: .5rem;
  animation: logoPulse 3s ease-in-out infinite alternate;
}
@keyframes logoPulse {
  from { filter: drop-shadow(0 0 20px rgba(56,189,248,.3)); }
  to   { filter: drop-shadow(0 0 36px rgba(34,211,238,.45)); }
}
.login-logo h1 {
  font-size: 1.8rem; font-weight: 800; letter-spacing: 1px;
  background: var(--accent-gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.login-logo p { color: var(--text-secondary); font-size: .9rem; }
.login-form {
  background: var(--glass-bg); backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 2rem; border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.error-msg { color: var(--danger); font-size: .85rem; margin-top: .75rem; text-align: center; }
.login-desc { text-align: center; color: var(--text-secondary); font-size: .9rem; margin-bottom: 1.25rem; }
.login-footer-text { text-align: center; color: var(--text-muted); font-size: .8rem; margin-top: 1rem; text-transform: uppercase; letter-spacing: 1px; }

/* Google Sign-In Button - Stitch Style */
.btn-google-stitch {
  position: relative; display: flex; align-items: center; justify-content: center; gap: .75rem;
  background: linear-gradient(135deg, #38bdf8, #22d3ee); color: #fff;
  font-size: 1rem; font-weight: 700; padding: 1rem 1.5rem;
  border: none; border-radius: var(--radius); cursor: pointer;
  transition: all var(--transition); overflow: visible;
}
.btn-google-stitch::before {
  content: ''; position: absolute; inset: -2px;
  background: linear-gradient(135deg, #38bdf8, #22d3ee);
  border-radius: inherit; z-index: -1; opacity: .5;
  filter: blur(8px); transition: opacity var(--transition);
}
.btn-google-stitch:hover::before { opacity: 1; }
.btn-google-stitch:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-google-stitch:active { transform: scale(.97); }
.google-icon { flex-shrink: 0; }

.btn-google {
  background: rgba(255,255,255,.06); color: var(--text-primary);
  border: 1px solid var(--border-strong); font-size: 1rem;
  padding: .8rem 1.25rem; font-weight: 600; border-radius: var(--radius);
  backdrop-filter: var(--glass-blur); transition: all var(--transition); cursor: pointer;
}
.btn-google:hover {
  background: rgba(56,189,248,.12); border-color: var(--neon-blue);
  box-shadow: 0 0 16px rgba(56,189,248,.2);
}

/* BUSINESS PANEL */
.admin-business-panel {
  margin-bottom: 1.5rem;
  padding: 1.15rem;
  background: linear-gradient(180deg, rgba(15,23,42,.72), rgba(15,23,42,.54));
}
.admin-business-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.admin-business-head .subtitle {
  margin-top: .2rem;
}
.admin-business-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.admin-business-kpi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: transform var(--transition), box-shadow var(--transition);
  background: rgba(var(--kpi-bg-rgb, 56,189,248), .06);
  border: 1px solid rgba(var(--kpi-bg-rgb, 56,189,248), .25);
}
.admin-business-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(var(--kpi-bg-rgb, 56,189,248), .15);
}
.admin-business-kpi-info {
  display: flex;
  flex-direction: column;
}
.admin-business-kpi-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: .35rem;
}
.admin-business-kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--kpi-accent, var(--neon-blue));
}
.admin-business-kpi-meta {
  display: block;
  margin-top: .25rem;
  color: var(--text-secondary);
  font-size: .82rem;
}
.admin-business-kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(var(--kpi-bg-rgb, 56,189,248), .15);
  color: var(--kpi-accent, var(--neon-blue));
  box-shadow: 0 0 15px rgba(var(--kpi-bg-rgb, 56,189,248), .2);
}
.admin-business-kpi-icon .material-symbols-outlined { font-size: 1.5rem; }
.admin-business-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 1rem;
}
.admin-business-block {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(2,6,23,.34);
  padding: 1rem;
}
.admin-business-block-head {
  margin-bottom: .8rem;
}
.admin-business-block-head h4 {
  font-size: 1rem;
  margin-bottom: .15rem;
}
.admin-business-alerts,
.admin-business-funnel {
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
.admin-business-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .85rem .9rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(15,23,42,.62);
}
.admin-business-alert[data-tone="danger"] {
  border-color: rgba(239,68,68,.25);
  background: rgba(127,29,29,.18);
}
.admin-business-alert[data-tone="warning"] {
  border-color: rgba(245,158,11,.25);
  background: rgba(120,53,15,.18);
}
.admin-business-alert[data-tone="info"] {
  border-color: rgba(56,189,248,.25);
  background: rgba(8,47,73,.24);
}
.admin-business-alert[data-tone="success"] {
  border-color: rgba(34,197,94,.25);
  background: rgba(20,83,45,.18);
}
.admin-business-alert-copy {
  min-width: 0;
}
.admin-business-alert-title {
  display: block;
  font-weight: 700;
  margin-bottom: .1rem;
}
.admin-business-alert-meta {
  color: var(--text-secondary);
  font-size: .84rem;
}
.admin-business-funnel-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: .65rem;
  align-items: center;
  padding: .8rem .85rem;
  border-radius: 12px;
  background: rgba(15,23,42,.62);
  border: 1px solid rgba(255,255,255,.05);
}
.admin-business-funnel-label {
  font-weight: 600;
}
.admin-business-funnel-count {
  font-size: 1.1rem;
  font-weight: 800;
}
.admin-business-funnel-hint {
  color: var(--text-secondary);
  font-size: .82rem;
}
.admin-business-meta {
  margin-top: .85rem;
  color: var(--text-muted);
  font-size: .82rem;
}
.admin-business-empty {
  padding: 1rem;
  border-radius: 12px;
  border: 1px dashed var(--border-strong);
  color: var(--text-secondary);
  text-align: center;
}

@media (max-width: 1100px) {
  .admin-business-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-business-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .admin-business-head {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-business-kpis {
    grid-template-columns: 1fr;
  }
  .admin-business-alert,
  .admin-business-funnel-row {
    grid-template-columns: 1fr;
  }
  .admin-business-alert {
    align-items: flex-start;
  }
}


/* FORMS */
.form-group { margin-bottom: 1rem; flex: 1; }
.form-group label {
  display: block; font-size: .75rem; font-weight: 600; color: var(--text-secondary);
  margin-bottom: .35rem; text-transform: uppercase; letter-spacing: .5px;
}
.form-group input, .form-group select, .form-group textarea,
.form-input {
  width: 100%; padding: .6rem .85rem; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .9rem; font-family: inherit;
  color: var(--text-primary); background: var(--bg-input);
  backdrop-filter: blur(8px); transition: border var(--transition), box-shadow var(--transition);
}
.form-group input::placeholder, .form-group textarea::placeholder,
.form-input::placeholder { color: var(--text-muted); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus,
.form-input:focus {
  outline: none; border-color: var(--neon-blue);
  box-shadow: 0 0 0 3px rgba(56,189,248,.15), 0 0 12px rgba(56,189,248,.1);
}
.form-group select { cursor: pointer; }
.form-group select option { background: #1e293b; color: var(--text-primary); }
.form-row { display: flex; gap: .75rem; }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .6rem 1.25rem; font-size: .88rem; font-weight: 600;
  font-family: inherit; border: none; border-radius: var(--radius);
  cursor: pointer; transition: all var(--transition); gap: .4rem; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-success { background: var(--success); color: #fff; box-shadow: 0 2px 8px rgba(34,197,94,.2); }
.btn-success:hover { box-shadow: 0 4px 12px rgba(34,197,94,.35); filter: brightness(1.1); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-outline { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg-hover); border-color: var(--border-strong); color: var(--text-primary); }
.btn-sm { padding: .4rem .85rem; font-size: .8rem; }
.btn-full { width: 100%; }
.btn-icon {
  background: none; border: 1px solid transparent; cursor: pointer; font-size: 1rem;
  padding: .35rem; border-radius: 6px; transition: all var(--transition); color: var(--text-secondary);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon .material-symbols-outlined { font-size: 1.1rem; }
.btn-icon:hover { background: rgba(56,189,248,.1); border-color: rgba(56,189,248,.2); color: var(--neon-blue); transform: scale(1.1); }
.btn-icon-danger:hover, .btn-icon-del:hover { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.2); color: #f87171; }

/* NAVBAR */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.25rem; height: 60px;
  background: var(--glass-bg); backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  border-bottom: 1px solid var(--glass-border);
  position: sticky; top: 0; z-index: 100;
}
.navbar-brand {
  display: flex; align-items: center; gap: .6rem;
  font-weight: 800; font-size: 1.05rem; color: var(--text-primary);
}
.navbar-logo {
  width: 36px; height: 36px; border-radius: 8px;
  filter: drop-shadow(0 0 8px rgba(56,189,248,.25));
}
.brand-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; font-weight: 800; letter-spacing: .5px;
}
.logo-icon-sm { font-size: 1.4rem; }
.navbar-links { display: flex; gap: .2rem; }
.nav-link {
  display: flex; align-items: center; gap: .35rem;
  padding: .5rem .85rem; text-decoration: none; color: var(--text-secondary);
  font-size: .84rem; font-weight: 500; border-radius: var(--radius);
  transition: all var(--transition); position: relative;
}
.nav-link .material-symbols-outlined { font-size: 1.15rem; }
.nav-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-link.active { background: rgba(56,189,248,.12); color: var(--neon-blue); font-weight: 600; }
.nav-link.active::after {
  content: ''; position: absolute; bottom: -1px;
  left: 50%; transform: translateX(-50%);
  width: 60%; height: 2px; background: var(--accent-gradient); border-radius: 2px;
}
.nav-icon { font-size: 1.15rem; }
.navbar-actions { display: flex; align-items: center; gap: .5rem; }
.btn-menu-toggle {
  display: none; background: none; border: none;
  font-size: 1.5rem; cursor: pointer; padding: .25rem; color: var(--text-secondary);
}
.btn-menu-toggle .material-symbols-outlined { font-size: 1.5rem; }

/* MAIN CONTENT */
.main-content { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.view-header { margin-bottom: 1.5rem; }
.view-header h2 {
  font-size: 1.5rem; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: center; gap: .5rem;
}
.view-header-icon {
  font-size: 1.5rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.subtitle { color: var(--text-muted); font-size: .9rem; margin-top: .25rem; }
/* Separador de sección dentro de vista unificada Pedidos */
.section-label-row {
  display: flex; align-items: center; gap: .6rem;
  margin: 2rem 0 1rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--border-strong);
}
.section-label-row h3 {
  font-size: 1.1rem; font-weight: 600;
  background: var(--accent-gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  letter-spacing: .02em;
}
.section-label-row .material-symbols-outlined {
  font-size: 1.3rem; color: var(--neon-blue);
}
.link-pub { color: var(--neon-cyan); text-decoration: none; font-weight: 500; transition: color var(--transition); }
.link-pub:hover { text-decoration: underline; color: var(--neon-blue); }

/* GLASS CARDS */
.card {
  background: var(--bg-card); backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg); padding: 1.5rem;
  border: 1px solid var(--glass-border); box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}
.card-results {
  position: relative;
}
.card-results::before {
  content: ''; position: absolute; top: -1px; left: -1px; right: -1px; bottom: -1px;
  background: linear-gradient(45deg, var(--neon-blue), var(--neon-cyan));
  z-index: -1; border-radius: inherit; opacity: .3; filter: blur(4px);
}
.card-title {
  font-size: 1rem; font-weight: 700; color: var(--text-primary);
  margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .5rem;
}
.card-title-icon { font-size: 1.15rem; color: var(--neon-cyan); }

/* STATS CARDS (Catálogo - Stitch style) */
.stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem; border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); }
.stat-info { display: flex; flex-direction: column; }
.stat-label {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .5px;
  font-weight: 600; color: var(--text-secondary); margin-bottom: .35rem;
}
.stat-value { font-size: 1.75rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-icon-wrap {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.stat-icon-wrap .material-symbols-outlined { font-size: 1.5rem; }
.stat-card-blue {
  background: rgba(56,189,248,.06); border: 1px solid rgba(56,189,248,.25);
}
.stat-card-blue:hover { box-shadow: 0 0 20px rgba(56,189,248,.15); }
.stat-card-blue .stat-value { color: var(--neon-blue); }
.stat-icon-blue { background: rgba(56,189,248,.15); color: var(--neon-blue); box-shadow: 0 0 15px rgba(56,189,248,.2); }
.stat-card-green {
  background: rgba(34,197,94,.06); border: 1px solid rgba(34,197,94,.25);
}
.stat-card-green:hover { box-shadow: 0 0 20px rgba(34,197,94,.15); }
.stat-card-green .stat-value { color: #4ade80; }
.stat-icon-green { background: rgba(34,197,94,.15); color: #4ade80; box-shadow: 0 0 15px rgba(34,197,94,.2); }
.stat-card-yellow {
  background: rgba(245,158,11,.06); border: 1px solid rgba(245,158,11,.25);
}
.stat-card-yellow:hover { box-shadow: 0 0 20px rgba(245,158,11,.15); }
.stat-card-yellow .stat-value { color: #fbbf24; }
.stat-icon-yellow { background: rgba(245,158,11,.15); color: #fbbf24; box-shadow: 0 0 15px rgba(245,158,11,.2); }

/* COTIZADOR */
.cotizador-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }

/* RESULTADOS */
.result-grid { display: flex; flex-direction: column; gap: .5rem; }
.result-item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; padding: .4rem 0; }
.result-hint { width: 100%; font-size: .7rem; color: var(--text-muted); margin-top: 1px; letter-spacing: .01em; }
.result-label { font-size: .85rem; color: var(--text-secondary); }
.result-value { font-weight: 600; font-size: .95rem; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.result-divider { height: 1px; background: var(--border); margin: .2rem 0; }
.result-subtotal .result-label, .result-subtotal .result-value { font-weight: 700; color: var(--text-primary); }
.result-final {
  background: rgba(56,189,248,.1); padding: .75rem !important;
  border-radius: var(--radius); margin-top: .25rem; border: 1px solid var(--border-strong);
}
.result-final .result-label { font-weight: 800; color: var(--neon-blue); font-size: .9rem; }
.result-final .result-value {
  font-weight: 800; font-size: 1.4rem;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(34,211,238,.3));
}
.result-margen .result-value { color: var(--success); }
.result-actions { display: flex; gap: .75rem; margin-top: 1.25rem; }

/* DASHBOARD */
.dashboard-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; margin-bottom: 1.5rem; }
.dash-card {
  padding: 1.25rem; border-radius: var(--radius-lg); text-align: center;
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative; overflow: hidden;
}
.dash-card:hover { transform: translateY(-3px); }
.dash-icon-bg {
  position: absolute; top: .5rem; right: .5rem; opacity: .15;
  transition: opacity .3s ease;
}
.dash-icon-bg .material-symbols-outlined { font-size: 2.5rem; }
.dash-card:hover .dash-icon-bg { opacity: .3; }
.dash-label {
  display: block; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .6px; font-weight: 600; margin-bottom: .5rem;
}
.dash-value { display: block; font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.dash-ingreso { background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.25); }
.dash-ingreso .dash-label { color: #4ade80; }
.dash-ingreso .dash-value { color: #4ade80; text-shadow: 0 0 10px rgba(34,197,94,.2); }
.dash-ingreso .dash-icon-bg { color: #4ade80; }
.dash-ingreso:hover { box-shadow: 0 0 25px rgba(34,197,94,.15); }
.dash-egreso { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.25); }
.dash-egreso .dash-label { color: #f87171; }
.dash-egreso .dash-value { color: #f87171; }
.dash-egreso .dash-icon-bg { color: #f87171; }
.dash-egreso:hover { box-shadow: 0 0 25px rgba(239,68,68,.15); }
.dash-pendiente { background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.25); }
.dash-pendiente .dash-label { color: #fbbf24; }
.dash-pendiente .dash-value { color: #fbbf24; }
.dash-pendiente .dash-icon-bg { color: #fbbf24; }
.dash-pendiente:hover { box-shadow: 0 0 25px rgba(245,158,11,.15); }
.dash-saldo { background: rgba(56,189,248,.08); border: 1px solid rgba(56,189,248,.25); }
.dash-saldo .dash-label { color: var(--neon-blue); }
.dash-saldo .dash-value { color: var(--neon-blue); text-shadow: 0 0 12px rgba(56,189,248,.25); }
.dash-saldo .dash-icon-bg { color: var(--neon-blue); }
.dash-saldo:hover { box-shadow: 0 0 25px rgba(56,189,248,.15); }

/* TOOLBAR */
.toolbar {
  display: flex; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap;
  padding: .75rem; border-radius: var(--radius-lg);
  background: var(--bg-card); border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}
.search-input {
  flex: 1; min-width: 200px; padding: .6rem .85rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .9rem; font-family: inherit;
  background: var(--bg-input); color: var(--text-primary); transition: all var(--transition);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { outline: none; border-color: var(--neon-cyan); box-shadow: 0 0 0 3px rgba(34,211,238,.15); }
.filter-select {
  padding: .6rem .85rem; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .9rem; font-family: inherit; background: var(--bg-input);
  color: var(--text-primary); min-width: 150px; cursor: pointer;
}
.filter-select option { background: #1e293b; color: var(--text-primary); }
.filter-select:focus { outline: none; border-color: var(--neon-cyan); box-shadow: 0 0 0 3px rgba(34,211,238,.15); }

/* TABLES */
.table-responsive {
  overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-lg);
  border: 1px solid rgba(56,189,248,.12);
}
.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.data-table thead { background: rgba(56,189,248,.08); border-bottom: 1px solid rgba(56,189,248,.15); }
.data-table th {
  padding: .75rem; text-align: left; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; font-size: .7rem; letter-spacing: .5px; white-space: nowrap;
}
.data-table td { padding: .7rem .75rem; border-bottom: 1px solid rgba(56,189,248,.06); vertical-align: middle; color: var(--text-primary); }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: rgba(56,189,248,.04); }

.catalogo-foto-cell { width: 56px; padding: 4px !important; text-align: center; }
.catalogo-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.catalogo-thumb-placeholder { font-size: 1.4rem; opacity: .3; }

.acciones-cell { white-space: nowrap; }
.toggle-pub { position: relative; display: inline-block; width: 36px; height: 20px; vertical-align: middle; margin-right: 4px; }
.toggle-pub input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--text-muted); border-radius: 20px;
  cursor: pointer; transition: background .3s;
}
.toggle-slider::before {
  content: ''; position: absolute; left: 2px; top: 2px;
  width: 16px; height: 16px; background: #fff; border-radius: 50%;
  transition: transform .3s; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.toggle-pub input:checked + .toggle-slider { background: var(--success); box-shadow: 0 0 8px rgba(34,197,94,.3); }
.toggle-pub input:checked + .toggle-slider::before { transform: translateX(16px); }
tr.pub-on { background: rgba(34,197,94,.06) !important; }

.preview-card-wrapper { padding: .5rem; }
.pub-card {
  background: var(--bg-card); border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--glass-border); box-shadow: var(--shadow); max-width: 280px;
}
.pub-card-img {
  width: 100%; aspect-ratio: 1/1; overflow: hidden;
  background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center;
}
.pub-card-img .preview-img { width: 100%; height: 100%; object-fit: cover; }
.preview-img-placeholder { text-align: center; font-size: 2.5rem; color: var(--text-muted); padding: 2rem; }
.pub-card-body { padding: .75rem 1rem 1rem; }
.pub-card-title { font-size: .95rem; font-weight: 600; color: var(--text-primary); margin-bottom: .3rem; }
.pub-card-cat, .pub-card-mat {
  display: inline-block; font-size: .7rem; padding: .15rem .55rem;
  border-radius: 20px; font-weight: 500; margin-right: .3rem; margin-bottom: .4rem;
}
.pub-card-cat { background: var(--primary-light); color: var(--neon-blue); }
.pub-card-mat { background: rgba(100,116,139,.15); color: var(--text-secondary); }
.pub-card-price { font-size: 1.15rem; font-weight: 700; color: var(--neon-cyan); margin-top: .3rem; }
.preview-link { display: block; margin-top: .5rem; color: var(--neon-blue); font-size: .85rem; text-decoration: none; }
.preview-link:hover { text-decoration: underline; }

.empty-state { text-align: center; color: var(--text-muted); padding: 3rem 1rem; font-size: .95rem; }

/* BADGES */
.badge {
  display: inline-block; padding: .2rem .6rem; border-radius: 20px;
  font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .3px;
}
.badge-ingreso { background: rgba(34,197,94,.1); color: #4ade80; border: 1px solid rgba(34,197,94,.2); }
.badge-egreso { background: rgba(239,68,68,.1); color: #f87171; border: 1px solid rgba(239,68,68,.2); }
.badge-pagado { background: rgba(34,197,94,.1); color: #4ade80; border: 1px solid rgba(34,197,94,.2); }
.badge-pendiente { background: rgba(245,158,11,.1); color: #fbbf24; border: 1px solid rgba(245,158,11,.2); }
.badge-entregado { background: rgba(56,189,248,.1); color: var(--neon-blue); border: 1px solid rgba(56,189,248,.2); }

/* MODAL */
.modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 1000; display: flex; align-items: center; justify-content: center;
}
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); }
.modal-content {
  position: relative; background: rgba(30,41,59,.85);
  backdrop-filter: var(--glass-blur-heavy); -webkit-backdrop-filter: var(--glass-blur-heavy);
  border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  width: 90%; max-width: 520px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: modalIn .3s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.05rem; color: var(--text-primary); }
.modal-close {
  background: none; border: none; font-size: 1.5rem; cursor: pointer;
  color: var(--text-muted); padding: 0 .25rem; line-height: 1; transition: color var(--transition);
}
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 1.25rem; }
.share-preview {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius);
  padding: .75rem; font-family: inherit; font-size: .85rem;
  background: var(--bg-input); color: var(--text-secondary); resize: none;
}
.share-actions { display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.share-actions .btn { flex: 1; min-width: 120px; }

/* TOAST */
.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 2000;
  display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  padding: .75rem 1.25rem; border-radius: var(--radius);
  font-size: .85rem; font-weight: 500; color: #fff;
  box-shadow: var(--shadow-md);
  animation: toastIn .3s ease, toastOut .3s ease 2.7s forwards;
  max-width: 360px; border: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(12px);
}
.toast-success { background: rgba(34,197,94,.85); }
.toast-error { background: rgba(239,68,68,.85); }
.toast-info { background: rgba(56,189,248,.85); }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(10px); } }

/* FIREBASE STATUS */
.firebase-status { display: flex; align-items: center; gap: .5rem; margin-top: .75rem; font-size: .9rem; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); }
.status-dot.connected { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.disconnected { background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.status-msg { margin-left: .75rem; font-size: .85rem; color: var(--success); }

/* FILAMENTOS */
.fil-toolbar {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
  padding: .75rem; border-radius: var(--radius-lg);
  background: var(--bg-card); border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}
.fil-search-input {
  padding: .5rem .85rem; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .9rem; min-width: 200px; flex: 1;
  background: var(--bg-input); color: var(--text-primary);
}
.fil-search-input::placeholder { color: var(--text-muted); }
.fil-search-input:focus { outline: none; border-color: var(--neon-cyan); box-shadow: 0 0 0 3px rgba(34,211,238,.15); }
.fil-select {
  padding: .5rem .85rem; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .85rem; background: var(--bg-input); color: var(--text-primary); cursor: pointer;
}
.fil-select:focus { outline: none; border-color: var(--neon-cyan); box-shadow: 0 0 0 3px rgba(34,211,238,.15); }
.fil-select option { background: #1e293b; color: var(--text-primary); }
.fil-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: .75rem; font-size: .85rem; color: var(--text-muted);
}
.fil-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
  gap: 1rem; margin-top: 1rem;
}
.fil-card {
  background: var(--bg-card); border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: all .3s ease; display: flex; flex-direction: column;
  backdrop-filter: var(--glass-blur);
}
.fil-card:hover {
  box-shadow: 0 4px 24px rgba(0,0,0,.3), 0 0 20px rgba(56,189,248,.12);
  transform: translateY(-4px); border-color: rgba(56,189,248,.3);
}
.fil-card-selected {
  border-color: var(--neon-blue);
  box-shadow: 0 0 0 2px rgba(56,189,248,.2), var(--shadow-glow);
}
.fil-card-header {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem; background: rgba(56,189,248,.06);
  border-bottom: 1px solid rgba(56,189,248,.1);
}
.fil-color-dot {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border); flex-shrink: 0;
}
.fil-tipo-badge {
  font-size: .7rem; font-weight: 600; padding: .15rem .5rem;
  border-radius: 12px; background: rgba(56,189,248,.12); color: var(--neon-blue);
  border: 1px solid rgba(56,189,248,.2);
}
.fil-descuento {
  margin-left: auto; font-size: .7rem; font-weight: 700;
  color: #f87171; background: rgba(239,68,68,.1);
  padding: .15rem .4rem; border-radius: 8px; border: 1px solid rgba(239,68,68,.2);
}
.fil-card-img {
  width: 100%; height: 140px; overflow: hidden;
  background: rgba(15,23,42,.4); display: flex; align-items: center; justify-content: center;
}
.fil-card-img img { width: 100%; height: 100%; object-fit: cover; }
.fil-no-img { font-size: 2.5rem; color: var(--text-muted); }
.fil-card-body { padding: .75rem; flex: 1; }
.fil-card-nombre {
  font-size: .8rem; font-weight: 600; color: var(--text-primary);
  line-height: 1.3; margin-bottom: .5rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.fil-card-precios { display: flex; align-items: center; gap: .5rem; }
.fil-precio-actual {
  font-size: 1.1rem; font-weight: 700;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.fil-precio-original { font-size: .8rem; color: var(--text-muted); text-decoration: line-through; }
.fil-precio-kg { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; font-weight: 500; }
.fil-card-actions {
  padding: .5rem .75rem; border-top: 1px solid var(--border);
  display: flex; gap: .5rem;
}
.fil-card-actions .btn { flex: 1; text-align: center; font-size: .75rem; padding: .35rem .5rem; }

/* SCROLLBAR (Stitch style) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(15,23,42,.2); }
::-webkit-scrollbar-thumb { background: rgba(56,189,248,.25); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(56,189,248,.45); }

/* RANGE SLIDER (Stitch style) */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; background: rgba(56,189,248,.2);
  border-radius: 2px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--neon-cyan); cursor: pointer;
  box-shadow: 0 0 10px rgba(34,211,238,.5);
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--neon-cyan); cursor: pointer; border: none;
  box-shadow: 0 0 10px rgba(34,211,238,.5);
}

/* MATERIAL SYMBOLS */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
}

/* ── FINANZAS: KPIs, Charts, Tags ── */
.fin-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.fin-kpi {
  display: flex;
  align-items: center;
  gap: .65rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
}
.fin-kpi-icon {
  font-size: 1.4rem;
  color: var(--neon-cyan);
  opacity: .8;
}
.fin-kpi-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.fin-kpi-label {
  display: block;
  font-size: .72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .3px;
}

/* ── Cotizador: preview filamento ── */
.cot-fil-info {
  display: flex; align-items: center; gap: .5rem;
  margin-top: .4rem;
}
.cot-fil-info.hidden { display: none; }
.cot-fil-swatch {
  width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.15);
}
.cot-fil-precio { font-size: .82rem; color: var(--neon-blue); }

/* ── Gráfico ventas catálogo ── */
.cat-chart-card {
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.cat-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
}
.cat-chart-header .card-title { margin: 0; }
#chart-ventas-mes {
  width: 100% !important;
  height: 220px !important;
}

.fin-charts-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
}
.fin-charts-toolbar .card-title { margin: 0; }

.fin-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.fin-chart-card {
  padding: 1rem 1.25rem;
  position: relative;
}
.fin-chart-card canvas {
  width: 100% !important;
  height: 240px !important;
}
.fin-chart-title {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 .5rem;
}

.fin-ref-tag {
  display: inline-block;
  font-size: .72rem;
  padding: .15rem .4rem;
  border-radius: 4px;
  background: rgba(56,189,248,.1);
  color: var(--neon-blue);
  border: 1px solid rgba(56,189,248,.15);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fin-cat-tag {
  display: inline-block;
  font-size: .72rem;
  padding: .15rem .4rem;
  border-radius: 4px;
  background: rgba(34,211,238,.08);
  color: var(--neon-cyan);
  border: 1px solid rgba(34,211,238,.12);
}
.text-muted { color: var(--text-muted); }

/* ── Reference selector ── */
.fin-ref-selector {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.fin-ref-label {
  flex: 1;
  font-size: .85rem;
  color: var(--text-muted);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: .45rem .7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fin-ref-label--active {
  color: var(--neon-blue);
  border-color: rgba(56,189,248,.25);
  background: rgba(56,189,248,.06);
}
.btn-sm {
  font-size: .78rem;
  padding: .35rem .65rem;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.btn-outline:hover {
  border-color: var(--neon-blue);
  color: var(--neon-blue);
}

/* ── Custom reference dropdown with images ── */
.ref-dropdown {
  position: relative;
}
.ref-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: .5rem .7rem;
  color: var(--text-primary);
  cursor: pointer;
  font-size: .85rem;
  text-align: left;
  transition: border-color .2s;
  min-height: 42px;
}
.ref-dropdown-toggle:hover,
.ref-dropdown-toggle:focus {
  border-color: var(--neon-blue);
  outline: none;
}
.ref-dropdown-placeholder {
  color: var(--text-muted);
}
.ref-dropdown-toggle-img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.ref-dropdown-toggle-icon {
  font-size: 1.2rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.ref-dropdown-toggle-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--neon-blue);
  font-weight: 500;
}
.ref-dropdown-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color .2s;
}
.ref-dropdown-clear:hover { color: var(--danger); }
.ref-dropdown-clear .material-symbols-outlined { font-size: .9rem; }

.ref-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  backdrop-filter: var(--glass-blur);
  z-index: 1100;
  overflow: hidden;
}
.ref-dropdown-search {
  width: 100%;
  padding: .55rem .7rem;
  background: var(--bg-input);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: .82rem;
  outline: none;
}
.ref-dropdown-search::placeholder { color: var(--text-muted); }
.ref-dropdown-list {
  max-height: 240px;
  overflow-y: auto;
}
.ref-dropdown-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .45rem .65rem;
  cursor: pointer;
  transition: background .15s;
}
.ref-dropdown-item:hover {
  background: var(--bg-hover);
}
.ref-dropdown-item-img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.ref-dropdown-item-noimg {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.04);
  color: var(--text-muted);
  flex-shrink: 0;
}
.ref-dropdown-item-noimg .material-symbols-outlined { font-size: 1.1rem; }
.ref-dropdown-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ref-dropdown-item-info strong {
  font-size: .8rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ref-dropdown-item-info span {
  font-size: .72rem;
  color: var(--neon-blue);
}
.ref-dropdown-empty {
  padding: .75rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .82rem;
}

@media (max-width: 768px) {
  .fin-kpis { grid-template-columns: repeat(2, 1fr); }
  .fin-charts-grid { grid-template-columns: 1fr; }
}

/* ── Multi-product modal & chips ── */
#modal-tx-productos > .modal-content,
#modal-ver-productos > .modal-content {
  padding: 1.25rem;
  max-width: 600px;
}
#modal-tx-productos .modal-title,
#modal-ver-productos .modal-title {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}
#modal-tx-productos .modal-title .material-symbols-outlined,
#modal-ver-productos .modal-title .material-symbols-outlined {
  font-size: 1.2rem;
  color: var(--neon-blue);
}
.tx-productos-resumen {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  min-height: 32px;
}
.txp-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: rgba(56,189,248,.08);
  border: 1px solid rgba(56,189,248,.2);
  border-radius: 20px;
  padding: .2rem .55rem;
  font-size: .75rem;
  color: var(--neon-blue);
}
.txp-chip-img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}
.txp-chip small {
  color: var(--text-muted);
  font-weight: 600;
}
.txp-chip-total {
  font-size: .78rem;
  font-weight: 600;
  color: var(--success);
  margin-left: .25rem;
}
.txp-search-section {
  margin-bottom: .75rem;
}
.txp-search-section .form-input {
  width: 100%;
  padding: .55rem .75rem;
  font-size: .85rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.txp-search-section .form-input::placeholder {
  color: var(--text-muted);
}
.txp-search-section .form-input:focus {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow: 0 0 0 3px rgba(56,189,248,.12);
}
.txp-catalogo-list {
  max-height: 180px;
  overflow-y: auto;
  margin-top: .35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
}
.txp-catalogo-list:empty {
  display: none;
}
.txp-cat-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .45rem .6rem;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  cursor: pointer;
}
.txp-cat-item:last-child { border-bottom: none; }
.txp-cat-item:hover { background: var(--bg-hover); }
.txp-cat-img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.txp-cat-noimg {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  flex-shrink: 0;
}
.txp-cat-noimg .material-symbols-outlined { font-size: 1.1rem; }
.txp-cat-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.txp-cat-info strong {
  font-size: .8rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.txp-cat-info span { font-size: .72rem; color: var(--neon-blue); }
.txp-add-btn { flex-shrink: 0; }
.txp-section-title {
  font-size: .82rem;
  color: var(--text-secondary);
  margin-bottom: .4rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.txp-table-wrap {
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: .5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
}
.txp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}
.txp-table thead {
  position: sticky;
  top: 0;
  background: rgba(15,23,42,.9);
  z-index: 1;
}
.txp-table th {
  text-align: left;
  padding: .5rem .55rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-strong);
  font-weight: 600;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.txp-table td {
  padding: .45rem .55rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-primary);
}
.txp-table tr:last-child td { border-bottom: none; }
.txp-table tr:hover td { background: var(--bg-hover); }
.txp-row-img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
}
.txp-cant-input {
  width: 52px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  padding: .2rem .35rem;
  font-size: .8rem;
  text-align: center;
}
.txp-cant-input:focus {
  border-color: var(--neon-blue);
  outline: none;
  box-shadow: 0 0 0 2px rgba(56,189,248,.15);
}
.txp-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: .75rem;
}
.txp-footer strong {
  color: var(--neon-blue);
  font-size: .9rem;
}
.txp-ver-btn {
  font-size: .72rem !important;
  padding: .2rem .55rem !important;
  white-space: nowrap;
}
#txp-vacio {
  padding: 1rem .5rem;
  color: var(--text-muted);
  font-size: .8rem;
}

/* MODAL LG */
.modal-content.modal-lg { max-width: 900px; }
.modal-content.modal-lg .modal-body { max-height: 82vh; overflow-y: auto; }

/* ── BULK BAR (acciones masivas catálogo) ── */
.bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .55rem 1rem;
    margin-bottom: .5rem;
    background: #0f1e38;
    border: 1px solid var(--neon-blue, #38bdf8);
    border-radius: 8px;
    flex-wrap: wrap;
}
.bulk-bar.hidden { display: none; }
.bulk-bar-left {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .9rem;
    color: var(--text-secondary, #94a3b8);
    white-space: nowrap;
}
.bulk-bar-actions {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
}
.btn.btn-sm {
    padding: .28rem .6rem;
    font-size: .8rem;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.btn.btn-sm.btn-outline {
    background: transparent;
    border: 1px solid var(--border, #334155);
    color: var(--text-primary, #e2e8f0);
}
.btn.btn-sm.btn-outline:hover {
    background: rgba(56,189,248,.1);
    border-color: var(--neon-blue, #38bdf8);
}
.btn.btn-sm.btn-icon-danger {
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
}
.btn.btn-sm.btn-icon-danger:hover { background: rgba(239,68,68,.15); }
.btn.btn-sm.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-secondary, #94a3b8);
    padding: .28rem .4rem;
}
.btn.btn-sm.btn-ghost:hover { color: #e2e8f0; }

/* Fila seleccionada */
tr.bulk-selected td {
    background: rgba(56,189,248,.07);
    border-top-color: rgba(56,189,248,.2);
    border-bottom-color: rgba(56,189,248,.2);
}

/* ── Edit Transaction Modal ── */
.modal-edit-tx-content {
  max-width: 680px;
  width: 92%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.modal-edit-tx-content .modal-header {
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.modal-edit-tx-content .modal-header h3 {
  font-size: 1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: .4rem;
  font-weight: 600;
}
.modal-edit-tx-content .modal-header h3 .material-symbols-outlined {
  color: var(--neon-blue);
  font-size: 1.15rem;
}
.modal-edit-tx-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  flex-shrink: 0;
  background: rgba(15,23,42,.3);
}

/* Resumen financiero (tarjetas destacadas) */
.edit-tx-resumen {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
  margin-bottom: 1rem;
}
.resumen-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  padding: .6rem .5rem;
  border-radius: var(--radius);
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.05);
  transition: border-color .2s;
}
.resumen-item:hover { border-color: var(--glass-border); }
.resumen-icon { font-size: 1.15rem; color: var(--text-muted); }
.resumen-label { font-size: .65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; }
.resumen-item strong { font-size: 1.1rem; color: var(--text-primary); font-weight: 700; }
.resumen-abonado .resumen-icon { color: var(--neon-blue); }
.resumen-abonado strong { color: var(--neon-blue); }
.resumen-restante .resumen-icon { color: #f59e0b; }
.resumen-restante strong { color: #f59e0b; }

/* Secciones internas del modal */
.edit-section {
  padding: .75rem .85rem;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: var(--radius);
  margin-bottom: .75rem;
}
.edit-section-title {
  font-size: .8rem;
  color: var(--text-muted);
  margin: 0 0 .65rem;
  display: flex;
  align-items: center;
  gap: .3rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 600;
}
.edit-section-title .material-symbols-outlined { font-size: .95rem; color: var(--neon-blue); }

/* Abonos */
.edit-tx-abonos .abonos-list { margin-bottom: .5rem; }
.abono-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .55rem;
  border-radius: 8px;
  margin-bottom: .25rem;
  background: rgba(255,255,255,.02);
  transition: background .15s;
}
.abono-item:hover { background: rgba(255,255,255,.04); }
.abono-fecha { font-size: .75rem; color: var(--text-muted); min-width: 80px; }
.abono-monto-tag {
  font-size: .78rem;
  font-weight: 600;
  color: #22c55e;
  background: rgba(34,197,94,.1);
  padding: .15rem .5rem;
  border-radius: 6px;
  min-width: 75px;
  text-align: center;
  border: 1px solid rgba(34,197,94,.15);
}
.abono-nota { font-size: .75rem; color: var(--text-secondary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abono-form {
  display: flex;
  gap: .4rem;
  align-items: center;
  padding-top: .5rem;
  border-top: 1px solid rgba(255,255,255,.04);
}
.abono-form .form-input {
  flex: 1;
  min-width: 80px;
  font-size: .8rem;
  padding: .4rem .5rem;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-primary);
}
.abono-form .form-input:focus { border-color: var(--neon-blue); outline: none; }
.btn-add-abono {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  white-space: nowrap;
  background: rgba(34,197,94,.12);
  color: #22c55e;
  border: 1px solid rgba(34,197,94,.2);
  border-radius: 8px;
  cursor: pointer;
  font-size: .78rem;
  padding: .4rem .65rem;
  font-weight: 600;
  transition: background .2s, border-color .2s;
}
.btn-add-abono:hover {
  background: rgba(34,197,94,.2);
  border-color: rgba(34,197,94,.35);
}

/* Ghost button (cancelar) */
.btn-ghost {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  border-radius: var(--radius);
  padding: .5rem 1rem;
  cursor: pointer;
  font-size: .85rem;
  transition: color .2s, border-color .2s;
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--border-strong); }

/* Primary button con icono */
.modal-footer .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

/* ── Abono progress bar in table ── */
.abono-progress {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,.06);
  border-radius: 2px;
  margin-top: .25rem;
  overflow: hidden;
}
.abono-bar {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #38bdf8);
  border-radius: 2px;
  transition: width .3s;
}
.abono-info {
  display: block;
  font-size: .65rem;
  color: var(--text-muted);
  margin-top: .15rem;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .modal-edit-tx-content { width: 97%; max-height: 95vh; }
  .edit-tx-resumen { grid-template-columns: 1fr; gap: .35rem; }
  .abono-form { flex-wrap: wrap; }
  .abono-form .form-input { min-width: 100%; }
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; text-align: center; justify-content: center; }
}

/* ── EDIT GALLERY (Admin) ── */
.edit-galeria {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  min-height: 60px;
  padding: .5rem 0;
  border: 1px dashed transparent;
  border-radius: 10px;
  transition: border-color .15s, background .15s;
}
.edit-galeria.drag-over {
  border-color: var(--neon-blue);
  background: rgba(56, 189, 248, 0.08);
}
.edit-drop-hint {
  width: 100%;
  margin: 0;
  padding: .5rem;
}
.edit-foto-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border);
  cursor: default;
}
.edit-foto-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.edit-foto-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  font-size: .55rem;
  font-weight: 700;
  padding: .1rem .3rem;
  border-radius: 4px;
  background: var(--neon-blue);
  color: var(--text-inverse);
  text-transform: uppercase;
}
.edit-foto-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  opacity: 0;
  transition: opacity .15s;
}
.edit-foto-thumb:hover .edit-foto-overlay { opacity: 1; }
.edit-foto-btn {
  background: rgba(255,255,255,.15);
  border: none;
  border-radius: 4px;
  padding: .2rem;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.edit-foto-btn:hover { background: rgba(255,255,255,.3); }
.edit-foto-btn-del:hover { background: rgba(239,68,68,.6); }

.edit-foto-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}
.edit-upload-label {
  display: inline-flex !important;
  align-items: center;
  gap: .3rem;
  cursor: pointer;
  flex-shrink: 0;
}
.edit-url-inline {
  display: flex;
  gap: .3rem;
  flex: 1;
  min-width: 200px;
}
.edit-url-inline .form-input { flex: 1; }
.btn-sm {
  padding: .35rem .65rem !important;
  font-size: .8rem !important;
}

.edit-upload-progress {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .5rem;
}
.edit-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(56,189,248,.15);
  border-radius: 2px;
  overflow: hidden;
}
.edit-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-gradient);
  border-radius: 2px;
  transition: width .2s;
}
.edit-upload-progress span {
  font-size: .75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Custom filament select dropdown ── */
.fil-sel-wrap {
  position: relative;
}
.fil-sel-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .6rem .85rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: .9rem;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: border var(--transition), box-shadow var(--transition);
  backdrop-filter: blur(8px);
}
.fil-sel-trigger:hover { border-color: var(--border-strong); }
.fil-sel-trigger:focus { outline: none; border-color: var(--neon-blue); box-shadow: 0 0 0 3px rgba(56,189,248,.15); }
.fil-sel-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.fil-sel-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fil-sel-chevron { font-size: 1.1rem; color: var(--text-muted); margin-left: auto; flex-shrink: 0; }
.fil-sel-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: rgba(15,23,42,.97);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  max-height: 240px;
  overflow-y: auto;
  z-index: 200;
}
.fil-sel-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .5rem .85rem;
  font-size: .88rem;
  cursor: pointer;
  transition: background var(--transition);
  color: var(--text-primary);
}
.fil-sel-item:hover { background: var(--bg-hover); }
.fil-sel-item:first-child { color: var(--text-muted); }
.fil-sel-item-oos { opacity: .45; cursor: not-allowed; }
.fil-sel-item .fil-sel-dot { width: 12px; height: 12px; }

/* ── Input con botón de acción interno ── */
.input-action-wrap { position: relative; }
.input-action-wrap .form-input { padding-right: 2.5rem; width: 100%; }
.input-action-btn {
  position: absolute; right: .4rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: .2rem;
  color: var(--text-muted); cursor: pointer; border-radius: 6px;
  display: flex; align-items: center;
  transition: color var(--transition), background var(--transition);
}
.input-action-btn .material-symbols-outlined { font-size: 1.1rem; }
.input-action-btn:hover { color: var(--neon-blue); background: rgba(56,189,248,.1); }

/* ── Costo estimado en modal edición ── */
.edit-costo-box {
  background: rgba(56,189,248,.05);
  border: 1px solid rgba(56,189,248,.2);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  margin-top: .5rem;
  margin-bottom: .25rem;
}
.edit-costo-box-label {
  display: block;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--neon-blue);
  font-weight: 600;
  margin-bottom: .45rem;
}
.edit-costo-rows { display: flex; flex-direction: column; gap: .25rem; }
.edit-costo-row {
  display: flex;
  justify-content: space-between;
  font-size: .83rem;
  color: var(--text-secondary);
}
.edit-costo-row strong { color: var(--text-primary); }
.edit-costo-total-row {
  margin-top: .35rem;
  padding-top: .35rem;
  border-top: 1px solid rgba(56,189,248,.15);
  font-size: .9rem;
  color: var(--text-primary);
}
.edit-costo-total-row strong { color: var(--neon-blue); font-size: .95rem; }

/* ── SOLICITUDES ADMIN ── */
.sol-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: .75rem;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.sol-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 0 20px rgba(56,189,248,.08);
  transform: translateY(-1px);
}
.sol-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: .5rem;
}
.sol-card-titulo {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-primary);
}
.sol-card-cliente {
  font-size: .78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-top: .2rem;
}
.sol-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .25rem;
  flex-shrink: 0;
}
.sol-card-desc {
  font-size: .82rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: .5rem;
}
.sol-card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

/* Estado badges */
.sol-estado {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.sol-estado-pendiente { background: var(--warning-light); color: var(--warning); }
.sol-estado-en_revision { background: var(--primary-light); color: var(--primary); }
.sol-estado-cotizada { background: rgba(139,92,246,.12); color: #a78bfa; }
.sol-estado-aprobada { background: var(--success-light); color: var(--success); }
.sol-estado-rechazada { background: var(--danger-light); color: var(--danger); }

.sol-fecha {
  font-size: .72rem;
  color: var(--text-muted);
}

/* Chips */
.sol-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .72rem;
  padding: .15rem .5rem;
  border-radius: 6px;
  background: rgba(56,189,248,.08);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.sol-chip-link { color: var(--neon-blue); }

/* Detail modal */
.sol-detail-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.sol-detail-top h3 {
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: .4rem;
}
.sol-detail-cliente {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1rem;
  font-size: .88rem;
  color: var(--text-secondary);
}
.sol-detail-cliente div {
  display: flex;
  align-items: center;
  gap: .3rem;
}
.sol-detail-cliente .material-symbols-outlined { font-size: 1rem; color: var(--neon-blue); }
.sol-detail-section {
  margin-bottom: 1rem;
}
.sol-detail-section h4 {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: .35rem;
}
.sol-detail-section p {
  font-size: .88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}
.sol-detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1rem;
}
.sol-detail-ref {
  margin-bottom: 1rem;
  padding: .75rem;
  background: rgba(15,23,42,.4);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.sol-detail-ref h4 {
  font-size: .82rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-bottom: .4rem;
}
.sol-detail-ref a {
  font-size: .78rem;
  color: var(--neon-blue);
  word-break: break-all;
}
.sol-ref-img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 6px;
  margin-top: .5rem;
  object-fit: contain;
}
.sol-detail-precio {
  font-size: .9rem;
  color: var(--success);
  margin-bottom: .5rem;
}
.sol-detail-respuesta {
  margin-bottom: 1rem;
  padding: .75rem;
  background: rgba(34,197,94,.06);
  border: 1px solid rgba(34,197,94,.15);
  border-radius: 8px;
}
.sol-detail-respuesta strong {
  color: var(--success);
  font-size: .82rem;
}
.sol-detail-respuesta p {
  color: var(--text-secondary);
  font-size: .85rem;
  margin-top: .3rem;
}

/* Actions */
.sol-detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.sol-action-group label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .25rem;
}
.sol-action-group input,
.sol-action-group textarea {
  width: 100%;
  padding: .5rem .65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: .85rem;
  font-family: inherit;
}
.sol-action-group input:focus,
.sol-action-group textarea:focus {
  outline: none;
  border-color: var(--neon-blue);
}
.sol-action-group textarea { resize: vertical; min-height: 60px; }
.sol-action-full { grid-column: 1 / -1; }
.sol-action-buttons {
  grid-column: 1 / -1;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.sol-action-buttons .btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .82rem;
  padding: .55rem 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all .2s;
}
.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover {
  background: #16a34a;
  box-shadow: 0 0 15px rgba(34,197,94,.3);
}
.btn-icon-danger {
  color: var(--danger) !important;
  border: 1px solid var(--danger-light) !important;
}
.btn-icon-danger:hover {
  background: var(--danger-light);
}

/* BUTTON GLOW (Stitch style) */
.btn-primary {
  background: var(--accent-gradient); color: var(--text-inverse);
  box-shadow: 0 2px 8px rgba(56,189,248,.25), 0 0 15px rgba(56,189,248,.15);
  position: relative;
}
.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(56,189,248,.4), 0 0 25px rgba(56,189,248,.25);
  filter: brightness(1.1); transform: translateY(-1px);
}
.btn-primary:active { transform: scale(.97); }

/* ========================================
   FILAMENT MODE TOGGLE + INVENTORY
   ======================================== */
.fil-mode-toggle {
  display: flex; gap: .25rem; margin-bottom: 1rem; padding: .25rem;
  background: var(--bg-card); border-radius: 12px;
  border: 1px solid var(--glass-border); width: fit-content;
}
.fil-mode-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .6rem 1.2rem; border: none; border-radius: 10px;
  background: transparent; color: var(--text-muted);
  cursor: pointer; font-size: .85rem; font-weight: 500; transition: all .2s;
}
.fil-mode-btn .material-symbols-outlined { font-size: 1.1rem; }
.fil-mode-btn:hover { color: var(--text-primary); background: rgba(56,189,248,.08); }
.fil-mode-btn.active {
  background: rgba(56,189,248,.15); color: var(--neon-blue);
  box-shadow: 0 0 12px rgba(56,189,248,.15);
}
.fil-panel { display: none; }
.fil-panel.active { display: block; }

.fil-inv-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: .75rem; margin-top: .75rem;
}
.fil-inv-card {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--glass-border);
  transition: all .2s;
}
.fil-inv-card:hover { border-color: rgba(56,189,248,.3); }
.fil-inv-card.fil-inv-card-oos { opacity: .75; border-color: rgba(239,68,68,.35); }
.fil-inv-color { width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0; border: 2px solid rgba(255,255,255,.15); }
.fil-inv-info { flex: 1; display: flex; flex-direction: column; gap: .15rem; }
.fil-inv-info strong { font-size: .88rem; }
.fil-inv-info span { font-size: .82rem; color: var(--neon-blue); }
.fil-inv-toggle-wrap {
  display: flex; align-items: center; gap: .5rem;
  flex-shrink: 0;
}
.fil-inv-status-label {
  font-size: .75rem; font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.fil-inv-card:not(.fil-inv-card-oos) .fil-inv-status-label {
  color: var(--success);
}
.fil-inv-actions { display: flex; gap: .35rem; align-items: center; flex-shrink: 0; }

.fil-inv-card-editing {
  display: block !important;
  border-color: var(--neon-blue) !important;
}
.fil-inv-edit-form { width: 100%; }
.fil-inv-edit-row {
  display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem;
}
.fil-inv-edit-field {
  display: flex; flex-direction: column; gap: .2rem; flex: 1; min-width: 110px;
}
.fil-inv-edit-field label { font-size: .75rem; color: var(--text-muted); }
.fil-inv-edit-actions { display: flex; gap: .5rem; justify-content: flex-end; }

/* ========================================
   PEDIDOS · SELECTOR FILAMENTOS
   ======================================== */
.ped-fil-selector {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.ped-fil-available {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  min-height: 38px;
}
.ped-fil-chip {
  border: 1px solid rgba(148,163,184,.28);
  background: rgba(15,23,42,.7);
  color: var(--text-primary);
  border-radius: 999px;
  padding: .28rem .55rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  cursor: pointer;
  transition: all .18s ease;
}
.ped-fil-chip:hover {
  border-color: rgba(56,189,248,.45);
  transform: translateY(-1px);
}
.ped-fil-chip.ped-fil-chip-active {
  border-color: rgba(34,211,238,.7);
  background: rgba(34,211,238,.16);
  box-shadow: 0 0 0 1px rgba(34,211,238,.28) inset;
}
.ped-fil-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.45);
  flex-shrink: 0;
}
.ped-fil-name {
  font-size: .78rem;
  font-weight: 600;
  line-height: 1;
}
.ped-fil-stock {
  font-size: .7rem;
  color: var(--text-muted);
  opacity: .9;
}
.ped-fil-selected { min-height: 24px; }
.ped-fil-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.ped-fil-tag {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .45rem;
  border-radius: 999px;
  background: rgba(56,189,248,.14);
  border: 1px solid rgba(56,189,248,.28);
  font-size: .74rem;
}
.ped-fil-tag em {
  color: #fbbf24;
  font-style: normal;
  font-size: .68rem;
}
.ped-fil-tag-otro {
  background: rgba(245,158,11,.12);
  border-color: rgba(245,158,11,.3);
}
.ped-fil-tag-remove {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  font-size: .95rem;
}
.ped-fil-tag-remove:hover { color: #fca5a5; }

/* ========================================
   CONFIG TABS
   ======================================== */
.config-tabs {
  display: flex; gap: .25rem; flex-wrap: wrap;
  margin-bottom: 1rem; padding: .25rem;
  background: var(--bg-card); border-radius: 12px;
  border: 1px solid var(--glass-border);
}
.config-tab {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .6rem 1rem; border: none; border-radius: 10px;
  background: transparent; color: var(--text-muted);
  cursor: pointer; font-size: .82rem; font-weight: 500;
  transition: all .2s;
}
.config-tab .material-symbols-outlined { font-size: 1.1rem; }
.config-tab:hover { color: var(--text-primary); background: rgba(56,189,248,.08); }
.config-tab.active {
  background: rgba(56,189,248,.15); color: var(--neon-blue);
  box-shadow: 0 0 12px rgba(56,189,248,.15);
}
.config-panel { display: none; }
.config-panel.active { display: block; }

/* ========================================
   CATEGORÍAS GRID
   ======================================== */
.categorias-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .75rem;
}
.categoria-card {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--glass-border);
  transition: all .2s;
}
.categoria-card:hover { border-color: rgba(56,189,248,.3); }
.categoria-color {
  width: 32px; height: 32px; border-radius: 8px;
  flex-shrink: 0;
}
.categoria-info {
  flex: 1; display: flex; flex-direction: column; gap: .15rem;
  min-width: 0;
}
.categoria-info strong { font-size: .9rem; }
.categoria-info .text-muted { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ========================================
   MÁQUINAS GRID
   ======================================== */
.maquinas-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: .75rem;
}
.maquina-card {
  padding: 1rem; border-radius: 12px;
  background: var(--bg-card); border: 1px solid var(--glass-border);
  transition: all .2s;
}
.maquina-card:hover { border-color: rgba(56,189,248,.3); }
.maquina-header {
  display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem;
}
.maquina-header .material-symbols-outlined { color: var(--neon-blue); font-size: 1.3rem; }
.maquina-header strong { flex: 1; }
.maquina-specs {
  display: grid; grid-template-columns: 1fr 1fr; gap: .35rem .75rem;
  font-size: .82rem; margin-bottom: .75rem;
}
.maquina-actions {
  display: flex; gap: .5rem; justify-content: flex-end;
  border-top: 1px solid var(--glass-border); padding-top: .5rem;
}

/* ========================================
   BOLETA / FACTURA MODAL
   ======================================== */
.btn-icon-success:hover { background: rgba(74,222,128,.1); border-color: rgba(74,222,128,.2); color: #4ade80; }
.boleta-preview { padding: .1rem 0; }
.boleta-preview-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1rem;
}
.boleta-preview-brand { display: flex; align-items: center; gap: .75rem; }
.boleta-brand-icon { font-size: 2rem; color: var(--neon-blue); }
.boleta-brand-name { font-size: 1.05rem; font-weight: 800; color: var(--text-primary); }
.boleta-brand-sub { font-size: .75rem; color: var(--text-secondary); }
.boleta-preview-meta { text-align: right; font-size: .83rem; line-height: 1.7; }
.boleta-doc-type {
    font-size: .68rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 700;
    border: 1px solid var(--border); border-radius: 4px; padding: 3px 10px;
    display: inline-block; margin-bottom: 6px; color: var(--text-secondary);
}
.boleta-preview-client {
    background: rgba(56,189,248,.04); border: 1px solid rgba(56,189,248,.12);
    border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: .9rem; font-size: .85rem;
}
.boleta-client-label { font-size: .66rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); font-weight: 600; margin-bottom: 4px; }
.boleta-client-name { font-weight: 700; color: var(--text-primary); }
.boleta-client-detail { color: var(--text-secondary); margin-top: 2px; }
.boleta-hint {
    font-size: .77rem; color: var(--neon-cyan); margin-bottom: .65rem;
    padding: 5px 10px; background: rgba(34,211,238,.06);
    border-radius: 4px; border: 1px solid rgba(34,211,238,.15);
}
.boleta-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: .85rem; }
.boleta-table thead th {
    background: rgba(56,189,248,.08); border-bottom: 1px solid var(--border);
    padding: 7px 11px; text-align: left;
    font-size: .7rem; text-transform: uppercase; letter-spacing: .5px;
    color: var(--text-secondary); font-weight: 600;
}
.boleta-table tbody td { padding: 9px 11px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.boleta-table tbody tr:last-child td { border-bottom: none; }
.boleta-td-qty { text-align: center; width: 55px; }
.boleta-td-price { width: 165px; }
.boleta-td-subtotal { text-align: right; width: 120px; font-weight: 600; color: var(--text-primary); }
.boleta-price-wrap { display: flex; align-items: center; gap: 4px; }
.boleta-price-prefix { color: var(--text-secondary); font-size: .88rem; }
.boleta-price-input {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px;
    color: var(--text-primary); padding: 5px 8px; font-size: .88rem; width: 115px;
    font-variant-numeric: tabular-nums; transition: border-color .15s;
}
.boleta-price-input:focus { outline: none; border-color: var(--neon-blue); box-shadow: 0 0 0 2px rgba(56,189,248,.15); }
.boleta-totals {
    border-top: 1px solid var(--border); padding-top: .75rem;
    display: flex; flex-direction: column; align-items: flex-end; gap: 5px; margin-bottom: 1rem;
}
.boleta-total-row { display: flex; justify-content: space-between; min-width: 250px; font-size: .88rem; color: var(--text-secondary); }
.boleta-total-final { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); padding-top: 5px; border-top: 1px solid var(--border); margin-top: 3px; }
.boleta-note { margin-top: .25rem; }
.boleta-note-label { font-size: .72rem; color: var(--text-secondary); display: block; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.boleta-note-input {
    width: 100%; box-sizing: border-box; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 6px; color: var(--text-primary); padding: 7px 10px;
    font-size: .84rem; resize: vertical; font-family: inherit;
}
.boleta-note-input:focus { outline: none; border-color: var(--neon-blue); box-shadow: 0 0 0 2px rgba(56,189,248,.15); }
/* Columna costo interno (solo modal, NO sale en PDF) */
.boleta-col-costo { width: 145px; }
.boleta-col-costo-th {
    background: rgba(251,191,36,.06) !important;
    color: #fbbf24 !important;
    border-bottom-color: rgba(251,191,36,.2) !important;
}
.boleta-col-costo {
    background: rgba(251,191,36,.04);
    border-right: 1px dashed rgba(251,191,36,.18);
}
.boleta-costo-val {
    display: block; font-size: .82rem; font-weight: 600;
    color: #fbbf24; font-variant-numeric: tabular-nums;
}
.boleta-margen-badge {
    display: inline-block; margin-top: 3px;
    font-size: .68rem; padding: 1px 6px; border-radius: 20px;
    background: rgba(251,191,36,.12); color: #fbbf24; border: 1px solid rgba(251,191,36,.2);
    font-weight: 600;
}
.boleta-costo-na { color: var(--text-secondary); font-size: .82rem; }
.btn-save-ajuste {
    color: #fbbf24 !important;
    border-color: rgba(251,191,36,.35) !important;
}
.btn-save-ajuste:hover {
    background: rgba(251,191,36,.08) !important;
    border-color: rgba(251,191,36,.6) !important;
}

/* ========================================
   ORDER DETAIL MODAL
   ======================================== */
.order-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.order-detail-section h4 {
  display: flex; align-items: center; gap: .35rem;
  color: var(--neon-blue); font-size: .85rem; text-transform: uppercase;
  letter-spacing: .04em; margin-bottom: .5rem;
}
.order-detail-section h4 .material-symbols-outlined { font-size: 1.1rem; }
.order-detail-section p { margin: .25rem 0; font-size: .88rem; }
.order-total { font-size: 1.1rem !important; color: var(--neon-blue); margin-top: .5rem !important; }

.order-items-list { display: flex; flex-direction: column; gap: .5rem; }
.order-item {
  padding: .75rem; border-radius: 10px;
  background: rgba(30,41,59,.5); border: 1px solid var(--glass-border);
}
.order-item-header {
  display: flex; justify-content: space-between; align-items: center;
}
.order-item-subtotal { color: var(--neon-blue); font-weight: 600; }
.order-item-meta {
  display: flex; gap: 1rem; font-size: .82rem; color: var(--text-muted);
  margin-top: .25rem;
}
.order-item-fils { margin-top: .35rem; display: flex; gap: .35rem; flex-wrap: wrap; }
.fil-tag {
  display: inline-block; padding: .15rem .5rem; border-radius: 6px;
  font-size: .75rem; font-weight: 500;
}

/* ========================================
   PEDIDOS BADGES
   ======================================== */
.badge {
  display: inline-block; padding: .2rem .6rem; border-radius: 6px;
  font-size: .75rem; font-weight: 600; letter-spacing: .02em;
}
.badge-success { background: rgba(34,197,94,.15); color: #4ade80; border: 1px solid rgba(34,197,94,.25); }
.badge-warning { background: rgba(245,158,11,.15); color: #fbbf24; border: 1px solid rgba(245,158,11,.25); }
.badge-info    { background: rgba(56,189,248,.15); color: #38bdf8; border: 1px solid rgba(56,189,248,.25); }
.badge-primary { background: rgba(129,140,248,.15); color: #818cf8; border: 1px solid rgba(129,140,248,.25); }
.badge-danger  { background: rgba(239,68,68,.15); color: #f87171; border: 1px solid rgba(239,68,68,.25); }
.badge-default { background: rgba(148,163,184,.15); color: #94a3b8; border: 1px solid rgba(148,163,184,.25); }

/* RESPONSIVE */
@media (max-width: 1024px) {
  .cotizador-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: repeat(2,1fr); }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  .navbar-links {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    background: rgba(15,23,42,.95); backdrop-filter: var(--glass-blur-heavy);
    -webkit-backdrop-filter: var(--glass-blur-heavy);
    flex-direction: column; padding: .5rem;
    border-bottom: 1px solid var(--glass-border); box-shadow: var(--shadow-lg);
  }
  .navbar-links.open { display: flex; }
  .btn-menu-toggle { display: block; }
  .brand-text { display: none; }
  .form-row { flex-direction: column; gap: 0; }
  .result-actions { flex-direction: column; }
  .share-actions { flex-direction: column; }
  .toolbar { flex-direction: column; }
  .filter-select { width: 100%; }
  .stats-grid { grid-template-columns: 1fr; }
  .order-detail-grid { grid-template-columns: 1fr; }
  .config-tabs { gap: .15rem; }
  .config-tab { padding: .5rem .7rem; font-size: .78rem; }
}
@media (max-width: 480px) {
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .dash-value { font-size: 1.1rem; }
  .main-content { padding: 1rem .75rem 2rem; }
  .card { padding: 1rem; }
  .data-table { font-size: .78rem; }
  .data-table th, .data-table td { padding: .5rem; }
  .config-tab span.material-symbols-outlined { display: none; }
}

/* ========================================================
   DB ADMIN PANEL – Estilos
   ======================================================== */

/* Layout principal */
.dba-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  height: calc(100vh - 200px);
  min-height: 500px;
}

/* Sidebar */
.dba-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dba-sidebar-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--neon-cyan);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.dba-sidebar-header .material-symbols-outlined { font-size: 1.1rem; }

.dba-collection-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: .4rem 0;
}
.dba-col-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .9rem;
  cursor: pointer;
  transition: background .15s;
  border-left: 3px solid transparent;
}
.dba-col-item:hover {
  background: var(--bg-hover);
}
.dba-col-item.active {
  background: var(--primary-light);
  border-left-color: var(--neon-blue);
}
.dba-col-icon { font-size: 1rem; color: var(--neon-blue); flex-shrink: 0; }
.dba-col-name { font-size: .82rem; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dba-col-raw { font-size: .68rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-left: auto; }

.dba-btn-add-col {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1rem;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .8rem;
  cursor: pointer;
  transition: color .15s;
  width: 100%;
}
.dba-btn-add-col:hover { color: var(--neon-cyan); }
.dba-btn-add-col .material-symbols-outlined { font-size: 1rem; }

/* Panel principal */
.dba-main {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Toolbar */
.dba-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  gap: .75rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.dba-toolbar-left { display: flex; align-items: baseline; gap: .75rem; }
.dba-toolbar-right { display: flex; align-items: center; gap: .5rem; }
.dba-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.dba-count { font-size: .75rem; color: var(--text-muted); }

.dba-search {
  padding: .35rem .75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: .85rem;
  width: 200px;
  transition: border-color .2s;
}
.dba-search:focus { outline: none; border-color: var(--neon-blue); }

/* Bulk bar */
.dba-bulk-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem 1rem;
  background: rgba(229,57,53,.1);
  border-bottom: 1px solid rgba(229,57,53,.3);
  font-size: .85rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* Loading */
.dba-loading {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 1rem;
  color: var(--text-muted);
  font-size: .85rem;
  flex-shrink: 0;
}
@keyframes dba-spin { to { transform: rotate(360deg); } }
.dba-spin { animation: dba-spin 1s linear infinite; display: inline-block; }

/* Table scroll area */
.dba-table-scroll {
  flex: 1;
  overflow: auto;
  padding: 0;
}

/* Table */
.dba-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.dba-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(15,23,42,.95);
}
.dba-table th {
  padding: .6rem .75rem;
  text-align: left;
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--neon-cyan);
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
.dba-th-check, .dba-td-check { width: 36px; text-align: center !important; }
.dba-th-id, .dba-td-id { max-width: 120px; font-family: monospace; font-size: .75rem; color: var(--text-muted); }
.dba-th-actions, .dba-td-actions { width: 80px; text-align: center !important; white-space: nowrap; }

.dba-table td {
  padding: .55rem .75rem;
  border-bottom: 1px solid rgba(56,189,248,.06);
  color: var(--text-secondary);
  vertical-align: top;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dba-table tr:hover td { background: var(--bg-hover); }

.dba-cell { cursor: default; }
.dba-null { color: var(--text-muted); font-style: italic; }
.dba-bool { color: var(--neon-purple); font-weight: 600; }
.dba-num { color: var(--neon-cyan); }
.dba-ts { color: var(--warning); }
.dba-obj { color: var(--text-muted); font-style: italic; }

.dba-empty-row { text-align: center; padding: 2rem; color: var(--text-muted); }

/* Row action buttons */
.dba-btn-edit, .dba-btn-del {
  background: none;
  border: none;
  cursor: pointer;
  padding: .2rem;
  border-radius: 4px;
  transition: background .15s;
  line-height: 1;
}
.dba-btn-edit { color: var(--neon-blue); }
.dba-btn-edit:hover { background: var(--primary-light); }
.dba-btn-del { color: var(--danger); }
.dba-btn-del:hover { background: var(--danger-light); }
.dba-btn-edit .material-symbols-outlined,
.dba-btn-del .material-symbols-outlined { font-size: 1rem; vertical-align: middle; }

/* Pager */
.dba-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: .6rem 1rem;
  border-top: 1px solid var(--border);
  font-size: .82rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.dba-pager button {
  padding: .25rem .75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  cursor: pointer;
  font-size: .8rem;
  transition: border-color .2s;
}
.dba-pager button:hover:not(:disabled) { border-color: var(--neon-blue); color: var(--neon-blue); }
.dba-pager button:disabled { opacity: .4; cursor: not-allowed; }

/* Welcome state */
.dba-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 200px;
  gap: 1rem;
  color: var(--text-muted);
  font-size: .9rem;
  padding: 2rem;
}
.dba-welcome-icon { font-size: 3rem; color: var(--border-strong); }

/* Error */
.dba-error { color: var(--danger); padding: 1rem; }

/* Storage gallery in DB Admin */
.dba-storage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .8rem;
  padding: .9rem;
}
.dba-storage-card {
  background: rgba(15,23,42,.55);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.dba-storage-check {
  position: absolute;
  top: .4rem;
  left: .45rem;
  z-index: 2;
  background: rgba(0,0,0,.35);
  border-radius: 6px;
  padding: .15rem .25rem;
}
.dba-storage-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #0b0f1a;
}
.dba-storage-meta {
  padding: .55rem .65rem .3rem;
}
.dba-storage-name {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dba-storage-path {
  margin-top: .25rem;
  font-size: .68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dba-storage-badges {
  margin-top: .4rem;
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}
.dba-storage-badge {
  font-size: .65rem;
  padding: .12rem .42rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.dba-storage-badge.used {
  color: #10b981;
  border-color: rgba(16,185,129,.35);
  background: rgba(16,185,129,.08);
}
.dba-storage-badge.unused {
  color: #f59e0b;
  border-color: rgba(245,158,11,.35);
  background: rgba(245,158,11,.08);
}
.dba-storage-updated {
  margin-top: .35rem;
  font-size: .66rem;
  color: var(--text-muted);
}
.dba-storage-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .3rem;
  padding: .4rem .55rem .55rem;
}
.dba-storage-actions button {
  border: 1px solid var(--border);
  background: rgba(15,23,42,.5);
  color: var(--text-secondary);
  border-radius: 7px;
  height: 30px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dba-storage-actions button:hover {
  border-color: var(--neon-blue);
  color: var(--neon-blue);
}
.dba-storage-actions .material-symbols-outlined { font-size: 1rem; }

/* JSON editor */
.dba-json-editor {
  width: 100%;
  background: #0b0f1a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: #e2e8f0;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: .82rem;
  line-height: 1.6;
  padding: .75rem 1rem;
  resize: vertical;
  transition: border-color .2s;
}
.dba-json-editor:focus { outline: none; border-color: var(--neon-blue); }

/* Responsive DB Admin */
@media (max-width: 768px) {
  .dba-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .dba-sidebar { max-height: 200px; }
  .dba-main { min-height: 400px; }
  .dba-search { width: 130px; }
  .dba-storage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}