/* ============================================================
   portal.css — Estilos compartidos para Sucursales y Users
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --rose:      #f472b6;
  --violet:    #a78bfa;
  --blue:      #60a5fa;
  --sky:       #38bdf8;
  --accent:    #7c3aed;
  --accent-2:  #2563eb;
  --text:      #1e1b4b;
  --text-sub:  #6b7280;
  --text-muted:#9ca3af;
  --surface:   rgba(255,255,255,0.72);
  --border:    rgba(255,255,255,0.85);
  --border-2:  rgba(148,163,184,0.25);
  --danger:    #ef4444;
  --danger-bg: rgba(239,68,68,0.07);
  --success:   #10b981;
}

html, body, #root { min-height: 100%; font-family: 'DM Sans', sans-serif; background: #faf5ff; color: var(--text); }
html { background: #faf5ff; min-height: 100%; }

/* ── Aurora background ── */
.page-bg {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%,   rgba(244,114,182,0.28) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 80% 10%,  rgba(167,139,250,0.22) 0%, transparent 55%),
    radial-gradient(ellipse 70% 60% at 60% 90%,  rgba(96,165,250,0.20)  0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 10% 70%,  rgba(56,189,248,0.15)  0%, transparent 55%),
    radial-gradient(ellipse 40% 40% at 90% 60%,  rgba(129,140,248,0.18) 0%, transparent 55%);
  animation: auroraShift 25s ease-in-out infinite alternate;
}
@keyframes auroraShift {
  0%   { opacity: 1;   filter: hue-rotate(0deg); }
  100% { opacity: .88; ; }
}
.blob { position: fixed; border-radius: 50%; pointer-events: none; filter: blur(40px); animation: blobFloat 20s ease-in-out infinite; }
.blob-1 { width: 400px; height: 400px; background: rgba(244,114,182,0.15); top: -100px; left: -80px; }
.blob-2 { width: 350px; height: 350px; background: rgba(167,139,250,0.12); bottom: -80px; right: -60px; animation-delay: -8s; }
.blob-3 { width: 280px; height: 280px; background: rgba(96,165,250,0.12); top: 40%; right: 8%; animation-delay: -14s; }
@keyframes blobFloat {
  0%,100% { transform: translate(0,0) scale(1); }
  33%     { transform: translate(20px,-15px) scale(1.04); }
  66%     { transform: translate(-15px,12px) scale(.97); }
}

/* ── Layout ── */
.layout { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* ── Navbar ── */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 64px;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(148,163,184,0.12), 0 4px 24px rgba(124,58,237,0.06);
}
.nav::after {
  content: ''; position: absolute; bottom: -1px; left: 10%; right: 10%; height: 1.5px;
  background: linear-gradient(90deg, var(--rose), var(--violet), var(--blue), var(--sky));
  border-radius: 999px; opacity: 0.6;
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-logo {
  width: 38px; height: 38px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(0,174,239,.35), 0 0 0 2px rgba(255,255,255,.7);
}
.nav-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nav-title {
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link {
  padding: 6px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 500;
  color: var(--text-sub); text-decoration: none; border: none; background: none; cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(124,58,237,0.07); color: var(--accent); }
.nav-link.active { background: rgba(124,58,237,0.1); color: var(--accent); font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-user { font-size: 12.5px; color: var(--text-sub); }
.nav-user strong { color: var(--text); font-weight: 600; }
.logout-btn {
  display: flex; align-items: center; gap: 6px; padding: 7px 14px;
  border-radius: 9px; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  color: var(--danger); border: 1.5px solid rgba(239,68,68,0.18);
  background: var(--danger-bg); cursor: pointer; transition: all .15s;
}
.logout-btn:hover { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.3); }
.logout-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Hamburger menu (mobile) ── */
.nav-burger {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  border: 1.5px solid var(--border-2); background: rgba(255,255,255,0.7);
  cursor: pointer; transition: all .15s; color: var(--text-sub);
}
.nav-burger:hover { background: rgba(124,58,237,0.07); color: var(--accent); }
.nav-burger svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

.nav-mobile-menu {
  display: none; position: fixed; inset: 0; z-index: 40;
  background: rgba(30,27,74,0.2); backdrop-filter: blur(6px);
  padding-top: 64px;
}
.nav-mobile-menu.open { display: block; }
.nav-mobile-inner {
  background: rgba(255,255,255,0.95); backdrop-filter: blur(40px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px 16px;
  display: flex; flex-direction: column; gap: 4px;
  animation: slideDown .22s cubic-bezier(0.16,1,0.3,1);
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.nav-mobile-link {
  padding: 11px 14px; border-radius: 12px; font-size: 14px; font-weight: 500;
  color: var(--text-sub); text-decoration: none; border: none; background: none; cursor: pointer;
  transition: background .15s, color .15s; text-align: left;
}
.nav-mobile-link:hover { background: rgba(124,58,237,0.07); color: var(--accent); }
.nav-mobile-link.active { background: rgba(124,58,237,0.1); color: var(--accent); font-weight: 600; }
.nav-mobile-sep { height: 1px; background: var(--border-2); margin: 6px 0; }
.nav-mobile-logout {
  padding: 11px 14px; border-radius: 12px; font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 500; color: var(--danger);
  border: none; background: none; cursor: pointer; text-align: left;
  transition: background .15s;
}
.nav-mobile-logout:hover { background: var(--danger-bg); }

/* ── Main content ── */
.main { flex: 1; padding: 36px 32px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ── Page header ── */
.ph { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.ph-text h1 { font-size: 28px; font-weight: 700; color: var(--text); letter-spacing: -0.03em; margin-bottom: 4px; }
.ph-text p  { font-size: 13.5px; color: var(--text-sub); font-weight: 300; }

/* ── Stat pills ── */
.stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.stat {
  display: flex; align-items: center; gap: 8px; padding: 9px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; font-size: 13px; font-weight: 500; color: var(--text);
  backdrop-filter: blur(20px); box-shadow: 0 2px 8px rgba(124,58,237,0.06);
}
.stat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.stat-n { font-weight: 700; margin-right: 1px; }
.dot-all    { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.dot-active { background: var(--success); }
.dot-in     { background: var(--text-muted); }
.dot-mc     { background: var(--rose); }

/* ── Toolbar ── */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }

.search-wrap { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; stroke: var(--text-muted); fill: none; stroke-width: 1.7; pointer-events: none; }
.search-wrap input {
  width: 100%; padding: 10px 14px 10px 38px;
  background: var(--surface); border: 1.5px solid var(--border-2);
  border-radius: 12px; font-family: 'DM Sans', sans-serif; font-size: 13.5px; color: var(--text);
  backdrop-filter: blur(20px); outline: none; transition: border-color .2s, box-shadow .2s;
}
.search-wrap input::placeholder { color: var(--text-muted); font-weight: 300; }
.search-wrap input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(167,139,250,0.14); background: rgba(255,255,255,.85); }

.filter-tabs { display: flex; gap: 3px; background: var(--surface); border: 1.5px solid var(--border-2); border-radius: 12px; padding: 3px; backdrop-filter: blur(20px); }
.ftab { padding: 6px 14px; border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--text-sub); border: none; background: none; cursor: pointer; transition: all .15s; white-space: nowrap; }
.ftab.on { background: #fff; color: var(--accent); box-shadow: 0 1px 6px rgba(124,58,237,0.12); font-weight: 600; }

.select-filter {
  padding: 9px 14px; background: var(--surface); border: 1.5px solid var(--border-2);
  border-radius: 12px; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  color: var(--text); outline: none; cursor: pointer; backdrop-filter: blur(20px);
  transition: border-color .2s; -webkit-appearance: none;
}
.select-filter:focus { border-color: var(--violet); }

/* ── Add button ── */
.add-btn {
  display: flex; align-items: center; gap: 7px; padding: 10px 20px;
  border-radius: 13px; border: none; font-family: 'DM Sans', sans-serif;
  font-size: 13.5px; font-weight: 600; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 50%, #2563eb 100%);
  box-shadow: 0 4px 20px rgba(124,58,237,0.35), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: transform .15s, box-shadow .2s; position: relative; overflow: hidden; white-space: nowrap;
}
.add-btn::after { content: ''; position: absolute; top: 0; left: -100%; width: 60%; height: 100%; background: linear-gradient(90deg,transparent,rgba(255,255,255,.15),transparent); transform: skewX(-20deg); transition: left .5s; }
.add-btn:hover::after { left: 150%; }
.add-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(124,58,237,0.45), inset 0 1px 0 rgba(255,255,255,0.15); }
.add-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; }

/* ── Table card ── */
.tcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: 24px;
  backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.6) inset, 0 2px 4px rgba(148,163,184,0.08), 0 12px 40px rgba(124,58,237,0.08);
  overflow: hidden;
}
.tcard::before { content: ''; display: block; height: 2px; background: linear-gradient(90deg, var(--rose), var(--violet), var(--blue), var(--sky)); }

.tscroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  padding: 13px 18px; text-align: left; font-size: 11px; font-weight: 700;
  color: var(--text-muted); letter-spacing: 0.09em; text-transform: uppercase;
  background: rgba(250,245,255,0.5); border-bottom: 1px solid rgba(148,163,184,0.12);
  white-space: nowrap;
}

