/* ============================================
   CROSS-RC TIMER — Design System
   HARBAK3MTRIL REBORN 2026
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Primary — Deep Forest Green */
  --primary: #1b4332;
  --primary-light: #2d6a4f;
  --primary-lighter: #40916c;
  --primary-dark: #0d2818;

  /* Accent — Sunset Orange / Warm Amber */
  --accent: #e76f51;
  --accent-light: #f4a261;
  --accent-dark: #c1553a;

  /* Surfaces */
  --surface: #ffffff;
  --surface-50: #f8faf9;
  --surface-100: #f1f5f3;
  --surface-200: #e5e7eb;
  --surface-glass: rgba(255, 255, 255, 0.07);
  --surface-glass-hover: rgba(255, 255, 255, 0.14);

  /* Text */
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --text-on-primary: #ffffff;
  --text-on-accent: #ffffff;

  /* Semantic */
  --success: #059669;
  --success-light: #d1fae5;
  --success-dark: #047857;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --danger-dark: #b91c1c;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --info: #2563eb;
  --info-light: #dbeafe;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl:
    0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-card-hover:
    0 10px 20px rgba(0, 0, 0, 0.08), 0 3px 6px rgba(0, 0, 0, 0.05);

  /* Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Transition */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Base & Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    opacity: 0.7;
  }
  50% {
    transform: scale(1);
    opacity: 0.4;
  }
  100% {
    transform: scale(0.95);
    opacity: 0.7;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes dot-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.6;
  }
}

.animate-fade-in {
  animation: fadeIn var(--transition-base) ease-out;
}
.animate-slide-up {
  animation: slideUp var(--transition-slow) ease-out;
}
.animate-slide-down {
  animation: slideDown var(--transition-slow) ease-out;
}
.animate-scale-in {
  animation: scaleIn var(--transition-base) ease-out;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: linear-gradient(
    180deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-base);
  color: rgba(255, 255, 255, 0.7);
  position: relative;
  text-decoration: none;
}

.sidebar-nav-item:hover {
  background: var(--surface-glass-hover);
  color: #fff;
  transform: translateX(2px);
}

.sidebar-nav-item.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.sidebar-nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
}

.card-lift:hover {
  transform: translateY(-2px);
}

/* ---------- Stat Cards ---------- */
.stat-card {
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  border-radius: 0 var(--radius-xl) 0 50%;
  opacity: 0.1;
}

.stat-card-primary {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border: 1px solid rgba(27, 67, 50, 0.1);
}
.stat-card-primary::before {
  background: var(--primary);
}

.stat-card-warning {
  background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
  border: 1px solid rgba(217, 119, 6, 0.1);
}
.stat-card-warning::before {
  background: var(--warning);
}

.stat-card-success {
  background: linear-gradient(135deg, #e8f5e9 0%, #a5d6a7 100%);
  border: 1px solid rgba(5, 150, 105, 0.1);
}
.stat-card-success::before {
  background: var(--success);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  line-height: 1.25;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  color: var(--text-on-primary);
  box-shadow: 0 2px 8px rgba(27, 67, 50, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 4px 14px rgba(27, 67, 50, 0.4);
  filter: brightness(1.1);
}

.btn-accent {
  background: linear-gradient(
    135deg,
    var(--accent) 0%,
    var(--accent-light) 100%
  );
  color: var(--text-on-accent);
  box-shadow: 0 2px 8px rgba(231, 111, 81, 0.3);
}
.btn-accent:hover {
  box-shadow: 0 4px 14px rgba(231, 111, 81, 0.4);
  filter: brightness(1.05);
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #10b981 100%);
  color: var(--text-on-primary);
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}
.btn-success:hover {
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.4);
  filter: brightness(1.1);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #ef4444 100%);
  color: var(--text-on-primary);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}
.btn-danger:hover {
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
  filter: brightness(1.1);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--surface-200);
  color: var(--text-secondary);
}
.btn-outline:hover {
  border-color: var(--primary-lighter);
  color: var(--primary);
  background: var(--surface-50);
}

.btn-outline-danger {
  background: transparent;
  border: 1.5px solid rgba(220, 38, 38, 0.3);
  color: var(--danger);
}
.btn-outline-danger:hover {
  background: var(--danger-light);
  border-color: var(--danger);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
}
.btn-ghost:hover {
  background: var(--surface-100);
  color: var(--text-primary);
}

.btn-lg {
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  border-radius: var(--radius-xl);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
}

@media (min-width: 768px) {
  .btn-actions {
    justify-content: flex-end;
  }
  .btn-actions .btn-sm {
    padding: 0.5rem 1rem;
  }
}

