/* ============================================
   ESTILO OFICIAL TALLERES DE CÓRDOBA
   ============================================ */

/* Paleta de Colores Oficial */
:root {
  --talleres-red: #8B1538;
  --talleres-red-dark: #6d1029;
  --talleres-red-light: #a91d47;
  --talleres-blue: #0a1628;
  --talleres-blue-light: #1a2942;
  --talleres-blue-lighter: #2a3a52;
  
  --bg-main: #0a1628;
  --bg-card: #1a2942;
  --primary: #8B1538;
  --primary-alt: #a91d47;
  --text-main: #ffffff;
  --text-muted: #b0b8c4;
  --border-soft: #2a3a52;
  --danger: #dc2626;
  --success: #10b981;

  /* Layout variables */
  --sidebar-width: 250px;
  --sidebar-logo-height: 88px;
  --content-padding-desktop: 32px;
  --content-padding-laptop: 24px;
  --nav-item-height: 48px;
  --nav-item-gap: 8px;
  --nav-border-radius: 10px;
  --subnav-control-height: 47.5px;
  --module-btn-min-height: 44px;
  --module-btn-padding-y: 0.6rem;
  --module-btn-padding-x: 1.2rem;
  --module-btn-font-size: 0.95rem;
}

/* Reset Básico */
*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

html {
  scrollbar-gutter: stable;
}

body {
  font-family: 'Montserrat', 'Roboto', system-ui, -apple-system, sans-serif;
  background-color: var(--talleres-blue);
  background-image: url('/img/Fondo.svg');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  color: var(--text-main);
  font-weight: 500;
  line-height: 1.6;
}

/* Layout solo en páginas con sidebar */
body.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-areas: "sidebar main";
}

/* Sidebar Navigation */
.sidebar-nav {
  grid-area: sidebar;
  width: var(--sidebar-width);
  position: fixed;
  inset: 0 auto 0 0;
  height: 100vh;
  overflow-y: auto;
  background: #1A294299;
  backdrop-filter: blur(10px);
  border-right: 2px solid var(--border-soft);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: var(--nav-item-gap);
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px 16px 8px;
  margin-bottom: 4px;
  border-bottom: 2px solid var(--border-soft);
}

.sidebar-logo img {
  display: block;
  max-width: 100%;
  max-height: var(--sidebar-logo-height);
  height: auto;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px #00000059);
}

.sidebar-nav a {
  position: relative;
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0 16px;
  height: var(--nav-item-height);
  border-radius: var(--nav-border-radius);
  border: 2px solid transparent;
  background-color: var(--talleres-red);
  transition: all 0.2s ease-out;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav a:hover {
  border-color: var(--talleres-red);
  background-color: var(--talleres-red-light);
  box-shadow: 0 4px 15px #8B153880;
  transform: translateX(4px);
}

.sidebar-nav a:focus {
  outline: 2px solid var(--talleres-red);
  outline-offset: 2px;
}

.sidebar-nav a.active {
  background-color: var(--talleres-red-light);
  border-color: var(--talleres-red-light);
  box-shadow: 0 4px 15px #8B153899;
}

.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 999px;
  background-color: var(--primary);
}

/* Toggle móvil/tablet */
.sidebar-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  background: #1A2942CC;
  color: var(--text-main);
  border: 2px solid var(--border-soft);
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.sidebar-toggle:hover {
  border-color: var(--talleres-red);
  background: #8B15381A;
  transform: translateY(-1px);
}

.sidebar-toggle:focus {
  outline: 2px solid var(--talleres-red);
  outline-offset: 2px;
}

.sidebar-toggle .icon {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: #00000059;
  backdrop-filter: blur(2px);
  z-index: 90;
}

body.sidebar-open .sidebar-backdrop {
  display: block;
}

/* Container Principal */
.main-content {
  grid-area: main;
  width: 100%;
  padding: var(--content-padding-desktop);
  min-height: 100vh;
}

.container {
  max-width: 100%;
  margin: 0;
  padding: 2rem;
  background-color: #1A294299;
  border-radius: 20px;
  box-shadow: 0 20px 60px #000000CC, 0 0 0 1px #8B153833;
  backdrop-filter: blur(10px);
}

/* Dashboard loading */
.dashboard-loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 22, 40, 0.7);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 200;
}

body.dashboard-loading .dashboard-loading-overlay {
  opacity: 1;
  visibility: visible;
}

body.dashboard-loading .main-content {
  opacity: 0;
  pointer-events: none;
}

.dashboard-loading-card {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-radius: 14px;
  background: rgba(26, 41, 66, 0.9);
  border: 2px solid var(--border-soft);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dashboard-loading-spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(139, 21, 56, 0.3);
  border-top-color: var(--talleres-red);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Optional max-width for forms/reading content */
.container.narrow {
  max-width: 1440px;
  margin: 0 auto;
}

/* Títulos - Estilo Talleres Bold */
h1, h2, h3 {
  margin-top: 0;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-main);
}

h1 {
  font-size: 2.2rem;
  font-weight: 900;
}

h2 {
  font-size: 1.6rem;
  font-weight: 800;
}

h3 {
  font-size: 1.3rem;
  font-weight: 700;
}

/* Navegación */
nav {
  /* Hidden by default - sidebar replaces it */
  display: none;
}

/* Formularios */
form {
  margin-top: 0.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-compact {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 900px;
}

.form-compact .form-group {
  margin-bottom: 0;
}

.form-compact .form-group.full-width {
  grid-column: 1 / -1;
}


@media (max-width: 768px) {
  .form-compact {
    grid-template-columns: 1fr;
  }
}

label {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text-muted);
}

