:root {
  --green-dark: #064e3b;
  --green-primary: #15803d;
  --green-bright: #22c55e;
  --green-accent: #16a34a;
  --green-soft: #dcfce7;
  --gold: #eab308;
  --red: #ef4444;
  --blue: #2563eb;
  --orange: #f97316;
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 14px 34px rgba(6, 78, 59, 0.18);
  --radius-md: 14px;
  --radius-lg: 20px;
}

body.dark-theme {
  --bg-page: #0b131e;
  --bg-card: #162232;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #263548;
  --green-soft: rgba(34, 197, 94, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: 85px;
  overflow-x: hidden;
}

/* Desktop + Mobile responsive wrapper */
.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* TOP NAVBAR */
.top-navbar {
  background: linear-gradient(135deg, #052e16 0%, #15803d 60%, #16a34a 100%);
  color: #ffffff;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.top-navbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.navbar-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
  padding: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.navbar-title-wrap {
  display: flex;
  flex-direction: column;
}

.navbar-title {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.3px;
  line-height: 1.15;
}

.navbar-nit {
  font-size: 0.74rem;
  color: #bbf7d0;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.top-navbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-pill {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.3);
}

.role-pill.admin {
  background: #eab308;
  color: #0f172a;
}

.role-pill.public {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

/* SIDEBAR DRAWER (Estilo Copa Fácil + Corporación Polo Deportes) */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: none;
}

.drawer-backdrop.open {
  display: block;
}

.side-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 310px;
  max-width: 86vw;
  background: var(--bg-card);
  z-index: 210;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 6px 0 30px rgba(0, 0, 0, 0.3);
  overflow-y: auto;
}

.side-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  background: linear-gradient(145deg, #0f172a 0%, #064e3b 100%);
  color: #fff;
  padding: 20px 16px;
}

.drawer-account-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.drawer-account-card:hover {
  background: rgba(255, 255, 255, 0.16);
}

.drawer-account-card img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  padding: 3px;
  object-fit: contain;
}

.drawer-section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 700;
  padding: 16px 18px 6px;
}

.drawer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.94rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  transition: background 0.15s;
}

.drawer-item:hover {
  background: var(--green-soft);
}

.drawer-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-item-icon {
  width: 28px;
  text-align: center;
  font-size: 1.1rem;
}

/* STADIUM HERO BANNER (Imagen 1 de referencia) */
.stadium-hero {
  position: relative;
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.96) 0%, rgba(240, 253, 244, 0.90) 42%, rgba(21, 128, 61, 0.92) 85%, #052e16 100%);
  border-radius: 0 0 28px 28px;
  padding: 24px 18px 26px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: 20px;
  border-bottom: 4px solid #22c55e;
}

.stadium-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(22, 163, 74, 0.06) 0px,
      rgba(22, 163, 74, 0.06) 24px,
      transparent 24px,
      transparent 48px
    );
  pointer-events: none;
}

.hero-top-wave {
  position: relative;
  z-index: 2;
  max-width: 680px;
  margin: 0 auto;
}

.hero-logo-box {
  width: 118px;
  height: 118px;
  margin: 0 auto 10px;
  background: #ffffff;
  border-radius: 26px;
  padding: 8px;
  box-shadow: 0 10px 28px rgba(6, 78, 59, 0.25);
  border: 3px solid #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-corp-title {
  font-size: 1.55rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.15;
}

.hero-nit-badge {
  display: inline-block;
  margin-top: 6px;
  background: #064e3b;
  color: #fef08a;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 4px 14px;
  border-radius: 999px;
  letter-spacing: 0.6px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.18);
}

.hero-slogan {
  margin-top: 8px;
  font-size: 1.05rem;
  font-weight: 800;
  font-style: italic;
  color: #1e3a8a;
  text-shadow: 0 1px 0 rgba(255,255,255,0.8);
}