/* ---------- Form Inputs ---------- */
.form-input {
  width: 100%;
  min-width: 0;
  border: 1.5px solid var(--surface-200);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface);
  transition: all var(--transition-base);
  outline: none;
}

.form-input:focus {
  border-color: var(--primary-lighter);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

.form-input-icon {
  position: relative;
}

.form-input-icon .icon-left {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
  transition: color var(--transition-base);
}

.form-input-icon .form-input {
  padding-left: 2.5rem;
}

.form-input-icon:focus-within .icon-left {
  color: var(--primary-lighter);
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

/* ---------- Form Input Underline Style ---------- */
.form-input-underline {
  width: 100%;
  border: none;
  border-bottom: 1.5px solid var(--surface-200);
  border-radius: 0;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-primary);
  background: transparent;
  transition: all var(--transition-base);
  outline: none;
}

.form-input-underline:focus {
  border-bottom-color: var(--primary-lighter);
  box-shadow: 0 2px 0 0 rgba(45, 106, 79, 0.3);
}

/* ---------- Radio Cards ---------- */
.radio-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border: 2px solid var(--surface-200);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
}

.radio-card:hover {
  border-color: var(--primary-lighter);
  background: var(--surface-50);
}

.radio-card.selected,
.radio-card:has(input:checked) {
  border-color: var(--primary);
  background: rgba(27, 67, 50, 0.04);
  box-shadow: 0 0 0 3px rgba(27, 67, 50, 0.08);
}

.radio-card input[type="radio"] {
  display: none !important;
}

/* ---------- File Upload ---------- */
.file-upload-zone {
  border: 2px dashed var(--surface-200);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  text-align: center;
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
}

.file-upload-zone:hover {
  border-color: var(--primary-lighter);
  background: rgba(27, 67, 50, 0.02);
}

.file-upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.175rem 0.625rem;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}
.badge-rally, .badge-adventure {
  width: 90px;
  justify-content: center;
}

.badge-rally {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fdba74;
}
.badge-adventure {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}
.badge-success {
  background: var(--success-light);
  color: var(--success-dark);
}
.badge-danger {
  background: var(--danger-light);
  color: var(--danger-dark);
}
.badge-warning {
  background: var(--warning-light);
  color: var(--warning);
}

/* ---------- Tables ---------- */
.table-container {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.table-container table {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
}

.table-container thead {
  background: var(--surface-50);
  border-bottom: 1px solid var(--surface-200);
}

.table-container thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.table-container tbody tr {
  border-bottom: 1px solid var(--surface-100);
  transition: background var(--transition-fast);
}

.table-container tbody tr:last-child {
  border-bottom: none;
}

.table-container tbody tr:hover {
  background: var(--surface-50);
}

.table-container tbody td {
  padding: 0.75rem 1rem;
  white-space: nowrap;
}

.table-container thead th.text-center,
.table-container tbody td.text-center {
  text-align: center;
}

/* ---------- Modals ---------- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop:not(.hidden) {
  display: flex;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  max-width: 24rem;
  width: 100%;
  padding: 1.5rem;
  animation: scaleIn var(--transition-base) ease-out;
}

/* ---------- Flash / Toast Messages ---------- */
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-1rem);
  }
}

.flash-message {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  padding-right: 2.5rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  animation: toastIn 0.4s ease-out;
  border: 1px solid;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.flash-message.toast-out {
  animation: toastOut 0.3s ease-in forwards;
}

.flash-success {
  background: var(--success-light);
  color: var(--success-dark);
  border-color: rgba(5, 150, 105, 0.2);
}

.flash-error {
  background: var(--danger-light);
  color: var(--danger-dark);
  border-color: rgba(220, 38, 38, 0.2);
}

.flash-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
}

.flash-close {
  position: absolute;
  top: 50%;
  right: 0.625rem;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.5;
  padding: 0.25rem;
  line-height: 0;
  transition: opacity var(--transition-fast);
}

.flash-close:hover {
  opacity: 1;
}

/* ---------- Page Banner (Logo Background) ---------- */
.page-banner {
  position: relative;
  background: #f9fafb;
  padding: 1.5rem 2rem;
  margin: 0 -2rem 0 -2rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
  box-shadow: none;
}

/* Logo watermark via pseudo-element for opacity control */
.page-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../logo.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
  opacity: 0.2;
  pointer-events: none;
  z-index: 1;
  filter: grayscale(0.3);
}

/* Page content overlaps the banner */
.page-content {
  position: relative;
  z-index: 4;
  margin-top: -6.5rem;
}