input[type="text"],
input[type="number"],
input[type="datetime-local"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 2px solid var(--talleres-red);
  background-color: #1A2942CC;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease-out;
  box-shadow: 0 2px 8px rgba(139, 21, 56, 0.2);
}

#personasSearch,
#colaboradoresSearch {
  text-align: left;
}

#personasSearch::placeholder,
#colaboradoresSearch::placeholder {
  text-align: left;
}

/* Mejorar estilo de select */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 1.2em;
  padding-right: 2.5rem;
  cursor: pointer;
  font-weight: 600;
  background-color: #0a1628;
  border: 2px solid var(--talleres-red);
}

select:hover {
  border-color: var(--talleres-red-light);
  background-color: #1a2942;
  box-shadow: 0 4px 12px rgba(139, 21, 56, 0.4);
  transform: translateY(-1px);
}

select:focus {
  border-color: var(--talleres-red-light);
  box-shadow: 0 0 0 3px rgba(139, 21, 56, 0.3), 0 4px 12px rgba(139, 21, 56, 0.4);
}

/* Mejorar opciones del dropdown del select */
select option {
  background-color: #0a1628;
  color: var(--text-main);
  padding: 0.85rem 1rem;
  font-weight: 600;
  font-size: 1rem;
  border-bottom: 1px solid rgba(139, 21, 56, 0.3);
  min-height: 42px;
  line-height: 1.5;
}

select option:first-child {
  border-top: 2px solid var(--talleres-red);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  margin-top: 2px;
}

select option:last-child {
  border-bottom: 2px solid var(--talleres-red);
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  margin-bottom: 2px;
}

select option:hover,
select option:focus {
  background-color: var(--talleres-red-dark);
  color: white;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

select option:checked,
select option[selected] {
  background-color: var(--talleres-red);
  background: linear-gradient(90deg, var(--talleres-red) 0%, var(--talleres-red-light) 100%);
  color: white;
  font-weight: 700;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--talleres-red);
  box-shadow: 0 0 0 3px #8B153833;
  background-color: #1A2942F2;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  border: 2px solid var(--talleres-blue-lighter);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease-out;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-primary {
  background-color: var(--talleres-red);
  border-color: var(--talleres-red);
  color: white;
}

input[type="date"],
input[type="time"] {
  color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.8;
}

.btn-primary:hover {
  background-color: var(--talleres-red-light);
  box-shadow: 0 8px 25px #8B153899;
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: transparent;
  border-color: var(--talleres-blue-lighter);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: var(--talleres-blue-light);
  border-color: var(--talleres-blue-lighter);
  box-shadow: 0 6px 18px rgba(139, 21, 56, 0.25);
}

.btn-ghost {
  background-color: transparent;
  border-color: var(--talleres-blue-lighter);
  color: var(--text-main);
  box-shadow: none;
}

.btn-ghost:hover {
  background: #1A294266;
  border-color: var(--talleres-blue-lighter);
  box-shadow: 0 6px 18px rgba(139, 21, 56, 0.2);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.btn-edit {
  background-color: var(--talleres-blue-light);
  border-color: var(--talleres-blue-lighter);
  color: white;
}

.btn-edit:hover {
  background-color: var(--talleres-blue-lighter);
  box-shadow: 0 8px 20px rgba(26, 41, 66, 0.45);
  transform: translateY(-2px);
}

.btn-delete {
  background-color: transparent;
  border-color: var(--talleres-blue-lighter);
  color: var(--text-muted);
}

.btn-delete:hover {
  background-color: var(--talleres-blue-light);
  border-color: var(--talleres-blue-lighter);
  color: var(--text-main);
  box-shadow: 0 8px 20px rgba(139, 21, 56, 0.25);
  transform: translateY(-2px);
}

.btn-cancel {
  background-color: var(--talleres-blue-light);
  border-color: var(--talleres-blue-lighter);
  color: var(--text-main);
}

.btn-cancel:hover {
  background-color: var(--talleres-blue-lighter);
  border-color: var(--talleres-blue-lighter);
  box-shadow: 0 8px 20px rgba(139, 21, 56, 0.2);
  transform: translateY(-2px);
}

/* Bloques y Textos */
.block {
  margin-top: 1.5rem;
  overflow-x: visible;
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.text-danger {
  color: var(--danger);
  font-weight: 600;
}

.text-success {
  color: var(--success);
  font-weight: 600;
}

.text-info {
  color: #3b82f6;
  font-weight: 600;
}

/* Tablas */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 520px;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
}

th {
  position: relative;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background-color: #1A2942CC;
}

tbody tr {
  transition: all 0.2s ease-out;
}

tbody tr:nth-child(even) {
  background-color: #1A294266;
}

tbody tr:nth-child(odd) {
  background-color: #1A294233;
}

tbody tr:hover {
  background-color: #8B153826;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px #8B15384C;
}

td.actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

td.actions .btn {
  margin: 0;
}

/* Table filters */
.th-cell {
  position: relative;
  width: 100%;
  display: block;
  text-align: center;
}

.th-cell > span {
  display: block;
  padding: 0 28px;
}

.th-filter-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

th:hover .th-filter-btn,
th:focus-within .th-filter-btn {
  opacity: 1;
  pointer-events: auto;
}

.th-filter-btn:hover,
.th-filter-btn:focus {
  color: var(--text-main);
  background: #1A294266;
  border-color: var(--border-soft);
}

.th-filter-btn .icon {
  margin: 0;
  width: 0.95rem;
  height: 0.95rem;
}

.th-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  background-color: #0a1628;
  border: 2px solid var(--border-soft);
  border-radius: 12px;
  padding: 0.4rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 30;
}

