* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif; background:#f0f2f5; color:#1a1a2e; display:flex; flex-direction:column; min-height:100vh; }

/* ---- Navigation ---- */
.nav { background:#1a1a2e; color:#fff; position:sticky; top:0; z-index:100; box-shadow:0 2px 12px rgba(0,0,0,0.15); }
.nav-inner { max-width:1200px; margin:0 auto; display:flex; align-items:center; height:56px; padding:0 24px; gap:8px; }
.nav-brand { font-weight:800; font-size:20px; color:#fff; text-decoration:none; letter-spacing:-0.5px; padding-right:20px; margin-right:8px; border-right:1px solid rgba(255,255,255,0.12); white-space:nowrap; display:flex; align-items:center; }
.nav-logo { height:30px; width:auto; max-width:150px; object-fit:contain; }
.nav-links { display:flex; gap:2px; overflow-x:auto; scrollbar-width:none; flex:1; }
.nav-links::-webkit-scrollbar { display:none; }
.nav-links a { color:rgba(255,255,255,0.6); text-decoration:none; padding:8px 18px; border-radius:8px; font-size:14px; font-weight:500; transition:all 0.15s; white-space:nowrap; }
.nav-links a:hover { background:rgba(255,255,255,0.1); color:#fff; }
.nav-links a.active { background:rgba(255,255,255,0.15); color:#fff; font-weight:600; box-shadow:inset 0 -2px 0 #4CAF50; }
.nav-icon { font-size:16px; margin-right:4px; }
.nav-user { color:rgba(255,255,255,0.6); font-size:13px; white-space:nowrap; padding:0 4px; }
.nav-exit { display:inline-flex; align-items:center; padding:7px 14px; margin-left:6px; border:1px solid rgba(231,76,60,0.5); border-radius:8px; background:rgba(231,76,60,0.12); color:#ff8b7d; font-size:13px; font-weight:600; text-decoration:none; white-space:nowrap; transition:all .15s; }
.nav-exit:hover { background:rgba(231,76,60,0.22); border-color:#e74c3c; color:#fff; }

/* ---- Main content ---- */
.main { flex:1; }
.container { max-width:1200px; margin:0 auto; padding:24px; }
.page-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:24px; flex-wrap:wrap; gap:8px; }
.page-header h1 { font-size:24px; font-weight:700; }

/* ---- Footer / Status Bar ---- */
.footer { background:#1a1a2e; color:rgba(255,255,255,0.7); border-top:3px solid #4CAF50; padding:0; text-align:center; }
.footer-inner { max-width:1200px; margin:0 auto; padding:12px 24px; display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:10px; }
.footer-item { display:inline-flex; align-items:center; gap:5px; font-size:12px; background:rgba(255,255,255,0.06); padding:5px 12px; border-radius:16px; white-space:nowrap; }
.footer-icon { font-size:14px; line-height:1; }
.footer-label { color:rgba(255,255,255,0.45); font-size:10px; text-transform:uppercase; letter-spacing:0.4px; }
.footer-value { color:#fff; font-size:13px; font-weight:600; }
.footer-item-link { background:transparent; padding:0; }
.footer-item-link a { color:#4CAF50; text-decoration:none; font-size:11px; font-weight:600; padding:5px 14px; border:1px solid rgba(76,175,80,0.4); border-radius:16px; transition:all 0.15s; }
.footer-item-link a:hover { background:rgba(76,175,80,0.15); border-color:#4CAF50; }

/* ---- Alerts ---- */
.alert { padding:12px 16px; border-radius:8px; margin-bottom:16px; font-size:14px; }
.alert-success { background:#d4edda; color:#155724; border:1px solid #c3e6cb; }
.alert-error { background:#f8d7da; color:#721c24; border:1px solid #f5c6cb; }
.alert-info { background:#d1ecf1; color:#0c5460; border:1px solid #bee5eb; }

/* ---- Cards ---- */
.cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:16px; margin-bottom:32px; }
.card { background:#fff; border-radius:12px; padding:20px; display:flex; align-items:center; gap:16px; box-shadow:0 1px 3px rgba(0,0,0,0.08); transition:box-shadow 0.2s; }
.card:hover { box-shadow:0 4px 12px rgba(0,0,0,0.12); }
.card-icon { width:44px; height:44px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:20px; color:#fff; flex-shrink:0; }
.card-icon.green { background:#28a745; }
.card-icon.red { background:#dc3545; }
.card-icon.blue { background:#007bff; }
.card-icon.purple { background:#6f42c1; }
.card-icon.orange { background:#fd7e14; }
.card-body { flex:1; }
.card-label { font-size:12px; color:#6c757d; text-transform:uppercase; letter-spacing:0.5px; }
.card-value { font-size:22px; font-weight:700; }
.card-sub { font-size:12px; color:#6c757d; margin-top:2px; word-break:break-all; }

/* ---- Dashboard hero ---- */
.dash-heading h1 { font-size:26px; font-weight:700; letter-spacing:-0.4px; }
.dash-sub { margin-top:4px; font-size:13px; color:#6c757d; }
.dash-chip { display:inline-flex; align-items:center; gap:8px; background:#fff; border:1px solid rgba(26,26,46,0.08); border-radius:999px; padding:8px 14px; font-size:12px; font-weight:600; color:#495057; box-shadow:0 2px 8px rgba(26,26,46,0.05); }
.dash-chip-dot { width:8px; height:8px; border-radius:50%; background:#28a745; box-shadow:0 0 0 4px rgba(40,167,69,0.12); }
.dash-chip.bad .dash-chip-dot { background:#dc3545; box-shadow:0 0 0 4px rgba(220,53,69,0.12); }
.dash-chip.ok .dash-chip-dot { animation:dashPulse 2.2s ease-out infinite; }
@keyframes dashPulse { 0% { box-shadow:0 0 0 0 rgba(40,167,69,0.35); } 70% { box-shadow:0 0 0 8px rgba(40,167,69,0); } 100% { box-shadow:0 0 0 0 rgba(40,167,69,0); } }

/* ---- Dashboard bento cards ---- */
.bento-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); grid-auto-rows:152px; gap:16px; margin-bottom:28px; perspective:1000px; }
.bento-card { --accent:76,175,80; position:relative; grid-column:span 2; display:flex; align-items:center; gap:16px; padding:22px; border-radius:18px; background:linear-gradient(155deg,#20203a 0%,#151528 58%,#101020 100%); border:1px solid rgba(255,255,255,0.07); box-shadow:0 10px 26px rgba(15,15,32,0.18), inset 0 1px 0 rgba(255,255,255,0.05); overflow:hidden; transform-style:preserve-3d; isolation:isolate; cursor:default; min-width:0; transition:transform 0.5s cubic-bezier(0.22,0.61,0.36,1), border-color 0.3s, box-shadow 0.3s; }
.bento-card:first-child { grid-row:span 2; flex-direction:column; align-items:flex-start; justify-content:center; gap:20px; }
.bento-card:first-child .card-body { flex:0 0 auto; }
.bento-card::before { content:''; position:absolute; inset:0; z-index:0; pointer-events:none; opacity:0; transition:opacity 0.35s; background:radial-gradient(300px circle at var(--mx,50%) var(--my,50%), rgba(var(--accent),0.18), transparent 70%); }
.bento-card::after { content:''; position:absolute; inset:0; z-index:1; pointer-events:none; opacity:0; transition:opacity 0.35s; border-radius:inherit; padding:1px; background:radial-gradient(200px circle at var(--mx,50%) var(--my,50%), rgba(var(--accent),0.85), transparent 55%); -webkit-mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite:xor; mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite:exclude; }
.bento-card:hover::before, .bento-card:hover::after { opacity:1; }
.bento-card.is-active { transition:transform 0.12s ease-out, border-color 0.3s, box-shadow 0.3s; }
.bento-card:hover { border-color:rgba(var(--accent),0.35); box-shadow:0 18px 40px rgba(15,15,32,0.32), 0 0 0 1px rgba(var(--accent),0.12), inset 0 1px 0 rgba(255,255,255,0.06); }
.bento-card > .card-icon, .bento-card > .card-body { position:relative; z-index:3; }
.bento-card > .card-body { min-width:0; }
.bento-card .card-icon { width:52px; height:52px; border-radius:14px; font-size:22px; background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.09); color:#fff; box-shadow:inset 0 1px 0 rgba(255,255,255,0.08); }
.bento-card:first-child .card-icon { width:62px; height:62px; font-size:27px; }
.bento-card .card-icon.green { background:rgba(40,167,69,0.16); border-color:rgba(124,227,138,0.25); color:#8ce99a; }
.bento-card .card-icon.red { background:rgba(220,53,69,0.16); border-color:rgba(255,160,170,0.25); color:#ffa8b3; }
.bento-card .card-icon.blue { background:rgba(0,123,255,0.16); border-color:rgba(142,197,255,0.25); color:#8ec5ff; }
.bento-card .card-icon.purple { background:rgba(111,66,193,0.2); border-color:rgba(208,191,255,0.25); color:#d0bfff; }
.bento-card .card-label { color:rgba(255,255,255,0.55); font-size:11px; letter-spacing:1px; }
.bento-card .card-value { color:#fff; font-size:26px; letter-spacing:-0.5px; margin-top:4px; }
.bento-card:first-child .card-value { font-size:32px; }
.bento-card .card-sub { color:rgba(255,255,255,0.5); }
.bento-orb { position:absolute; z-index:0; width:190px; height:190px; right:-55px; top:-65px; border-radius:50%; background:radial-gradient(circle at 32% 32%, rgba(var(--accent),0.55), rgba(var(--accent),0.08) 55%, transparent 72%); opacity:0.75; pointer-events:none; animation:orbFloat 9s ease-in-out infinite; }
@keyframes orbFloat { 0%,100% { transform:translate3d(0,0,0) scale(1); } 50% { transform:translate3d(-12px,14px,0) scale(1.06); } }
.bento-particle { position:absolute; z-index:2; border-radius:50%; pointer-events:none; opacity:0.15; animation:bentoFloat var(--dur,3s) ease-in-out var(--delay,0s) infinite alternate; }
.bento-particle.is-out { animation:none; opacity:0; transition:opacity 0.25s; }
@keyframes bentoFloat { from { transform:translate3d(0,0,0) scale(0.65); opacity:0.15; } to { transform:translate3d(var(--dx,20px),var(--dy,-20px),0) scale(1); opacity:0.9; } }
.bento-ripple { position:absolute; z-index:2; width:12px; height:12px; border-radius:50%; background:rgba(var(--accent),0.45); pointer-events:none; transform:translate(-50%,-50%) scale(0); animation:bentoRipple 0.75s ease-out forwards; }
@keyframes bentoRipple { to { transform:translate(-50%,-50%) scale(34); opacity:0; } }

@media (max-width:1100px) {
  .bento-grid { grid-template-columns:repeat(2,minmax(0,1fr)); grid-auto-rows:auto; }
  .bento-card { grid-column:span 1; grid-row:auto; min-height:140px; }
  .bento-card:first-child { grid-column:span 2; flex-direction:row; align-items:center; justify-content:flex-start; gap:16px; min-height:150px; }
  .bento-orb { width:150px; height:150px; top:-70px; }
}
@media (max-width:640px) {
  .bento-grid { grid-template-columns:1fr; }
  .bento-card:first-child { grid-column:span 1; }
  .bento-card { padding:18px; }
  .dash-chip { width:100%; justify-content:center; }
}
/* ---- Sections ---- */
.section { background:#fff; border-radius:12px; padding:24px; margin-bottom:20px; box-shadow:0 1px 3px rgba(0,0,0,0.08); }
.section h2 { font-size:18px; margin-bottom:16px; padding-left:10px; border-left:4px solid #4CAF50; line-height:1.2; }

/* ---- Buttons ---- */
.btn { display:inline-block; padding:10px 20px; border-radius:8px; font-size:14px; font-weight:600; text-decoration:none; border:none; cursor:pointer; transition:all 0.15s; line-height:1.4; }
.btn-primary { background:#1a1a2e; color:#fff; } .btn-primary:hover { background:#2d2d4e; }
.btn-secondary { background:#007bff; color:#fff; } .btn-secondary:hover { background:#0069d9; }
.btn-outline { background:transparent; color:#1a1a2e; border:1.5px solid #1a1a2e; } .btn-outline:hover { background:#f0f0f5; }
.btn-danger { background:#dc3545; color:#fff; } .btn-danger:hover { background:#c82333; }
.btn-success { background:#28a745; color:#fff; } .btn-success:hover { background:#218838; }
.btn-sm { padding:6px 12px; font-size:12px; }
.btn:disabled { opacity:0.5; cursor:not-allowed; }

/* ---- Misc ---- */
.endpoint-box { display:block; background:#1a1a2e; color:#0f0; padding:12px 16px; border-radius:8px; font-family:monospace; font-size:15px; margin:8px 0; word-break:break-all; }
.small { font-size:13px; color:#6c757d; margin-top:4px; }

/* ---- Tables ---- */
.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:14px; }
thead th { background:#f8f9fa; text-align:left; padding:10px 12px; font-weight:600; color:#495057; border-bottom:2px solid #dee2e6; }
tbody td { padding:10px 12px; border-bottom:1px solid #e9ecef; }
tbody tr:hover { background:#f8f9fa; }

/* ---- Badges ---- */
.badge { display:inline-block; padding:3px 10px; border-radius:20px; font-size:12px; font-weight:600; }
.badge-active { background:#d4edda; color:#155724; }
.badge-inactive { background:#f8d7da; color:#721c24; }
.badge-entry { background:#cce5ff; color:#004085; }
.badge-exit { background:#fff3cd; color:#856404; }

/* ---- Status indicator ---- */
.status-indicator { display:inline-block; padding:4px 12px; border-radius:20px; font-size:13px; font-weight:600; }
.status-indicator.ok { background:#d4edda; color:#155724; }
.status-indicator.err { background:#f8d7da; color:#721c24; }

/* ---- Forms ---- */
.filter-form { display:flex; gap:12px; align-items:end; flex-wrap:wrap; margin-bottom:16px; }
.filter-form label { font-size:13px; color:#495057; }
.filter-form input, .filter-form select { padding:6px 10px; border:1.5px solid #ced4da; border-radius:6px; font-size:14px; margin-top:4px; }
label { display:block; font-size:13px; color:#495057; font-weight:600; margin-bottom:4px; }
input, select, textarea { padding:8px 12px; border:1.5px solid #ced4da; border-radius:6px; font-size:14px; margin-bottom:12px; transition:border-color 0.15s; }
input:focus, select:focus, textarea:focus { outline:none; border-color:#1a1a2e; }

/* ---- Settings ---- */
.settings-form label { display:block; margin-bottom:14px; font-size:13px; color:#495057; font-weight:600; }
.settings-form input, .settings-form select { width:100%; max-width:500px; padding:8px 12px; border:1.5px solid #ced4da; border-radius:6px; font-size:14px; margin-top:4px; }
.settings-form .checkbox-label { display:flex; align-items:center; gap:8px; font-weight:400; cursor:pointer; }
.settings-form .checkbox-label input[type=checkbox] { width:auto; margin:0; }

/* ---- Selector de rutas / explorador de bases ---- */
.path-picker { display:flex; align-items:stretch; gap:8px; margin-bottom:12px; }
.path-picker input { flex:1; min-width:0; margin-bottom:0; }
.path-picker .btn { flex:0 0 auto; white-space:nowrap; }
.settings-form .path-picker input { max-width:none; margin-top:0; }
.db-browser-overlay { position:fixed; inset:0; z-index:1000; display:flex; align-items:center; justify-content:center; padding:20px; background:rgba(10,12,24,0.62); backdrop-filter:blur(4px); }
.db-browser-overlay[hidden] { display:none !important; }
body.db-browser-open { overflow:hidden; }
.db-browser-dialog { width:min(780px,100%); max-height:min(86vh,760px); display:flex; flex-direction:column; overflow:hidden; background:#fff; color:#1a1a2e; border-radius:14px; box-shadow:0 24px 70px rgba(0,0,0,0.38); }
.db-browser-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:20px 22px 14px; border-bottom:1px solid #e9ecef; }
.db-browser-head h3 { margin:0; font-size:18px; color:#1a1a2e; }
.db-browser-help { margin:4px 0 0; font-size:12px; color:#6c757d; }
.db-browser-close { flex:0 0 auto; width:32px; height:32px; border:0; border-radius:8px; background:transparent; color:#6c757d; font-size:26px; line-height:1; cursor:pointer; }
.db-browser-close:hover { background:#f0f2f5; color:#1a1a2e; }
.db-browser-toolbar { display:flex; align-items:center; gap:8px; padding:12px 16px; border-bottom:1px solid #e9ecef; background:#f8f9fa; }
.db-browser-toolbar input { flex:1; min-width:0; margin:0; padding:7px 10px; font-family:Consolas,monospace; font-size:13px; }
.db-browser-list { flex:1; min-height:240px; overflow:auto; padding:8px; }
.db-browser-row { display:flex; align-items:center; gap:10px; width:100%; padding:9px 12px; border:0; border-radius:8px; background:transparent; color:inherit; font:inherit; text-align:left; cursor:pointer; }
.db-browser-row:hover, .db-browser-row:focus-visible { background:#f0f2f5; outline:none; }
.db-browser-row.is-selected { background:#e8f5e9; box-shadow:inset 0 0 0 2px #4CAF50; }
.db-browser-icon { flex:0 0 24px; width:24px; text-align:center; font-size:18px; }
.db-browser-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.db-browser-kind { flex:0 0 auto; color:#6c757d; font-size:11px; }
.db-browser-empty { padding:48px 20px; text-align:center; color:#6c757d; font-size:13px; }
.db-browser-foot { display:flex; align-items:center; gap:12px; padding:12px 16px; border-top:1px solid #e9ecef; }
.db-browser-status { flex:1; min-width:0; color:#6c757d; font-size:12px; }
.db-browser-status.is-error { color:#dc3545; }

/* ---- Misc ---- */
.empty { text-align:center; padding:60px 20px; color:#6c757d; font-size:15px; }
.log-box { background:#1a1a2e; color:#e0e0e0; font-family:'Consolas','Courier New',monospace; font-size:13px; padding:16px; border-radius:8px; max-height:600px; overflow-y:auto; line-height:1.6; }
.log-line { white-space:pre-wrap; word-break:break-all; }
.code, code { font-family:Consolas, monospace; font-size:13px; background:#eef0f3; padding:2px 6px; border-radius:4px; }

/* ---- Login ---- */
.login-wrap { display:flex; align-items:center; justify-content:center; min-height:100vh; background:linear-gradient(135deg,#1a1a2e 0%,#16213e 100%); }
.login-card { background:#fff; border-radius:8px; padding:32px; width:340px; box-shadow:0 4px 20px rgba(0,0,0,0.3); }
.login-card img { display:block; margin:0 auto 16px; height:40px; }
.login-card img.login-logo { display:block; margin:0 auto 18px; height:84px; width:auto; max-width:100%; object-fit:contain; }
.login-card img.login-logo-dark { display:none; }
.login-card h1 { font-size:20px; text-align:center; margin-bottom:24px; color:#1a1a2e; }
.login-card label { display:block; font-size:13px; color:#555; margin-bottom:4px; }
.login-card input { width:100%; padding:10px 12px; border:1px solid #ccc; border-radius:4px; font-size:14px; box-sizing:border-box; margin-bottom:16px; }
.login-card button { width:100%; padding:10px; background:#1a1a2e; color:#fff; border:none; border-radius:4px; font-size:15px; cursor:pointer; }
.login-card button:hover { background:#16213e; }
.error { background:#f8d7da; color:#721c24; padding:10px; border-radius:4px; margin-bottom:16px; text-align:center; font-size:13px; }

/* ---- Sync spin ---- */
.sync-status .card-icon { transition:background 0.3s; }
@keyframes spin { from { transform:rotate(0deg) } to { transform:rotate(360deg) } }
.sync-status .card-icon.blue { animation:spin 2s linear infinite; }

/* ---- Responsive ---- */
@media (max-width:768px) {
  .nav-inner { height:auto; padding:12px 16px; flex-wrap:wrap; gap:6px; }
  .nav-brand { border-right:none; padding-right:0; font-size:17px; }
  .nav-links { width:100%; }
  .nav-links a { flex:1; text-align:center; padding:8px 6px; font-size:12px; border-radius:6px; }
  .nav-user { display:none; }
  .nav-exit { padding:5px 10px; font-size:12px; }
  .footer-inner { gap:6px; padding:10px 8px; }
  .footer-item { font-size:11px; padding:4px 8px; gap:3px; }
  .footer-item-link a { font-size:10px; padding:4px 10px; }
  .container { padding:16px; }
}

/* ---- Theme toggle ---- */
.nav-inner { position:relative; }
.theme-toggle { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; padding:0; margin-left:4px; border:1px solid rgba(255,255,255,0.16); border-radius:50%; background:rgba(255,255,255,0.06); color:#fff; font-size:16px; line-height:1; cursor:pointer; flex:0 0 auto; transition:background 0.15s, border-color 0.15s, transform 0.15s; }
.theme-toggle:hover { background:rgba(255,255,255,0.14); border-color:rgba(255,255,255,0.3); transform:translateY(-1px); }
.theme-toggle:focus-visible { outline:2px solid #4CAF50; outline-offset:2px; }
.theme-icon { display:inline-block; line-height:1; }
.theme-icon-sun { display:none; }
html[data-theme="dark"] .theme-icon-moon { display:none; }
html[data-theme="dark"] .theme-icon-sun { display:inline-block; }

.login-card { position:relative; }
.login-card .login-theme { position:absolute; top:14px; right:14px; width:34px; height:34px; margin:0; padding:0; border-radius:50%; background:#f1f2f6; border:1px solid #d9dbe4; color:#1a1a2e; font-size:16px; }
.login-card .login-theme:hover { background:#e6e8ef; border-color:#c6c9d6; transform:none; }

/* ---- Efectos bento globales: spotlight, tilt 3D, anillo, partículas y ripple ---- */
/* Opt-in por elemento con [data-bento]; bento.js adjunta listeners y partículas. */
.card[data-bento],
.section[data-bento],
.login-card[data-bento],
.kpi[data-bento],
.auth-card[data-bento] {
  --accent:76,175,80;
  position:relative;
  overflow:hidden;
  isolation:isolate;
  min-width:0;
  transform-style:preserve-3d;
  transition:transform 0.5s cubic-bezier(0.22,0.61,0.36,1), box-shadow 0.2s, border-color 0.3s;
}
.card[data-bento],
.section[data-bento] { border:1px solid rgba(26,26,46,0.06); }
.login-card[data-bento],
.auth-card[data-bento] { --accent:163,68,166; }
.kpi[data-bento] { --kpi-bar:#4CAF50; }
.kpi[data-bento].accent { --accent:76,175,80; }
.kpi[data-bento].ok { --accent:40,167,69; }
.kpi[data-bento].danger { --accent:220,53,69; }
.kpi[data-bento].gold { --accent:255,193,7; }

.card[data-bento]::before,
.section[data-bento]::before,
.login-card[data-bento]::before,
.auth-card[data-bento]::before {
  content:''; position:absolute; inset:0; z-index:0; pointer-events:none;
  opacity:0; transition:opacity 0.35s;
  background:radial-gradient(240px circle at var(--mx,50%) var(--my,50%), rgba(var(--accent),0.10), transparent 70%);
}
.kpi[data-bento]::before {
  content:''; position:absolute; inset:0; z-index:0; pointer-events:none;
  opacity:0; transition:opacity 0.35s;
  background:radial-gradient(300px circle at var(--mx,50%) var(--my,50%), rgba(var(--accent),0.18), transparent 70%);
}
.login-card[data-bento]::before,
.auth-card[data-bento]::before {
  background:radial-gradient(240px circle at var(--mx,50%) var(--my,50%), rgba(var(--accent),0.16), transparent 70%);
}

.card[data-bento]::after,
.section[data-bento]::after,
.login-card[data-bento]::after,
.auth-card[data-bento]::after {
  content:''; position:absolute; inset:0; z-index:4; pointer-events:none;
  opacity:0; transition:opacity 0.35s; border-radius:inherit; padding:1px;
  background:radial-gradient(180px circle at var(--mx,50%) var(--my,50%), rgba(var(--accent),0.55), transparent 55%);
  -webkit-mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite:xor;
  mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite:exclude;
}
.kpi[data-bento]::after {
  content:''; position:absolute; inset:0; z-index:4; pointer-events:none;
  opacity:0; transition:opacity 0.35s; border-radius:inherit; padding:1px;
  background:radial-gradient(200px circle at var(--mx,50%) var(--my,50%), rgba(var(--accent),0.85), transparent 55%);
  -webkit-mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite:xor;
  mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite:exclude;
}
.login-card[data-bento]::after,
.auth-card[data-bento]::after {
  background:radial-gradient(180px circle at var(--mx,50%) var(--my,50%), rgba(var(--accent),0.6), transparent 55%);
}

.card[data-bento]:hover::before, .card[data-bento]:hover::after,
.section[data-bento]:hover::before, .section[data-bento]:hover::after,
.login-card[data-bento]:hover::before, .login-card[data-bento]:hover::after,
.kpi[data-bento]:hover::before, .kpi[data-bento]:hover::after,
.auth-card[data-bento]:hover::before, .auth-card[data-bento]:hover::after { opacity:1; }

.card[data-bento].is-active,
.section[data-bento].is-active,
.login-card[data-bento].is-active,
.auth-card[data-bento].is-active { transition:transform 0.12s ease-out, box-shadow 0.2s, border-color 0.3s; }
.kpi[data-bento].is-active { transition:transform 0.12s ease-out, box-shadow 0.3s, border-color 0.3s; }

.card[data-bento]:hover,
.section[data-bento]:hover {
  border-color:rgba(var(--accent),0.3);
  box-shadow:0 14px 32px rgba(15,15,32,0.14), 0 0 0 1px rgba(var(--accent),0.10);
}
.login-card[data-bento]:hover,
.auth-card[data-bento]:hover {
  border-color:rgba(var(--accent),0.3);
  box-shadow:0 18px 44px rgba(15,15,32,0.28), 0 0 0 1px rgba(var(--accent),0.12);
}
.kpi[data-bento]:hover {
  border-color:rgba(var(--accent),0.35);
  box-shadow:0 18px 40px rgba(15,15,32,0.32), 0 0 0 1px rgba(var(--accent),0.12), inset 4px 0 0 0 var(--kpi-bar);
}

.card[data-bento] > *:not(.bento-orb):not(.bento-particle):not(.bento-ripple),
.section[data-bento] > *:not(.bento-orb):not(.bento-particle):not(.bento-ripple),
.kpi[data-bento] > *:not(.bento-orb):not(.bento-particle):not(.bento-ripple),
.auth-card[data-bento] > *:not(.bento-orb):not(.bento-particle):not(.bento-ripple),
.login-card[data-bento] > *:not(.bento-orb):not(.bento-particle):not(.bento-ripple):not(.login-theme) {
  position:relative; z-index:3;
}
.login-card[data-bento] > .login-theme { z-index:5; }

.section[data-bento] > .bento-orb,
.card[data-bento] > .bento-orb,
.login-card[data-bento] > .bento-orb,
.auth-card[data-bento] > .bento-orb {
  width:150px; height:150px; right:-45px; top:-55px;
}

/* ---- Dark theme ---- */
html[data-theme="dark"] { color-scheme:dark; }
html[data-theme="light"] { color-scheme:light; }
html[data-theme="dark"] body { background:radial-gradient(1100px 560px at 50% -8%, rgba(76,175,80,0.08), transparent 62%), #0b0c16; color:#e7eaf3; }
html[data-theme="dark"] .nav { background:#0d0e1a; border-bottom:1px solid rgba(255,255,255,0.06); box-shadow:0 4px 20px rgba(0,0,0,0.35); }
html[data-theme="dark"] .nav-links a.active { background:rgba(76,175,80,0.16); box-shadow:inset 0 -2px 0 #4CAF50; }
html[data-theme="dark"] .footer { background:#0d0e1a; }
html[data-theme="dark"] .section { background:#151627; border:1px solid rgba(255,255,255,0.06); box-shadow:0 16px 36px rgba(0,0,0,0.22); }
html[data-theme="dark"] .section h2 { color:#f3f5fb; }
html[data-theme="dark"] .section a, html[data-theme="dark"] .manual a, html[data-theme="dark"] .empty a, html[data-theme="dark"] .small a, html[data-theme="dark"] .login-card a { color:#8ec5ff; }
html[data-theme="dark"] .card { background:linear-gradient(160deg,#1a1b2e 0%,#141522 100%); border:1px solid rgba(255,255,255,0.07); box-shadow:0 12px 28px rgba(0,0,0,0.22); }
html[data-theme="dark"] .card:hover { box-shadow:0 16px 34px rgba(0,0,0,0.32); }
html[data-theme="dark"] .card[data-bento],
html[data-theme="dark"] .section[data-bento],
html[data-theme="dark"] .login-card[data-bento],
html[data-theme="dark"] .auth-card[data-bento] { border-color:rgba(255,255,255,0.08); }
html[data-theme="dark"] .card[data-bento]::before,
html[data-theme="dark"] .section[data-bento]::before,
html[data-theme="dark"] .login-card[data-bento]::before,
html[data-theme="dark"] .auth-card[data-bento]::before { background:radial-gradient(240px circle at var(--mx,50%) var(--my,50%), rgba(var(--accent),0.15), transparent 70%); }
html[data-theme="dark"] .card[data-bento]:hover,
html[data-theme="dark"] .section[data-bento]:hover,
html[data-theme="dark"] .login-card[data-bento]:hover,
html[data-theme="dark"] .auth-card[data-bento]:hover { border-color:rgba(var(--accent),0.4); box-shadow:0 18px 38px rgba(0,0,0,0.38), 0 0 0 1px rgba(var(--accent),0.16); }
html[data-theme="dark"] .card-label, html[data-theme="dark"] .card-sub, html[data-theme="dark"] .small, html[data-theme="dark"] .dash-sub, html[data-theme="dark"] .empty, html[data-theme="dark"] .filter-form label, html[data-theme="dark"] label, html[data-theme="dark"] .settings-form label { color:#9aa0b5; }
html[data-theme="dark"] .card-value, html[data-theme="dark"] .page-header h1, html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3 { color:#f3f5fb; }
html[data-theme="dark"] .bento-card { background:linear-gradient(155deg,#1c1d33 0%,#141526 58%,#0f101d 100%); border-color:rgba(255,255,255,0.09); box-shadow:0 18px 40px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.05); }
html[data-theme="dark"] .bento-card:hover { box-shadow:0 22px 48px rgba(0,0,0,0.45), 0 0 0 1px rgba(var(--accent),0.16), inset 0 1px 0 rgba(255,255,255,0.06); }
html[data-theme="dark"] .bento-card .card-label { color:rgba(255,255,255,0.55); }
html[data-theme="dark"] .bento-card .card-sub { color:rgba(255,255,255,0.5); }
html[data-theme="dark"] .bento-card .card-value { color:#fff; }
html[data-theme="dark"] .dash-chip { background:#151627; border-color:rgba(255,255,255,0.09); color:#c8cde0; box-shadow:0 4px 14px rgba(0,0,0,0.2); }
html[data-theme="dark"] .btn-outline { color:#d8dcec; border-color:#4a4e6e; }
html[data-theme="dark"] .btn-outline:hover { background:rgba(255,255,255,0.06); }
html[data-theme="dark"] .btn-primary { background:#4CAF50; color:#08130a; }
html[data-theme="dark"] .btn-primary:hover { background:#66bb6a; }
html[data-theme="dark"] thead th { background:#1b1c30; color:#c9cee1; border-bottom-color:#2b2d47; }
html[data-theme="dark"] tbody td { border-bottom-color:#23243a; }
html[data-theme="dark"] tbody tr:hover { background:#191a2c; }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { background:#10111f; color:#eef1fa; border-color:#343754; }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color:#6e748c; }
html[data-theme="dark"] input:focus, html[data-theme="dark"] select:focus, html[data-theme="dark"] textarea:focus { border-color:#4CAF50; box-shadow:0 0 0 3px rgba(76,175,80,0.13); }
html[data-theme="dark"] .alert-success { background:rgba(40,167,69,0.14); color:#8ce99a; border-color:rgba(76,175,80,0.3); }
html[data-theme="dark"] .alert-error { background:rgba(220,53,69,0.14); color:#ffa8b3; border-color:rgba(220,53,69,0.3); }
html[data-theme="dark"] .alert-info { background:rgba(23,162,184,0.14); color:#7fdbec; border-color:rgba(23,162,184,0.3); }
html[data-theme="dark"] .badge-active { background:rgba(40,167,69,0.18); color:#8ce99a; }
html[data-theme="dark"] .badge-inactive { background:rgba(220,53,69,0.18); color:#ffa8b3; }
html[data-theme="dark"] .badge-entry { background:rgba(0,123,255,0.18); color:#8ec5ff; }
html[data-theme="dark"] .badge-exit { background:rgba(255,193,7,0.16); color:#ffd666; }
html[data-theme="dark"] .status-indicator.ok { background:rgba(40,167,69,0.18); color:#8ce99a; }
html[data-theme="dark"] .status-indicator.err { background:rgba(220,53,69,0.18); color:#ffa8b3; }
html[data-theme="dark"] .code, html[data-theme="dark"] code { background:#24263c; color:#c8f7c5; }
html[data-theme="dark"] .endpoint-box { border:1px solid rgba(76,175,80,0.25); }
html[data-theme="dark"] .log-box { background:#070812; border:1px solid rgba(255,255,255,0.06); }
html[data-theme="dark"] .error { background:rgba(220,53,69,0.14); color:#ffa8b3; }
html[data-theme="dark"] .login-wrap { background:radial-gradient(800px 500px at 50% 0%, rgba(76,175,80,0.12), transparent 60%), linear-gradient(135deg,#0b0c16 0%,#101426 100%); }
html[data-theme="dark"] .login-card { background:#151627; border:1px solid rgba(255,255,255,0.08); box-shadow:0 20px 60px rgba(0,0,0,0.45); }
html[data-theme="dark"] .login-card img.login-logo-light { display:none; }
html[data-theme="dark"] .login-card img.login-logo-dark { display:block; }
html[data-theme="dark"] .login-card h1 { color:#f3f5fb; }
html[data-theme="dark"] .login-card label { color:#aab0c5; }
html[data-theme="dark"] .login-card input { background:#10111f; color:#eef1fa; border-color:#343754; }
html[data-theme="dark"] .login-card form button { background:#4CAF50; color:#08130a; }
html[data-theme="dark"] .login-card form button:hover { background:#66bb6a; }
html[data-theme="dark"] .login-card .login-theme { background:#24263c; color:#eef1fa; border-color:#3a3d55; }
html[data-theme="dark"] .login-card .login-theme:hover { background:#2c2f4a; }
html[data-theme="dark"] .db-browser-dialog { background:#151627; color:#e7eaf3; border:1px solid rgba(255,255,255,0.08); }
html[data-theme="dark"] .db-browser-head, html[data-theme="dark"] .db-browser-toolbar, html[data-theme="dark"] .db-browser-foot { border-color:#23243a; }
html[data-theme="dark"] .db-browser-toolbar { background:#10111f; }
html[data-theme="dark"] .db-browser-head h3 { color:#f3f5fb; }
html[data-theme="dark"] .db-browser-help, html[data-theme="dark"] .db-browser-kind, html[data-theme="dark"] .db-browser-status, html[data-theme="dark"] .db-browser-empty { color:#9aa0b5; }
html[data-theme="dark"] .db-browser-status.is-error { color:#ffa8b3; }
html[data-theme="dark"] .db-browser-close { color:#9aa0b5; }
html[data-theme="dark"] .db-browser-close:hover { background:rgba(255,255,255,0.06); color:#fff; }
html[data-theme="dark"] .db-browser-row:hover, html[data-theme="dark"] .db-browser-row:focus-visible { background:rgba(255,255,255,0.06); }
html[data-theme="dark"] .db-browser-row.is-selected { background:rgba(76,175,80,0.15); box-shadow:inset 0 0 0 2px #4CAF50; }

@media (max-width:640px) {
  .path-picker { flex-direction:column; }
  .path-picker .btn { width:100%; }
  .db-browser-overlay { padding:8px; }
  .db-browser-dialog { max-height:94vh; }
  .db-browser-toolbar { flex-wrap:wrap; }
  .db-browser-toolbar input { flex-basis:100%; order:3; }
  .db-browser-toolbar [data-db-action="go"] { order:4; }
  .db-browser-kind { display:none; }
}

@media (max-width:768px) {
  .theme-toggle { position:absolute; top:10px; right:16px; margin:0; width:32px; height:32px; font-size:15px; }
  .nav-inner .nav-links { margin-right:36px; }
}

/* Efectos bento activos también en equipos híbridos (touch + mouse). */
@media (prefers-reduced-motion:reduce) {
  .bento-card, .bento-card.is-active,
  .card[data-bento], .card[data-bento].is-active,
  .section[data-bento], .section[data-bento].is-active,
  .login-card[data-bento], .login-card[data-bento].is-active,
  .kpi[data-bento], .kpi[data-bento].is-active,
  .auth-card[data-bento], .auth-card[data-bento].is-active { transition:none; }
  .bento-card::before, .bento-card::after,
  .card[data-bento]::before, .card[data-bento]::after,
  .section[data-bento]::before, .section[data-bento]::after,
  .login-card[data-bento]::before, .login-card[data-bento]::after,
  .kpi[data-bento]::before, .kpi[data-bento]::after,
  .auth-card[data-bento]::before, .auth-card[data-bento]::after { display:none; }
  .bento-orb, .bento-particle, .bento-ripple, .dash-chip.ok .dash-chip-dot { animation:none; }
  .bento-particle, .bento-ripple { display:none; }
}

/* MAYA-WM-20261126-604BA8E0 | GENERICO | v2.0.0 */
