/* ==========================================================================
   Base & Resets
   ========================================================================== */
body {
  margin: 0;
  padding: 24px 16px;
  background-color: #f8fafc;
  color: #1e293b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  -webkit-font-smoothing: antialiased;
}

div, span, p { margin: 0; padding: 0; }
img { border: none; margin: 0; padding: 0; }

a, a:visited, a:active {
  color: #0f172a;
  text-decoration: none;
}
a:hover {
  color: #0284c7;
}

/* Typography */
h1 { font-size: 24px; line-height: 30px; font-weight: 700; margin: 0 0 12px 0; color: #0f172a; }
h2 { font-size: 20px; line-height: 26px; font-weight: 700; margin: 0 0 16px 0; color: #0f172a; letter-spacing: -0.01em; }
h3 { font-size: 16px; line-height: 22px; font-weight: 600; margin: 0; }
h4 { font-size: 14px; line-height: 20px; font-weight: 600; margin: 0; }
h5 { font-size: 12px; line-height: 16px; font-weight: 600; margin: 0; }

/* ==========================================================================
   Table Container & Base Structure
   ========================================================================== */
table.vypis_skladeb,
table.vypis_soutezicich {
  width: auto;
  min-width: 680px;
  max-width: 98%;
  margin: 0 auto 30px auto;
  background-color: #ffffff;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  border: 1px solid #cbd5e1;
}

/* Cell Defaults */
table.vypis_skladeb td {
  padding: 7px 12px;
  font-size: 12.5px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
  color: #334155;
  transition: background-color 0.15s ease;
}

table.vypis_soutezicich td {
  padding: 6px 8px;
  font-size: 12px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
}

/* Clear outer right border from last column */
table.vypis_skladeb tr td:last-child,
table.vypis_soutezicich tr td:last-child {
  border-right: none;
}

/* Alignments */
table.table_top td { vertical-align: middle; }
table.table_left td, td.table_left { text-align: left; }
table.table_center td, td.table_center { text-align: center; }

/* Text emphasis in table */
table.vypis_skladeb td b {
  color: #0f172a;
  font-weight: 700;
}

/* ==========================================================================
   Category Header Rows (Shared Rules)
   ========================================================================== */
.cat_header td,
tr.fisaf_color td,
tr.d[style*="#4876FF"] td,
tr.d[style*="#FF6A6A"] td,
tr.d[style*="#7CCD7C"] td {
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em;
  padding: 8px 14px !important;
  text-align: left !important;
  text-transform: uppercase;
  border-right: none !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* --- Aerobic (Rich Sapphire / Royal Blue) --- */
.cat_aerobic,
tr.d[style*="#4876FF"] {
  background: linear-gradient(90deg, #1d4ed8 0%, #3b82f6 100%) !important;
}
.cat_aerobic td,
tr.d[style*="#4876FF"] td {
  border-bottom: 2px solid #1e40af !important;
}

/* --- Step (Warm Coral / Crimson) --- */
.cat_step,
tr.d[style*="#FF6A6A"] {
  background: linear-gradient(90deg, #dc2626 0%, #f43f5e 100%) !important;
}
.cat_step td,
tr.d[style*="#FF6A6A"] td {
  border-bottom: 2px solid #991b1b !important;
}

/* --- Dance (Emerald / Deep Teal) --- */
.cat_dance,
tr.d[style*="#7CCD7C"] {
  background: linear-gradient(90deg, #059669 0%, #10b981 100%) !important;
}
.cat_dance td,
tr.d[style*="#7CCD7C"] td {
  border-bottom: 2px solid #065f46 !important;
}

/* ==========================================================================
   Subheader Column Rows (č., soutěžící, rok, klub)
   ========================================================================== */
tr.table_header_row,
tr.d:not(.p):not(.cat_header):not(.fisaf_color):not([style*="#"]) {
  background: #f1f5f9 !important;
}

tr.table_header_row td,
tr.d:not(.p):not(.cat_header):not(.fisaf_color):not([style*="#"]) td {
  font-size: 11px !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569 !important;
  padding: 7px 10px !important;
  border-bottom: 2px solid #cbd5e1 !important;
}

tr.table_header_row td i,
tr.d:not(.p):not(.cat_header):not(.fisaf_color):not([style*="#"]) td i {
  font-style: normal;
}

/* ==========================================================================
   Competitor Data Rows (.p.d)
   ========================================================================== */
/* Alternating row zebra striping */
tr.p.d:nth-child(even) {
  background-color: #f8fafc;
}

tr.p.d:nth-child(odd) {
  background-color: #ffffff;
}

/* Interactive hover */
tr.p.d:hover td {
  background-color: #e2e8f0 !important;
}

/* Starting number column styling */
tr.p.d td.l {
  font-weight: 700;
  color: #334155;
  border-left: none;
  /*font-variant-numeric: tabular-nums;*/
  /*width: 44px;*/
}

/* Year of birth column styling */
tr.p.d td:nth-child(2) {
  font-variant-numeric: tabular-nums;
  color: #475569;
  width: 60px;
}

/* ==========================================================================
   Legacy Overrides
   ========================================================================== */
table td.l, table tr.l td { border-left: 1px solid #f1f5f9; }
table td.p, table tr.p td { border-right: 1px solid #f1f5f9; }
table td.h, table tr.h td { border-top: 1px solid #f1f5f9; }
table td.d, table tr.d td { border-bottom: 1px solid #f1f5f9; }

/* ==========================================================================
   Print Optimization
   ========================================================================== */
@media print {
  body {
    background-color: #ffffff;
    padding: 0;
  }
  .netisk {
    display: none;
  }
  table.vypis_skladeb,
  table.vypis_soutezicich {
    box-shadow: none;
    border: 1px solid #64748b;
    page-break-inside: auto;
    width: 100%;
  }
  tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }
  .cat_aerobic,
  .cat_step,
  .cat_dance,
  tr.cat_header,
  tr.d[style*="#"] {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}