/* ============================================================
   RP-DATA — estilos específicos de la app
   Variables, reset, navbar, footer, landing, login, botones
   comunes y responsive base → rp-shared-style.css (assets)
   ============================================================ */

/* ── Variables específicas de RP-Data ── */
:root {
  --rp-success: #1a7a4a;
}

/* ── Layout app ── */
html, body { overflow-x: hidden; }
#screen-app { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; background: var(--app-bg); }

/* ── Tabs ── */
.tab-content        { display: none; flex-direction: column; padding: 20px 24px; gap: 20px; }
.tab-content.active { display: flex; flex: 1; }
/* Cada pestaña envuelve su contenido en un div propio (#futbolistas-view, etc.)
   controlado por el router: ese div necesita el mismo flex+gap que antes
   daba .tab-content directamente a sus hijos. */
#futbolistas-view, #equipos-view, #ligas-view, #partido-view { display: flex; flex-direction: column; gap: 20px; width: 100%; }
.tab-header  { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.tab-header h2 { font-family: var(--font-ui) !important; font-size: 22px; font-weight: 400; letter-spacing: 1px; color: #fff; }
.tab-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Input/select sueltos en tab-actions (buscador, filtros) ── */
.fp-field-input {
  background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px; color: #fff; padding: 9px 12px; font-size: 14px; font-family: var(--font-ui);
}
.fp-field-input:focus { outline: none; border-color: #fff; }
.fp-field-input::placeholder { color: rgba(255,255,255,0.35); }
.fp-field-input option { background: #012C1D; }

/* ── Botones específicos ── */
.btn-danger { background: #c62828; color: #fff; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.btn-edit   { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.3); padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 13px;
  display: inline-block; text-decoration: none; }

/* ===== TABLA ===== */
.table-wrap { overflow-x: auto; }
.rp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rp-table th { background: rgba(0,0,0,0.3); color: var(--app-muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: .8px; padding: 10px 12px; text-align: left;
  font-weight: 600; border-bottom: 1px solid var(--app-border); white-space: nowrap; }
.rp-table td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.06); vertical-align: middle; }
.rp-table tr:hover td { background: rgba(255,255,255,0.03); }
.rp-table tr:last-child td { border-bottom: none; }
.rp-table th.sortable { cursor: pointer; user-select: none; }
.rp-table th.sortable:hover { color: #fff; }
.rp-table th.sortable::after { content: ' ⇅'; opacity: .5; }

/* ===== BADGES ===== */
.badge           { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: 20px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-ok        { background: rgba(26,122,74,0.25);  color: #5cde9a; }
.badge-pendiente { background: rgba(255,255,255,0.1); color: var(--app-muted); }
.role-admin      { background: rgba(198,40,40,0.3); color: #ff8888; }
.role-usuario    { background: rgba(26,122,74,0.3); color: #5cde9a; }

/* ===== PANEL ADMIN (gestión) ===== */
.mgmt-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.mgmt-list { display: flex; flex-direction: column; gap: 6px; }
.mgmt-item { background: rgba(0,0,0,0.2); border: 1px solid var(--app-border); border-radius: 8px;
  padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.mgmt-item:hover { border-color: rgba(255,255,255,0.3); }
.mi-info   { flex: 1; }
.mi-title  { font-size: 15px; font-weight: 600; color: #fff; }
.mi-sub    { font-size: 12px; color: var(--app-muted); margin-top: 2px; }
.mi-badge-role { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }

/* ===== FORM PANEL (sticky) ===== */
.form-panel { background: rgba(0,0,0,0.25); border: 1px solid var(--app-border);
  border-radius: 10px; padding: 20px; display: flex; flex-direction: column; gap: 14px;
  position: sticky; top: 76px; }
.form-panel h4 { font-family: var(--font-card); font-size: 16px; color: #fff;
  letter-spacing: 1px; border-bottom: 1px solid var(--app-border); padding-bottom: 10px; }
.fp-field  { display: flex; flex-direction: column; gap: 5px; }
.fp-field label { font-size: 11px; color: var(--app-muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.fp-field input, .fp-field select, .fp-field textarea {
  background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px; color: #fff; padding: 9px 12px; font-size: 14px; font-family: var(--font-ui); }
.fp-field input:focus, .fp-field select:focus, .fp-field textarea:focus { outline: none; border-color: #fff; }
.fp-field input::placeholder { color: rgba(255,255,255,0.35); }
.fp-field select option { background: #012C1D; }
.fp-actions { display: flex; gap: 8px; }

/* ===== TABLA DE RESUMEN (dashboard/futbolista/equipo/partido) ===== */
.stats-table th { text-align: center; }
.stats-table td { font-family: var(--font-card); font-size: 20px; color: #fff; text-align: center; }

/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { padding: 12px 18px; border-radius: 8px; font-size: 14px; font-weight: 600;
  color: #fff; opacity: 0; transform: translateY(10px); transition: all .3s;
  pointer-events: auto; max-width: 320px; }
.toast.show  { opacity: 1; transform: translateY(0); }
.toast-ok    { background: #1a7a4a; }
.toast-err   { background: #c62828; }
.toast-info  { background: #0369a1; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 40px 20px; color: var(--app-muted); }
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ===== ENTITY LISTA (futbolistas / equipos / ligas) ===== */
.entity-lista { display: flex; flex-direction: column; gap: 6px; }
.entity-item  { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,0.2); border-radius: 6px; padding: 10px 12px; }
.ei-shield    { background: #fff; border-radius: 5px; width: 36px; height: 36px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; font-family: var(--font-card); color: #012C1D; font-size: 14px; }
.ei-info      { flex: 1; }
.ei-nombre    { font-size: 14px; font-weight: 600; }
.ei-sub       { font-size: 11px; color: var(--app-muted); margin-top: 1px; }
.ei-actions   { display: flex; gap: 6px; }

/* ===== MODO CLARO: overrides específicos de RP-Data ===== */
body.light-mode .tab-header h2   { color: #012C1D; }
body.light-mode .fp-field input, body.light-mode .fp-field select, body.light-mode .fp-field textarea,
body.light-mode .fp-field-input  { background: #fff; color: #012C1D; border-color: rgba(1,44,29,0.35); }
body.light-mode .fp-field input::placeholder, body.light-mode .fp-field-input::placeholder { color: rgba(1,44,29,0.4); }
body.light-mode .fp-field select option, body.light-mode .fp-field-input option { background: #fff; color: #012C1D; }
body.light-mode .btn-edit { background: rgba(1,44,29,0.1); color: #012C1D; border-color: rgba(1,44,29,0.3); }
body.light-mode .mgmt-item, body.light-mode .entity-item { border-color: rgba(1,44,29,0.2); background: rgba(1,44,29,0.04); }
body.light-mode .mi-title, body.light-mode .ei-nombre  { color: #012C1D; }
body.light-mode .mi-sub, body.light-mode .ei-sub    { color: #3a5a4a; }
body.light-mode .rp-table th { background: #012C1D; color: #fff; }
body.light-mode .rp-table td { color: #012C1D; }
body.light-mode .rp-table tr:hover td { background: rgba(1,44,29,0.05); }
body.light-mode .form-panel { background: rgba(1,44,29,0.05); border-color: rgba(1,44,29,0.2); }
body.light-mode .form-panel h4 { color: #012C1D; border-bottom-color: rgba(1,44,29,0.15); }
body.light-mode .fp-field label { color: #3a5a4a; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .mgmt-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .tab-content { padding: 16px 12px; }
  .entity-lista { max-height: 400px; overflow-y: auto; }
}

@media (min-width: 769px) {
  .tab-header h2 { font-size: 24px; }
  .rp-table th { font-size: 12px; }
  .rp-table td { font-size: 15px; }
  .badge        { font-size: 13px; }
  .mi-title     { font-size: 16px; }
  .mi-sub       { font-size: 13px; }
}
