/* Estilos Mobile-First y Sistema de Habilitacion - Asoc. El Maiten */
:root {
  --primary: #0f4c3a;
  --primary-light: #16654e;
  --primary-dark: #092e23;
  --accent: #d97706;
  --accent-light: #f59e0b;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #34d399;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-border: #f87171;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #cbd5e1;
  --radius: 14px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --bottom-nav-height: 65px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 15px;
}

/* ========================================================
   PANTALLA DE LOGIN
   ======================================================== */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: linear-gradient(135deg, #092e23 0%, #0f4c3a 60%, #16654e 100%);
}

.login-card {
  background: white;
  border-radius: 20px;
  padding: 2.2rem 1.8rem;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.login-header {
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-asoc-badge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  border: 3px solid var(--accent);
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.login-asoc-img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: 50%;
  background: white;
  padding: 4px;
  border: 3px solid var(--accent);
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.login-header h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.3;
}

.login-header p {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon svg {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  pointer-events: none;
}

.input-with-icon .form-control {
  padding-left: 44px;
}

.mobile-input {
  font-size: 16px !important; /* Evita zoom automático en iOS */
  height: 50px;
  border-radius: 12px;
}

.login-options {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin: 1rem 0 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.btn-block {
  width: 100%;
}

.btn-touch {
  height: 52px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 12px;
}

.login-footer-info {
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

/* ========================================================
   APLICACIÓN Y NAVEGACIÓN
   ======================================================== */
.app-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  background: linear-gradient(135deg, #092e23 0%, #0f4c3a 100%);
  color: white;
  padding: 0.8rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.header-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.asoc-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: white;
  border-radius: 50%;
  padding: 2px;
  border: 2px solid var(--accent);
}

.brand-title h1 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: white;
  line-height: 1.2;
}

.brand-title p {
  font-size: 0.75rem;
  color: #a7f3d0;
  font-weight: 600;
}

.user-session-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
}

.badge-role {
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--accent);
  color: white;
}

.badge-role.admin { background: #d97706; }
.badge-role.delegado { background: #2563eb; }
.badge-role.arbitro { background: #7c3aed; }

.btn-logout {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.8);
}

/* Tabs Desktop */
.nav-tabs {
  display: flex;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
  border-radius: 10px;
  margin-top: 0.75rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: #e2e8f0;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s;
}

.tab-btn.active {
  background: white;
  color: var(--primary-dark);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: white;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
  z-index: 99;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
}

.mobile-nav-item {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 0;
  cursor: pointer;
  transition: color 0.15s;
  gap: 3px;
}

.mobile-nav-item.active {
  color: var(--primary);
  font-weight: 800;
}

.mobile-nav-item svg {
  transition: transform 0.15s;
}

.mobile-nav-item.active svg {
  transform: translateY(-2px);
}

/* ========================================================
   CONTENIDO PRINCIPAL
   ======================================================== */
.main-content {
  max-width: 1300px;
  margin: 1.25rem auto;
  padding: 0 1rem;
  flex: 1;
  width: 100%;
}

@media (max-width: 768px) {
  .main-content {
    margin: 0.8rem auto 80px; /* Espacio para barra inferior */
    padding: 0 0.75rem;
  }
  .desktop-only {
    display: none !important;
  }
  .mobile-bottom-nav {
    display: flex;
  }
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Barra de Estado */
.status-bar {
  background: white;
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-left: 5px solid var(--primary);
}

.status-info {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #ecfdf5;
  color: #065f46;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.8rem;
  border: 1px solid var(--success-border);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4);
}

/* ========================================================
   BUSCADOR Y FORMULARIOS
   ======================================================== */
.search-card {
  background: white;
  border-radius: 12px;
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
  margin-bottom: 0.85rem;
}

.mobile-search-card {
  border: 2px solid #e2e8f0;
}

.search-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-inputs-grid {
  display: grid;
  grid-template-columns: 2.2fr 1.2fr 1fr auto;
  gap: 0.85rem;
  align-items: flex-end;
}

@media (max-width: 850px) {
  .search-inputs-grid {
    grid-template-columns: 1fr 1fr;
  }
  .span-full-mobile {
    grid-column: span 2;
  }
  .search-buttons-row {
    grid-column: span 2;
    display: flex;
    gap: 0.6rem;
  }
}

@media (max-width: 500px) {
  .search-inputs-grid {
    grid-template-columns: 1fr;
  }
  .span-full-mobile {
    grid-column: span 1;
  }
  .search-buttons-row {
    grid-column: span 1;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #334155;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field-large {
  font-size: 16px !important;
  font-weight: 600;
  height: 50px;
  border-radius: 12px;
  padding-right: 38px;
}

.btn-input-clear {
  position: absolute;
  right: 12px;
  background: #cbd5e1;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #334155;
  cursor: pointer;
}

.mobile-select {
  height: 48px;
  font-size: 15px;
  border-radius: 10px;
}

.form-control {
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  outline: none;
  background: #f8fafc;
  color: var(--text-main);
  width: 100%;
  transition: all 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(15, 76, 58, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  border: none;
  font-size: 0.92rem;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-touch-search {
  height: 48px;
  flex: 2;
  font-size: 1rem;
}

.btn-touch-clear {
  height: 48px;
  flex: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: #e2e8f0;
  color: #334155;
}

.btn-outline-primary {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}

/* ========================================================
   TARJETA DE RESULTADO DE JUGADOR (EN CANCHA)
   ======================================================== */
.player-card {
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 2px solid var(--border);
}

.player-card.habilitado {
  border: 3px solid var(--success-border);
}

.player-card.no-habilitado {
  border: 3px solid var(--danger-border);
}

.player-header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.2rem;
  border-radius: 9999px;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.status-indicator.habilitado {
  background: #059669;
  color: white;
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.35);
}

.status-indicator.no-habilitado {
  background: #dc2626;
  color: white;
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.35);
}

.player-body {
  padding: 1.5rem 1.25rem;
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 1.5rem;
  align-items: center;
}

@media (max-width: 768px) {
  .player-body {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.2rem;
  }
  .player-rut {
    margin: 0 auto;
  }
  .card-actions {
    width: 100%;
  }
  .card-actions .btn {
    width: 100%;
    height: 48px;
  }
}

.club-badge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.club-logo-img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  border-radius: 14px;
  padding: 6px;
  background: white;
  border: 2px solid var(--border);
}

.club-logo-placeholder {
  width: 110px;
  height: 110px;
  background: linear-gradient(135deg, #0f4c3a 0%, #1e3a8a 100%);
  color: white;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  border: 2px solid #e2e8f0;
}

.club-badge-name {
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary-dark);
}

.player-details {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.player-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.player-rut {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f0fdf4;
  padding: 0.35rem 0.8rem;
  border-radius: 8px;
  width: fit-content;
  border: 1.5px solid var(--success-border);
}

.player-grid-data {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.data-item {
  background: #f8fafc;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.data-item .label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.data-item .value {
  font-size: 1rem;
  font-weight: 800;
  color: #1e293b;
  margin-top: 2px;
}

.player-pase-history {
  padding: 0.8rem;
  background: #fffbeb;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  font-size: 0.85rem;
  color: #78350f;
  text-align: left;
}

/* ========================================================
   TABLAS Y NÓMINAS
   ======================================================== */
.table-container {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-top: 1.25rem;
  border: 1px solid var(--border);
}

.table-header {
  padding: 0.65rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.table-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
  min-width: 650px;
}

.custom-table th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 800;
  padding: 0.55rem 0.75rem;
  border-bottom: 2px solid var(--border);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.custom-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: #334155;
  vertical-align: middle;
  font-size: 0.86rem;
}

.custom-table tbody tr:hover {
  background-color: #f0fdf4;
}

.mini-club-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
}

.badge-serie {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.78rem;
}

.badge-serie-a { background: #dbeafe; color: #1e40af; }
.badge-serie-c { background: #fef3c7; color: #92400e; }
.badge-serie-f { background: #fce7f3; color: #9d174d; }
.badge-serie-default { background: #e2e8f0; color: #334155; }

/* Empty state */
.empty-state {
  padding: 3rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
}

.empty-icon-box {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.empty-state h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #334155;
  margin-bottom: 0.5rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: white;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}

.stat-card .label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-card .value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-top: 0.2rem;
}

.club-filter-bar {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Upload Area */
.upload-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.upload-box {
  border: 2px dashed #94a3b8;
  border-radius: var(--radius);
  padding: 2.5rem 1.25rem;
  text-align: center;
  cursor: pointer;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.upload-box:hover {
  border-color: var(--primary);
  background: #f0fdf4;
}

.upload-icon {
  width: 54px;
  height: 54px;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

/* Logos Grid */
.logos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.logo-card {
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  border: 1px solid var(--border);
}

.logo-preview-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  background: #f8fafc;
  border-radius: 10px;
  padding: 6px;
  border: 1px solid #e2e8f0;
}

.logo-card-title {
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--primary-dark);
}

.file-input-hidden {
  display: none;
}

/* Modales */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: white;
  border-radius: 16px;
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  padding: 1.8rem;
  position: relative;
}

.modal-close {
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  z-index: 10;
}

.modal-close:hover,
.modal-close:active {
  background: #fee2e2;
  border-color: #f87171;
  color: #dc2626;
  transform: scale(1.08);
}

/* Carnet Imprimible */
.carnet-credential {
  border: 2px solid var(--primary);
  border-radius: 14px;
  overflow: hidden;
  background: white;
}

.carnet-top {
  background: #0f4c3a;
  color: white;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.carnet-body {
  padding: 1.2rem;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.2rem;
  align-items: center;
}

.carnet-footer {
  background: #f8fafc;
  padding: 0.75rem 1.2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

/* Footer */
.app-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 1.5rem 1rem;
  font-size: 0.84rem;
  text-align: center;
  margin-top: auto;
}

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: #1e293b;
  color: white;
  padding: 0.85rem 1.3rem;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  max-width: 90%;
  text-align: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.toast-success { background: #065f46; border-left: 4px solid #10b981; }
.toast.toast-error { background: #7f1d1d; border-left: 4px solid #ef4444; }

@page {
  size: letter portrait;
  margin: 6mm 5mm 6mm 5mm;
}

/* ========================================================
   MODO IMPRESIÓN PROFESIONAL (NÓMINAS Y CARNETS)
   ======================================================== */
@media print {
  html, body {
    background: white !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Ocultar elementos de interfaz web innecesarios en papel */
  .app-header, .mobile-bottom-nav, .search-card, .card-actions, .app-footer, .no-print, .status-bar, .toast, .btn-input-clear, #nomina-club-badge-header, #club-stats-container, .table-header {
    display: none !important;
  }

  /* 1. CUANDO SE IMPRIME CARNET INDIVIDUAL */
  body.printing-carnet .app-layout {
    display: none !important;
  }
  body.printing-carnet #carnet-modal {
    display: block !important;
    position: static !important;
    background: none !important;
    padding: 0 !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  body.printing-carnet #carnet-modal .modal-content {
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
  body.printing-carnet .carnet-share-panel,
  body.printing-carnet .modal-close {
    display: none !important;
  }
  body.printing-carnet .carnet-credential {
    max-width: 500px !important;
    margin: 15px auto !important;
    page-break-inside: avoid !important;
  }

  /* 2. CUANDO SE IMPRIME NÓMINA DE CLUB (ALTA DENSIDAD: 50-60 JUGADORES POR HOJA) */
  body:not(.printing-carnet) #carnet-modal,
  body:not(.printing-carnet) #user-modal {
    display: none !important;
  }

  body:not(.printing-carnet) #tab-clubes {
    display: block !important;
    width: 100% !important;
  }

  body:not(.printing-carnet) #tab-search,
  body:not(.printing-carnet) #tab-pases,
  body:not(.printing-carnet) #tab-users,
  body:not(.printing-carnet) #tab-logos,
  body:not(.printing-carnet) #tab-excel {
    display: none !important;
  }

  /* Encabezado oficial ultra compacto */
  .print-only {
    display: block !important;
  }

  .nomina-print-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1.5px solid #0f4c3a !important;
    padding-bottom: 3px !important;
    margin-bottom: 3px !important;
  }

  .table-container {
    display: block !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .table-responsive {
    overflow: visible !important;
  }

  .custom-table {
    width: 100% !important;
    font-size: 7.2pt !important;
    line-height: 1.15 !important;
    border-collapse: collapse !important;
  }

  .custom-table th, .custom-table td {
    border: 0.65px solid #64748b !important;
    padding: 1.2px 3.5px !important;
    color: #000000 !important;
    height: auto !important;
  }

  .custom-table th:nth-child(1), .custom-table td:nth-child(1) { width: 20px !important; text-align: center !important; white-space: nowrap !important; }
  .custom-table th:nth-child(2), .custom-table td:nth-child(2) { width: 75px !important; min-width: 75px !important; white-space: nowrap !important; word-break: keep-all !important; }
  .custom-table th:nth-child(4), .custom-table td:nth-child(4) { width: 30px !important; text-align: center !important; white-space: nowrap !important; }
  .custom-table th:nth-child(5), .custom-table td:nth-child(5) { width: 58px !important; white-space: nowrap !important; }
  .custom-table th:nth-child(6), .custom-table td:nth-child(6) { width: 42px !important; white-space: nowrap !important; }
  .custom-table th:nth-child(7), .custom-table td:nth-child(7) { width: 58px !important; white-space: nowrap !important; }
  .custom-table th:nth-child(8), .custom-table td:nth-child(8) { width: 52px !important; text-align: center !important; white-space: nowrap !important; }

  .custom-table th {
    background: #e2e8f0 !important;
    font-weight: 800 !important;
    font-size: 7pt !important;
    text-transform: uppercase !important;
  }

  .custom-table tr {
    page-break-inside: avoid !important;
  }

  .custom-table tr:nth-child(even) {
    background: #f8fafc !important;
  }

  .status-badge {
    border: 0.5px solid #059669 !important;
    color: #065f46 !important;
    background: #ecfdf5 !important;
    font-size: 6.5pt !important;
    font-weight: 700 !important;
    padding: 0.5px 3px !important;
    border-radius: 2px !important;
  }

  .badge-serie {
    border: 0.5px solid #94a3b8 !important;
    font-size: 6.8pt !important;
    padding: 0.5px 3px !important;
    font-weight: 700 !important;
    border-radius: 2px !important;
  }

  .nomina-print-signatures {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
    page-break-inside: avoid !important;
    text-align: center;
  }

  .sig-line {
    border-top: 1px solid #000000;
    margin-top: 25px;
    padding-top: 2px;
    font-size: 7.5pt;
    font-weight: bold;
    color: #000000;
  }
}