.th-filter-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.filter-option {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main);
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s ease-out;
}

.filter-option:hover {
  background: #1A294266;
  border-color: var(--border-soft);
}

.filter-option.is-active {
  background: #8B153826;
  border-color: var(--talleres-red);
  color: var(--text-main);
}

.filter-separator {
  height: 1px;
  background: var(--border-soft);
  margin: 0.35rem 0;
}

.filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.4rem 0 0.85rem 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: #1A294266;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-chip strong {
  color: var(--text-main);
  font-weight: 700;
}

.filter-clear-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s ease-out;
}

.filter-clear-btn:hover {
  background: #8B153826;
  color: var(--text-main);
}

/* List toolbar */
.list-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0.75rem;
  margin: 1rem 0 0.5rem 0;
  overflow-x: auto;
}

.list-toolbar-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.list-toolbar-group--end {
  margin-left: auto;
}

.form-inline {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 180px;
  margin: 0;
}

.form-inline input,
.form-inline select {
  min-height: 40px;
}

.list-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.35rem 0 0.85rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.list-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-top: 0.85rem;
}

.list-pagination .btn {
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
}

.list-pagination .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.list-pagination .page-info {
  padding: 0 0.4rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Shared module layout */
.module-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.module-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.module-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.module-search {
  margin: 0;
  width: min(320px, 100%);
}

.module-search input {
  width: 100%;
}

/* Botones estandar de modulos (referencia: Partidos) */
.module-layout .btn:not(.btn-sm):not(.btn-icon-only) {
  min-height: var(--module-btn-min-height);
  padding: var(--module-btn-padding-y) var(--module-btn-padding-x);
  font-size: var(--module-btn-font-size);
}

/* Igualar botones superiores entre modulos (Partidos/Personal) */
.page-subnav .btn,
.personas-views-tabs .btn,
.module-header-actions .btn {
  min-height: var(--module-btn-min-height);
  padding: var(--module-btn-padding-y) var(--module-btn-padding-x);
  font-size: var(--module-btn-font-size);
  line-height: 1.2;
}

.module-divider {
  margin: 0;
}

.module-top-row {
  margin: 0;
}

.container > .module-top-row > .page-subnav-row,
.container > .module-top-row > .personas-views-tabs {
  margin-top: 0;
}

.partidos-layout {
  gap: 1rem;
}

.partidos-layout .page-subnav-row {
  margin: 0;
  flex-wrap: nowrap;
  align-items: center;
}

.partidos-layout .page-subnav {
  flex: 1 1 auto;
  gap: 0.6rem;
}

.partidos-layout .page-subnav .btn {
  min-width: 170px;
  height: var(--module-btn-min-height);
  min-height: var(--module-btn-min-height);
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
}

.partidos-layout .page-subnav-tools {
  margin-left: auto;
  flex-wrap: nowrap;
  align-items: center;
}

.partidos-layout .page-subnav-tools .module-search {
  width: 220px;
}

.partidos-layout .card {
  margin-bottom: 0;
}

.partidos-layout .card h2 {
  margin-top: 0;
}

.personas-shell {
  gap: 1rem;
}

.personas-shell .page-subnav-row {
  margin: 0;
  flex-wrap: nowrap;
  align-items: center;
}

.personas-shell .page-subnav {
  flex: 1 1 auto;
  gap: 0.6rem;
}

.personas-shell .page-subnav .btn {
  min-width: 170px;
  height: var(--module-btn-min-height);
  min-height: var(--module-btn-min-height);
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
}

.personas-shell .page-subnav-tools {
  margin-left: auto;
  flex-wrap: nowrap;
  align-items: center;
}

.personas-shell .page-subnav-tools .module-search {
  width: 220px;
}

.personas-shell .page-subnav-tools .btn[data-personas-view-tools] {
  width: 260px;
  min-width: 260px;
  justify-content: center;
}

.informes-shell {
  gap: 1rem;
}

.informes-shell .page-subnav-row {
  margin: 0;
  flex-wrap: nowrap;
  align-items: center;
}

.informes-shell .page-subnav {
  flex: 1 1 auto;
  gap: 0.6rem;
}

.informes-shell .page-subnav .btn {
  min-width: 180px;
  height: var(--module-btn-min-height);
  min-height: var(--module-btn-min-height);
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
}

.informes-shell .page-subnav-tools {
  margin-left: auto;
  flex-wrap: nowrap;
  align-items: center;
}

.informes-shell .page-subnav-tools .module-search {
  width: 280px;
}

.reportes-shell {
  gap: 1rem;
}

.reportes-shell .page-subnav-row {
  margin: 0;
  flex-wrap: wrap;
  align-items: center;
}

.reportes-shell .page-subnav {
  flex: 1 1 auto;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.reportes-shell .page-subnav .btn {
  min-width: 150px;
  height: var(--module-btn-min-height);
  min-height: var(--module-btn-min-height);
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
}

[data-reportes-view][hidden] {
  display: none !important;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.inline-check label {
  margin: 0;
}

/* Tarjetas */
.card {
  border-radius: 16px;
  padding: 1.5rem;
  background-color: #1A2942F2;
  border: 2px solid #8B15384C;
  box-shadow: 0 8px 32px #00000066;
  margin-bottom: 1.5rem;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card-header-row h3 {
  margin: 0;
}

.asignaciones-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

#asignacionesCount {
  font-size: 1rem;
  padding: 0.45rem 0.85rem;
}

.modal-card.modal-form {
  max-width: 720px;
}

/* Dashboard Grid - 4 Columnas */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.dashboard-progress {
  grid-column: span 2;
  margin-bottom: 0;
}

.stat-card {
  background-color: #1A2942F2;
  border: 2px solid #8B153866;
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px #0000004C;
}

.stat-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px #8B153880;
  border-color: var(--talleres-red);
}

.stat-card-icon {
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.75rem;
  display: block;
  color: var(--talleres-red);
  filter: drop-shadow(0 2px 8px #8B153866);
}

.stat-card-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.stat-card-value {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1;
  text-shadow: 0 2px 10px #8B153880;
}

.stat-card-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-weight: 500;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success {
  background-color: #10B98133;
  color: #10b981;
  border: 1px solid #10B98166;
}

.badge-danger {
  background-color: #DC262633;
  color: #dc2626;
  border: 1px solid #DC262666;
}

.badge-info {
  background-color: #3B82F633;
  color: #3b82f6;
  border: 1px solid #3B82F666;
}

.badge-warning {
  background-color: #FBBF2433;
  color: #fbbf24;
  border: 1px solid #FBBF2466;
}

/* HR */
hr {
  border: none;
  border-top: 2px solid var(--border-soft);
  margin: 2rem 0;
}

/* Iconos SVG */
.icon {
  width: 1.1rem;
  height: 1.1rem;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.25rem;
  flex-shrink: 0;
}

.btn .icon {
  margin-right: 0.4rem;
  width: 1.2rem;
  height: 1.2rem;
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.action-card {
  background-color: var(--talleres-red);
  border: 2px solid var(--talleres-red);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  text-decoration: none;
  color: white;
  transition: all 0.3s ease;
  cursor: pointer;
}

.action-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px #8B153899;
  filter: brightness(1.15);
}

.action-card-icon {
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.75rem;
  display: block;
  filter: drop-shadow(0 2px 8px #FFFFFF4C);
}

.action-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
}

.page-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 1.25rem 0;
}

.page-subnav-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0 1.25rem 0;
}

.page-subnav-row .page-subnav {
  margin: 0;
}

.page-subnav-row .active-party-row {
  margin: 0;
}

.party-control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  margin: 0 0 1.5rem 0;
}

