/* ==========================================================================
   VAL DI FIEMME 26/27 - ORGANIZER DASHBOARD STYLES
   ========================================================================== */

.dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Dashboard Top Header */
.dashboard-header-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 24px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
}

.dashboard-title-area h2 {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-title-area p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.dashboard-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-dash {
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.btn-dash:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-dash.btn-export {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.btn-dash.btn-export:hover {
  background: rgba(16, 185, 129, 0.25);
}

.btn-dash.btn-seed {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
}

.btn-dash.btn-seed:hover {
  background: rgba(99, 102, 241, 0.25);
}

/* KPI Statistics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-smooth);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.16);
}

.stat-icon-wrapper {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-card.stat-attendees .stat-icon-wrapper {
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary);
}

.stat-card.stat-trofej .stat-icon-wrapper {
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold);
}

a.stat-card {
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
}

.stat-card.stat-timing {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.18), rgba(18, 29, 52, 0.8));
  border-color: rgba(52, 211, 153, 0.45);
}

.stat-card.stat-timing .stat-icon-wrapper {
  background: rgba(16, 185, 129, 0.22);
  color: #34d399;
}

.stat-card.stat-timing .stat-label,
.stat-card.stat-timing .stat-value {
  color: #ecfdf5;
}

.stat-card.stat-timing:hover {
  border-color: #34d399;
  transform: translateY(-3px);
}

.stat-card.stat-results {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.2), rgba(18, 29, 52, 0.8));
  border-color: rgba(56, 189, 248, 0.5);
}

.stat-card.stat-results .stat-icon-wrapper {
  background: rgba(56, 189, 248, 0.22);
  color: #7dd3fc;
}

.stat-card.stat-results .stat-label,
.stat-card.stat-results .stat-value {
  color: #e0f2fe;
}

.stat-card.stat-results:hover {
  border-color: #38bdf8;
  transform: translateY(-3px);
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 2.1rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.stat-subtext {
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-top: 8px;
}

.stat-subtext strong {
  color: inherit;
  font-weight: 700;
}

.dist-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

/* Attendee Table Controls */
.table-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.table-card-heading {
  padding: 18px 24px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.table-card-heading .btn-dash {
  margin-left: auto;
}

.results-year-hint {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
}

.table-card-heading .results-year-hint + .btn-dash {
  margin-left: 0;
}

.results-controls {
  align-items: flex-start;
}

.results-category-pills {
  flex-basis: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.results-category-pills[hidden] {
  display: none;
}

.results-category-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.results-category-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-right: 4px;
}

.badge-category {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #7dd3fc;
  font-size: 0.74rem;
  font-weight: 700;
}

.result-time {
  color: #fbbf24;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.result-person-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.result-awards {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  flex-wrap: wrap;
}

.result-award {
  font-size: 1.35rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.result-award.award-cup {
  font-size: 1.28rem;
}

.result-award.award-overall-star {
  font-size: 1.28rem;
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.5));
}

.btn-dash.btn-timing {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  text-decoration: none;
}

.btn-dash.btn-timing:hover {
  background: rgba(245, 158, 11, 0.28);
  color: #fff;
}

a.btn-dash {
  text-decoration: none;
}

.badge-broj {
  font-family: var(--font-heading);
  font-weight: 800;
  color: #38bdf8;
  font-size: 1rem;
}

.timing-broj-input {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.timing-athlete {
  margin: 0;
  min-height: 0;
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.timing-athlete.has-name {
  min-height: 2.4rem;
  margin: 6px 0 18px;
  color: var(--primary);
}

.race-time-wrap {
  position: relative;
  display: block;
  margin-top: 6px;
  border-radius: var(--radius-lg);
  background: rgba(6, 9, 19, 0.72);
  border: 1px solid var(--border-glass);
  min-height: 108px;
  overflow: hidden;
}

.race-time-wrap.focused {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.race-time-capture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  font-size: 48px;
  border: none;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  z-index: 2;
}

.race-time-face {
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 108px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 4.2rem;
  line-height: 1;
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

.race-time-colon {
  color: var(--primary);
  padding: 0 4px;
  transform: translateY(-6px);
}

.race-time-mm,
.race-time-ss {
  min-width: 1.4em;
  text-align: center;
}

@media (max-width: 580px) {
  .race-time-face {
    font-size: 3.4rem;
  }
}

.table-controls-bar {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.search-box-wrap {
  position: relative;
  min-width: 260px;
  flex-grow: 1;
}

.search-box-wrap input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border-radius: var(--radius-pill);
  background: rgba(10, 16, 30, 0.7);
  border: 1px solid var(--border-glass);
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition-fast);
}

.search-box-wrap input:focus {
  border-color: var(--primary);
  background: rgba(12, 20, 36, 0.9);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.9rem;
}

.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pill-btn {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-glass);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-pill-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--primary);
  color: var(--primary-light);
}

/* Data Table */
.data-table-container {
  width: 100%;
  overflow-x: auto;
}

.attendee-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.attendee-table th {
  padding: 10px 12px 10px 20px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  background: rgba(10, 16, 30, 0.4);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.th-sort:hover,
.th-sort.is-sorted {
  color: var(--primary-light);
}

.th-sort-ind {
  min-width: 0.8em;
  font-size: 0.62rem;
  color: var(--primary);
}

.attendee-table td {
  padding: 14px 20px;
  font-size: 0.86rem;
  color: var(--text-main);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  white-space: nowrap;
}

.attendee-table tbody tr {
  transition: background var(--transition-fast);
}

.attendee-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.table-person-cell {
  display: flex;
  flex-direction: column;
}

.table-person-name {
  font-weight: 700;
  color: #fff;
}

.table-person-sub {
  font-size: 0.74rem;
  color: var(--text-dim);
}

/* Badge Indicators */
.badge-role {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-role.role-O {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.badge-role.role-G {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-role.role-P {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-check.yes {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.badge-check.no {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}

.table-actions-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-table-action {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.btn-table-action:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn-table-action.delete:hover {
  background: rgba(244, 63, 94, 0.2);
  color: var(--rose);
  border-color: rgba(244, 63, 94, 0.4);
}

.skipass-handed {
  position: relative;
  width: 32px;
  height: 32px;
  margin: 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.skipass-handed-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.skipass-handed-box {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid var(--text-dim);
  background: transparent;
  position: relative;
}

.skipass-handed-box::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform var(--transition-fast);
}

.skipass-handed:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(52, 211, 153, 0.35);
}

.skipass-handed.is-checked {
  background: rgba(16, 185, 129, 0.22);
  border-color: #34d399;
}

.skipass-handed.is-checked .skipass-handed-box {
  background: #34d399;
  border-color: #34d399;
}

.skipass-handed.is-checked .skipass-handed-box::after {
  transform: rotate(45deg) scale(1);
}

.skipass-handed.is-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* Empty State */
.table-empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-dim);
}

.empty-state-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
  opacity: 0.6;
}

/* Responsive */
@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