.hero-platform-pill {
  margin: 14px auto 0;
  max-width: 420px;
  background: linear-gradient(135deg, #064e3b 0%, #14532d 100%);
  color: #ffffff;
  padding: 11px 20px;
  border-radius: 16px;
  border: 2px solid #4ade80;
  box-shadow: 0 8px 20px rgba(5, 46, 22, 0.35);
}

.hero-platform-pill h2 {
  font-size: 1.25rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.8px;
}

.hero-platform-pill p {
  font-size: 0.82rem;
  color: #bbf7d0;
  margin-top: 2px;
}

.modality-tags {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.modality-tag {
  background: rgba(255, 255, 255, 0.9);
  color: #064e3b;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* MAIN CONTAINER */
.main-content {
  padding: 0 16px 28px;
  flex: 1;
}

/* STATS COUNTER STRIP (Imagen 4 de referencia) */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.18s, border-color 0.18s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--green-bright);
}

.kpi-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-value {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--green-primary);
  margin-top: 4px;
}

/* ICON GRID MENU (6 + 2 Módulos de Imagen 1, 4 y 5) */
.module-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

@media (max-width: 820px) {
  .module-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 520px) {
  .module-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.module-tile {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 18px;
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}

.module-tile:hover {
  transform: translateY(-4px);
  border-color: var(--green-bright);
  box-shadow: var(--shadow-md);
}

.module-tile-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--green-soft);
}

.module-tile-title {
  font-weight: 800;
  font-size: 0.96rem;
  color: var(--text-main);
}

.module-tile-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* SECTION HEADER BAR */
.section-top-bar {
  background: linear-gradient(135deg, #064e3b 0%, #15803d 100%);
  color: #ffffff;
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 18px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 10px;
}

.section-top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-top-bar h1 {
  font-size: 1.25rem;
  font-weight: 800;
  font-style: italic;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.92rem;
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
}

.btn-green {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.btn-green:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.btn-full {
  width: 100%;
  padding: 13px;
  font-size: 1rem;
  border-radius: 999px;
}

.btn-outline {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--green-primary);
  color: var(--green-primary);
}

.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 9px;
}

/* SEARCH BAR & FILTERS */
.filter-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input-wrap {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  box-shadow: var(--shadow-sm);
}

.search-input:focus {
  border-color: var(--green-primary);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.select-pill {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
}

/* LIST CARDS (Torneos, Equipos, Jugadores) */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.18s;
}

.list-card:hover {
  transform: translateY(-2px);
  border-color: var(--green-bright);
  box-shadow: var(--shadow-md);
}

.list-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.trophy-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #fef9c3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  flex-shrink: 0;
}

.status-badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
}

.status-Activa, .status-Habilitado {
  background: #16a34a;
  color: #ffffff;
}

.status-Finalizado {
  background: #94a3b8;
  color: #ffffff;
}

.status-Proceso {
  background: #3b82f6;
  color: #ffffff;
}

.status-Vivo {
  background: #dc2626;
  color: #ffffff;
  animation: pulseLive 1.5s infinite;
}