.page-subnav-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.page-subnav-row > .page-subnav-tools:only-child {
  margin-left: auto;
}

.page-subnav-tools .card {
  margin: 0;
}

.party-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1.5rem;
}

.party-actions-row .cupo-inline.card {
    flex: 0 0 220px;
    width: 220px;
    min-width: 220px;
    max-width: 100%;
  margin-left: auto;
  height: auto;
  min-height: unset;
  padding: 0.85rem 1rem;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  background: linear-gradient(135deg, #8B1538 0%, #A91D47 100%);
  border: 2px solid #C72C52;
  box-shadow: 0 4px 12px rgba(139, 21, 56, 0.3);
  position: relative;
  overflow: hidden;
}

.party-actions-row .cupo-inline.card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.party-actions-row .cupo-inline.card .cupo-inline-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.party-actions-row .cupo-inline-actions {
  margin-left: 0;
  flex-wrap: nowrap;
  justify-content: flex-start;
  width: 100%;
}

.party-actions-row .cupo-inline-actions input {
  flex: 1;
  height: 36px;
  padding: 0.4rem 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #1a2942;
}

.party-actions-row .cupo-inline-actions input:focus {
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.party-actions-row .cupo-inline-actions .btn {
  height: 36px;
  padding: 0 0.75rem;
  background: rgba(255, 255, 255, 0.95);
  color: #8B1538;
  border: 2px solid rgba(255, 255, 255, 0.3);
  font-weight: 700;
}

.party-actions-row .cupo-inline-actions .btn:hover {
  background: #ffffff;
  border-color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.link-actions-card {
    flex: 0 1 auto;
    padding: 0.6rem 0.8rem;
    min-height: unset;
  }

  #contenidoPartido .party-actions-row .link-actions-card {
    flex: 1 1 0;
    display: flex;
    align-items: center;
  }

  #contenidoPartido .party-actions-row .link-actions-row {
    width: 100%;
  }

.link-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.link-actions-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-left: auto;
}

.link-actions-buttons .btn.is-reserved {
  visibility: hidden;
  pointer-events: none;
}

#inscripcionControls .badge {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

#inscripcionControls .btn {
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
}

.cupo-inline.card {
  padding: 0 0.85rem;
  min-width: 280px;
  max-width: 100%;
  height: var(--subnav-control-height);
  min-height: var(--subnav-control-height);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  border-radius: 8px;
  border-color: var(--talleres-red);
  background: #1A294299;
  box-shadow: none;
  position: relative;
}

.cupo-inline-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
}

.cupo-inline-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

.cupo-inline-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

.cupo-inline-actions input {
  width: 70px;
  height: calc(var(--subnav-control-height) - 14px);
  padding: 0 0.5rem;
  font-size: 0.85rem;
}

.cupo-inline-actions .btn {
  height: calc(var(--subnav-control-height) - 14px);
  min-width: 36px;
  padding: 0 0.55rem;
  font-size: 0.75rem;
}

.cupo-inline-actions .btn .icon {
  margin-right: 0;
}

.cupo-inline.card:focus-within {
  box-shadow: 0 0 0 3px #8B153840;
}

.cupo-inline.card.is-reserved {
  visibility: hidden;
  pointer-events: none;
}

.cupo-floating {
  position: absolute;
  left: 16px;
  right: 16px;
  top: calc(44% + 18px);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 2px solid #2A3A52CC;
  background: #1A2942EB;
  color: var(--text-main);
  box-shadow: 0 6px 18px #00000059;
  pointer-events: none;
  transform: translateY(-50%);
  width: auto;
  justify-content: center;
  margin: 0;
  align-self: auto;
}

