/* ============================================================
   RPPARTIDOS — 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 RPPartidos ── */
: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; }
.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; }

/* ── Select en cabeceras de tab ── */
.tab-select {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 6px;
  color: #fff;
  padding: 7px 32px 7px 12px;
  font-size: 13px;
  font-family: var(--font-ui);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='rgba(255,255,255,0.5)' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 140px;
}
.tab-select:focus { outline: none; border-color: rgba(255,255,255,0.6); }
.tab-select option { background: #012C1D; color: #fff; }

body.light-mode .tab-select {
  background: rgba(1,44,29,0.07);
  border-color: rgba(1,44,29,0.3);
  color: #012C1D;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='rgba(1,44,29,0.5)' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
body.light-mode .tab-select option { background: #fff; color: #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; }

/* ── Modo claro: overrides específicos de RPPartidos ── */
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 { background: #fff; color: #012C1D; border-color: rgba(1,44,29,0.35); }
body.light-mode .fp-field input::placeholder { color: rgba(1,44,29,0.4); }
body.light-mode .fp-field select 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 { border-color: rgba(1,44,29,0.2); }
body.light-mode .mi-title  { color: #012C1D; }
body.light-mode .mi-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 .stat-card { background: #fff; border-color: rgba(1,44,29,0.2); }
body.light-mode .stat-num  { color: #012C1D; }
body.light-mode .stat-label { color: #3a5a4a; }
body.light-mode .jornada-block { background: #fff; border-color: rgba(1,44,29,0.2); }
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-color: rgba(1,44,29,0.15); }
body.light-mode .fp-field label { color: #3a5a4a; }
body.light-mode .jornada-header  { background: #012C1D; }
body.light-mode .jornada-num     { color: #fff; }
body.light-mode .jornada-meta    { color: rgba(255,255,255,0.7); }
body.light-mode .jornada-countdown { background: rgba(255,255,255,0.15); color: #fff; }
body.light-mode .mi-siglas       { background: #012C1D; color: #fff; }
body.light-mode .upload-zone     { border-color: rgba(1,44,29,0.35); }
body.light-mode .upload-zone-text { color: #3a5a4a; }
body.light-mode .upload-zone-text strong { color: #012C1D; }
body.light-mode .form-panel h4   { border-bottom-color: rgba(1,44,29,0.15); }

/* ===== TABLA DE PARTIDOS ===== */
.table-wrap { overflow-x: auto; }
.rp-table { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
.rp-table th:nth-child(1) { width: 45%; }
.rp-table th:nth-child(2) { width: 20%; }
.rp-table th:nth-child(3) { width: 18%; }
.rp-table th:nth-child(4) { width: 17%; }
.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; }

/* ===== JORNADAS ===== */
.jornada-header { background: rgba(0,0,0,0.35); padding: 12px 16px; border-radius: 8px 8px 0 0;
  margin-top: 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.jornada-num  { font-family: var(--font-card); font-size: 22px; color: #fff; letter-spacing: 1px; }
.jornada-meta { font-size: 13px; color: var(--app-muted); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.jornada-countdown { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px;
  background: rgba(255,255,255,0.1); color: #fff; white-space: nowrap; }
.jornada-countdown.urgent  { background: rgba(220,100,0,0.3); color: #ffaa44; }
.jornada-countdown.expired { background: rgba(198,40,40,0.3); color: #ff6666; }
.jornada-countdown.ok      { background: rgba(26,122,74,0.3);  color: #5cde9a; }
.jornada-block { background: var(--app-surface); border: 1px solid var(--app-border);
  border-radius: 0 0 8px 8px; margin-bottom: 4px; }

/* ===== 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-retraso   { background: rgba(217,119,6,0.25);  color: #fbbf24; }
.badge-pendiente { background: rgba(255,255,255,0.1); color: var(--app-muted); }
.badge-vencido   { background: rgba(220,100,0,0.2);   color: #fb923c; }
.badge-penal     { background: rgba(198,40,40,0.25);  color: #ff6666; }
.badge-indulto   { background: rgba(3,105,161,0.25);  color: #7dd3fc; }

/* ===== UPLOAD ZONE ===== */
.upload-zone { border: 2px dashed var(--app-border); border-radius: 8px; padding: 24px;
  text-align: center; cursor: pointer; transition: all .2s; }
.upload-zone:hover, .upload-zone.drag-over { border-color: #fff; background: rgba(255,255,255,0.04); }
.upload-zone input[type=file] { display: none; }
.upload-zone-text { color: var(--app-muted); font-size: 14px; line-height: 1.7; }
.upload-zone-text strong { color: #fff; }

/* ===== PROGRESS BAR ===== */
.progress-wrap      { display: none; flex-direction: column; gap: 6px; }
.progress-wrap.show { display: flex; }
.progress-bar-bg    { height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; }
.progress-bar-fill  { height: 100%; background: #fff; border-radius: 4px; transition: width .2s; width: 0%; }
.progress-text      { font-size: 12px; color: var(--app-muted); text-align: center; }

/* ===== 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-siglas { font-family: var(--font-card); font-size: 20px; color: #fff; letter-spacing: 2px;
  background: rgba(255,255,255,0.12); padding: 4px 10px; border-radius: 4px; flex-shrink: 0; }
.mi-badge-role { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.role-admin    { background: rgba(198,40,40,0.3); color: #ff8888; }
.role-tecnico  { background: rgba(3,105,161,0.3); color: #7dd3fc; }
.role-analista { background: rgba(26,122,74,0.3); color: #5cde9a; }

/* ===== 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; }

/* ===== STATS CARDS (dashboard) ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(160px,1fr)); gap: 14px; }
.stat-card  { background: var(--app-surface); border: 1px solid var(--app-border);
  border-radius: 10px; padding: 18px 16px; display: flex; flex-direction: column; gap: 6px; }
.stat-num   { font-family: var(--font-card); font-size: 36px; color: #fff; line-height: 1; }
.stat-label { font-size: 12px; color: var(--app-muted); text-transform: uppercase; letter-spacing: .5px; }
.stat-card.accent-green  { border-color: rgba(26,122,74,0.5); }
.stat-card.accent-orange { border-color: rgba(217,119,6,0.5); }
.stat-card.accent-red    { border-color: rgba(198,40,40,0.5); }

/* ===== 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; }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.88);
  display: flex; align-items: center; justify-content: center; z-index: 500; padding: 16px; }
.modal-content { background: var(--app-surface); border: 1px solid var(--app-border);
  border-radius: 12px; padding: 24px; width: 100%; display: flex;
  flex-direction: column; gap: 16px; position: relative; max-height: 92vh; overflow-y: auto; }
.modal-close { position: absolute; top: 14px; right: 14px; background: transparent;
  border: none; color: var(--app-muted); font-size: 20px; cursor: pointer; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.modal-wide { max-width: 560px; }
.modal-xl   { max-width: 800px; }

/* ===== 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 ===== */
.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; }
.ei-shield img { width: 100%; height: 100%; object-fit: contain; }
.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; }
.entity-form  { background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; padding: 16px; margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.entity-form h4 { font-size: 13px; color: var(--app-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.entity-form-actions { display: flex; gap: 8px; }
.shield-box   { background: #fff; border-radius: 8px; width: 80px; height: 80px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  border: 2px solid var(--app-border); transition: border-color .2s; flex-shrink: 0; }
.shield-box:hover { border-color: #fff; }
.shield-box img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.upload-ph    { font-size: 11px; color: var(--app-muted); text-align: center; padding: 4px; }

/* ===== 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; }
}

/* ── Calendario ── */
.cal-nav { display:flex; align-items:center; gap:16px; margin-bottom:16px; }
.cal-month-label { font-family: var(--font-ui); font-size:20px; font-weight:600; color:#fff; min-width:180px; text-align:center; letter-spacing:1px; }
.cal-legend { display:flex; gap:16px; flex-wrap:wrap; margin-bottom:12px; font-size:12px; color:var(--app-muted); }
.cal-legend span { display:flex; align-items:center; gap:5px; }
.cal-dot { display:inline-block; width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.dot-partido   { background:#6b8aff; }
.dot-limite    { background:#f59e0b; }
.dot-ok        { background:#5cde9a; }
.dot-pendiente { background:#ff6666; }

.cal-table { max-width:700px; }
.cal-header-row { display:grid; grid-template-columns:repeat(7,1fr); gap:3px; margin-bottom:3px; }
.cal-body       { display:grid; grid-template-columns:repeat(7,1fr); gap:3px; }
.cal-cell { min-height:64px; border-radius:6px; padding:6px 8px; background:rgba(255,255,255,0.04); position:relative; display:flex; flex-direction:column; gap:4px; }
.cal-day-name { min-height:auto; padding:4px 0; text-align:center; font-size:11px; color:var(--app-muted); background:transparent; font-weight:600; letter-spacing:1px; }
.cal-empty    { background:transparent; }
.cal-today    { outline:2px solid rgba(255,255,255,0.3); }
.cal-has-events { cursor:pointer; background:rgba(255,255,255,0.07); }
.cal-has-events:hover { background:rgba(255,255,255,0.12); }
.cal-day-num  { font-size:13px; color:var(--app-muted); font-weight:600; }
.cal-today .cal-day-num { color:#fff; }
.cal-dots     { display:flex; gap:3px; flex-wrap:wrap; }

body.light-mode .cal-month-label { color:#012C1D; }
body.light-mode .cal-cell        { background:rgba(1,44,29,0.05); }
body.light-mode .cal-has-events  { background:rgba(1,44,29,0.1); }
body.light-mode .cal-has-events:hover { background:rgba(1,44,29,0.18); }
body.light-mode .cal-day-num     { color:#3a5a4a; }
body.light-mode .cal-today       { outline-color:rgba(1,44,29,0.4); }
body.light-mode .cal-today .cal-day-num { color:#012C1D; }

@media (max-width:500px) {
  .cal-cell { min-height:44px; padding:4px 5px; }
  .cal-day-num { font-size:11px; }
  .cal-month-label { font-size:16px; }
}
