:root {
  --primary: #FF0000;
  --primary-dark: #CC0000;
  --primary-light: #FF6666;
  --secondary: #0066FF;
  --secondary-dark: #0052CC;
  --background: #ffffff;
  --surface: #f8f9fa;
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --border: #ecf0f1;
  --success: #27ae60;
  --warning: #f39c12;
  --error: #FF0000;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

html {
  -webkit-text-size-adjust: 100%;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

.hidden {
  display: none !important;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
}

/* Header & Navigation moved to ../shared/topbar-admin-sync.css */

.content {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}

.page-content {
  flex-grow: 1;
  padding: 60px 32px;
  max-width: none;
  width: 100%;
  margin: 0;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.page-title {
  font-size: 32px;
  margin-bottom: 8px;
}

.lede {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
}

.filter-item.grow {
  grid-column: span 2;
}

.filter-item select,
.filter-item input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-primary);
  background: #fff;
}

.btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn.sm {
  padding: 6px 10px;
  font-size: 12px;
}

.summary {
  margin-top: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  background: #fff;
}

.table-wrap {
  margin-top: 12px;
}

.desktop-table {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 14px;
}

.table .level-separator-row td {
  background: rgba(255, 0, 0, 0.08);
  color: var(--primary-dark);
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 0, 0, 0.15);
}

.table th {
  text-transform: uppercase;
  color: var(--text-secondary);
  font-size: 12px;
}

.mobile-list {
  display: none;
  gap: 10px;
}

.mobile-level-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-level-title {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--primary-dark);
}

.mobile-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.mobile-card-head {
  margin-bottom: 6px;
}

.mobile-card-head strong {
  overflow-wrap: anywhere;
}

.mobile-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 4px 0;
}

.mobile-card p span {
  color: var(--text-primary);
}

.table-card-action {
  display: inline-flex;
}

.mobile-card-actions {
  margin-top: 8px;
}

.card-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(248, 250, 252, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.card-modal.hidden {
  display: none;
}

.card-modal-panel {
  width: min(980px, 100%);
  max-height: calc(100vh - 32px);
  background: #ffffff;
  border: 1px solid rgba(15,23,42,0.14);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  color: #0f172a;
}

.card-modal-header,
.card-modal-actions {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15,23,42,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-modal-actions {
  border-bottom: none;
  border-top: 1px solid rgba(15,23,42,0.08);
  justify-content: flex-end;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(15,23,42,0.18);
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
}

.card-modal-body {
  overflow: auto;
  padding: 14px;
  -webkit-overflow-scrolling: touch;
}

.card-preview-wrap {
  display: flex;
  justify-content: center;
}

.athlete-card {
  width: 9.5cm;
  height: 13cm;
  position: relative;
  border: 1px solid rgba(255,255,255,0.3);
  background: #ffffff;
  overflow: hidden;
  color: #111827;
  box-shadow: 0 10px 20px rgba(0,0,0,0.28);
  display: flex;
  flex-direction: column;
  background-size: cover;
  background-position: center;
  --card-header-bg: #ffffff;
}

.card-header,
.card-role,
.card-content,
.card-footer {
  position: relative;
  z-index: 2;
}

.card-header {
  background: var(--card-header-bg);
  border-bottom: 1px solid rgba(15,23,42,0.08);
  padding: 8px 8px 6px;
}

.card-organizers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 26px;
  margin-bottom: 6px;
}

.card-organizers img {
  height: 26px;
  width: auto;
  max-width: 56px;
  object-fit: contain;
}

.logo-empty {
  font-size: 11px;
  color: #64748b;
}

.card-header h3 {
  margin: 0;
  text-align: center;
  font-size: 16px;
  line-height: 1.25;
}

.card-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  justify-content: flex-start;
}

.card-role {
  margin: 7px auto 0;
  width: calc(100% - 18px);
  background: #1d4ed8;
  color: #fff;
  text-align: center;
  font-size: 22px;
  letter-spacing: 0.3px;
  padding: 4px 8px;
  order: 1;
}

.card-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  justify-content: flex-start;
}

.card-content.no-photo {
  justify-content: center;
}

.card-photo {
  width: 3cm;
  height: 3.8cm;
  border: 1px solid rgba(15,23,42,0.2);
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.card-photo span {
  color: #3b82f6;
  font-size: 24px;
}

.card-info {
  width: 100%;
  background: transparent; /* Loại bỏ nền trắng */
  border: none; /* Loại bỏ border */
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  margin-bottom: 4px;
  order: 2; /* Đưa info xuống dưới */
}

.card-info p {
  margin: 3px 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px;
  align-items: baseline;
  font-size: 14px;
  color: #0f172a;
}

.card-info strong {
  font-weight: 700;
}

.card-info span {
  border-bottom: 1px solid rgba(15,23,42,0.75);
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  font-weight: 700; /* Thông tin in đậm hơn */
}

.card-footer {
  flex-shrink: 0;
  background: transparent; /* Loại bỏ nền trắng */
  border: none;
  padding: 5px 8px 7px;
}

.card-footer-label {
  display: none; /* Ẩn nhãn */
}

.card-sponsors {
  --sponsor-logo-height: 48px; /* Tăng kích thước logo */
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 8px;
  align-items: center;
  justify-items: center;
  min-height: 48px;
}

.card-sponsors img {
  height: var(--sponsor-logo-height);
  max-width: 100%;
  object-fit: contain;
  border: none;
  background: transparent;
}

body.modal-open {
  overflow: hidden;
}

.placeholder {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 60px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 18px;
}

/* ============== Footer ============== */
.footer {
  background: var(--text-primary);
  color: white;
  padding: 60px 32px 24px;
  margin-top: 80px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 40px;
  max-width: none;
  width: 100%;
  margin: 0 0 40px;
}

.footer-col h4 {
  margin-bottom: 16px;
  font-size: 16px;
}

.footer-col p {
  color: rgba(255,255,255,0.7);
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.6;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-col a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 14px;
}

/* ============== Responsive Design ============== */
@media (max-width: 900px) {
/* Profile dropdown mobile */
.page-content {
    padding: 40px 20px;
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-item.grow {
    grid-column: span 2;
  }

  .placeholder {
    padding: 40px;
  }

  .desktop-table {
    display: none;
  }

  .mobile-list {
    display: grid;
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }
}

@media (max-width: 768px) {
.brand-text {
    font-size: 16px;
  }

  .page-content {
    padding: 30px 16px;
  }

  .page-title {
    font-size: 26px;
  }

  .filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .filter-item.grow {
    grid-column: span 1;
  }

  .desktop-table {
    display: none;
  }

  .mobile-list {
    display: grid;
  }

  .placeholder {
    padding: 30px;
    font-size: 16px;
  }

  .footer {
    padding: 40px 16px 20px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-col h4 {
    font-size: 14px;
  }

  .footer-col p,
  .footer-col a {
    font-size: 13px;
  }

  .card-modal {
    padding: 10px;
  }

  .card-modal-panel {
    width: 100%;
    max-height: calc(100vh - 20px);
  }
}