.cupo-floating-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

.cupo-floating-value {
  font-size: 0.95rem;
  font-weight: 800;
}

body:not(.has-partido) .cupo-inline.card,
body:not(.has-partido) .cupo-floating,
.cupo-floating.cupo-no-asignado {
  display: none;
}

body.inscripcion-pending #contenidoPartido .link-actions-buttons .btn,
body.inscripcion-pending #contenidoPartido .cupo-inline.card,
body.inscripcion-pending .cupo-floating {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: none;
}

body[data-inscripcion-state="abierta"] #contenidoPartido #btnDescargarPDF,
body[data-inscripcion-state="abierta"] #contenidoPartido .cupo-inline.card,
body[data-inscripcion-state="abierta"] .cupo-floating,
body[data-inscripcion-state="cerrada"] #contenidoPartido #btnCompartirDisponibilidad,
body[data-inscripcion-state="inactiva"] #contenidoPartido #btnCompartirDisponibilidad,
body[data-inscripcion-state="inactiva"] #contenidoPartido #btnDescargarPDF,
body[data-inscripcion-state="inactiva"] #contenidoPartido .cupo-inline.card,
body[data-inscripcion-state="inactiva"] .cupo-floating {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cupo-floating--under {
  border-color: #FBBF2499;
  background: #FBBF242E;
}

.cupo-floating--under .cupo-floating-value {
  color: #fbbf24;
}

.cupo-floating--match {
  border-color: #10B981B2;
  background: #10B9812E;
}

.cupo-floating--match .cupo-floating-value {
  color: #10b981;
}

.cupo-floating--over {
  border-color: #DC2626BF;
  background: #DC262633;
}

.cupo-floating--over .cupo-floating-value {
  color: #ef4444;
}

.active-party-row.card {
  padding: 0;
  width: 220px;
  max-width: 100%;
  height: var(--subnav-control-height);
  min-height: var(--subnav-control-height);
  border-radius: 8px;
  border-color: var(--talleres-red);
  background: transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
}

/* Selector de partido mimetizado con el fondo del card contenedor */
.active-party-row.card .custom-select-trigger {
  background-color: transparent;
  border: none;
  box-shadow: none;
}

.active-party-row.card .custom-select-trigger:hover {
  background-color: rgba(139, 21, 56, 0.12);
  box-shadow: none;
  transform: none;
}

.active-party-row.card .custom-select-wrapper.open .custom-select-trigger {
  box-shadow: none;
  border-color: transparent;
}

.active-party-row.card .custom-select-dropdown {
  background-color: var(--bg-card);
  border-color: var(--talleres-red);
}

.active-party-row.card .custom-select-search {
  background-color: var(--bg-card);
}

/* Fallback nativo: cuando el custom-select aun no envuelve el <select> */
.active-party-row select option {
  background-color: var(--bg-card);
  color: var(--text-main);
}


.active-party-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.active-party-row.card .form-group {
  margin: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
}

.active-party-header label {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.active-party-header .btn-clear-partido {
  margin-left: auto;
}

.active-party-row.card.is-selected {
  border-color: var(--talleres-red);
  box-shadow: none;
}

.active-party-row.card:focus-within {
  box-shadow: 0 0 0 3px #8B153840;
}

.active-party-row.card.is-selected:focus-within {
  box-shadow: 0 0 0 3px #8B153840;
}

.active-party-row.card.is-selected label {
  color: var(--text-main);
}

.active-party-row.card.is-selected select {
  border-color: transparent;
  box-shadow: none;
}

.btn-clear-partido:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lock-on-close:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(180deg, rgba(10, 22, 40, 0.82) 0%, rgba(10, 22, 40, 0.9) 100%);
  backdrop-filter: blur(6px);
  z-index: 1000;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: linear-gradient(160deg, rgba(26, 41, 66, 0.96) 0%, rgba(13, 24, 40, 0.98) 100%);
  border: 2px solid rgba(139, 21, 56, 0.35);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55),
              0 0 0 1px rgba(139, 21, 56, 0.2) inset;
  overflow: hidden;
}

.modal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--talleres-red) 0%, var(--talleres-red-light) 100%);
  opacity: 0.9;
}

.modal-card h3 {
  margin: 0 0 0.5rem 0;
  color: var(--text-main);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.modal-card p {
  margin: 0 0 1rem 0;
  color: #d2d8e4;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.modal-card--asignaciones {
  max-width: 920px;
}

.modal-asignaciones-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-asignaciones-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-asignaciones-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-asignaciones-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.modal-asignaciones-list,
.modal-asignaciones-selected {
  border: 1px solid #24364d;
  background: #0f1d33;
  border-radius: 12px;
  padding: 0.75rem;
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
}

.modal-asignaciones-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.45rem 0.35rem;
  border-bottom: 1px dashed #24364d;
}

.modal-asignaciones-row:last-child {
  border-bottom: none;
}

.modal-asignaciones-row.is-selected {
  background: rgba(26, 41, 66, 0.6);
  border-radius: 10px;
}

.modal-asignaciones-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.modal-asignaciones-selected-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-asignaciones-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .modal-asignaciones-grid {
    grid-template-columns: 1fr;
  }
}

.form-compact .modal-actions {
  grid-column: 1 / -1;
  align-items: center;
}

.modal-open {
  overflow: hidden;
  padding-right: var(--modal-scrollbar-offset, 0px);
}

.active-party-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
  margin: 0.5rem 0 1.5rem 0;
  text-align: right;
}

.active-party-row .form-group {
  margin: 0;
  min-width: 200px;
}