@keyframes pulseLive {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

/* TEAM SHIELD GENERATOR */
.team-shield {
  width: 48px;
  height: 52px;
  border-radius: 10px 10px 24px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.85rem;
  color: #ffffff;
  border: 2px solid #cbd5e1;
  box-shadow: 0 3px 8px rgba(0,0,0,0.18);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

/* PARTIDOS (Imagen 1 abajo izquierda) */
.match-date-banner {
  background: linear-gradient(90deg, #15803d 0%, #16a34a 100%);
  color: #ffffff;
  text-align: center;
  font-weight: 800;
  padding: 10px 16px;
  border-radius: 999px;
  margin-bottom: 8px;
  box-shadow: 0 3px 10px rgba(21, 128, 61, 0.25);
}

.match-venue-sub {
  text-align: center;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-main);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.match-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.match-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.92rem;
}

.match-center-pill {
  background: #16a34a;
  color: #ffffff;
  font-weight: 800;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.92rem;
  text-align: center;
  min-width: 102px;
  box-shadow: 0 3px 8px rgba(22, 163, 74, 0.28);
}

.match-score-box {
  background: #0f172a;
  color: #ffffff;
  font-weight: 900;
  font-size: 1.25rem;
  padding: 7px 18px;
  border-radius: 12px;
  letter-spacing: 2px;
}

/* TABLES (Posiciones, Goleadores, Fair Play) */
.table-wrap {
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

table.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

table.standings-table th {
  background: #064e3b;
  color: #ffffff;
  font-weight: 800;
  padding: 11px 10px;
  text-align: center;
}

table.standings-table th:nth-child(2),
table.standings-table td:nth-child(2) {
  text-align: left;
}

table.standings-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
  font-weight: 600;
}

table.standings-table tr:hover {
  background: var(--green-soft);
}

.pos-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.78rem;
  background: #e2e8f0;
  color: #0f172a;
}

.pos-qualified {
  background: #16a34a;
  color: #ffffff;
}

/* CONTABILIDAD (Imagen 1 abajo centro-derecha) */
.caja-general-banner {
  background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
  color: #ffffff;
  text-align: center;
  padding: 20px;
  border-radius: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  border: 2px solid #34d399;
}

.caja-general-banner p {
  font-size: 0.95rem;
  color: #a7f3d0;
  font-weight: 700;
}

.caja-general-banner h2 {
  font-size: 2.1rem;
  font-weight: 900;
  margin-top: 4px;
}

.accounting-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.acc-tile {
  padding: 16px;
  border-radius: 16px;
  color: #ffffff;
  text-align: center;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s;
}

.acc-tile:hover {
  transform: translateY(-2px);
}

.acc-tile.ingresos { background: linear-gradient(135deg, #16a34a, #22c55e); }
.acc-tile.gastos { background: linear-gradient(135deg, #dc2626, #ef4444); }
.acc-tile.recibos { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.acc-tile.reportes { background: linear-gradient(135deg, #ea580c, #f59e0b); }

/* CARNETS DIGITALES E IMPRESIÓN POR EQUIPOS */
.carnet-selection-bar {
  background: var(--bg-card);
  border: 2px solid var(--green-primary);
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.carnet-team-section {
  margin-bottom: 28px;
}

.carnet-team-header {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 6px solid var(--team-primary, #16a34a);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.carnets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(324px, max-content));
  gap: 14px;
  justify-content: start;
}

.carnet-card {
  width: 85.6mm;
  background: transparent;
  display: flex;
  flex-direction: column;
  position: relative;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.carnet-cedula-frame {
  width: 85.6mm;
  height: 54mm;
  background: #ffffff;
  border: 2px solid var(--team-primary, #15803d);
  border-radius: 3.2mm;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  color: #0f172a;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.carnet-card.selected-for-print .carnet-cedula-frame {
  box-shadow: 0 0 0 3px #22c55e, var(--shadow-md);
}

.carnet-card-toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 4px 8px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 0.72rem;
}

.carnet-check-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}

.carnet-check-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #16a34a;
  cursor: pointer;
}

.carnet-header {
  background: var(--team-header-bg, linear-gradient(135deg, #064e3b 0%, #15803d 100%));
  color: var(--team-header-text, #ffffff);
  height: 9.2mm;
  padding: 0 2.2mm;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5mm;
  border-bottom: 0.6mm solid var(--team-accent, #eab308);
  flex-shrink: 0;
  box-sizing: border-box;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.carnet-header img.corp-logo {
  width: 6.6mm;
  height: 6.6mm;
  border-radius: 1.2mm;
  background: #fff;
  padding: 0.3mm;
  object-fit: contain;
  flex-shrink: 0;
}

.carnet-team-pill {
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  font-weight: 900;
  font-size: 5.5pt;
  line-height: 1.05;
  padding: 0.7mm 1.6mm;
  border-radius: 1.5mm;
  display: inline-flex;
  align-items: center;
  gap: 1mm;
  max-width: 31mm;
  box-shadow: 0 1px 3px rgba(0,0,0,0.16);
  text-align: left;
}

.carnet-body {
  padding: 1.4mm 2.2mm 1.2mm;
  display: flex;
  gap: 2.2mm;
  align-items: stretch;
  background: var(--team-body-bg, linear-gradient(145deg, #ffffff 0%, #f8fafc 100%));
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
}

.carnet-left-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 17.5mm;
  flex-shrink: 0;
}

.carnet-photo-wrap {
  width: 17.5mm;
  height: 21mm;
  border-radius: 1.8mm;
  border: 0.5mm solid var(--team-primary, #16a34a);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--team-primary, #15803d);
  color: #fff;
  font-weight: 900;
  font-size: 11pt;
  position: relative;
  flex-shrink: 0;
}

.carnet-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carnet-dorsal-badge {
  background: var(--team-primary, #15803d);
  color: var(--team-header-text, #ffffff);
  font-weight: 900;
  font-size: 5.8pt;
  padding: 0.5mm 1mm;
  border-radius: 999px;
  border: 0.35mm solid var(--team-accent, #eab308);
  width: 100%;
  text-align: center;
  white-space: nowrap;
  box-sizing: border-box;
}

.carnet-validity-left {
  width: 100%;
  background: #f8fafc;
  border: 0.3mm solid #cbd5e1;
  border-left: 0.7mm solid var(--team-primary, #15803d);
  border-radius: 1mm;
  padding: 0.4mm 0.8mm;
  text-align: center;
  box-sizing: border-box;
}

.carnet-info-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.carnet-player-name {
  font-size: 8.2pt;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.05;
  text-transform: uppercase;
  border-bottom: 0.4mm solid var(--team-primary, #15803d);
  padding-bottom: 0.5mm;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carnet-data-rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8mm 1.3mm;
}

.carnet-data-item {
  background: rgba(255, 255, 255, 0.92);
  border: 0.25mm solid #cbd5e1;
  border-left: 0.7mm solid var(--team-primary, #16a34a);
  border-radius: 1mm;
  padding: 0.5mm 1.2mm;
  box-sizing: border-box;
}

.carnet-data-label {
  font-size: 4.6pt;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748b;
  display: block;
  line-height: 1.05;
}

.carnet-data-value {
  font-size: 6.2pt;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.carnet-bottom-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5mm;
  margin-top: 0.4mm;
}

.interbarrios-badge {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.6mm 1.4mm;
  border-radius: 1.2mm;
  font-size: 5.4pt;
  font-weight: 900;
  line-height: 1.1;
  flex: 1;
  min-width: 0;
}

.interbarrios-badge.yes {
  background: #dcfce7;
  color: #14532d;
  border: 0.3mm solid #16a34a;
}

.interbarrios-badge.no {
  background: #f1f5f9;
  color: #334155;
  border: 0.3mm solid #cbd5e1;
}

.carnet-signature-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 29mm;
  flex-shrink: 0;
  text-align: center;
}

.carnet-signature-img {
  height: 5.6mm;
  max-width: 27mm;
  object-fit: contain;
  display: block;
}

.carnet-signature-line {
  width: 100%;
  border-top: 0.3mm solid #0f172a;
  padding-top: 0.2mm;
  font-size: 4.5pt;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: 0.1px;
  text-transform: uppercase;
  white-space: nowrap;
}

.carnet-footer {
  background: var(--team-footer-bg, #0f172a);
  color: #ffffff;
  height: 4.2mm;
  font-size: 5pt;
  padding: 0 2.2mm;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  border-top: 0.4mm solid var(--team-accent, #eab308);
  flex-shrink: 0;
  box-sizing: border-box;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* Photo upload box in Modal */
.photo-upload-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 2px dashed var(--border-color);
  border-radius: 14px;
  background: var(--bg-page);
  margin-bottom: 14px;
}

.photo-preview-thumb {
  width: 76px;
  height: 90px;
  border-radius: 10px;
  border: 2px solid var(--green-primary);
  object-fit: cover;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
  overflow: hidden;
}

.photo-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* TABS SUB-NAVIGATION */
.tabs-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 16px;
}

.tab-btn {
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.86rem;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.tab-btn.active {
  background: #15803d;
  color: #ffffff;
  border-color: #15803d;
}

/* BOTTOM NAVIGATION BAR (Estilo App Móvil de Imagen 1) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  padding: 8px 6px 10px;
  z-index: 120;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 12px;
  transition: all 0.15s;
}

.bottom-nav-item.active {
  color: #16a34a;
  background: var(--green-soft);
}

.bottom-nav-item span.nav-icon {
  font-size: 1.25rem;
}

/* MODAL DIALOG */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(3px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--bg-card);
  border-radius: 20px;
  max-width: 560px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.modal-box.modal-wide {
  max-width: 820px;
}

/* =========================================================================
   FASES, CUADRO ELIMINATORIO (BRACKET), SORTEOS E INSCRIPCIONES
   ========================================================================= */

.phase-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.phase-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  background: var(--bg-page);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.18s ease;
}

.phase-step:hover {
  border-color: var(--green-bright);
  color: var(--text-main);
}

.phase-step.active {
  background: linear-gradient(135deg, #16a34a 0%, #064e3b 100%);
  color: #ffffff;
  border-color: #22c55e;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.28);
}

.phase-step.completed {
  background: var(--green-soft);
  color: #15803d;
  border-color: #22c55e;
}

.phase-arrow {
  color: var(--text-muted);
  font-weight: 900;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* Control bar for Draws & Fixture */
.phase-control-panel {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--green-soft) 100%);
  border: 2px solid var(--green-primary);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.phase-actions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* Group cards grid */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.group-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--green-primary);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.group-card-header {
  background: linear-gradient(135deg, #064e3b 0%, #15803d 100%);
  color: #ffffff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 900;
  font-size: 0.94rem;
}

/* Visual Knockout Bracket */
.bracket-scroll {
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 18px;
}

.bracket-columns {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(255px, 1fr);
  gap: 18px;
  align-items: start;
}

.bracket-col {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.bracket-col-title {
  background: linear-gradient(135deg, #0f172a 0%, #064e3b 100%);
  color: #fef08a;
  font-weight: 900;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 8px 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bracket-match-box {
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 9px 10px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}

.bracket-match-box:hover {
  border-color: var(--green-bright);
}

.bracket-team-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
}

.bracket-team-line.winner {
  background: var(--green-soft);
  color: #14532d;
  font-weight: 900;
}

body.dark-theme .bracket-team-line.winner {
  color: #86efac;
}

.bracket-score-pill {
  min-width: 26px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  text-align: center;
  font-weight: 900;
  font-size: 0.82rem;
}

.champion-banner {
  background: linear-gradient(135deg, #854d0e 0%, #eab308 50%, #ca8a04 100%);
  color: #0f172a;
  border-radius: 18px;
  padding: 18px;
  text-align: center;
  margin-bottom: 18px;
  box-shadow: 0 10px 28px rgba(234, 179, 8, 0.35);
  border: 2px solid #fef08a;
}

/* Draw animation ball */
.draw-spinner-box {
  text-align: center;
  padding: 22px 14px;
  background: linear-gradient(145deg, #064e3b 0%, #0f172a 100%);
  color: #ffffff;
  border-radius: 16px;
  border: 2px solid #eab308;
}

.draw-ball {
  width: 78px;
  height: 78px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fef08a, #eab308 60%, #a16207 100%);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  box-shadow: 0 0 24px rgba(234, 179, 8, 0.6);
  animation: bounceSpin 0.65s infinite alternate;
}

@keyframes bounceSpin {
  0% { transform: translateY(0) scale(1) rotate(-8deg); }
  100% { transform: translateY(-8px) scale(1.06) rotate(8deg); }
}

/* Inscription status badges & boxes */
.status-pendiente {
  background: #f59e0b;
  color: #ffffff;
}

.status-en_revision {
  background: #2563eb;
  color: #ffffff;
}

.status-devuelta {
  background: #ea580c;
  color: #ffffff;
}

.status-aceptada {
  background: #16a34a;
  color: #ffffff;
}

.status-rechazada {
  background: #dc2626;
  color: #ffffff;
}

.notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 900;
  margin-left: 4px;
}

.correction-alert-box {
  background: rgba(234, 88, 12, 0.12);
  border: 2px solid #ea580c;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  color: var(--text-main);
}

.ins-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 9px 12px;
  margin-bottom: 8px;
}

.phase-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(22, 163, 74, 0.14);
  color: #15803d;
  border: 1px solid rgba(22, 163, 74, 0.35);
}

body.dark-theme .phase-pill-tag {
  color: #86efac;
}

/* =========================================================================
   SELECTOR DE PARTIDOS POR FECHAS (ESTILO COPA FÁCIL)
   ========================================================================= */
.cf-view-toggle {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}

.cf-view-toggle button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.78rem;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.cf-view-toggle button.active {
  background: linear-gradient(135deg, #16a34a 0%, #064e3b 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

.cf-round-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(135deg, #064e3b 0%, #15803d 100%);
  color: #ffffff;
  border-radius: 18px;
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-md);
}

.cf-round-arrow {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.16s ease;
}

.cf-round-arrow:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(1.04);
}

.cf-round-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.cf-round-center {
  text-align: center;
  flex: 1;
  min-width: 0;
}

.cf-round-title {
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #fef08a;
}

.cf-round-sub {
  font-size: 0.78rem;
  color: #dcfce7;
  font-weight: 700;
  margin-top: 2px;
}

.cf-round-pills {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}

.cf-round-pill {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 800;
  font-size: 0.8rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cf-round-pill:hover {
  border-color: var(--green-bright);
}

.cf-round-pill.active {
  background: #15803d;
  color: #ffffff;
  border-color: #15803d;
  box-shadow: 0 3px 10px rgba(21, 128, 61, 0.28);
}

.cf-round-pill .pill-count {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
}

.cf-round-pill.active .pill-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fef08a;
}

.cf-round-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 5px solid #16a34a;
  border-radius: 14px;
  padding: 10px 14px;
  margin: 16px 0 10px;
  box-shadow: var(--shadow-sm);
}

/* =========================================================================
   ADAPTACIÓN COMPLETA A CUALQUIER PANTALLA (MÓVILES PEQUEÑOS, GRANDES, TABLETS)
   ========================================================================= */
html {
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
}

.top-navbar {
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  gap: 8px;
}

.top-navbar-left {
  min-width: 0;
  flex: 1;
}

.navbar-brand {
  min-width: 0;
  flex: 1;
}

.navbar-title-wrap {
  min-width: 0;
  flex: 1;
}

.navbar-title,
.navbar-nit {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-navbar-right {
  flex-shrink: 0;
}

.role-pill {
  max-width: 210px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.groups-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.carnets-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 324px), max-content));
  max-width: 100%;
}

.carnet-team-section {
  max-width: 100%;
  overflow-x: auto;
}

.table-wrap {
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.tabs-bar,
.phase-stepper,
.cf-round-pills,
.bracket-scroll {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.bottom-nav {
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom, 0px));
  gap: 2px;
}

.bottom-nav-item {
  flex: 1;
  min-width: 0;
  padding: 4px 2px;
  text-align: center;
}

.bottom-nav-item span:last-child {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-card {
  flex-wrap: wrap;
}

.list-card-left {
  min-width: 0;
  flex: 1 1 200px;
}

.list-card-left > div {
  min-width: 0;
  word-break: break-word;
}

.modal-box {
  max-height: 90dvh;
}

/* Tablets y móviles medianos (<= 768px) */
@media (max-width: 768px) {
  .main-content {
    padding: 0 12px 24px;
  }

  .stadium-hero {
    padding: 18px 14px 20px;
    border-radius: 0 0 22px 22px;
  }

  .hero-logo-box {
    width: 96px;
    height: 96px;
    border-radius: 20px;
  }

  .hero-corp-title {
    font-size: 1.28rem;
  }

  .hero-slogan {
    font-size: 0.94rem;
  }

  .section-top-bar {
    padding: 12px 14px;
    margin: 10px 0 14px;
  }

  .section-top-bar h1 {
    font-size: 1.06rem;
  }

  .filter-row {
    gap: 8px;
  }

  .search-input-wrap {
    min-width: 0;
    flex: 1 1 100%;
  }

  .select-pill {
    max-width: 100%;
    font-size: 0.84rem;
    padding: 8px 12px;
  }

  .bracket-columns {
    grid-auto-columns: minmax(230px, 84vw);
  }
}

/* Teléfonos estándar y compactos (<= 560px) */
@media (max-width: 560px) {
  .top-navbar {
    padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    border-radius: 10px;
  }

  .navbar-logo {
    width: 34px;
    height: 34px;
  }

  .navbar-title {
    font-size: 0.86rem;
  }

  .navbar-nit {
    font-size: 0.64rem;
  }

  .role-pill {
    max-width: 125px;
    font-size: 0.68rem;
    padding: 4px 8px;
  }

  .main-content {
    padding: 0 10px 20px;
  }

  .kpi-card {
    padding: 11px 12px;
  }

  .kpi-value {
    font-size: 1.35rem;
  }

  .module-grid {
    gap: 10px;
  }

  .module-tile {
    padding: 13px 8px;
    border-radius: 14px;
  }

  .module-tile-icon {
    width: 48px;
    height: 48px;
    font-size: 1.65rem;
  }

  .module-tile-title {
    font-size: 0.86rem;
  }

  .list-card {
    padding: 12px;
    gap: 10px;
    border-radius: 14px;
  }

  .trophy-icon {
    width: 42px;
    height: 42px;
    font-size: 1.45rem;
  }

  .match-card {
    padding: 12px 10px;
  }

  .match-row {
    gap: 6px;
  }

  .match-team {
    font-size: 0.78rem;
    min-width: 0;
    word-break: break-word;
  }

  .match-center-pill {
    min-width: 74px;
    padding: 5px 10px;
    font-size: 0.78rem;
  }

  .match-score-box {
    font-size: 1.05rem;
    padding: 5px 12px;
  }

  table.standings-table {
    font-size: 0.76rem;
  }

  table.standings-table th,
  table.standings-table td {
    padding: 8px 5px;
  }

  .accounting-tiles {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .acc-tile {
    padding: 12px 8px;
    font-size: 0.84rem;
  }

  .caja-general-banner {
    padding: 14px 12px;
  }

  .caja-general-banner h2 {
    font-size: 1.55rem;
  }

  .modal-overlay {
    padding: 8px;
    align-items: flex-end;
  }

  .modal-box,
  .modal-box.modal-wide {
    max-width: 100%;
    padding: 15px 13px;
    border-radius: 18px 18px 12px 12px;
    max-height: 92dvh;
  }

  .form-row {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  .photo-upload-box {
    flex-direction: column;
    text-align: center;
  }

  .cf-round-nav {
    padding: 10px;
    gap: 8px;
  }

  .cf-round-arrow {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .cf-round-title {
    font-size: 0.94rem;
  }

  .cf-round-sub {
    font-size: 0.7rem;
  }

  .cf-view-toggle {
    width: 100%;
  }

  .cf-view-toggle button {
    flex: 1;
    font-size: 0.72rem;
    padding: 6px 8px;
  }

  .bottom-nav-item {
    font-size: 0.64rem;
  }

  .bottom-nav-item span.nav-icon {
    font-size: 1.15rem;
  }
}

/* Teléfonos muy pequeños (<= 360px) */
@media (max-width: 360px) {
  .navbar-nit {
    display: none;
  }

  .role-pill {
    max-width: 96px;
  }

  .hero-corp-title {
    font-size: 1.1rem;
  }

  .bottom-nav-item {
    font-size: 0.58rem;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.form-group {
  margin-bottom: 13px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-page);
  color: var(--text-main);
  font-size: 0.94rem;
  outline: none;
}

.form-control:focus {
  border-color: var(--green-primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* PRINT STYLES (Tamaño Exacto Cédula de Ciudadanía Colombia: 85.6mm x 54mm) */
@media print {
  @page {
    margin: 8mm;
  }
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .top-navbar, .bottom-nav, .section-top-bar, .no-print, .filter-row, .carnet-selection-bar, .carnet-card-toolbar, .carnet-team-header {
    display: none !important;
  }
  body {
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .app-shell {
    max-width: 100% !important;
  }
  .main-content {
    padding: 0 !important;
  }
  .carnets-grid {
    grid-template-columns: repeat(2, 85.6mm) !important;
    justify-content: center !important;
    gap: 4mm 6mm !important;
  }
  .carnet-card {
    width: 85.6mm !important;
    height: 54mm !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    box-shadow: none !important;
  }
  .carnet-cedula-frame {
    width: 85.6mm !important;
    height: 54mm !important;
    box-shadow: none !important;
  }
  .carnet-team-section {
    margin-bottom: 4mm !important;
  }
  body.print-selected-only .carnet-card:not(.selected-for-print) {
    display: none !important;
  }
  body.print-selected-only .carnet-team-section:not(.has-selected-for-print) {
    display: none !important;
  }

  /* Impresión limpia de un solo documento / reglamento oficial (oculta toda la app y botones) */
  body.printing-document .app-shell,
  body.printing-document .modal-overlay {
    display: none !important;
  }
  body.printing-document #doc-print-sheet {
    display: block !important;
    padding: 6mm 10mm !important;
    color: #0f172a !important;
    background: #ffffff !important;
  }
}

.doc-print-sheet {
  display: none;
}

.doc-sheet-header {
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 2.5px solid #15803d;
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.doc-sheet-header img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 10px;
  border: 2px solid #16a34a;
  padding: 3px;
}

.doc-sheet-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 6px;
}

.doc-sheet-meta {
  display: inline-block;
  background: #dcfce7;
  color: #14532d;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.doc-sheet-body {
  font-size: 0.96rem;
  line-height: 1.65;
  white-space: pre-wrap;
  color: #1e293b;
}

.doc-sheet-footer {
  margin-top: 34px;
  padding-top: 14px;
  border-top: 1px dashed #cbd5e1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.print-page-section {
  background: #ffffff;
  color: #0f172a;
  padding-bottom: 10px;
}

.print-page-section + .print-page-section {
  page-break-before: always;
  break-before: page;
}

.print-official-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-top: 10px;
}

.print-official-table th {
  background: #064e3b;
  color: #ffffff;
  border: 1px solid #064e3b;
  padding: 6px 5px;
  text-align: center;
  font-weight: 800;
}

.print-official-table td {
  border: 1px solid #cbd5e1;
  padding: 5px;
  text-align: center;
  color: #0f172a;
}

.print-official-table td.left {
  text-align: left;
}

.print-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0 14px;
}

.print-kpi-box {
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}
