/* ─── Panel de CUENTAS — estilos compartidos (MANUAL 31, paso 2) ─────────────
   El look del Side Panel de accounts-extension (cuentas/app.css), encerrado bajo
   .acc-root (el panel) y .acc-hoja (la hoja de abajo, que vive en el body) para
   no chocar con los estilos del Viewer. La tarjeta se llama .card-acc y las
   sub-pestañas .subtabs-acc por lo mismo. Copia IGUAL en la web-app (paso 3). */

.acc-root, .acc-hoja, .acc-hoja-fondo {
  --fondo: #0d0d0d;
  --panel: #141414;
  --campo: #1e1e1e;
  --borde: #2a2a2a;
  --borde-suave: #222;
  --texto: #f5f5f5;
  --texto-2: #a3a3a3;
  --texto-3: #525252;
  --verde: #22c55e;

  --lbl-account: #f59e0b;
  --lbl-pass:    #a78bfa;
  --lbl-pp:      #34d399;
  --lbl-maxwin:  #60a5fa;
  --lbl-maxbet:  #f87171;
  --lbl-notes:   #22d3ee;
  --lbl-url:     #94a3b8;
}
.acc-root, .acc-hoja {
  color: var(--texto);
  font-family: 'TBV Lexend', 'Lexend', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
}
.acc-root { background: var(--fondo); }
.acc-root button, .acc-root input, .acc-root select, .acc-root textarea,
.acc-hoja button, .acc-hoja input, .acc-hoja select, .acc-hoja textarea { font: inherit; color: inherit; }
.acc-root button, .acc-hoja button { cursor: pointer; }
.acc-root [hidden], .acc-hoja[hidden], .acc-hoja-fondo[hidden] { display: none !important; }