.active-party-row select {
  min-width: 220px;
  height: 100%;
  border: none;
  background: transparent;
  padding: 0 2.2rem 0 0.7rem;
  color: var(--text-main);
  font-family: inherit;
  text-align: center;
  text-align-last: center;
  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' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23E2E8F0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 12px 8px;
}

.active-party-row select option {
  color: var(--text-main);
  background-color: var(--bg-card);
}

.active-party-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Alert Box */
.alert-box {
  background: #1A2942E6;
  border: 2px solid var(--border-soft);
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-box-icon {
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  color: #fbbf24;
}

.alert-box-text {
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 500;
}

#alertasContainer .alert-box {
  align-items: center;
}

#alertasContainer .alert-box-text {
  width: 100%;
}

#alertasContainer .alert-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: #bfdbfe;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease-out;
}

#alertasContainer .alert-link:hover {
  background: rgba(59, 130, 246, 0.28);
  border-color: rgba(59, 130, 246, 0.7);
  transform: translateY(-1px);
}

#alertasContainer .alert-count {
  font-weight: 700;
  color: var(--text-main);
}

#alertasContainer .alert-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 0.7fr) auto;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

#alertasContainer .alert-col {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
}

#alertasContainer .alert-col-value {
  font-size: 1.05rem;
  font-weight: 600;
}

#alertasContainer .alert-col-main .alert-col-value {
  font-size: 1.2rem;
}

#alertasContainer .alert-col-action {
  align-items: center;
}

/* Section Title */
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 2rem 0 1rem 0;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
}

.section-title-icon {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  color: var(--talleres-red);
}

/* Compact Table */
.compact-table {
  font-size: 0.85rem;
}

.compact-table td {
  padding: 0.5rem 0.75rem;
}

#listaPartidos .table {
  font-size: 1rem;
}

#listaPartidos .table th {
  font-size: 0.95rem;
}

#listaPartidos .table th,
#listaPartidos .table td {
  text-align: center;
}

#listaPartidos .badge {
  min-width: 120px;
  justify-content: center;
}

#listaPersonas .table th,
#listaPersonas .table td {
  text-align: center;
}

#listaPersonas .badge {
  min-width: 120px;
  justify-content: center;
}

#proximosPartidos .compact-table {
  width: 100%;
  font-size: 1rem;
}

#proximosPartidos .compact-table th,
#proximosPartidos .compact-table td {
  text-align: center;
}

#proximosPartidos .compact-table th {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Code */
code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  background-color: #1A2942E6;
  border: 1px solid var(--border-soft);
  color: #bfdbfe;
}