/* -- Banner-aware overrides for elements in the overlap zone -- */
.page-content .page-header {
  margin-bottom: 1.75rem;
}

.page-content .page-header h1 {
  color: var(--gray-900);
  text-shadow: none;
}

.page-content .page-header .subtitle {
  color: var(--gray-500);
}

/* Outline buttons in the header zone */
.page-content .page-header .btn-outline,
.page-content .page-header ~ .btn-outline,
.page-content > .flex:first-child .btn-outline {
  background: unset;
  border-color: unset;
  color: unset;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.page-content .page-header .btn-outline:hover,
.page-content .page-header ~ .btn-outline:hover,
.page-content > .flex:first-child .btn-outline:hover {
  background: unset;
  border-color: unset;
}

/* ---------- Page Header ---------- */
.page-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.page-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  color: white;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
}

.page-header-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.page-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.page-header .subtitle {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* ---------- Filter Tabs ---------- */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1.5px solid var(--surface-200);
  transition: all var(--transition-base);
  text-decoration: none;
  color: var(--text-secondary);
  background: var(--surface);
}

.filter-tab:hover {
  border-color: var(--primary-lighter);
  color: var(--primary);
}

.filter-tab.active {
  background: var(--primary);
  color: var(--text-on-primary);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(27, 67, 50, 0.25);
}

.filter-tab .count {
  margin-left: 0.25rem;
  opacity: 0.7;
}

/* ---------- Quick Action Cards ---------- */
.action-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.125rem 1.25rem;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.action-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.action-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
}

.action-card-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* ---------- Mobile Bottom Nav ---------- */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: space-around;
  padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 50;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--text-tertiary);
  text-decoration: none;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  position: relative;
}

.mobile-nav-item.active {
  color: var(--primary);
}

.mobile-nav-item.active::after {
  content: "";
  position: absolute;
  top: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1.25rem;
  height: 3px;
  background: var(--primary);
  border-radius: var(--radius-full);
}

.mobile-nav-item svg {
  width: 1.375rem;
  height: 1.375rem;
  transition: all var(--transition-base);
}

.mobile-nav-item.active svg {
  transform: scale(1.1);
}

/* ---------- Public Header (Not Logged In) ---------- */
.public-header {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 60%,
    var(--accent) 100%
  );
  padding: 1rem 1.5rem 1rem;
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.public-header::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 260px;
  height: 260px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

.public-header::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 50%;
}

.public-header img {
  position: relative;
  z-index: 1;
}

/* ---------- Section Headers ---------- */
.section-header {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  color: white;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.025em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ---------- Size Chips ---------- */
.size-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  border: 2px solid var(--surface-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  position: relative;
}

.size-chip:hover {
  border-color: var(--primary-lighter);
  color: var(--primary);
}

.size-chip:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(27, 67, 50, 0.3);
}

.size-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Checkbox ---------- */
input[type="checkbox"] {
  accent-color: var(--primary);
}
input[type="radio"] {
  accent-color: var(--primary);
}

/* ---------- Utility: Empty State ---------- */
.empty-state {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-full);
  background: var(--surface-100);
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
}

.empty-state-text {
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

/* ---------- Mobile Header ---------- */
.mobile-header {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

/* ---------- Medal Colors ---------- */
.medal-gold {
  color: #f59e0b;
}
.medal-silver {
  color: #9ca3af;
}
.medal-bronze {
  color: #b45309;
}

/* ---------- Podium Cards ---------- */
.podium-card {
  position: relative;
  overflow: hidden;
}

.podium-card.gold {
  box-shadow:
    0 0 0 2px #f59e0b,
    var(--shadow-card);
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.podium-card.silver {
  box-shadow:
    0 0 0 2px #d1d5db,
    var(--shadow-card);
  background: linear-gradient(135deg, #f9fafb, #f3f4f6);
}

.podium-card.bronze {
  box-shadow:
    0 0 0 2px #d97706,
    var(--shadow-card);
  background: linear-gradient(135deg, #fffbeb, #fde68a);
}

/* ---------- Pulse animation for scan pages ---------- */
.scan-pulse {
  animation: pulse-ring 2s ease-in-out infinite;
}

/* ---------- Print styles ---------- */
@media print {
  .no-print {
    display: none !important;
  }
}

/* ---------- Responsive scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--surface-200);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* Toggle Switch */
.toggle-switch {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  min-width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 9999px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 2px;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch:checked {
  background: var(--primary);
}
.toggle-switch:checked::after {
  transform: translateX(20px);
}