/* ── Cabecera: casas, buscador, chips ─────────────────────────────────── */
.acc-root .acc-top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(13, 13, 13, .96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--borde-suave);
  padding: 8px 12px;
}
.acc-root .casas {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -12px; padding: 0 12px 2px;
}
.acc-root .casas::-webkit-scrollbar { display: none; }
.acc-root .casa {
  flex-shrink: 0; padding: 6px 13px; border-radius: 20px;
  background: var(--panel); border: 1px solid var(--borde);
  font-size: 12px; font-weight: 700; letter-spacing: .5px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.acc-root .casa img { width: 15px; height: 15px; border-radius: 3px; }
.acc-root .casa.on { background: var(--texto); color: var(--fondo); border-color: var(--texto); }
.acc-root .casa .cuenta-n { font-size: 10px; opacity: .6; font-weight: 600; }

.acc-root .barra { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.acc-root .barra input {
  flex: 1; min-width: 0;
  background: var(--panel); border: 1px solid var(--borde); border-radius: 9px;
  padding: 7px 11px; font-size: 13px; outline: none;
}
.acc-root .barra input:focus { border-color: var(--verde); }
.acc-root .subtabs-acc { display: flex; background: var(--panel); border: 1px solid var(--borde); border-radius: 9px; padding: 2px; flex-shrink: 0; }
.acc-root .subtabs-acc button { background: none; border: 0; border-radius: 7px; padding: 6px 9px; font-size: 11px; font-weight: 700; color: var(--texto-2); }
.acc-root .subtabs-acc button.on { background: var(--campo); color: var(--texto); }

.acc-root .chips {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 7px -12px 0; padding: 0 12px;
}
.acc-root .chips:empty { display: none; }
.acc-root .chips::-webkit-scrollbar { display: none; }
.acc-root .chip {
  flex-shrink: 0; padding: 4px 10px; border-radius: 16px;
  background: transparent; border: 1px solid var(--borde);
  font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  color: var(--texto-2); white-space: nowrap;
}
.acc-root .chip b { font-weight: 800; margin-left: 4px; opacity: .8; }
.acc-root .chip.on { color: var(--texto); border-color: currentColor; }

/* ── Lista de tarjetas ─────────────────────────────────────────────────── */
.acc-root .lista {
  padding: 10px 10px 96px;
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.acc-root .vacio { grid-column: 1 / -1; text-align: center; color: var(--texto-3); padding: 50px 20px; font-size: 13px; line-height: 1.6; }
.acc-root .vacio .btn { margin-top: 14px; }
.acc-root .cargando { grid-column: 1 / -1; text-align: center; color: var(--texto-3); padding: 60px 0; }

.acc-root .card-acc {
  background: var(--panel); border: 1px solid var(--borde-suave);
  border-radius: 11px; overflow: hidden;
  display: flex; flex-direction: column;
}
.acc-root .card-acc.archivada { opacity: .72; }
.acc-root .card-bar { height: 4px; flex-shrink: 0; background: #374151; }
.acc-root .card-body { padding: 10px 11px 11px; }
.acc-root .card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.acc-root .card-titulo { min-width: 0; }
.acc-root .card-name { font-size: 15px; font-weight: 700; line-height: 1.2; word-break: break-word; }
.acc-root .card-city { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-top: 3px; color: var(--texto-2); }
.acc-root .card-pills { display: flex; align-items: center; gap: 5px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.acc-root .pill, .acc-hoja .pill {
  padding: 3px 8px; border-radius: 5px; border: 0;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  white-space: nowrap; background: #374151; color: #e5e7eb;
}
.acc-root .card-menu {
  background: none; border: 0; color: var(--texto-3);
  font-size: 19px; line-height: 1; padding: 0 2px 0 4px; margin-top: -2px;
}

.acc-root .card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.acc-root .cf {
  background: var(--campo); border: 1px solid var(--borde); border-radius: 7px;
  padding: 7px 8px; text-align: left; min-width: 0;
  display: flex; flex-direction: column;
}
.acc-root button.cf:active { background: #262626; }
.acc-root .cf.s3 { grid-column: span 3; }
.acc-root .cf-l { font-size: 9px; text-transform: uppercase; letter-spacing: .7px; font-weight: 700; margin-bottom: 4px; display: flex; justify-content: space-between; gap: 4px; }
.acc-root .cf-l .accion { color: var(--texto-3); font-weight: 600; letter-spacing: 0; text-transform: none; }
.acc-root .cf-v { font-size: 13px; font-weight: 600; word-break: break-word; line-height: 1.3; }
.acc-root .cf-v.vacio-v { color: var(--texto-3); }
.acc-root .cf-url { font-size: 12px; color: #60a5fa; word-break: break-all; font-weight: 500; }
.acc-root .lbl-account { color: var(--lbl-account); }
.acc-root .lbl-pass    { color: var(--lbl-pass); }
.acc-root .lbl-pp      { color: var(--lbl-pp); }
.acc-root .lbl-maxwin  { color: var(--lbl-maxwin); }
.acc-root .lbl-maxbet  { color: var(--lbl-maxbet); }
.acc-root .lbl-notes   { color: var(--lbl-notes); }
.acc-root .lbl-url     { color: var(--lbl-url); }
.acc-root .url-fila { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.acc-root .btn-goto {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #1a1a1a; border: 1px solid var(--borde); color: #93c5fd; text-decoration: none; font-size: 14px;
}
.acc-root .card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.acc-root .tag { padding: 2px 8px; border-radius: 12px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; background: #374151; color: #e5e7eb; }

/* ── Botón flotante "＋" ────────────────────────────────────────────────── */
.acc-root .fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 30;
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--verde); color: #04130a; border: 0;
  font-size: 25px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .55);
}

/* ── Botones y formularios (panel y hoja) ─────────────────────────────── */
.acc-root .btn, .acc-hoja .btn {
  background: var(--campo); border: 1px solid var(--borde); border-radius: 8px;
  padding: 9px 14px; font-size: 13px; font-weight: 600;
}
.acc-root .btn.primario, .acc-hoja .btn.primario { background: var(--verde); border-color: var(--verde); color: #04130a; }
.acc-hoja .form { display: flex; flex-direction: column; gap: 11px; margin-top: 6px; }
.acc-hoja .form label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--texto-2); font-weight: 600; }
.acc-hoja .form input, .acc-hoja .form select, .acc-hoja .form textarea, .acc-hoja .campo-edit {
  width: 100%;
  background: var(--fondo); border: 1px solid var(--borde); border-radius: 8px;
  padding: 9px 11px; font-size: 14px; color: var(--texto);
  outline: none;
}
.acc-hoja .form input:focus, .acc-hoja .form select:focus, .acc-hoja .form textarea:focus, .acc-hoja .campo-edit:focus { border-color: var(--verde); }
.acc-hoja .form textarea { min-height: 70px; resize: vertical; }
.acc-hoja .dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acc-hoja .msg { font-size: 12px; margin: 0; line-height: 1.4; color: #fca5a5; }

/* ── Hoja de abajo (editar, menús, ⚙) ─────────────────────────────────── */
.acc-hoja-fondo { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 50; }
.acc-hoja {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51;
  max-height: 86vh; overflow-y: auto;
  background: var(--panel); border-top: 1px solid var(--borde);
  border-radius: 16px 16px 0 0;
  padding: 10px 14px 18px;
  animation: acc-subir .18s ease-out;
}
@keyframes acc-subir { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.acc-hoja .hoja-asa { width: 40px; height: 4px; border-radius: 2px; background: #3a3a3a; margin: 0 auto 12px; }
.acc-hoja h3 { margin: 0 0 4px; font-size: 15px; }
.acc-hoja .hoja-sub { color: var(--texto-2); font-size: 12px; margin: 0 0 12px; }
.acc-hoja .hoja-sub.pegado { margin: 0; white-space: nowrap; }
.acc-hoja .hoja-sub.titulo-lista { margin: 14px 0 6px; }
.acc-hoja .hoja-acciones { display: flex; gap: 10px; margin-top: 14px; }
.acc-hoja .hoja-acciones .btn { flex: 1; }

.acc-hoja .opciones { display: flex; flex-direction: column; gap: 6px; }
.acc-hoja .opcion {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--campo); border: 1px solid var(--borde); border-radius: 9px;
  padding: 10px 12px; font-size: 13px; font-weight: 600; text-align: left; width: 100%;
}
.acc-hoja a.opcion { color: inherit; text-decoration: none; }
.acc-hoja .opcion small { color: var(--texto-3); font-weight: 500; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.acc-hoja .opcion.on { border-color: var(--verde); }
.acc-hoja .opcion .marca-on { color: var(--verde); }
.acc-hoja .opcion.peligro { color: #fca5a5; }

.acc-hoja .historial { display: flex; flex-direction: column; gap: 8px; }
.acc-hoja .h-fila { background: var(--campo); border: 1px solid var(--borde); border-radius: 9px; padding: 8px 10px; font-size: 12px; line-height: 1.45; }
.acc-hoja .h-meta { color: var(--texto-2); font-size: 10px; margin-bottom: 3px; }
.acc-hoja .h-antes { color: #fca5a5; text-decoration: line-through; }
.acc-hoja .h-despues { color: #86efac; }
.acc-hoja .cargando { text-align: center; color: var(--texto-3); padding: 40px 0; }

.acc-hoja .tabla-admin { display: flex; flex-direction: column; gap: 6px; }
.acc-hoja .fila-admin {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  background: var(--campo); border: 1px solid var(--borde); border-radius: 9px; padding: 8px 10px;
}
.acc-hoja .fila-admin .quien { min-width: 0; }
.acc-hoja .fila-admin .quien b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.acc-hoja .fila-admin .quien span { display: block; font-size: 11px; color: var(--texto-2); overflow: hidden; text-overflow: ellipsis; }
.acc-hoja .fila-admin select, .acc-hoja .fila-admin input {
  background: var(--fondo); border: 1px solid var(--borde); border-radius: 7px; padding: 6px 8px; font-size: 13px;
}
.acc-hoja .fila-admin .crece { flex: 1; min-width: 0; }
.acc-hoja .fila-colores { display: flex; gap: 6px; align-items: center; }
.acc-hoja .fila-colores .emoji-in { width: 46px; }
.acc-hoja .fila-colores .rango { width: 90px; padding: 0; }
.acc-hoja .icono {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--panel); border: 1px solid var(--borde);
  font-size: 15px; display: inline-flex; align-items: center; justify-content: center;
}
.acc-hoja .tabs-hoja { display: flex; gap: 6px; margin-bottom: 14px; }
.acc-hoja .tabs-hoja button { flex: 1; background: var(--campo); border: 1px solid var(--borde); border-radius: 8px; padding: 7px; font-weight: 700; font-size: 12px; color: var(--texto-2); }
.acc-hoja .tabs-hoja button.on { color: var(--texto); border-color: var(--texto-2); }