/* Responsivo */
@media (max-width: 768px) {
  .container {
    border-radius: 0;
    margin-top: 0;
    padding: 1.2rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  nav {
    gap: 0.4rem;
  }

  nav a {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-progress {
    grid-column: auto;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .page-subnav-tools {
    width: 100%;
    justify-content: stretch;
  }

  .personas-shell .page-subnav-row {
    flex-wrap: wrap;
  }

  .personas-shell .page-subnav-tools {
    width: 100%;
    margin-left: 0;
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .informes-shell .page-subnav-row {
    flex-wrap: wrap;
  }

  .informes-shell .page-subnav-tools {
    width: 100%;
    margin-left: 0;
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .reportes-shell .page-subnav .btn {
    min-width: 0;
    flex: 1 1 auto;
  }

  .cupo-inline.card,
  .active-party-row.card {
    width: 100%;
  }


  .stat-card-value {
    font-size: 2rem;
  }

  .block {
    overflow-x: auto;
  }

  .list-toolbar {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .list-toolbar-group {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  table {
    min-width: 0;
    font-size: 0.85rem;
  }

  th, td {
    padding: 0.5rem;
  }

  .btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
  }
}

/* Tabs / Pestañas */
.tabs-container {
  margin: 1.5rem 0;
}

.tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-soft);
  margin-bottom: 1.5rem;
}

.tab-button {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s ease-out;
  position: relative;
  bottom: -2px;
}

.tab-button:hover {
  color: var(--text-main);
  border-bottom-color: var(--talleres-red);
  background: transparent;
}

.tab-button.active {
  color: var(--text-main);
  border-bottom-color: var(--talleres-red);
  background: transparent;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Utilidades */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.fw-bold { font-weight: 700; }
.fw-normal { font-weight: 500; }

/* Botones de solo icono */
.btn-icon-only {
  padding: 0.5rem;
  min-width: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.btn-icon-only {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.btn.btn-icon-only:hover {
  border-color: transparent;
  background: transparent;
  box-shadow: 0 0 0 3px rgba(139, 21, 56, 0.25);
  transform: translateY(-1px);
}

.btn-icon-only .icon {
  margin: 0;
  width: 1.25rem;
  height: 1.25rem;
}

/* Media Queries - Responsive Layout */

/* Laptop: 1024-1279px */
@media (max-width: 1279px) and (min-width: 1024px) {
  .main-content {
    padding: var(--content-padding-laptop);
  }
}

/* Tablet: 768-1023px */
@media (max-width: 1023px) and (min-width: 768px) {
  body.layout {
    grid-template-columns: 1fr;
    grid-template-areas: "main";
  }

  .sidebar-nav {
    position: fixed;
    inset: 0 auto 0 0;
    height: 100vh;
    max-width: 78%;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 10px 30px #00000059;
  }

  body.sidebar-open .sidebar-nav {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: inline-flex;
    position: sticky;
    top: 0;
    z-index: 80;
  }

  .main-content {
    padding: var(--content-padding-laptop);
  }
}

/* Tarjetas de personas con hover */
.persona-card {
  position: relative;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  transition: all 0.2s ease;
  cursor: pointer;
  width: 100%;
  background: transparent;
  text-align: inherit;
}

.persona-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-color: var(--talleres-red);
}

.persona-card:disabled,
.persona-card[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.persona-card:disabled:hover,
.persona-card[aria-disabled="true"]:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border-soft);
}

.persona-card:hover .persona-card-icon {
  opacity: 1;
}

.persona-card-icon {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 3;
}

.persona-card-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding-right: 2.5rem;
}

.persona-card-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.persona-card-dni {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.persona-card-contador {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: #FBBF24;
  color: #1F2937;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

/* Colores específicos para cada tipo de tarjeta */
.persona-card-sin-respuesta {
  background: #FBBF241A;
  border-color: #FBBF244C;
}

.persona-card-no-asisten {
  background: #EF44441A;
  border-color: #EF44444C;
}

.persona-card-disponibles {
  background: #10B9811A;
  border-color: #10B9814C;
}

.persona-card-permanentes {
  background: #3B82F61A;
  border-color: #3B82F64C;
}

.persona-card-rotacion {
  background: #8B5CF61A;
  border-color: #8B5CF64C;
}

/* Mobile: <768px */
@media (max-width: 767px) {
  body.layout {
    grid-template-columns: 1fr;
    grid-template-areas: "main";
  }

  .sidebar-nav {
    position: fixed;
    inset: 0 auto 0 0;
    height: 100vh;
    max-width: 82%;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 12px 36px #00000066;
  }

  body.sidebar-open .sidebar-nav {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: inline-flex;
    position: sticky;
    top: 0;
    z-index: 80;
  }

  .main-content {
    padding: 18px;
  }

  .container {
    padding: 1.25rem;
  }
}

/* ============================================
   CUSTOM SELECT COMPONENT (Profesional)
   ============================================ */

.custom-select-wrapper {
  position: relative;
  width: 100%;
}

.custom-select-wrapper select {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

.custom-select-trigger {
  position: relative;
  width: 100%;
  padding: 0.6rem 0.8rem;
  padding-right: 2.5rem;
  border-radius: 10px;
  border: 2px solid var(--talleres-red);
  background-color: #0a1628;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease-out;
  box-shadow: 0 2px 8px rgba(139, 21, 56, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  user-select: none;
}

.custom-select-trigger:hover {
  border-color: var(--talleres-red-light);
  background-color: #1a2942;
  box-shadow: 0 4px 12px rgba(139, 21, 56, 0.4);
  transform: translateY(-1px);
}

.custom-select-trigger::after {
  content: '';
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.2em;
  height: 1.2em;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transition: transform 0.2s ease-out;
  pointer-events: none;
}

.custom-select-wrapper.open .custom-select-trigger::after {
  transform: translateY(-50%) rotate(180deg);
}

.custom-select-wrapper.open .custom-select-trigger {
  border-color: var(--talleres-red-light);
  box-shadow: 0 0 0 3px rgba(139, 21, 56, 0.3), 0 4px 12px rgba(139, 21, 56, 0.4);
}

.custom-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  background-color: #0a1628;
  border: 2px solid var(--talleres-red);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(139, 21, 56, 0.4), 0 4px 12px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease-out;
}

.custom-select-search {
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(139, 21, 56, 0.25);
  background-color: #0a1628;
  color: var(--text-main);
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  position: sticky;
  top: 0;
  z-index: 2;
}

.custom-select-search::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.custom-select-search:focus {
  box-shadow: inset 0 -2px 0 var(--talleres-red);
}

.custom-select-wrapper.open .custom-select-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-select-wrapper--icon {
  width: 2.5rem;
  flex: 0 0 auto;
}

.custom-select-wrapper--icon .custom-select-trigger {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 10px;
  justify-content: center;
  text-align: center;
}

.custom-select-wrapper--icon .custom-select-trigger::after {
  display: none;
}

.custom-select-wrapper--icon .custom-select-dropdown {
  left: auto;
  right: 0;
  min-width: 220px;
}

.custom-select-option {
  padding: 0.85rem 1rem;
  color: var(--text-main);
  font-weight: 600;
  font-size: 1rem;
  border-bottom: 1px solid rgba(139, 21, 56, 0.2);
  cursor: pointer;
  transition: all 0.15s ease-out;
  user-select: none;
  text-align: center;
}

.custom-select-option:first-child {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.custom-select-option:last-child {
  border-bottom: none;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.custom-select-option:hover,
.custom-select-option.focused {
  background-color: var(--talleres-red-dark);
  color: white;
  font-weight: 700;
}

.custom-select-option.selected {
  background: linear-gradient(90deg, var(--talleres-red) 0%, var(--talleres-red-light) 100%);
  color: white;
  font-weight: 700;
  position: relative;
}

.custom-select-option.selected::before {
  content: '✓';
  position: absolute;
  left: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.custom-select-option.selected {
  padding-left: 2rem;
}

/* Scrollbar personalizado para el dropdown */
.custom-select-dropdown::-webkit-scrollbar {
  width: 8px;
}

.custom-select-dropdown::-webkit-scrollbar-track {
  background: #1a2942;
  border-radius: 10px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb {
  background: var(--talleres-red);
  border-radius: 10px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--talleres-red-light);
}

/* Responsive */
@media (max-width: 768px) {
  .custom-select-dropdown {
    max-height: 240px;
  }
  
  .custom-select-option {
    padding: 0.75rem 0.85rem;
    font-size: 0.95rem;
  }
}

/* ============================================
   AUTHENTICATION STYLES
   ============================================ */

/* User Header - Main Content */
.user-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(26, 41, 66, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-icon {
  color: var(--talleres-red);
  flex-shrink: 0;
}

.user-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.logout-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--talleres-red);
  color: white;
  border: 2px solid var(--talleres-red);
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-button:hover {
  background: var(--talleres-red-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 21, 56, 0.4);
}

.logout-button:active {
  transform: translateY(0);
}

.logout-button svg {
  flex-shrink: 0;
}

/* Sidebar User Info */
.sidebar-user-info {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 2px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-user-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  padding: 0 0.5rem;
  text-align: center;
}

.sidebar-logout-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--talleres-red);
  color: white;
  border: 2px solid var(--talleres-red);
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.sidebar-logout-button:hover {
  background: var(--talleres-red-light);
  transform: translateX(4px);
}

.sidebar-logout-button:active {
  transform: translateX(0);
}

.sidebar-logout-button svg {
  flex-shrink: 0;
}

/* Responsive para autenticación */
@media (max-width: 768px) {
  .user-header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  .logout-button,
  .sidebar-logout-button {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   PAGE HEADER WITH LOGO
   ============================================ */

.page-header-logo {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-soft);
}

.page-header-logo img {
  width: 80px;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.page-header-logo h2 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

/* ============================================
   PARTIDO DESTACADO
   ============================================ */

.partido-info-card {
  background: linear-gradient(135deg, rgba(139, 21, 56, 0.15) 0%, rgba(26, 41, 66, 0.3) 100%);
  border: 2px solid var(--talleres-red);
  box-shadow: 0 8px 24px rgba(139, 21, 56, 0.2);
}

.partido-destacado {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: rgba(139, 21, 56, 0.1);
  border-left: 4px solid var(--talleres-red);
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.8;
}

.partido-destacado:empty {
  display: none;
}

.partido-destacado strong {
  color: var(--talleres-red-light);
  font-weight: 700;
}

/* Responsive */
@media (max-width: 768px) {
  .page-header-logo {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .page-header-logo img {
    width: 60px;
  }
  
  .page-header-logo h2 {
    font-size: 1.5rem;
  }
  
  .partido-destacado {
    font-size: 1rem;
    padding: 1rem;
  }
}

/* ============================================
   ASIGNACIONES
   ============================================ */

.ubicaciones-board {
  display: grid;
  gap: 1.5rem;
}

.ubicaciones-grupo {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background: #12223b;
  box-shadow: inset 0 0 0 1px #ffffff0d;
}

.ubicaciones-grupo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ubicaciones-grupo-title h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ubicaciones-grupo-title .text-muted {
  font-size: 0.85rem;
}

.ubicaciones-grupo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

@media (min-width: 1200px) {
  .ubicaciones-grupo-grid {
    grid-template-columns: repeat(4, minmax(240px, 1fr));
  }
}

.ubicacion-card {
  background: #16253d;
  border: 1px solid #24364d;
  border-radius: 14px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

.ubicacion-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.ubicacion-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ubicacion-card-actions .select-add {
  width: 100%;
}

.ubicaciones-board select,
.ubicaciones-board .custom-select-trigger {
  border: 1px solid #2a3a52;
  background-color: #0f1d33;
  box-shadow: none;
  font-weight: 600;
}

.ubicaciones-board select:hover,
.ubicaciones-board .custom-select-trigger:hover {
  border-color: #3b4d66;
  background-color: #13263f;
  box-shadow: none;
  transform: none;
}

.ubicaciones-board select:focus,
.ubicaciones-board .custom-select-trigger:focus {
  border-color: #3b4d66;
  box-shadow: 0 0 0 2px #8b153833;
}

.ubicaciones-board select option,
.ubicaciones-board .custom-select-option {
  background-color: #0f1d33;
  border-bottom: 1px solid #22334a;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 0.8rem;
}

.ubicaciones-board .custom-select-dropdown {
  background-color: #0f1d33;
  border-color: #2a3a52;
  box-shadow: 0 8px 24px #00000066;
}

.ubicacion-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ubicacion-item {
  padding: 0.5rem;
  border-radius: 10px;
  border: 1px solid #1f2f45;
  background: #0c182b;
}

.ubicacion-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: nowrap;
}

.ubicacion-item-info {
  min-width: 0;
  flex: 1;
}

.ubicacion-item-name {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
}

.ubicacion-item-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
}

.ubicacion-item-actions select:not(.ubicacion-item-move) {
  min-width: 110px;
  max-width: 140px;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
}


.ubicacion-item-fijo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ubicacion-item-fijo input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.ubicacion-item-fijo .icon {
  margin: 0;
  width: 1rem;
  height: 1rem;
}

.ubicacion-item-fijo input:checked + .icon {
  color: var(--talleres-red);
}

.ubicacion-item-toggle {
  appearance: none;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: #2a3a52;
  border: 1px solid #3a4a63;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.ubicacion-item-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f3f4f6;
  transition: transform 0.2s ease;
}

.ubicacion-item-toggle:checked {
  background: var(--talleres-red);
  border-color: var(--talleres-red-light);
}

.ubicacion-item-toggle:checked::after {
  transform: translateX(16px);
}

.ubicacion-item-toggle:focus {
  outline: 2px solid #8b153833;
  outline-offset: 2px;
}

/* ============================================================
   Estado de asistencia (Presente / Ausente / Baja)
   Aplica a <select class="estado-..."> y <span class="estado-badge estado-...">
   ============================================================ */
.estado-presente {
  color: #1b8c4a;
  background: #e2f5ea;
  border-color: #1b8c4a;
}

.estado-ausente {
  color: #c0392b;
  background: #fbeae5;
  border-color: #c0392b;
}

.estado-baja {
  color: #d68910;
  background: #fdf3df;
  border-color: #d68910;
}

.estado-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
}
