/* =========================================================
   VirtualPin — estilos (misma base que Recaudación)
   ========================================================= */
:root {
  --brand: #3B7A1A;
  --brand-dark: #2E6113;
  --brand-soft: #EDF5E1;
  --ink: #231F20;
  --sidebar-bg: #231F20;
  --sidebar-ink: #BDB8B1;
  --surface: #F5F6F1;
  --radius: 14px;
  --bs-primary: var(--brand);
  --bs-primary-rgb: 59, 122, 26;
  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-color: var(--ink);
  --bs-link-color: var(--brand);
  --bs-link-hover-color: var(--brand-dark);
}

body { font-family: var(--bs-body-font-family); }

.btn-primary {
  --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark);
  --bs-btn-active-bg: var(--brand-dark); --bs-btn-disabled-bg: var(--brand);
  font-weight: 600;
}
.form-control { border-radius: 10px; border-color: #D9DBD0; }
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 .25rem rgba(59, 122, 26, .15); }
.form-label { font-weight: 500; font-size: .9rem; }
.card { border-radius: var(--radius); border-color: #E3E4DC; box-shadow: 0 1px 2px rgba(35, 31, 32, .04); }
.alert { border-radius: 10px; border: 0; }

/* ---------- Marca ---------- */
.brand-mark {
  width: 56px; height: 56px; border-radius: 16px;
  display: inline-grid; place-items: center;
  background: rgba(255, 255, 255, .15); color: #fff; font-size: 1.7rem;
}
.brand-mark-sm { width: 38px; height: 38px; border-radius: 11px; font-size: 1.15rem; background: var(--brand); color: #fff; }

/* ---------- Pantallas de acceso ---------- */
.auth-body { background: var(--surface); min-height: 100vh; }
.auth-wrap { display: flex; min-height: 100vh; }
.auth-brand {
  flex: 0 0 44%; flex-direction: column; padding: 56px;
  color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(145deg, #231F20 0%, #2D3B21 58%, #3B7A1A 100%);
}
.auth-brand::after {
  content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%;
  right: -180px; bottom: -200px; background: rgba(255, 255, 255, .08);
}
.auth-brand h1 { font-weight: 700; font-size: 2.4rem; margin: 28px 0 10px; }
.auth-brand .lead { opacity: .85; max-width: 380px; }
.auth-features { list-style: none; padding: 0; margin: 36px 0 0; position: relative; z-index: 1; }
.auth-features li { display: flex; align-items: center; gap: 12px; padding: 9px 0; font-weight: 500; }
.auth-features i {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 10px; background: rgba(255, 255, 255, .15);
}
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 410px; }
.auth-title { font-weight: 700; font-size: 1.65rem; margin-bottom: 6px; }

/* Inputs con icono */
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #8A857E; pointer-events: none; }
.input-icon > .form-control { padding-left: 42px; }
.input-icon > .form-control-lg { font-size: 1rem; padding-top: .7rem; padding-bottom: .7rem; }
.toggle-pass {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; color: #8A857E; padding: 6px 8px;
}
.toggle-pass:hover { color: var(--brand); }
.input-icon:has(.toggle-pass) > .form-control { padding-right: 44px; }

/* Medidor de fuerza */
.strength { height: 5px; background: #E3E4DC; border-radius: 4px; overflow: hidden; }
.strength span { display: block; height: 100%; width: 0; transition: width .25s, background .25s; }

/* ---------- Aplicación ---------- */
.app-body { background: var(--surface); }
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 264px; flex-shrink: 0; background: var(--sidebar-bg); color: var(--sidebar-ink);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 14px;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 22px;
  color: #fff; font-weight: 700; font-size: 1.1rem; text-decoration: none;
}
.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 2px;
  border-radius: 10px; color: var(--sidebar-ink); text-decoration: none; font-weight: 500; font-size: .93rem;
}
.sidebar-nav a i { font-size: 1.1rem; }
.sidebar-nav a span:not(.badge-soon) { white-space: nowrap; }
.sidebar-nav a:hover:not(.disabled) { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar-nav a.active, .sidebar-nav a.active:hover { background: var(--brand); color: #fff; }
.sidebar-nav a.disabled { opacity: .5; cursor: default; }
.lista-grupo td { background: var(--bs-tertiary-bg); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--bs-secondary-color); padding-top: 6px; padding-bottom: 6px; }
/* Grupo desplegable (Parámetros) */
.sidebar-group summary {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 2px; border-radius: 10px;
  color: var(--sidebar-ink); font-weight: 500; font-size: .93rem; cursor: pointer; list-style: none; user-select: none;
}
.sidebar-group summary::-webkit-details-marker { display: none; }
.sidebar-group summary i { font-size: 1.1rem; }
.sidebar-group summary:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar-group summary.has-active { color: #fff; }
.sidebar-group .sidebar-caret { margin-left: auto; font-size: .8rem !important; transition: transform .2s; }
.sidebar-group[open] .sidebar-caret { transform: rotate(180deg); }
.sidebar-sub { list-style: none; padding: 0 0 4px 14px; margin: 0 0 2px 20px; border-left: 1px solid rgba(255, 255, 255, .1); }
.sidebar-sub a { padding: 8px 12px; font-size: .9rem; }
.sidebar-sub a i { font-size: 1rem; }
.badge-soon {
  margin-left: auto; font-size: .65rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 7px; border-radius: 20px; background: rgba(190, 185, 175, .2); color: #8A857E;
}
.module-card .badge-soon { margin-left: 6px; vertical-align: middle; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 12px 28px;
  background: #fff; border-bottom: 1px solid #E3E4DC; position: sticky; top: 0; z-index: 10;
}
.topbar-title { font-size: 1.15rem; font-weight: 600; margin: 0; }
.btn-icon { border: 0; background: none; font-size: 1.5rem; padding: 2px 6px; }
.user-chip {
  display: flex; align-items: center; gap: 10px; border: 0; background: none;
  padding: 4px 8px; border-radius: 12px;
}
.user-chip:hover { background: var(--surface); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-weight: 700;
}
.app-content { padding: 28px; }

.welcome { background: linear-gradient(120deg, #231F20, #3B7A1A); color: #fff; }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: #6F6A64; font-weight: 600; margin-bottom: 14px; }
.module-icon {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-size: 1.25rem;
}

/* Sidebar móvil */
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: 0; z-index: 1040; transform: translateX(-100%); transition: transform .25s; }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 1030; }
  .topbar, .app-content { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Listados y formularios (Parte 2) ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.form-select { border-radius: 10px; border-color: #D9DBD0; }
.form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .25rem rgba(59, 122, 26, .15); }
.filter-card .form-label { margin-bottom: 4px; color: #56514D; }
.card-header { border-bottom-color: #ECEDE6; padding: 14px 18px; }

.data-table thead th {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #6F6A64;
  font-weight: 600; background: #FAFAF7; border-bottom-color: #ECEDE6; white-space: nowrap; padding: 12px 16px;
}
.data-table td { padding: 12px 16px; border-color: #EFF0EA; }
.th-sort { color: inherit; text-decoration: none; }
.th-sort:hover, .th-sort.active { color: var(--brand); }
.doc-type {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .03em;
  padding: 2px 6px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); margin-right: 4px;
}
.row-inactive td { opacity: .55; }
.row-highlight td { animation: flashrow 2.5s ease-out; }
@keyframes flashrow { 0%, 40% { background: #fff6d6; } 100% { background: transparent; } }

.empty-state { text-align: center; padding: 56px 16px; color: #6F6A64; }
.empty-state > i { font-size: 2.6rem; display: block; margin-bottom: 8px; color: #C9CBC0; }

.form-actions {
  position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px;
  padding: 14px 0; margin-top: 4px; background: linear-gradient(to top, var(--surface) 70%, transparent);
}
.invalid-feedback { font-size: .82rem; }

/* Tarjetas del inicio */
.stat-card .stat-label { font-size: .78rem; color: #6F6A64; font-weight: 500; }
.stat-card .stat-value { font-size: 1.7rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.module-link { transition: transform .15s, box-shadow .15s, border-color .15s; }
.module-link:hover { transform: translateY(-2px); border-color: #C7DEA8; box-shadow: 0 6px 18px rgba(59, 122, 26, .10); }

/* Ficha de solo lectura (rol usuario) */
.avatar-lg { width: 60px; height: 60px; font-size: 1.5rem; }
.info-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #EFF0EA; }
.info-row:last-child { border-bottom: 0; }
.info-row > i { color: #8A857E; font-size: 1.1rem; margin-top: 2px; }
.info-label { font-size: .75rem; color: #6F6A64; }
.info-value { font-weight: 500; word-break: break-word; }

/* Acceso del cliente */
.access-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.access-dl dt { font-weight: 500; color: #6F6A64; }
.access-dl dd { margin: 0; word-break: break-all; }

/* Modal de confirmación */
.confirm-icon {
  width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center;
  background: #fff1f0; color: #e03131; font-size: 1.4rem;
}
.modal-content { border-radius: var(--radius); border: 0; }
.contact-cell > div { white-space: nowrap; }

/* ---------- Nueva contraseña ---------- */
.pass-reqs { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; color: #6F6A64; }
.pass-reqs li { display: flex; align-items: center; gap: 5px; transition: color .15s; }
.pass-reqs li.ok { color: #2f9e44; }
.pass-match { min-height: 1.3em; color: #6F6A64; }
.pass-match.ok { color: #2f9e44; font-weight: 500; }
.pass-match.bad { color: #e03131; font-weight: 500; }
.form-control.match-ok { border-color: #2f9e44; }
.form-control.match-ok:focus { box-shadow: 0 0 0 .25rem rgba(47, 158, 68, .15); }
.form-control.match-bad { border-color: #e03131; }
.form-control.match-bad:focus { box-shadow: 0 0 0 .25rem rgba(224, 49, 49, .15); }
.btn:disabled { cursor: not-allowed; }


/* ---------- Logo ---------- */
.logo-img { border-radius: 11px; flex-shrink: 0; display: block; }
.brand-mark > img { display: block; }


/* =====================================================================
   Modo día / noche (Parte 52). El claro es el de siempre; el oscuro redefine los colores de la app
   sobre el modo oscuro de Bootstrap (data-bs-theme="dark" en <html>).
   ===================================================================== */
.btn-tema { color: var(--bs-secondary-color); font-size: 1.2rem; }
.btn-tema:hover { color: var(--brand); }
.btn-tema .tema-icon-light { display: none; }
[data-bs-theme=dark] .btn-tema .tema-icon-light { display: inline; }
[data-bs-theme=dark] .btn-tema .tema-icon-dark { display: none; }

[data-bs-theme=dark] {
  color-scheme: dark;
  --brand: #9ACA3C;
  --brand-dark: #B3DB66;
  --brand-soft: rgba(154, 202, 60, .16);
  --ink: #E7E5E1;
  --surface: #121110;
  --sidebar-bg: #0B0A0A;
  --bs-primary-rgb: 154, 202, 60;
  --bs-body-bg: #1B1918;
  --bs-body-bg-rgb: 27, 25, 24;
  --bs-body-color: #E4E1DC;
  --bs-body-color-rgb: 228, 225, 220;
  --bs-secondary-color: rgba(228, 225, 220, .68);
  --bs-tertiary-color: rgba(228, 225, 220, .45);
  --bs-secondary-bg: #252220;
  --bs-tertiary-bg: #221F1D;
  --bs-tertiary-bg-rgb: 34, 31, 29;
  --bs-border-color: #36322F;
  --bs-border-color-translucent: rgba(255, 255, 255, .1);
  --bs-link-color: #B3DB66;
  --bs-link-hover-color: #C8E78E;
  --bs-link-color-rgb: 179, 219, 102;
  --bs-link-hover-color-rgb: 200, 231, 142;
  --bs-emphasis-color: #fff;
  --muted: #A39E97;
  --line: #34302D;
  --line-soft: #2A2725;
}
[data-bs-theme=dark] .btn-primary { --bs-btn-color: #16200B; --bs-btn-hover-color: #16200B; --bs-btn-active-color: #16200B; --bs-btn-disabled-color: #16200B; }
[data-bs-theme=dark] .form-control, [data-bs-theme=dark] .form-select { border-color: var(--line); background-color: #161413; }
[data-bs-theme=dark] .form-control:focus, [data-bs-theme=dark] .form-select:focus { background-color: #161413; box-shadow: 0 0 0 .25rem rgba(154, 202, 60, .22); }
[data-bs-theme=dark] .form-control:disabled, [data-bs-theme=dark] .form-control[readonly], [data-bs-theme=dark] .form-select:disabled { background-color: #221F1D; }
[data-bs-theme=dark] .input-group-text { background-color: #221F1D; border-color: var(--line); }
[data-bs-theme=dark] .card { border-color: var(--line); box-shadow: none; }
[data-bs-theme=dark] .card-header, [data-bs-theme=dark] .card-footer { border-color: var(--line); }
[data-bs-theme=dark] .topbar { background: var(--bs-body-bg); border-bottom-color: var(--line); }
[data-bs-theme=dark] .user-chip:hover { background: var(--surface); }
[data-bs-theme=dark] .section-title, [data-bs-theme=dark] .empty-state, [data-bs-theme=dark] .stat-card .stat-label,
[data-bs-theme=dark] .info-label, [data-bs-theme=dark] .pass-reqs, [data-bs-theme=dark] .pass-match,
[data-bs-theme=dark] .filter-card .form-label, [data-bs-theme=dark] .data-table th { color: var(--muted); }
[data-bs-theme=dark] .empty-state > i { color: #4A4541; }
[data-bs-theme=dark] .data-table th { background: #1F1C1A; border-bottom-color: var(--line); }
[data-bs-theme=dark] .data-table td { border-color: var(--line-soft); }
[data-bs-theme=dark] .info-row { border-bottom-color: var(--line-soft); }
[data-bs-theme=dark] .input-icon > i, [data-bs-theme=dark] .toggle-pass, [data-bs-theme=dark] .info-row > i { color: var(--muted); }
[data-bs-theme=dark] .strength { background: var(--line); }
[data-bs-theme=dark] .module-link:hover { border-color: #55722A; }
@keyframes flashrow-dark { 0%, 40% { background: rgba(250, 200, 60, .2); } 100% { background: transparent; } }
[data-bs-theme=dark] .row-highlight td { animation-name: flashrow-dark; }
[data-bs-theme=dark] .tipo-inactivo { background: #1F1C1A; }
[data-bs-theme=dark] .confirm-icon { background: rgba(224, 49, 49, .18); color: #ff8787; }
/* Clases "light" de Bootstrap que quedan claras en modo oscuro */
[data-bs-theme=dark] .bg-light { background-color: var(--bs-tertiary-bg) !important; }
[data-bs-theme=dark] .text-bg-light { background-color: var(--bs-tertiary-bg) !important; color: var(--bs-body-color) !important; }
[data-bs-theme=dark] .table-light { --bs-table-bg: #221F1D; --bs-table-color: var(--bs-body-color); --bs-table-border-color: var(--line); }
[data-bs-theme=dark] .btn-light { --bs-btn-bg: #262321; --bs-btn-color: var(--bs-body-color); --bs-btn-border-color: var(--line);
  --bs-btn-hover-bg: #302C29; --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: #403B37; --bs-btn-active-bg: #36322F; --bs-btn-active-color: #fff; }
[data-bs-theme=dark] .text-dark { color: var(--bs-body-color) !important; }
[data-bs-theme=dark] .bg-white { background-color: var(--bs-body-bg) !important; }
[data-bs-theme=dark] .border.text-bg-light, [data-bs-theme=dark] .badge.border { border-color: var(--line) !important; }
/* Pantallas de ingreso */
[data-bs-theme=dark] .auth-body { background: var(--surface); }
[data-bs-theme=dark] .sidebar-nav a.active, [data-bs-theme=dark] .sidebar-nav a.active:hover { background: #3B7A1A; color: #fff; }
[data-bs-theme=dark] input::-webkit-calendar-picker-indicator { filter: invert(.85); }

/* =====================================================================
   VirtualPin: permisos por módulo
   ===================================================================== */
.nivel { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.nivel-modificacion { background: var(--brand-soft); color: var(--brand-dark); }
.nivel-lectura { background: #FFF4D6; color: #7A5300; }
[data-bs-theme=dark] .nivel-modificacion { color: var(--brand); }
[data-bs-theme=dark] .nivel-lectura { background: rgba(250, 200, 60, .15); color: #FFD66B; }
.sidebar-ro { font-size: .85rem !important; opacity: .6; }
.perm-col { width: 150px; }
.perm-table .form-check-input { width: 1.2em; height: 1.2em; cursor: pointer; }
.perm-table .form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.perm-admin-aviso { display: none; }
.perm-es-admin .perm-admin-aviso { display: block; }
.perm-es-admin .perm-table tbody, .perm-es-admin .perm-todos { opacity: .45; }
@media (max-width: 575.98px) { .perm-col { width: auto; font-size: .7rem; } }

/* =====================================================================
   Pantalla de ingreso: logo + nombre y cotizaciones (dólar blue y Banco Nación)
   ===================================================================== */
.auth-brand { overflow-y: auto; }
.auth-marca { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.auth-marca h1 { margin: 0; }
.cotiz-lugar { position: relative; z-index: 1; margin-top: 24px; max-width: 340px; }
.cotiz { display: grid; gap: 10px; }
.cotiz section { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; padding: 10px 12px; }
.cotiz-titulo { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin: 0 0 6px; opacity: .8; }
.cotiz-blue-valores { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; text-align: center; }
.cotiz-lbl { font-size: .75rem; opacity: .8; }
.cotiz-num { font-size: 1.35rem; font-weight: 700; line-height: 1.15; color: #C8E78E; font-variant-numeric: tabular-nums; }
.cotiz-var { font-size: .68rem; font-weight: 600; opacity: .85; }
.cotiz-pie { font-size: .64rem; opacity: .65; margin-top: 6px; }
.cotiz-blue .cotiz-pie { text-align: center; }
.cotiz-tabs { gap: 4px; margin-bottom: 6px; border: 0; }
.cotiz-tabs .nav-link { color: rgba(255, 255, 255, .75); background: rgba(255, 255, 255, .06); border: 0; border-radius: 7px; padding: 4px 9px; font-size: .72rem; font-weight: 600; }
.cotiz-tabs .nav-link:hover { color: #fff; }
.cotiz-tabs .nav-link.active { background: #9ACA3C; color: #16200B; }
.cotiz-tabla-wrap { overflow-x: auto; }
.cotiz-tabla { width: 100%; font-size: .74rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.cotiz-tabla th { font-weight: 600; padding: 4px 3px; border-bottom: 1px solid rgba(255, 255, 255, .25); white-space: nowrap; }
.cotiz-tabla td { padding: 3px 3px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.cotiz-tabla th:not(:first-child), .cotiz-tabla td:not(:first-child) { text-align: right; white-space: nowrap; }
.cotiz-tabla tbody tr:last-child td { border-bottom: 0; }

/* ---------- Proveedores (datos de ingreso) ---------- */
.cred-line { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.cred-lbl { color: var(--bs-secondary-color); font-size: .78rem; }
.cred-value { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.btn-icon-sm { border: 0; background: none; padding: 1px 4px; border-radius: 6px; color: #8A857E; line-height: 1; }
.btn-icon-sm:hover { background: var(--brand-soft); color: var(--brand); }
.url-cell a { display: inline-block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; text-decoration: none; }
.clave-actual { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px dashed #D9DBD0; }
[data-bs-theme=dark] .btn-icon-sm { color: var(--muted); }
[data-bs-theme=dark] .clave-actual { border-color: var(--line); }

/* ---------- SIMs ---------- */
.sim-st { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.sim-st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sim-st-ok { background: #E3F2D3; color: #2E6113; }
.sim-st-off { background: #FDE2E1; color: #A61B1B; }
.sim-st-ready { background: #DCEBFB; color: #1D4F91; }
.sim-st-test { background: #FFF1CC; color: #7A5300; }
.sim-st-inv, .sim-st-ret { background: #ECEDE6; color: #56514D; }
[data-bs-theme=dark] .sim-st-ok { background: rgba(154, 202, 60, .16); color: #B3DB66; }
[data-bs-theme=dark] .sim-st-off { background: rgba(224, 49, 49, .18); color: #FF8787; }
[data-bs-theme=dark] .sim-st-ready { background: rgba(77, 148, 255, .16); color: #8FBFFF; }
[data-bs-theme=dark] .sim-st-test { background: rgba(250, 200, 60, .15); color: #FFD66B; }
[data-bs-theme=dark] .sim-st-inv, [data-bs-theme=dark] .sim-st-ret { background: #2A2725; color: var(--muted); }
.sim-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; border: 1px solid #D9DBD0; background: var(--bs-body-bg);
  color: var(--bs-body-color); text-decoration: none; font-size: .85rem; }
.sim-chip strong { font-variant-numeric: tabular-nums; }
.sim-chip:hover { border-color: var(--brand); color: var(--brand); }
.sim-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
[data-bs-theme=dark] .sim-chip { border-color: var(--line); }
[data-bs-theme=dark] .sim-chip.active { color: #16200B; }
.sim-dl { display: grid; grid-template-columns: minmax(150px, auto) 1fr; gap: 6px 16px; margin: 0; }
.sim-dl dt { font-weight: 500; color: var(--bs-secondary-color); font-size: .85rem; }
.sim-dl dd { margin: 0; word-break: break-all; }
@media (max-width: 575.98px) { .sim-dl { grid-template-columns: 1fr; gap: 0; } .sim-dl dd { margin-bottom: 8px; } }
.sim-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #C9CBC0; margin-right: 6px; }
.sim-dot.on { background: #2F9E44; box-shadow: 0 0 0 3px rgba(47, 158, 68, .2); }
tr.clickable { cursor: pointer; }

/* Log de la API (SIMs) */
.api-log .list-group-item { padding: .6rem 1rem; }
.api-log-error { background: rgba(220, 53, 69, .06); }
.api-log-msg { word-break: break-all; white-space: pre-wrap; }
.api-log-pre { white-space: pre-wrap; word-break: break-all; background: var(--bs-tertiary-bg); border-radius: .4rem; padding: .5rem .75rem; max-height: 320px; overflow: auto; }
.api-log details summary { cursor: pointer; }
.importar-sims > summary { cursor: pointer; list-style: none; }
.importar-sims > summary::-webkit-details-marker { display: none; }

/* ---------- SIMs · Personal: selección, acciones masivas y pestañas de la ficha ---------- */
.col-check { width: 42px; padding-right: 0 !important; }
.col-check .form-check-input { cursor: pointer; margin: 0; }
.masiva-bar { position: sticky; top: 0; z-index: 3; background: var(--bs-primary-bg-subtle); border-radius: var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius) 0 0; }
.masiva-resultados { max-height: 260px; overflow-y: auto; }
[data-sim-tabs] .nav-tabs .nav-link { white-space: nowrap; font-size: .875rem; }
[data-sim-tabs] .tab-pane { min-height: 80px; }
[data-masiva-barra] { background-color: var(--brand); }

/* ---------- WhatsApp ---------- */
.wa-tabs .nav-link { border-radius: 10px; color: var(--bs-body-color); padding: 6px 12px; font-size: .9rem; }
.wa-tabs .nav-link.active { background: var(--brand); color: #fff; }
[data-bs-theme=dark] .wa-tabs .nav-link.active { color: #16200B; }
.wa-gw { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; white-space: nowrap; cursor: default; }
.wa-gw-punto { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.wa-gw-ok { background: rgba(47, 158, 68, .12); color: #2b8a3e; }
.wa-gw-ok .wa-gw-punto { animation: wa-latido 2s infinite; }
.wa-gw-mal { background: rgba(224, 49, 49, .12); color: #c92a2a; }
.wa-gw-nunca { background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); }
[data-bs-theme=dark] .wa-gw-ok { color: #69db7c; }
[data-bs-theme=dark] .wa-gw-mal { color: #ff8787; }
@keyframes wa-latido { 0%, 100% { box-shadow: 0 0 0 0 rgba(47, 158, 68, .5); } 50% { box-shadow: 0 0 0 4px rgba(47, 158, 68, 0); } }

.wa-app { display: flex; flex-direction: row; height: calc(100vh - 150px); min-height: 480px; overflow: hidden; }
.wa-lado { width: 340px; flex-shrink: 0; display: flex; flex-direction: column; border-right: 1px solid var(--bs-border-color); }
.wa-lado-cab { padding: 12px; border-bottom: 1px solid var(--bs-border-color); }
.wa-lista { flex: 1; overflow-y: auto; }
.wa-conv { display: flex; gap: 10px; padding: 10px 12px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--bs-border-color-translucent); }
.wa-conv:hover { background: var(--bs-tertiary-bg); }
.wa-conv.active { background: var(--brand-soft, rgba(59, 122, 26, .1)); }
.wa-conv-cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wa-conv-fila { display: flex; align-items: center; gap: 6px; min-width: 0; }
.wa-conv-nombre { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-conv-hora { font-size: .72rem; color: var(--bs-secondary-color); }
.wa-conv-texto { flex: 1; font-size: .82rem; color: var(--bs-secondary-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-conv-nueva .wa-conv-texto { color: var(--bs-body-color); font-weight: 500; }
.wa-conv-nueva .wa-conv-hora { color: #25a244; font-weight: 600; }
.wa-linea { font-size: .68rem; font-weight: 600; background: var(--bs-tertiary-bg); border-radius: 5px; padding: 0 5px; color: var(--bs-secondary-color); }
.wa-badge { background: #25a244; color: #fff; font-size: .7rem; }
.wa-avatar { position: relative; flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: #dfe5d6; color: #3b5a2a; display: grid; place-items: center; font-weight: 700; }
[data-bs-theme=dark] .wa-avatar { background: #2c3626; color: #b3db66; }
.wa-ventana-punto { position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: #25a244; border: 2px solid var(--bs-body-bg); }

.wa-chat { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wa-vacio { margin: auto; text-align: center; color: var(--bs-secondary-color); padding: 20px; }
.wa-vacio > i { font-size: 3rem; color: #25a244; opacity: .5; }
.wa-chat-cab { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--bs-border-color); }
.wa-alias-form { padding: 8px 14px; border-bottom: 1px solid var(--bs-border-color); }
.min-w-0 { min-width: 0; }
.wa-mensajes { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 4px;
  background: #efeae2 radial-gradient(rgba(0, 0, 0, .035) 1px, transparent 1px) 0 0 / 18px 18px; }
[data-bs-theme=dark] .wa-mensajes { background: #0f1412 radial-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px) 0 0 / 18px 18px; }
.wa-msg { display: flex; }
.wa-sale { justify-content: flex-end; }
.wa-burbuja { max-width: min(560px, 78%); padding: 6px 9px 4px; border-radius: 10px; background: #fff; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); font-size: .92rem; word-wrap: break-word; overflow-wrap: anywhere; }
.wa-sale .wa-burbuja { background: #d9fdd3; }
[data-bs-theme=dark] .wa-burbuja { background: #202c33; color: #e9edef; }
[data-bs-theme=dark] .wa-sale .wa-burbuja { background: #005c4b; }
.wa-reaccion .wa-burbuja { background: transparent; box-shadow: none; font-size: 1.1rem; }
.wa-texto a { word-break: break-all; }
.wa-pie { display: flex; justify-content: flex-end; align-items: center; gap: 5px; font-size: .7rem; color: #667781; margin-top: 2px; }
[data-bs-theme=dark] .wa-pie { color: #8696a0; }
.wa-quien { font-style: italic; margin-right: auto; }
.wa-leido { color: #53bdeb; }
.wa-responder { opacity: 0; font-size: .8rem; }
.wa-msg:hover .wa-responder { opacity: 1; }
.wa-origen { font-size: .72rem; color: #667781; margin-bottom: 2px; }
.wa-error { font-size: .74rem; color: #c92a2a; border-top: 1px dashed rgba(201, 42, 42, .3); margin-top: 4px; padding-top: 3px; }
[data-bs-theme=dark] .wa-error { color: #ff8787; }
.wa-img { display: block; max-width: 100%; max-height: 320px; border-radius: 7px; margin-bottom: 3px; }
.wa-sticker { width: 120px; height: 120px; object-fit: contain; }
.wa-doc { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 7px; background: rgba(0, 0, 0, .05); color: inherit; text-decoration: none; max-width: 300px; min-width: 0; }
.wa-doc > i { font-size: 1.6rem; color: #e03131; }
.wa-doc > span { min-width: 0; }
.wa-doc small { color: #667781; }
.wa-burbuja audio { max-width: 260px; height: 40px; }
.wa-ventana { font-size: .78rem; padding: 6px 14px; border-top: 1px solid var(--bs-border-color); }
.wa-ventana.abierta { color: #2b8a3e; }
.wa-ventana.cerrada { color: #9c6b00; background: rgba(250, 176, 5, .08); }
[data-bs-theme=dark] .wa-ventana.abierta { color: #69db7c; }
[data-bs-theme=dark] .wa-ventana.cerrada { color: #ffd43b; }
.wa-componer { padding: 10px 14px; border-top: 1px solid var(--bs-border-color); }
.wa-componer textarea { resize: none; max-height: 160px; }
.wa-modos .nav-link { padding: 2px 0; }
.wa-cita, .wa-adjunto { display: flex; align-items: center; gap: 6px; font-size: .8rem; padding: 5px 8px; margin-bottom: 6px; border-left: 3px solid #25a244; background: var(--bs-tertiary-bg); border-radius: 6px; }
.wa-cita span, .wa-adjunto span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-close-sm { width: .6em; height: .6em; }
.wa-vista { white-space: pre-wrap; background: #d9fdd3; color: #111b21; border-radius: 10px; padding: 8px 10px; min-height: 60px; }
[data-bs-theme=dark] .wa-vista { background: #005c4b; color: #e9edef; }
.wa-plantilla-texto { white-space: normal; }
.wa-plantilla-ref summary { cursor: pointer; }
.wa-plantilla-ref .wa-plantilla-texto { background: var(--bs-tertiary-bg); border-radius: 8px; padding: 6px 9px; margin: 4px 0 6px; }
.wa-webhook-box { background: var(--bs-tertiary-bg); border-radius: 10px; padding: 10px 12px; }
.wa-json { font-size: .78rem; max-height: 70vh; overflow: auto; background: var(--bs-tertiary-bg); border-radius: 8px; padding: 10px; white-space: pre-wrap; word-break: break-all; }
@media (max-width: 767.98px) {
  .wa-app { height: calc(100vh - 120px); }
  .wa-lado { width: 100%; border-right: 0; }
  .wa-con-chat .wa-lado { display: none; }
  .wa-app:not(.wa-con-chat) .wa-chat { display: none; }
}