/* ── Sortable column headers ── */
.th-sort {
  display: inline-flex; align-items: center; gap: 5px;
  cursor: pointer; user-select: none;
  transition: color .15s;
}
.th-sort:hover { color: var(--accent); }
.th-sort svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; opacity: 0.5; }
.th-sort.asc svg, .th-sort.desc svg { opacity: 1; color: var(--accent); }

tbody tr { border-bottom: 1px solid rgba(148,163,184,0.08); transition: background .12s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(124,58,237,0.025); }
td { padding: 13px 18px; vertical-align: middle; }

.td-id   { font-size: 11.5px; color: var(--text-muted); font-weight: 600; font-family: monospace; }
.td-name { font-weight: 600; color: var(--text); }
.td-sub  { font-size: 12px; color: var(--text-sub); margin-top: 3px; }
.td-code {
  font-size: 11.5px; font-family: monospace;
  background: rgba(124,58,237,0.08); color: var(--accent);
  padding: 2px 8px; border-radius: 6px; display: inline-block; font-weight: 500;
}

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.b-on  { background: rgba(16,185,129,0.1);  color: #059669; }
.b-off { background: rgba(148,163,184,0.12); color: var(--text-muted); }
.b-mc  { background: rgba(244,114,182,0.1);  color: #be185d; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; fill: currentColor; }

/* ── Action buttons ── */
.acts { display: flex; align-items: center; gap: 6px; }
.act {
  width: 32px; height: 32px; border-radius: 9px;
  border: 1.5px solid var(--border-2); background: rgba(255,255,255,0.7);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s; color: var(--text-sub);
}
.act svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.act:hover       { background: rgba(124,58,237,0.08); color: var(--accent); border-color: rgba(124,58,237,0.2); }
.act.warn:hover  { background: rgba(245,158,11,0.08); color: #d97706; border-color: rgba(245,158,11,0.22); }
.act.del:hover   { background: var(--danger-bg); color: var(--danger); border-color: rgba(239,68,68,0.22); }

/* ── Empty/loading states ── */
.t-empty { padding: 64px; text-align: center; color: var(--text-muted); }
.t-empty svg { width: 40px; height: 40px; stroke: currentColor; fill: none; stroke-width: 1.2; margin: 0 auto 12px; display: block; opacity: .5; }
.t-load  { padding: 48px; text-align: center; }
.spinner { width: 26px; height: 26px; border: 2.5px solid rgba(124,58,237,0.15); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Pagination ── */
.pag {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-top: 1px solid rgba(148,163,184,0.1);
  flex-wrap: wrap; gap: 12px; background: rgba(250,245,255,0.4);
}
.pag-info { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.pag-info strong { color: var(--text-sub); font-weight: 600; }
.pag-btns { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pag-btn {
  min-width: 34px; height: 34px; padding: 0 10px; border-radius: 9px;
  border: 1.5px solid var(--border-2); background: rgba(255,255,255,0.75);
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  color: var(--text-sub); cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.pag-btn:hover:not(:disabled) { background: rgba(124,58,237,.08); color: var(--accent); border-color: rgba(124,58,237,.25); transform: translateY(-1px); }
.pag-btn:disabled { opacity: .3; cursor: not-allowed; transform: none !important; }
.pag-btn.active {
  background: linear-gradient(135deg,#7c3aed,#2563eb); color: #fff;
  border-color: transparent; box-shadow: 0 3px 12px rgba(124,58,237,.35);
  font-weight: 700; transform: none;
}
.pag-btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pag-ellipsis { padding: 0 4px; color: var(--text-muted); font-size: 14px; line-height: 34px; user-select: none; }
.pag-top { border-top: none; border-bottom: 1px solid rgba(148,163,184,0.1); }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 200;
  background: rgba(30,27,74,.9); backdrop-filter: blur(16px); color: #fff;
  padding: 11px 22px; border-radius: 12px; font-size: 13.5px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: tIn .25s ease;
  border: 1px solid rgba(255,255,255,.1); white-space: nowrap;
}
@keyframes tIn { from { opacity:0; transform:translateX(-50%) translateY(8px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }

/* ── Modal overlay ── */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(30,27,74,0.25);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%; max-width: 520px;
  background: rgba(255,255,255,0.82); border: 1px solid var(--border); border-radius: 28px;
  backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.7) inset, 0 24px 80px rgba(124,58,237,0.18);
  animation: slideUp .28s cubic-bezier(0.16,1,0.3,1);
  overflow: hidden; max-height: 92vh; display: flex; flex-direction: column;
}
.modal.sm { max-width: 400px; }
@keyframes slideUp { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.modal::before { content: ''; display: block; height: 2px; flex-shrink: 0; background: linear-gradient(90deg, var(--rose), var(--violet), var(--blue), var(--sky)); }

.mhead { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 24px 0; flex-shrink: 0; gap: 12px; }
.mhead h2 { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.mhead p  { font-size: 13px; color: var(--text-sub); font-weight: 300; margin-top: 3px; }
.mclose { width: 30px; height: 30px; border-radius: 9px; border: 1.5px solid var(--border-2); background: rgba(255,255,255,.7); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: all .15s; flex-shrink: 0; }
.mclose:hover { background: var(--danger-bg); color: var(--danger); border-color: rgba(239,68,68,.2); }
.mclose svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; }

.mbody { padding: 18px 24px; overflow-y: auto; flex: 1; }
.mfoot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px 20px; flex-shrink: 0; border-top: 1px solid rgba(148,163,184,0.12); }

/* Form inside modal */
.msec { font-size: 10.5px; font-weight: 700; color: var(--text-muted); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.msep { height: 1px; background: linear-gradient(90deg,transparent,rgba(148,163,184,.2),transparent); margin: 14px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mf { margin-bottom: 12px; }
.mf label { display: block; font-size: 11px; font-weight: 600; color: var(--text-sub); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.mf input[type=text], .mf input[type=email], .mf input[type=number], .mf input[type=password] {
  width: 100%; padding: 10px 13px;
  background: rgba(255,255,255,.65); border: 1.5px solid var(--border-2);
  border-radius: 12px; font-family: 'DM Sans', sans-serif; font-size: 13.5px; color: var(--text);
  outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.mf select {
  width: 100%; padding: 10px 13px;
  background: rgba(255,255,255,.65); border: 1.5px solid var(--border-2);
  border-radius: 12px; font-family: 'DM Sans', sans-serif; font-size: 13.5px; color: var(--text);
  outline: none; transition: border-color .2s; cursor: pointer; -webkit-appearance: none;
}
.mf input:focus, .mf select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(167,139,250,.14); background: #fff; }
.mf input::placeholder { color: var(--text-muted); font-weight: 300; }
.mf select option { background: #fff; color: var(--text); }

.tog-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; background: rgba(255,255,255,.65); border: 1.5px solid var(--border-2); border-radius: 12px; }
.tog-row span { font-size: 13.5px; color: var(--text); }
.tog { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.tog input { opacity: 0; width: 0; height: 0; }
.tog-s { position: absolute; inset: 0; background: var(--border-2); border-radius: 999px; cursor: pointer; transition: background .2s; }
.tog-s::before { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.tog input:checked + .tog-s { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.tog input:checked + .tog-s::before { transform: translateX(18px); }

.merr { display: flex; align-items: center; gap: 8px; padding: 10px 13px; background: var(--danger-bg); border: 1px solid rgba(239,68,68,.18); border-radius: 11px; margin-bottom: 12px; }
.merr svg { width: 13px; height: 13px; stroke: var(--danger); fill: none; stroke-width: 2; flex-shrink: 0; }
.merr span { font-size: 12.5px; color: var(--danger); }

/* ── Modal buttons ── */
.btn-p {
  padding: 10px 20px; border-radius: 13px; border: none; font-family: 'DM Sans', sans-serif;
  font-size: 13.5px; font-weight: 600; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 50%, #2563eb 100%);
  box-shadow: 0 4px 16px rgba(124,58,237,0.3), inset 0 1px 0 rgba(255,255,255,.15);
  transition: transform .12s, box-shadow .15s, opacity .15s;
  display: flex; align-items: center; gap: 7px;
}
.btn-p:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(124,58,237,0.42); }
.btn-p:disabled { opacity: .5; cursor: not-allowed; }
.btn-p.red  { background: linear-gradient(135deg,#ef4444,#dc2626); box-shadow: 0 4px 16px rgba(239,68,68,.25); }
.btn-p.red:hover:not(:disabled)  { box-shadow: 0 6px 22px rgba(239,68,68,.38); }
.btn-p.warn { background: linear-gradient(135deg,#f59e0b,#d97706); box-shadow: 0 4px 16px rgba(245,158,11,.25); }
.btn-p.warn:hover:not(:disabled) { box-shadow: 0 6px 22px rgba(245,158,11,.38); }
.btn-g { padding: 10px 18px; border-radius: 13px; border: 1.5px solid var(--border-2); font-family: 'DM Sans', sans-serif; font-size: 13.5px; font-weight: 500; color: var(--text-sub); background: rgba(255,255,255,.7); cursor: pointer; transition: all .15s; }
.btn-g:hover { background: rgba(124,58,237,.06); color: var(--accent); border-color: rgba(124,58,237,.2); }

.bs { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }

/* ── Confirm modal ── */
.conf-icon { width: 54px; height: 54px; border-radius: 16px; display: flex; align-items: center; justify-content: center; margin: 4px auto 14px; }
.conf-icon.red  { background: var(--danger-bg); }
.conf-icon.warn { background: rgba(245,158,11,.08); }
.conf-icon svg { width: 26px; height: 26px; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.conf-icon.red  svg { stroke: var(--danger); }
.conf-icon.warn svg { stroke: #d97706; }
.conf-txt { text-align: center; }
.conf-txt h3 { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 7px; }
.conf-txt p  { font-size: 13.5px; color: var(--text-sub); line-height: 1.55; }
.conf-txt strong { color: var(--text); }

/* ── Password field with eye toggle ── */
.pwr { position: relative; }
.pwr input { padding-right: 42px !important; }
.eye-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; padding: 4px; color: var(--text-muted); display: flex; border-radius: 7px; transition: color .2s; }
.eye-btn:hover { color: var(--accent); }
.eye-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.7; }

/* ── Avatar (Users page) ── */
.ava { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; background: linear-gradient(135deg,rgba(124,58,237,.15),rgba(37,99,235,.12)); color: var(--accent); border: 1px solid rgba(124,58,237,.15); }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-info .td-name { font-weight: 600; color: var(--text); }
.user-info .td-sub { font-size: 12px; color: var(--text-sub); margin-top: 2px; }

/* ── Responsive ── */
@media (max-width: 700px) {
  .main { padding: 20px 16px; }
  .nav { padding: 0 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .nav-links, .nav-user { display: none; }
  .nav-burger { display: flex; }
  .ph { flex-direction: column; align-items: flex-start; }
  .tcard { border-radius: 18px; }
}

/* ══════════════════════════════════════════════════════════════
   Dark mode — prefers-color-scheme + [data-theme="dark"]
   ══════════════════════════════════════════════════════════════ */
/* Dark mode via attribute selector set by useDarkMode hook */
html[data-theme="dark"] {
  --text:      #e2e8f0;
  --text-sub:  #94a3b8;
  --text-muted:#64748b;
  --surface:   rgba(30,27,74,0.72);
  --border:    rgba(255,255,255,0.1);
  --border-2:  rgba(148,163,184,0.15);
  --danger-bg: rgba(239,68,68,0.12);
}
html[data-theme="dark"],
html[data-theme="dark"] body,
html[data-theme="dark"] #root { background: #0f0a1e; }
html[data-theme="dark"] .page-bg {
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%,   rgba(167,139,250,0.20) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 80% 10%,  rgba(124,58,237,0.15) 0%, transparent 55%),
    radial-gradient(ellipse 70% 60% at 60% 90%,  rgba(37,99,235,0.12)  0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 10% 70%,  rgba(56,189,248,0.10)  0%, transparent 55%),
    radial-gradient(ellipse 40% 40% at 90% 60%,  rgba(129,140,248,0.12) 0%, transparent 55%);
}
html[data-theme="dark"] .nav {
  background: rgba(15,10,30,0.82);
  border-color: rgba(255,255,255,0.08);
}
html[data-theme="dark"] .tcard,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .ql-card {
  background: rgba(30,27,74,0.65);
  border-color: rgba(255,255,255,0.08);
}
html[data-theme="dark"] table thead th { background: rgba(15,10,30,0.5); color: var(--text-sub); }
html[data-theme="dark"] table tbody tr:hover { background: rgba(124,58,237,0.08); }
html[data-theme="dark"] .modal,
html[data-theme="dark"] .overlay { background: rgba(0,0,0,0.6); }
html[data-theme="dark"] .mf input,
html[data-theme="dark"] .mf select,
html[data-theme="dark"] .mf textarea,
html[data-theme="dark"] .search-wrap input,
html[data-theme="dark"] .pag-size-sel {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-color: rgba(255,255,255,0.1);
}
html[data-theme="dark"] .mf input::placeholder { color: var(--text-muted); }
html[data-theme="dark"] .ftab { color: var(--text-sub); }
html[data-theme="dark"] .ftab.on { background: rgba(124,58,237,0.15); }
html[data-theme="dark"] .select-filter {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-color: rgba(255,255,255,0.1);
}
html[data-theme="dark"] .pag-btn { color: var(--text-sub); }
html[data-theme="dark"] code { background: rgba(124,58,237,0.15) !important; }

/* ── Dark mode toggle button ─────────────────────────────────── */
.theme-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: rgba(124,58,237,0.08); border: 1.5px solid rgba(124,58,237,0.15);
  color: var(--accent); cursor: pointer; transition: all .15s; flex-shrink: 0;
}
.theme-btn:hover { background: rgba(124,58,237,0.14); }
.theme-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* ── Export button ───────────────────────────────────────────── */
.export-btn {
  display: flex; align-items: center; gap: 6px; padding: 9px 16px;
  border-radius: 10px; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  color: var(--accent); border: 1.5px solid rgba(124,58,237,0.2);
  background: rgba(124,58,237,0.07); cursor: pointer; transition: all .15s; white-space: nowrap;
}
.export-btn:hover:not(:disabled) { background: rgba(124,58,237,0.13); border-color: rgba(124,58,237,0.35); }
.export-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.export-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* ── Page size selector ──────────────────────────────────────── */
.pag-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pag-size-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-sub); white-space: nowrap;
}
.pag-size-sel {
  padding: 4px 8px; border-radius: 7px; font-size: 12px; font-family: 'DM Sans', sans-serif;
  background: var(--surface); border: 1px solid var(--border-2);
  color: var(--text); cursor: pointer; outline: none;
}
.pag-size-sel:focus { border-color: var(--violet); box-shadow: 0 0 0 2px rgba(167,139,250,0.15); }

/* Adjust pag layout */
.pag { flex-wrap: wrap; gap: 10px; }

/* ── Keyboard-navigable table rows ──────────────────────────── */
tbody tr[tabindex]:focus {
  outline: 2px solid rgba(124,58,237,0.5);
  outline-offset: -2px;
  background: rgba(124,58,237,0.06);
}

/* ── Dashboard styles ────────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 24px;
  align-items: stretch;
}
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .dash-grid { grid-template-columns: 1fr; }
}
.kpi-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 18px 16px;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2px 12px rgba(124,58,237,0.07);
  display: flex; align-items: center; gap: 14px; position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(124,58,237,0.12); }
.kpi-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; align-self: flex-start; margin-top: 2px;
}
.kpi-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.kpi-purple { background: rgba(124,58,237,0.1); color: var(--accent); }
.kpi-green  { background: rgba(16,185,129,0.1); color: var(--success); }
.kpi-blue   { background: rgba(37,99,235,0.1);  color: var(--accent-2); }
.kpi-yellow { background: rgba(245,158,11,0.1); color: #d97706; }

.kpi-body { flex: 1; min-width: 0; overflow: hidden; }
.kpi-label {
  display: block; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-sub); margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kpi-value { display: block; font-size: 30px; font-weight: 700; color: var(--text); line-height: 1.1; }
.kpi-sub   { display: block; font-size: 11px; color: var(--text-muted); margin-top: 3px; }

.kpi-ring { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; }
.kpi-ring svg { width: 52px; height: 52px; transform: rotate(-90deg); }
.kpi-ring span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--text-sub); }

.dash-charts {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.chart-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 22px;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2px 12px rgba(124,58,237,0.07);
}
.chart-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 18px; }
.chart-empty { font-size: 13px; color: var(--text-muted); text-align: center; padding: 20px 0; }

/* Bar charts */
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row  { display: flex; align-items: center; gap: 10px; }
.bar-label { font-size: 13px; color: var(--text-sub); white-space: nowrap; min-width: 100px; display: flex; gap: 6px; align-items: center; }
.bar-track { flex: 1; height: 8px; background: var(--border-2); border-radius: 999px; overflow: hidden; }
.bar-fill  { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; transition: width .6s cubic-bezier(.16,1,.3,1); }
.bar-count { font-size: 12px; font-weight: 600; color: var(--text); min-width: 24px; text-align: right; }

/* Role bars */
.role-list { display: flex; flex-direction: column; gap: 10px; }
.role-row  { display: flex; align-items: center; gap: 10px; }
.role-badge { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; min-width: 56px; text-align: center; }

/* Donut */
.donut-wrap { position: relative; width: 120px; height: 120px; margin: 0 auto 16px; }
.donut-svg  { width: 120px; height: 120px; transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-big  { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1; }
.donut-tiny { font-size: 10px; color: var(--text-muted); }
.legend { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.leg-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-sub); }
.leg-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Quick links */
.quicklinks { display: flex; flex-direction: column; gap: 10px; }
.ql-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 20px; text-decoration: none;
  backdrop-filter: blur(20px); transition: all .2s;
}
.ql-card:hover { transform: translateX(4px); box-shadow: 0 4px 16px rgba(124,58,237,0.1); border-color: rgba(124,58,237,0.25); }
.ql-icon { width: 40px; height: 40px; border-radius: 10px; background: rgba(124,58,237,0.1); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ql-icon svg { width: 18px; height: 18px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; }
.ql-title { font-size: 14px; font-weight: 600; color: var(--text); }
.ql-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ql-arrow { width: 16px; height: 16px; stroke: var(--text-muted); fill: none; stroke-width: 2; stroke-linecap: round; margin-left: auto; flex-shrink: 0; }

/* ── New additions ─────────────────────────────────────────── */

/* Missing variables (patch) */
:root {
  --card-bg:   rgba(255,255,255,0.72);
  --bg:        rgba(255,255,255,0.5);
  --warning:   #d97706;
  --radius-lg: 18px;
  --radius-md: 12px;
}
html[data-theme="dark"] {
  --card-bg: rgba(30,27,74,0.75);
  --bg:      rgba(15,10,30,0.6);
}

/* Table wrappers used in Tickets / SystemHealth */
.t-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; overflow: hidden;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2px 12px rgba(124,58,237,0.07);
}
.t-wrap::before {
  content: ''; display: block; height: 2px;
  background: linear-gradient(90deg, var(--rose), var(--violet), var(--blue), var(--sky));
}
.t-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t-table thead th {
  padding: 12px 16px; text-align: left; font-size: 11px; font-weight: 700;
  color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase;
  background: rgba(250,245,255,0.5); border-bottom: 1px solid rgba(148,163,184,0.12);
  white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
html[data-theme="dark"] .t-table thead th { background: rgba(15,10,30,0.5); }
.t-table tbody tr { border-bottom: 1px solid rgba(148,163,184,0.08); transition: background .1s; }
.t-table tbody tr:last-child { border-bottom: none; }
.t-table tbody tr:hover { background: rgba(124,58,237,0.025); }
.t-table td { padding: 11px 16px; vertical-align: middle; }

/* Overflow wrapper for wide tables */
.t-scroll { overflow-x: auto; }
.t-scroll .t-table { min-width: 640px; }

/* ── Drawer (ticket detail panel) ───────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; justify-content: flex-end;
}
.drawer-backdrop {
  position: absolute; inset: 0;
  background: rgba(15,10,30,0.4);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: fadeIn .18s ease;
}
.drawer-panel {
  position: relative; z-index: 1;
  width: min(460px, 100vw); height: 100%;
  background: var(--card-bg);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow: -8px 0 40px rgba(124,58,237,0.15);
  animation: slideInRight .24s cubic-bezier(0.16,1,0.3,1);
  display: flex; flex-direction: column;
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(148,163,184,0.12);
  position: sticky; top: 0; z-index: 2;
  background: inherit;
  backdrop-filter: blur(40px);
}
.drawer-header::before {
  content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 1.5px;
  background: linear-gradient(90deg, var(--rose), var(--violet), var(--blue), var(--sky));
}
.drawer-title {
  font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -.02em;
}
.drawer-close {
  width: 30px; height: 30px; border-radius: 9px;
  border: 1.5px solid var(--border-2); background: rgba(255,255,255,.5);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all .15s;
}
.drawer-close:hover { background: var(--danger-bg); color: var(--danger); border-color: rgba(239,68,68,.2); }
.drawer-close svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; }
.drawer-body { padding: 20px 24px; flex: 1; }
.drawer-field { margin-bottom: 16px; }
.drawer-field-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 4px;
}
.drawer-field-value {
  font-size: 13.5px; color: var(--text); font-weight: 400; line-height: 1.5;
  word-break: break-word;
}
.drawer-field-value.mono {
  font-family: monospace; font-size: 12px;
  background: rgba(124,58,237,0.07); color: var(--accent);
  padding: 3px 8px; border-radius: 6px; display: inline-block;
}
.drawer-problema {
  font-size: 13.5px; line-height: 1.65; color: var(--text);
  background: rgba(124,58,237,0.04); border: 1px solid rgba(124,58,237,0.1);
  border-radius: 12px; padding: 14px 16px; margin-top: 4px;
}
.drawer-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(148,163,184,0.2), transparent);
  margin: 14px 0;
}
html[data-theme="dark"] .drawer-panel { background: rgba(20,16,42,0.95); }
html[data-theme="dark"] .drawer-close { background: rgba(255,255,255,.07); }
html[data-theme="dark"] .drawer-problema { background: rgba(124,58,237,0.08); border-color: rgba(124,58,237,0.15); }

/* ── Filter bar ─────────────────────────────────────────────── */
.filter-bar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 14px 18px; margin-bottom: 16px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  backdrop-filter: blur(20px);
}
.filter-field { display: flex; flex-direction: column; gap: 4px; }
.filter-label { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.filter-input {
  padding: 8px 11px; border: 1.5px solid var(--border-2); border-radius: 10px;
  font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--text);
  background: rgba(255,255,255,.65); outline: none; transition: border-color .2s;
}
.filter-input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(167,139,250,.12); }
html[data-theme="dark"] .filter-input { background: rgba(255,255,255,.06); color: var(--text); border-color: rgba(255,255,255,.12); }

/* ── Tab bar ────────────────────────────────────────────────── */
.tab-bar {
  display: flex; gap: 2px;
  border-bottom: 1px solid rgba(148,163,184,0.15);
  margin-bottom: 16px;
}
.tab-btn {
  padding: 9px 16px; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  color: var(--text-muted); border: none; border-bottom: 2px solid transparent;
  background: transparent; cursor: pointer; transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--accent); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ── Pagination (for new tables) ────────────────────────────── */
.t-pag {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-top: 1px solid rgba(148,163,184,0.1);
  flex-wrap: wrap; gap: 10px;
  background: rgba(250,245,255,0.3); font-size: 12.5px; color: var(--text-muted);
}
html[data-theme="dark"] .t-pag { background: rgba(15,10,30,0.3); }
.t-pag-btns { display: flex; gap: 4px; }
.t-pag-btn {
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: 8px;
  border: 1.5px solid var(--border-2); background: rgba(255,255,255,.7);
  font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500;
  color: var(--text-sub); cursor: pointer; transition: all .12s;
  display: flex; align-items: center; justify-content: center;
}
.t-pag-btn:hover:not(:disabled) { background: rgba(124,58,237,.08); color: var(--accent); border-color: rgba(124,58,237,.2); }
.t-pag-btn:disabled { opacity: .3; cursor: not-allowed; }
.t-pag-btn.active { background: linear-gradient(135deg,#7c3aed,#2563eb); color:#fff; border-color:transparent; font-weight:700; }
html[data-theme="dark"] .t-pag-btn { background: rgba(255,255,255,.05); }

/* ── Performance: reduce expensive repaints on background elements ── */
.blob { will-change: transform; contain: layout style; }
.page-bg { will-change: opacity; contain: layout style; }
.kpi-card, .chart-card { will-change: transform; }

/* Modal overlay fix (keep original .overlay class, add alias) */
.modal-overlay { animation: fadeIn .18s ease; }
.modal-overlay .modal { animation: slideUp .25s cubic-bezier(0.16,1,0.3,1); }


/* ════════════════════════════════════════════════════════════════
   QR Generator — modal & components
   ════════════════════════════════════════════════════════════════ */

/* QR action button in table row */
.act.qr {
  color: #25d366;
  border-color: rgba(37,211,102,.25);
  background: rgba(37,211,102,.08);
}
.act.qr:hover {
  background: rgba(37,211,102,.18);
  border-color: rgba(37,211,102,.5);
  color: #1da851;
  transform: translateY(-1px);
}
html[data-theme="dark"] .act.qr {
  color: #25d366;
  border-color: rgba(37,211,102,.3);
  background: rgba(37,211,102,.1);
}

/* Wide QR modal */
.modal.qr-modal {
  max-width: 780px;
  width: 96vw;
}

/* Two-column layout inside QR modal body */
.qr-modal-body {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 600px) {
  .qr-modal-body {
    grid-template-columns: 1fr;
  }
}

/* Left column: config fields */
.qr-left {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Config wrapper */
.qr-config {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Textarea override for QR message */
.qr-textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  font-family: inherit;
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border-2);
  background: rgba(255,255,255,.7);
  color: var(--text-main);
  transition: border .15s, box-shadow .15s;
  box-sizing: border-box;
}
.qr-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}
html[data-theme="dark"] .qr-textarea {
  background: rgba(255,255,255,.06);
  color: var(--text-main);
}

/* Hint text under inputs */
.qr-hint {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}
.qr-hint code {
  font-size: 11px;
  background: rgba(124,58,237,.1);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', 'Fira Mono', monospace;
}

/* Label icon */
.qr-label-icon {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  margin-right: 4px;
  opacity: .7;
}

/* URL preview strip */
.qr-url-preview {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(37,99,235,.05);
  border: 1px solid rgba(37,99,235,.15);
}
.qr-url-label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.qr-url-code {
  display: block;
  font-family: 'JetBrains Mono', 'Fira Mono', monospace;
  font-size: 10.5px;
  color: #2563eb;
  word-break: break-all;
  line-height: 1.5;
}
html[data-theme="dark"] .qr-url-code { color: #93c5fd; }

/* Right column: QR preview */
.qr-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.qr-preview-box {
  width: 200px;
  height: 200px;
  border-radius: 14px;
  border: 2px dashed var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.6);
  overflow: hidden;
  transition: border-color .2s;
}
html[data-theme="dark"] .qr-preview-box {
  background: rgba(255,255,255,.04);
}
.qr-preview-box:has(.qr-img) {
  border-style: solid;
  border-color: rgba(37,211,102,.4);
}

.qr-img {
  width: 196px;
  height: 196px;
  object-fit: contain;
  border-radius: 12px;
  display: block;
}

.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}
.qr-placeholder svg {
  width: 40px;
  height: 40px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  opacity: .4;
}
.qr-placeholder span {
  font-size: 12px;
}

.qr-spinner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.qr-preview-note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  max-width: 200px;
}

/* Bulk progress bar */
.qr-bulk-progress {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qr-progress-bar-wrap {
  height: 8px;
  background: rgba(124,58,237,.12);
  border-radius: 99px;
  overflow: hidden;
}
.qr-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #25d366);
  border-radius: 99px;
  transition: width .2s ease;
}
.qr-progress-txt {
  font-size: 12.5px;
  color: var(--text-sub);
  text-align: center;
}

/* ============================================================
   Extensiones glassmorphism para vistas del portal
   ============================================================ */

/* ════════════════════════════════════════════════════
   TABLAS GLASSMORPHISM — header con paleta violeta
   ════════════════════════════════════════════════════ */

/* Contenedor de la tabla — hereda el glass del card */
.glass-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: 'DM Sans', sans-serif;
}

/* ── Header con degradado violeta ── */
.glass-table thead tr th {
  padding: 11px 16px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  white-space: nowrap;
  border: none;
  /* Degradado violeta → índigo alineado con la paleta */
  background: linear-gradient(135deg, rgba(124,58,237,.18) 0%, rgba(79,70,229,.14) 50%, rgba(37,99,235,.1) 100%);
  color: #7c3aed;
  border-bottom: 1.5px solid rgba(124,58,237,.2);
}
/* Primera y última celda con border-radius */
.glass-table thead tr th:first-child {
  border-radius: 0;
}
.glass-table thead tr th:last-child {
  border-radius: 0;
}

[data-theme="dark"] .glass-table thead tr th {
  background: linear-gradient(135deg, rgba(124,58,237,.25) 0%, rgba(79,70,229,.2) 50%, rgba(37,99,235,.15) 100%);
  color: #a78bfa;
  border-bottom-color: rgba(167,139,250,.25);
}

/* ── Filas ── */
.glass-table tbody td {
  padding: 10px 16px;
  vertical-align: middle;
  font-size: 13px;
  color: var(--text, #1e1b4b);
  border-bottom: 1px solid rgba(148,163,184,.12);
  background: transparent;
  transition: background .12s;
}
[data-theme="dark"] .glass-table tbody td {
  color: #e9d5ff;
  border-bottom-color: rgba(167,139,250,.08);
}

/* Última fila sin borde inferior */
.glass-table tbody tr:last-child td { border-bottom: none; }

/* ── Hover glass ── */
.glass-table tbody tr:hover td {
  background: rgba(124,58,237,.05) !important;
}
[data-theme="dark"] .glass-table tbody tr:hover td {
  background: rgba(167,139,250,.08) !important;
}

/* ── Zebra suave ── */
.glass-table tbody tr:nth-child(even) td {
  background: rgba(124,58,237,.025);
}
[data-theme="dark"] .glass-table tbody tr:nth-child(even) td {
  background: rgba(167,139,250,.04);
}
.glass-table tbody tr:nth-child(even):hover td {
  background: rgba(124,58,237,.06) !important;
}

/* ── Eliminar estilos Bootstrap que interfieren ── */
.glass-card .table,
.glass-card .table > :not(caption) > * > * {
  background: transparent !important;
  border-color: rgba(148,163,184,.12) !important;
}
.glass-card .table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-accent-bg: transparent; }
.glass-card .table-hover > tbody > tr:hover > * { --bs-table-accent-bg: transparent; }
.glass-card .table-dark,
.glass-card .table-dark th,
.glass-card .table-dark td { background: transparent !important; }

/* ── DataTables overrides para glass-table ── */
table.glass-table.dataTable thead th,
table.glass-table.dataTable thead td {
  border-bottom: 1.5px solid rgba(124,58,237,.2) !important;
}
table.glass-table.dataTable.no-footer { border-bottom: none; }
div.dataTables_scrollHead table.glass-table { margin-bottom: 0 !important; }

/* ── Glass card (alias de .tcard) ── */
.glass-card {
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.85);
  border-radius: 20px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.55) inset,
              0 12px 40px rgba(124,58,237,0.09);
  overflow: hidden;
}
[data-theme="dark"] .glass-card {
  background: rgba(30,27,74,0.55);
  border-color: rgba(167,139,250,0.18);
  box-shadow: 0 0 0 1px rgba(167,139,250,.08) inset,
              0 12px 40px rgba(124,58,237,0.2);
}
.glass-card::before {
  content: ''; display: block; height: 2px;
  background: linear-gradient(90deg, #f472b6, #a78bfa, #60a5fa, #38bdf8);
}
.glass-card-header {
  padding: .85rem 1.25rem;
  background: rgba(255,255,255,0.4);
  border-bottom: 1px solid rgba(255,255,255,0.6);
  font-weight: 600; font-size: .9rem;
  display: flex; align-items: center; gap: .6rem;
}
[data-theme="dark"] .glass-card-header {
  background: rgba(30,27,74,0.4);
  border-bottom-color: rgba(167,139,250,0.12);
  color: #e9d5ff;
}

/* ── Glass input ── */
.glass-input {
  background: rgba(255,255,255,0.65) !important;
  border: 1.5px solid rgba(148,163,184,0.25) !important;
  border-radius: 12px !important;
  font-family: 'DM Sans', sans-serif !important;
  transition: border-color .2s, box-shadow .2s !important;
}
.glass-input:focus {
  background: rgba(255,255,255,0.88) !important;
  border-color: #a78bfa !important;
  box-shadow: 0 0 0 3px rgba(167,139,250,0.14) !important;
  outline: none !important;
}
[data-theme="dark"] .glass-input {
  background: rgba(30,27,74,0.5) !important;
  border-color: rgba(167,139,250,0.15) !important;
  color: #e9d5ff !important;
}
[data-theme="dark"] .glass-input:focus {
  background: rgba(30,27,74,0.8) !important;
  border-color: #a78bfa !important;
}

/* ── Glass select ── */
.glass-select {
  background: rgba(255,255,255,0.65) !important;
  border: 1.5px solid rgba(148,163,184,0.25) !important;
  border-radius: 12px !important;
  font-family: 'DM Sans', sans-serif !important;
  cursor: pointer;
}
.glass-select:focus {
  border-color: #a78bfa !important;
  box-shadow: 0 0 0 3px rgba(167,139,250,0.14) !important;
}
[data-theme="dark"] .glass-select {
  background: rgba(30,27,74,0.5) !important;
  border-color: rgba(167,139,250,0.15) !important;
  color: #e9d5ff !important;
}

/* ── Glass badge ── */
.gbadge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
  border: 1px solid transparent;
}
.gbadge-active  { background: rgba(16,185,129,.12); color: #059669; border-color: rgba(16,185,129,.3); }
.gbadge-inactive{ background: rgba(239,68,68,.1);   color: #dc2626; border-color: rgba(239,68,68,.25);}
.gbadge-primary { background: rgba(124,58,237,.1);  color: #7c3aed; border-color: rgba(124,58,237,.25);}
.gbadge-info    { background: rgba(37,99,235,.1);   color: #2563eb; border-color: rgba(37,99,235,.25); }
[data-theme="dark"] .gbadge-active  { background: rgba(16,185,129,.18); color: #34d399; }
[data-theme="dark"] .gbadge-inactive{ background: rgba(239,68,68,.18);  color: #f87171; }
[data-theme="dark"] .gbadge-primary { background: rgba(167,139,250,.18);color: #a78bfa; }
[data-theme="dark"] .gbadge-info    { background: rgba(96,165,250,.18); color: #60a5fa; }

/* ── Form label glass ── */
.glass-label {
  font-size: 12px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-muted,#9ca3af);
  margin-bottom: .3rem; display: block;
}

/* ── Filter bar ── */
.filter-bar {
  display: flex; align-items: flex-end; gap: 10px;
  flex-wrap: wrap; margin-bottom: 1rem;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 16px; padding: 14px 16px;
  box-shadow: 0 2px 12px rgba(124,58,237,0.06);
}
[data-theme="dark"] .filter-bar {
  background: rgba(30,27,74,0.45);
  border-color: rgba(167,139,250,0.12);
}

/* ── Action buttons row ── */
.action-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }

/* ── Detail field ── */
.detail-field { margin-bottom: .1rem; }
.detail-label {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted,#9ca3af);
  margin-bottom: 2px;
}
.detail-value { font-size: .95rem; font-weight: 600; color: var(--text,#1e1b4b); }
[data-theme="dark"] .detail-value { color: #e9d5ff; }

/* ============================================================
   DataTables — controles y paginación glass completa
   (compatible Bootstrap 5 + DataTables 1.13)
   ============================================================ */

/* ── Wrapper ── */
.dataTables_wrapper {
  font-family: 'DM Sans', sans-serif;
  font-size: .82rem;
  color: var(--text, #1e1b4b);
}

/* ── Labels de "Mostrar" y "Buscar" ── */
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
  color: var(--text-muted, #9ca3af);
  font-size: .78rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Select "Mostrar N" e input de búsqueda ── */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  background: rgba(255,255,255,.65) !important;
  border: 1.5px solid rgba(148,163,184,.22) !important;
  border-radius: 10px !important;
  color: var(--text, #1e1b4b) !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: .8rem !important;
  padding: .3rem .65rem !important;
  outline: none !important;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: none !important;
}
.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: #a78bfa !important;
  box-shadow: 0 0 0 3px rgba(167,139,250,.14) !important;
}
[data-theme="dark"] .dataTables_wrapper .dataTables_length select,
[data-theme="dark"] .dataTables_wrapper .dataTables_filter input {
  background: rgba(30,27,74,.55) !important;
  border-color: rgba(167,139,250,.15) !important;
  color: #e9d5ff !important;
}

/* ── Info "Mostrando X a Y de Z" ── */
.dataTables_wrapper .dataTables_info {
  color: var(--text-muted, #9ca3af);
  font-size: .76rem;
  padding-top: .6rem;
}

/* ══════════════════════════════════════════════════════
   PAGINACIÓN — anular Bootstrap 5 completamente
══════════════════════════════════════════════════════ */

/* Contenedor */
.dataTables_wrapper .dataTables_paginate {
  padding-top: .6rem;
}

/* UL de Bootstrap — reset total */
.dataTables_wrapper .dataTables_paginate .pagination {
  display: flex !important;
  flex-wrap: wrap;
  gap: 4px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  border: none !important;
}

/* LI items — reset Bootstrap */
.dataTables_wrapper .dataTables_paginate .pagination .page-item {
  border: none !important;
  margin: 0 !important;
}

/* LINKS — estilos glass base */
.dataTables_wrapper .dataTables_paginate .pagination .page-item .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 34px !important;
  height: 34px !important;
  padding: 0 .6rem !important;
  margin: 0 !important;
  border-radius: 10px !important;
  border: 1.5px solid rgba(148,163,184,.22) !important;
  background: rgba(255,255,255,.65) !important;
  backdrop-filter: blur(20px) !important;
  color: var(--text, #1e1b4b) !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: .78rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  text-decoration: none !important;
  box-shadow: none !important;
  transition: background .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s !important;
  line-height: 1 !important;
}

/* HOVER */
.dataTables_wrapper .dataTables_paginate .pagination .page-item:not(.active):not(.disabled) .page-link:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button:not(.current):not(.disabled):hover {
  background: rgba(124,58,237,.09) !important;
  border-color: rgba(124,58,237,.35) !important;
  color: #7c3aed !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 8px rgba(124,58,237,.12) !important;
}

/* ACTIVO / CURRENT */
.dataTables_wrapper .dataTables_paginate .pagination .page-item.active .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 55%, #2563eb 100%) !important;
  border-color: transparent !important;
  color: #fff !important;
  font-weight: 700 !important;
  box-shadow: 0 3px 14px rgba(124,58,237,.4) !important;
  transform: none !important;
  pointer-events: none;
}

/* DESHABILITADO */
.dataTables_wrapper .dataTables_paginate .pagination .page-item.disabled .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  background: rgba(148,163,184,.08) !important;
  border-color: rgba(148,163,184,.12) !important;
  color: var(--text-muted, #9ca3af) !important;
  cursor: default !important;
  pointer-events: none !important;
  opacity: .6 !important;
  transform: none !important;
  box-shadow: none !important;
}

/* ANTERIOR / SIGUIENTE — texto más descriptivo */
.dataTables_wrapper .dataTables_paginate .pagination .page-item:first-child .page-link,
.dataTables_wrapper .dataTables_paginate .pagination .page-item:last-child .page-link {
  font-size: .75rem !important;
  padding: 0 .85rem !important;
  min-width: 80px !important;
  letter-spacing: .01em;
}

/* Eliminar bordes redondeados dobles de Bootstrap */
.dataTables_wrapper .dataTables_paginate .pagination .page-item:first-child .page-link,
.dataTables_wrapper .dataTables_paginate .pagination .page-item:last-child .page-link {
  border-radius: 10px !important;
}

/* Focus sin outline feo */
.dataTables_wrapper .dataTables_paginate .pagination .page-link:focus,
.dataTables_wrapper .dataTables_paginate .paginate_button:focus {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(124,58,237,.18) !important;
}

/* ── DARK MODE ── */
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .pagination .page-item .page-link,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
  background: rgba(30,27,74,.55) !important;
  border-color: rgba(167,139,250,.15) !important;
  color: #e9d5ff !important;
}
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .pagination .page-item:not(.active):not(.disabled) .page-link:hover,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button:not(.current):not(.disabled):hover {
  background: rgba(167,139,250,.12) !important;
  border-color: rgba(167,139,250,.4) !important;
  color: #a78bfa !important;
}
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .pagination .page-item.active .page-link,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: linear-gradient(135deg, #7c3aed, #4f46e5) !important;
  color: #fff !important;
  border-color: transparent !important;
}
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .pagination .page-item.disabled .page-link {
  background: rgba(30,27,74,.3) !important;
  color: rgba(167,139,250,.3) !important;
}

/* ── Dashboard extras ── */
.chart-empty { font-size: 13px; color: var(--text-muted,#9ca3af); text-align: center; padding: 20px 0; }
.kpi-ring {
  position: relative; width: 44px; height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.kpi-ring svg { width: 44px; height: 44px; transform: rotate(-90deg); position: absolute; }
.kpi-ring span { font-size: 9.5px; font-weight: 700; color: var(--text,#1e1b4b); position: relative; z-index: 1; }

/* ── License table (same glass style) ── */
.lic-table {
  font-size: .81rem; margin: 0; width: 100%;
  border-collapse: separate; border-spacing: 0;
  font-family: 'DM Sans', sans-serif;
}
.lic-table thead th {
  padding: .55rem .75rem;
  font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  white-space: nowrap; border: none;
  background: linear-gradient(135deg, rgba(124,58,237,.18) 0%, rgba(79,70,229,.14) 50%, rgba(37,99,235,.1) 100%);
  color: #7c3aed;
  border-bottom: 1.5px solid rgba(124,58,237,.2);
}
[data-theme="dark"] .lic-table thead th {
  background: linear-gradient(135deg, rgba(124,58,237,.25) 0%, rgba(79,70,229,.2) 50%, rgba(37,99,235,.15) 100%);
  color: #a78bfa;
  border-bottom-color: rgba(167,139,250,.25);
}
.lic-table tbody td {
  padding: .48rem .75rem; vertical-align: middle;
  border-bottom: 1px solid rgba(148,163,184,.1);
  color: var(--text,#1e1b4b); background: transparent;
  transition: background .12s;
}
[data-theme="dark"] .lic-table tbody td { border-bottom-color: rgba(167,139,250,.07); color: #e9d5ff; }
.lic-table tbody tr:last-child td { border-bottom: none; }
.lic-table tbody tr:hover td { background: rgba(124,58,237,.05) !important; }
[data-theme="dark"] .lic-table tbody tr:hover td { background: rgba(167,139,250,.08) !important; }
.lic-table tbody tr:nth-child(even) td { background: rgba(124,58,237,.02); }
.lic-id   { font-weight: 700; color: #7c3aed; }
[data-theme="dark"] .lic-id { color: #a78bfa; }
.suc-num  { font-weight: 600; font-variant-numeric: tabular-nums; }
.suc-sep  { color: var(--text-muted,#9ca3af); }
.venc-red { color: #dc2626; font-weight: 700; }
.venc-yel { color: #d97706; font-weight: 600; }
/* ── KPI cards clickables desde el dashboard ── */
a.kpi-link {
  text-decoration: none !important;
  color: inherit !important;
  display: flex;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  /* Heredar todos los estilos del kpi-card sin romperlos */
  transition: transform .18s, box-shadow .2s !important;
}
/* Eliminar subrayado en todos los estados */
a.kpi-link,
a.kpi-link:hover,
a.kpi-link:focus,
a.kpi-link:active,
a.kpi-link:visited {
  text-decoration: none !important;
  color: inherit !important;
  outline: none;
}
/* Overlay sutil al hover */
a.kpi-link::before {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background: rgba(124,58,237,0);
  border-radius: inherit;
  transition: background .18s;
  pointer-events: none;
}
a.kpi-link > * { position: relative; z-index: 1; }
a.kpi-link:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 32px rgba(124,58,237,.2) !important;
}
a.kpi-link:hover::before { background: rgba(124,58,237,.03); }
/* Flecha discreta */
a.kpi-link:hover .kpi-arrow { opacity: 1; transform: translateY(-50%) translateX(0); }
.kpi-arrow {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%) translateX(6px);
  font-size: 1.2rem; font-weight: 400;
  color: rgba(124,58,237,.45);
  opacity: 0;
  transition: opacity .18s, transform .18s;
  line-height: 1; z-index: 2;
  -webkit-text-fill-color: rgba(124,58,237,.45);
}

/* ── Badge de filtro activo en el listado ── */
.active-filter-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: .3rem .85rem;
  background: rgba(124,58,237,.1);
  border: 1.5px solid rgba(124,58,237,.25);
  border-radius: 20px;
  font-size: .75rem; font-weight: 700;
  color: #7c3aed;
}
[data-theme="dark"] .active-filter-badge {
  background: rgba(167,139,250,.15);
  border-color: rgba(167,139,250,.3);
  color: #a78bfa;
}
