@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ═══════════════════════════════════════════════════════════════════════════
   TOKENS — Palette
   Melting Wax Yellow : "urugi ponen mezhugaa" — fragile, dissolving soul
   Pitch Black        : "ulagil neenda iravendraal endhan iravae" — blindness
   Tear-Drop Grey     : silent tears, heavy sighing, gentle orchestration
   Sacred White/Ivory : "deivam thantha deebham neeyae" — divine, untainted
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --charcoal:      #f3f5f4;
  --charcoal-2:    #ffffff;
  --charcoal-3:    #f8f9f8;
  --charcoal-4:    #eef0ef;

  --tear:          #6b7770;
  --tear-light:    #8a9490;
  --tear-border:   #e5eae7;

  --ember:         #ea4335;
  --ember-soft:    rgba(234,67,53,0.06);
  --ember-border:  rgba(234,67,53,0.15);

  --wax:           #115e3b;
  --wax-dim:       #0e4d31;
  --wax-soft:      rgba(17,94,59,0.06);
  --wax-border:    rgba(17,94,59,0.12);

  --ivory:         #121614;
  --ivory-secondary:#6b7770;

  --success:       #3ab077;
  --success-bg:    rgba(58,176,119,0.06);
  --success-border:rgba(58,176,119,0.12);
  --warning:       #b07838;
  --warning-bg:    rgba(176,120,56,0.06);
  --warning-border:rgba(176,120,56,0.12);
  --error:         var(--ember);
  --error-bg:      var(--ember-soft);
  --error-border:  var(--ember-border);

  --green-dark:    #0E6A44;
  --green-mid:     #107F4B;
  --green-soft:    #5BB381;
  --green-accent:  #22C55E;
  --green-pale:    #DCFCE7;
  --green-pale-bg: rgba(220,252,231,0.5);

  --bg:            var(--charcoal);
  --surface:       var(--charcoal-2);
  --surface-alt:   var(--charcoal-3);
  --border:        var(--tear-border);
  --border-hover:  #d5dad7;

  --text:          var(--ivory);
  --text-secondary:var(--tear);
  --text-muted:    var(--tear-light);

  --primary:       var(--wax);
  --primary-hover: var(--wax-dim);

  --shadow-sm:     0 1px 2px rgba(0,0,0,0.04);
  --shadow:        0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-md:     0 4px 20px rgba(0,0,0,0.02);
  --shadow-lg:     0 10px 30px rgba(0,0,0,0.03);

  --radius:        16px;
  --radius-sm:     12px;
  --radius-xs:     8px;
  --font:          'Inter', system-ui, -apple-system, sans-serif;
  --transition:    180ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOKENS — Light Mode (warm parchment inversion)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (prefers-color-scheme: light) {
  :root {
    --charcoal:      #f3f5f4;
    --charcoal-2:    #ffffff;
    --charcoal-3:    #f8f9f8;
    --charcoal-4:    #eef0ef;

    --tear:          #6b7770;
    --tear-light:    #8a9490;
    --tear-border:   #e5eae7;

    --ember:         #ea4335;
    --ember-soft:    rgba(234,67,53,0.06);
    --ember-border:  rgba(234,67,53,0.15);

    --wax:           #115e3b;
    --wax-dim:       #0e4d31;
    --wax-soft:      rgba(17,94,59,0.06);
    --wax-border:    rgba(17,94,59,0.12);

    --ivory:         #121614;
    --ivory-secondary:#6b7770;

    --success:       #3ab077;
    --success-bg:    rgba(58,176,119,0.06);
    --success-border:rgba(58,176,119,0.12);
    --warning:       #b07838;
    --warning-bg:    rgba(176,120,56,0.06);
    --warning-border:rgba(176,120,56,0.12);

    --green-dark:    #0E6A44;
    --green-mid:     #107F4B;
    --green-soft:    #5BB381;
    --green-accent:  #22C55E;
    --green-pale:    #DCFCE7;
    --green-pale-bg: rgba(220,252,231,0.5);

    --shadow-sm:     0 1px 2px rgba(0,0,0,0.04);
    --shadow:        0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    --shadow-md:     0 4px 20px rgba(0,0,0,0.02);
    --shadow-lg:     0 10px 30px rgba(0,0,0,0.03);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET
   ═══════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }
html { scroll-behavior: smooth; scroll-padding-top: 88px }

body {
  background: var(--bg);
  color: var(--text-secondary);
  font-family: var(--font);
  overflow-x: hidden;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition) }
a:hover { color: var(--primary-hover) }

/* ═══════════════════════════════════════════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════════════════════════════════════════ */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════════════════════════════════════════ */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
  height: 72px;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

@media (prefers-color-scheme: light) {
  .topbar { background: #ffffff }
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.brand-dot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--green-dark);
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.7rem;
  color: var(--green-soft);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}

.nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-links a {
  color: var(--tear);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  padding: 8px 16px;
  border-radius: 100px;
}

.nav-links a:hover {
  color: var(--green-dark);
  background: var(--green-pale-bg);
}

.judge-pill, .admin-pill {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 6px 16px;
  border-radius: 100px;
  color: var(--primary);
  background: var(--wax-soft);
  pointer-events: none;
}

.admin-pill {
  color: var(--ember);
  background: var(--ember-soft);
}

.topbar-right .judge-pill {
  color: var(--primary) !important;
  background: var(--wax-soft) !important;
  border: 1px solid var(--wax-border) !important;
}

.logout-form { display: inline; margin: 0; padding: 0 }

.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--tear);
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-family: inherit;
}
.hamburger:hover {
  color: var(--green-dark);
  border-color: var(--green-mid);
}
.hamburger i {
  width: 18px;
  height: 18px;
  display: block;
}

.logout-btn {
  background: transparent;
  border: 1px solid var(--border);
  padding: 7px 18px;
  border-radius: 100px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--tear);
  transition: all var(--transition);
  font-family: inherit;
}

.logout-btn:hover {
  border-color: var(--ember);
  color: var(--ember);
  background: var(--ember-soft);
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTENT & FOOTER
   ═══════════════════════════════════════════════════════════════════════════ */
.content {
  flex: 1;
  padding: 48px 32px 80px;
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}

/* Admin dashboard: full width */
.admin-topbar ~ .content,
body:has(.admin-topbar) .content {
  max-width: 100%;
  padding: 40px 48px 80px;
}

.footer {
  text-align: center;
  padding: 24px 32px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  width: 100%;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.footer-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--border);
  object-fit: contain;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FLASH MESSAGES
   ═══════════════════════════════════════════════════════════════════════════ */
.flash-wrap { margin-bottom: 32px }

.flash {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-weight: 500;
  font-size: 0.875rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: flash-in 0.3s ease-out;
  border: 1px solid;
}

@keyframes flash-in {
  from { opacity: 0; transform: translateY(-8px) }
  to { opacity: 1; transform: translateY(0) }
}

.flash-success {
  background: var(--green-pale);
  color: var(--green-dark);
  border-color: var(--green-soft);
}

.flash-error {
  background: var(--error-bg);
  color: var(--error);
  border-color: var(--error-border);
}

.flash-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.5;
  padding: 0 4px;
  transition: opacity var(--transition);
  line-height: 1;
}

.flash-close:hover { opacity: 1 }

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════════════════════════════════ */
.login-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 70vh;
  padding: 32px;
}

.login-card {
  background: var(--surface);
  padding: 48px 40px;
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  text-align: center;
  animation: card-in 0.3s ease-out;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(8px) }
  to { opacity: 1; transform: translateY(0) }
}

.login-logo h1 {
  margin: 0;
  color: var(--text);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
}

.brand-dot.big {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.brand-dot.big img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tagline {
  color: var(--text-muted);
  margin-top: 6px;
  margin-bottom: 32px;
  font-size: 0.8rem;
  font-weight: 500;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.login-form label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 16px;
  margin-bottom: 6px;
}

.login-form input {
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all var(--transition);
}

.login-form input::placeholder { color: var(--text-muted) }

.login-form input:focus {
  outline: none;
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(16,127,75,0.1);
}

.login-form input:hover:not(:focus) {
  border-color: var(--border-hover);
}

.hint {
  margin-top: 24px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN TABS
   ═══════════════════════════════════════════════════════════════════════════ */
.login-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg);
  border-radius: var(--radius-xs);
  padding: 3px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.login-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.login-tab.active {
  background: var(--green-mid);
  color: #ffffff;
}

.login-tab:hover:not(.active) {
  color: var(--text);
  background: var(--surface-alt);
}

.tab-form {
  display: none;
}

.tab-form.active {
  display: flex;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */
.btn-primary {
  background: var(--green-mid);
  color: #ffffff;
  border: none;
  padding: 0 24px;
  height: 44px;
  border-radius: var(--radius-xs);
  font: 600 0.875rem/1 var(--font);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  text-align: center;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

.btn-primary:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: #ffffff;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary.full { width: 100%; margin-top: 24px }
.btn-primary.small { height: 38px; padding: 0 20px; font-size: 0.8rem; margin-top: 8px }
.btn-primary.tiny { height: 32px; padding: 0 14px; font-size: 0.75rem; margin-top: 0; border-radius: 6px }

.btn-secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 0 24px;
  height: 44px;
  border-radius: var(--radius-xs);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  font-family: inherit;
  transition: all var(--transition);
}

.btn-secondary:hover {
  border-color: var(--green-mid);
  color: var(--green-dark);
  background: var(--green-pale-bg);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary.small { height: 38px; padding: 0 20px; font-size: 0.8rem }
.btn-secondary.tiny { height: 32px; padding: 0 14px; font-size: 0.75rem; border-radius: 6px }

.btn-danger {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error-border);
  padding: 0 16px;
  height: 32px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}

.btn-danger:hover {
  background: var(--error);
  color: #fff;
  border-color: var(--error);
}

.btn-danger.tiny { height: 32px; padding: 0 14px; font-size: 0.75rem; border-radius: 6px }

/* ═══════════════════════════════════════════════════════════════════════════
   PAGE HEAD
   ═══════════════════════════════════════════════════════════════════════════ */
.page-head { margin-bottom: 40px }

.page-head h2 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.muted {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 4px 0;
  font-weight: 400;
}

.progress-text { margin-top: 8px }

/* ═══════════════════════════════════════════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════════════════════════════════════════ */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-top: 12px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--green-mid);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TEAM ENTRY FORM
   ═══════════════════════════════════════════════════════════════════════════ */
.team-entry-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 560px;
  animation: card-in 0.3s ease-out;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.team-entry-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group { margin-bottom: 20px }

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="file"] {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: all var(--transition);
}

.form-group input[type="text"]::placeholder { color: var(--text-muted) }

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--wax-soft);
}

.form-group input[type="text"]:hover:not(:focus),
.form-group input[type="password"]:hover:not(:focus) {
  border-color: var(--border-hover);
}

.track-options { display: flex; gap: 12px }
.track-option { flex: 1; cursor: pointer }
.track-option input[type="radio"] { display: none }

.track-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: all var(--transition);
  text-align: center;
}

.track-option input[type="radio"]:checked + .track-card {
  border-color: var(--primary);
  background: var(--wax-soft);
}

.track-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.track-icon { font-size: 2rem }
.track-label { font-weight: 600; font-size: 0.875rem; color: var(--text) }
.team-info-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap }
.team-meta { font-size: 0.8rem; color: var(--text-muted) }

/* ═══════════════════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.badge-pending {
  background: var(--wax-soft);
  color: var(--primary);
}

.badge-done {
  background: var(--green-pale);
  color: var(--green-dark);
}

.badge-software {
  background: rgba(90,130,170,0.1);
  color: #7AACC8;
}

.badge-hardware {
  background: var(--warning-bg);
  color: var(--warning);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCORE FORM
   ═══════════════════════════════════════════════════════════════════════════ */
.back-link {
  color: var(--green-mid);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
  margin-bottom: 12px;
}

.back-link:hover {
  gap: 10px;
  color: var(--green-dark);
}

.score-form {
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-top: 20px;
  animation: card-in 0.3s ease-out;
}

.criteria-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.criteria-row {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  transition: all var(--transition);
}

.criteria-row:hover {
  border-color: var(--wax-border);
}

.criteria-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.criteria-label { font-weight: 600; font-size: 0.9rem; color: var(--text) }

.criteria-max {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.range-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-wrap input[type="number"] {
  width: 100px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  font-family: var(--font);
  outline: none;
  -moz-appearance: textfield;
  transition: all var(--transition);
}

.range-wrap input[type="number"]::-webkit-inner-spin-button,
.range-wrap input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.range-wrap input[type="number"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--wax-soft);
}

.range-wrap input[type="number"]:hover:not(:focus) {
  border-color: var(--border-hover);
}

.range-max {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.total-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 16px;
  letter-spacing: -0.02em;
}

.total-row #totalScore {
  color: var(--primary);
}

.total-row .muted {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESULTS TABLE
   ═══════════════════════════════════════════════════════════════════════════ */
.export-link { margin-top: 12px }

.table-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
}

.results-table th,
.results-table td {
  padding: 14px 20px;
  text-align: left;
  white-space: nowrap;
}

.results-table th {
  background: var(--surface-alt);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

.results-table tbody tr {
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}

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

.results-table tbody tr:hover {
  background: var(--surface-alt);
}

.results-table tbody td {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.crit-header {
  font-size: 0.7rem;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN PANEL
   ═══════════════════════════════════════════════════════════════════════════ */
.admin-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  animation: card-in 0.3s ease-out;
  border: 1px solid var(--border);
}

.admin-section h3 {
  margin: 0 0 20px;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.form-row input {
  flex: 1;
  min-width: 140px;
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  transition: all var(--transition);
}

.form-row input::placeholder { color: var(--text-muted) }

.form-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--wax-soft);
}

.form-row input:hover:not(:focus) {
  border-color: var(--border-hover);
}

.admin-table-wrap { overflow-x: auto }

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table input[type="text"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  transition: all var(--transition);
}

.admin-table input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--wax-soft);
}

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

.admin-table tbody tr:hover {
  background: var(--surface-alt);
}

.inline-form { display: inline; margin: 0; padding: 0 }
.actions-cell { display: flex; gap: 6px; align-items: center }

/* ═══════════════════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 64px 32px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.empty-state p { max-width: 400px; margin: 0 auto; line-height: 1.7 }

.empty-state a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition);
}

.empty-state a:hover { color: var(--green-dark) }

/* ═══════════════════════════════════════════════════════════════════════════
   DASHBOARD HOME
   ═══════════════════════════════════════════════════════════════════════════ */
.dashboard-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.dashboard-hero { margin-bottom: 48px }

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--green-dark);
  margin-bottom: 8px;
  line-height: 1.1;
}

.hero-sub {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.hero-welcome {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 400;
}

.hero-message {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 420px;
  line-height: 1.6;
  margin: 12px auto 0;
}

.action-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.action-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 28px 28px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 260px;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}

.action-card:hover {
  border-color: var(--green-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: inherit;
}

.action-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  background: var(--green-pale);
  color: var(--green-mid);
}

.action-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.5;
}

.action-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.action-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.action-arrow {
  margin-left: auto;
  color: var(--text-muted);
  transition: all var(--transition);
}

.action-card:hover .action-arrow {
  color: var(--green-mid);
  transform: translateX(2px);
}

.action-arrow svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SEARCH BAR
   ═══════════════════════════════════════════════════════════════════════════ */
.search-bar {
  margin-bottom: 28px;
  max-width: 480px;
}

.search-bar input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  transition: all var(--transition);
}

.search-bar input::placeholder { color: var(--text-muted) }

.search-bar input:focus {
  outline: none;
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(16,127,75,0.1);
}

.search-bar input:hover:not(:focus) {
  border-color: var(--border-hover);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TRACK GROUPS
   ═══════════════════════════════════════════════════════════════════════════ */
.track-group { margin-bottom: 32px }

.track-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.track-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-software { background: #7AACC8 }
.dot-hardware { background: var(--warning) }
.dot-other    { background: var(--text-muted) }

.track-count {
  font-size: 0.7rem;
  background: var(--surface-alt);
  color: var(--text-muted);
  padding: 2px 10px;
  border-radius: 100px;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TEAM LIST
   ═══════════════════════════════════════════════════════════════════════════ */
.team-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.team-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}

.team-item:hover {
  border-color: var(--wax-border);
  transform: translateX(2px);
  box-shadow: var(--shadow-md);
  color: inherit;
}

.team-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.team-item-name { font-weight: 600; font-size: 0.9rem; color: var(--text) }
.team-item-school { font-size: 0.8rem; color: var(--text-muted) }
.team-item-meta { font-size: 0.8rem; color: var(--text-muted) }

.team-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-item-arrow {
  color: var(--text-muted);
  transition: all var(--transition);
}

.team-item:hover .team-item-arrow {
  color: var(--primary);
  transform: translateX(2px);
}

.draft-score {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary);
}

.submitted-score {
  font-weight: 700;
  font-size: 0.85rem;
  color: #7AACC8;
}

.judge-count {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-alt);
  padding: 3px 10px;
  border-radius: 6px;
}

.readonly-notice {
  text-align: center;
  padding: 24px;
  background: rgba(122,172,200,0.06);
  border: 1px solid rgba(122,172,200,0.15);
  border-radius: var(--radius-sm);
  margin-top: 20px;
}

.readonly-notice p {
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

input[type="number"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--surface-alt);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FLAT TEAM LIST
   ═══════════════════════════════════════════════════════════════════════════ */
.team-list-flat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.team-item-flat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}

.team-item-flat:hover {
  border-color: var(--wax-border);
  transform: translateX(2px);
  box-shadow: var(--shadow-md);
  color: inherit;
}

/* ═══════════════════════════════════════════════════════════════════════════
   EDITORIAL ACCENTS
   ═══════════════════════════════════════════════════════════════════════════ */
.chapter-divider {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}

.sidebar-text {
  display: none;
}

.glassy-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   DECORATIVE LAYERS — Hidden
   ═══════════════════════════════════════════════════════════════════════════ */
.microchips-layer,
.stars-layer,
.robot-mascot,
.bg-glow,
.bg-grid,
.bg-particles {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px }
::-webkit-scrollbar-track { background: transparent }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover) }

/* ═══════════════════════════════════════════════════════════════════════════
   SELECTION
   ═══════════════════════════════════════════════════════════════════════════ */
::selection {
  background: var(--wax-soft);
  color: var(--text);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOCUS VISIBLE
   ═══════════════════════════════════════════════════════════════════════════ */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 850px) {
  .topbar { height: 64px; padding: 0 20px }
  .hamburger { display: inline-flex }
  .topbar .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px;
    gap: 0;
    display: none;
    z-index: 999;
  }
  .topbar .nav-links.open { display: flex }
  .topbar .nav-links a, .topbar .nav-links .logout-btn, .topbar .nav-links .judge-pill {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    border-radius: 0;
    width: 100%;
    justify-content: flex-start;
    border-left: none;
    border-right: none;
  }
  .topbar .nav-links a:last-child, .topbar .nav-links .logout-btn:last-child { border-bottom: 0 }
  .topbar .nav-links .logout-form { width: 100% }
  .topbar .nav-links .logout-form .logout-btn { border: none; border-bottom: 1px solid var(--border) }
  .content { padding: 32px 20px 64px }
  .score-form { padding: 24px 20px }
  .criteria-row { padding: 20px }
  .track-options { flex-direction: column }
  .form-row { flex-direction: column }
  .form-row input { min-width: 100% }
  .results-table th,
  .results-table td { padding: 12px 14px; font-size: 0.8rem }
  .admin-table th,
  .admin-table td { padding: 10px 10px; font-size: 0.75rem }
  .page-head h2 { font-size: 1.5rem }
  .hero-title { font-size: 2.2rem }
  .action-buttons { flex-direction: column; align-items: center }
  .action-card { width: 100%; max-width: 320px; padding: 24px }
  .team-item,
  .team-item-flat { padding: 14px 16px }
}

@media (max-width: 640px) {
  .topbar { height: 56px }
  .topbar .nav-links { top: 56px }
  .content { padding: 24px 16px 48px }
  .login-card { padding: 36px 24px; margin: 12px }
  .brand-sub { display: none }
  .hero-title { font-size: 1.8rem }
  .action-card { padding: 20px }
  .score-form { padding: 20px 16px }
  .results-table th,
  .results-table td { padding: 10px 12px; font-size: 0.75rem }
  .admin-table th,
  .admin-table td { padding: 8px 8px; font-size: 0.7rem }
  .footer { padding: 20px; font-size: 0.7rem }
}

@media (max-width: 380px) {
  .hero-title { font-size: 1.5rem }
  .page-head h2 { font-size: 1.3rem }
  .brand-name { font-size: 0.9rem }
  .content { padding: 20px 12px 40px }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN HEADER — Section 1
   ═══════════════════════════════════════════════════════════════════════════ */
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  height: 64px;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.logo-circle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.topbar-left .brand-name {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--green-dark);
  letter-spacing: -0.02em;
}

.topbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.panel-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 7px 16px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: all var(--transition);
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.nav-btn:hover {
  color: var(--green-dark);
  background: var(--green-pale-bg);
}

.nav-active {
  color: var(--green-dark) !important;
  background: var(--green-pale-bg) !important;
  font-weight: 700;
}

.logout-btn {
  color: var(--ember) !important;
  border-color: var(--ember-border) !important;
  background: var(--ember-soft) !important;
}

.logout-btn:hover {
  border-color: var(--ember) !important;
  color: #fff !important;
  background: var(--ember) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   METRICS DASHBOARD — Section 2 (Stripe + Monitoring inspired)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Top Stats Row */
.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.dash-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all var(--transition);
}

.dash-stat-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.dash-stat-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.dash-stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.dash-stat-total {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
}

/* Segmented Progress Bar (monitoring style) */
.dash-seg-track {
  display: flex;
  gap: 4px;
  margin-top: 10px;
}

.dash-seg {
  flex: 1;
  height: 8px;
  border-radius: 2px;
  background: var(--green-pale);
  transition: background 0.3s ease;
}

.dash-seg-fill {
  background: var(--green-accent);
}

/* Section Header */
.dash-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 16px;
}

.dash-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.dash-section-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 4px 0 0;
}

/* Metric Cards (Stripe card style) */
.dash-metric-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.dash-metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all var(--transition);
}

.dash-metric-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.dash-metric-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.dash-metric-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dash-metric-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.dash-metric-card-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dash-metric-card-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 4px 0 8px;
}

/* Table inside cards */
.dash-metric-table {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.dash-metric-table-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  padding: 10px 0 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.dash-metric-table-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  padding: 10px 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.dash-metric-table-row:last-child {
  border-bottom: none;
}

.dash-val-green {
  color: var(--green-accent);
  font-weight: 600;
}

.dash-val-muted {
  color: var(--text-muted);
  font-weight: 500;
}

.dash-val-warn {
  color: var(--warning);
  font-weight: 700;
}

/* Bottom Status Row */
.dash-bottom-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.dash-status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--transition);
}

.dash-status-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.dash-status-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-status-grid {
  display: flex;
  gap: 24px;
}

.dash-status-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-status-item-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.dash-status-item-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* Status Badges */
.dash-badge-row {
  display: flex;
  gap: 8px;
}

.dash-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.dash-badge-green {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.dash-badge-orange {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.dash-status-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Legacy overrides */
.metric-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-pale-bg);
  border-style: dashed;
  border-color: var(--green-soft);
}

.placeholder-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Legacy list utilities (used in modal forms) */
.metric-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.judge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.judge-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.judge-stats {
  display: flex;
  gap: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.stat-ev {
  color: var(--green-accent);
}

.stat-nev {
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LEADERBOARD — Clean Table Cards
   ═══════════════════════════════════════════════════════════════════════════ */
.dash-leaderboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 28px;
  overflow: hidden;
}

.dash-table-wrap {
  overflow-x: auto;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
}

.dash-table thead {
  border-bottom: 1px solid var(--border);
}

.dash-table th {
  padding: 14px 20px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  white-space: nowrap;
  background: var(--surface-alt);
}

.dash-table td {
  padding: 14px 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

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

.dash-table tbody tr:hover {
  background: var(--surface-alt);
}

.dash-rank-col {
  width: 48px;
  text-align: center;
}

.dash-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.dash-rank-1 {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.dash-rank-2 {
  background: linear-gradient(135deg, #94a3b8, #64748b);
}

.dash-rank-3 {
  background: linear-gradient(135deg, #d97706, #b45309);
}

.dash-rank-num {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.dash-team-name {
  font-weight: 600;
  color: var(--text);
}

.dash-cell-muted {
  color: var(--text-muted);
}

.dash-cell-num {
  font-variant-numeric: tabular-nums;
}

.dash-avg-val {
  font-weight: 700;
  color: var(--text);
}

.dash-avg-max {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dash-rank-first {
  color: var(--green-accent);
}

/* Export Buttons */
.dash-export-btns {
  display: flex;
  gap: 8px;
}

.dash-export-btn {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.dash-export-btn:hover {
  border-color: var(--green-mid);
  color: var(--green-dark);
  background: var(--green-pale-bg);
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTROL BAR — Quick Actions
   ═══════════════════════════════════════════════════════════════════════════ */
.dash-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.dash-action-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all var(--transition);
}

.dash-action-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.dash-action-card-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dash-action-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-action-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: left;
  transition: all var(--transition);
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-action-btn:hover {
  border-color: var(--green-mid);
  color: var(--green-dark);
  background: var(--green-pale-bg);
}

.dash-action-btn-success {
  border-color: var(--success-border);
  color: var(--success);
  background: var(--success-bg);
}

.dash-action-btn-success:hover {
  border-color: var(--success);
  color: var(--success);
  background: var(--success-bg);
}

.dash-action-btn-warn {
  border-color: var(--warning-border);
  color: var(--warning);
  background: var(--warning-bg);
}

.dash-action-btn-warn:hover {
  border-color: var(--warning);
  color: var(--warning);
  background: var(--warning-bg);
}

.dash-action-btn-danger {
  color: var(--text-muted);
}

.dash-action-btn-danger:hover {
  border-color: var(--ember-border);
  color: var(--ember);
  background: var(--ember-soft);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODAL FORMS
   ═══════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
}

.modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-form {
  display: none;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--green-soft);
  border-top: 3px solid var(--green-mid);
  border-radius: var(--radius);
  padding: 32px;
  width: 90%;
  max-width: 440px;
  z-index: 300;
  box-shadow: var(--shadow-lg);
  animation: card-in 0.2s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-form.active {
  display: block;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--green-pale);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  transition: color var(--transition);
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
}

.form-select {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  transition: all var(--transition);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(16,127,75,0.1);
}

.form-select:hover:not(:focus) {
  border-color: var(--border-hover);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN HEADER RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 850px) {
  .admin-topbar { height: 64px; padding: 0 20px }
  .admin-topbar .topbar-right {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px;
    gap: 0;
    display: none;
    z-index: 999;
  }
  .admin-topbar .topbar-right.open { display: flex }
  .admin-topbar .topbar-right a,
  .admin-topbar .topbar-right button {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    border-radius: 0;
    width: 100%;
    justify-content: flex-start;
    border-left: none;
    border-right: none;
    border-top: none;
  }
  .admin-topbar .topbar-right a:last-child,
  .admin-topbar .topbar-right button:last-child { border-bottom: 0 }
  .topbar-center { position: static; transform: none }
  .panel-title { font-size: 0.85rem }
  .dash-stats-row { grid-template-columns: repeat(2, 1fr) }
  .dash-metric-cards { grid-template-columns: 1fr }
  .dash-bottom-row { grid-template-columns: 1fr }
  .dash-actions-grid { grid-template-columns: repeat(2, 1fr) }
  .control-bar { padding: 16px; gap: 8px }
  .control-btn { padding: 8px 16px; font-size: 0.75rem }
}

@media (max-width: 640px) {
  .admin-topbar { height: 56px; padding: 0 16px }
  .topbar-left .brand-name { font-size: 1rem }
  .topbar-center { display: none }
  .panel-title { display: none }
  .nav-btn { padding: 6px 14px; font-size: 0.75rem }
  .dash-stats-row { grid-template-columns: 1fr 1fr; gap: 10px }
  .dash-stat-card { padding: 16px }
  .dash-stat-value { font-size: 1.75rem }
  .dash-metric-cards { gap: 10px }
  .dash-metric-card { padding: 16px }
  .dash-bottom-row { gap: 10px }
  .dash-status-card { padding: 16px }
  .dash-actions-grid { grid-template-columns: 1fr }
  .control-btn { padding: 7px 14px; font-size: 0.7rem }
  .modal-form { padding: 24px; width: 95% }
}

@media (max-width: 480px) {
  .dash-stats-row { grid-template-columns: 1fr }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN EDIT SCORE
   ═══════════════════════════════════════════════════════════════════════════ */
.team-select-form {
  margin-bottom: 32px;
}

.team-select-form .form-row select {
  max-width: 400px;
}

.score-edit-card {
  background: var(--surface);
  border: 1px solid var(--green-soft);
  border-left: 3px solid var(--green-mid);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  animation: card-in 0.2s ease-out;
}

.score-edit-card:hover {
  border-color: var(--green-mid);
}

.score-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.score-edit-judge {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.score-edit-current {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.score-edit-current strong {
  color: var(--green-mid);
}

.score-edit-row {
  padding: 16px 20px;
}

.score-edit-row .range-wrap input[type="number"] {
  width: 80px;
  padding: 8px 12px;
  font-size: 1rem;
}

.score-edit-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.score-edit-total {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.score-edit-total strong {
  color: var(--green-dark);
  font-size: 1.25rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PARTICIPANT TAB LOCK
   ═══════════════════════════════════════════════════════════════════════════ */
.login-tab.locked {
  opacity: 0.7;
  cursor: default;
}

.login-tab.locked:hover:not(.active) {
  color: var(--text-secondary);
  background: transparent;
}

.lock-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
}

.lock-icon-sm {
  width: 12px;
  height: 12px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
}

.locked-state .locked-icon {
  width: 48px;
  height: 48px;
  display: block;
  margin: 0 auto 16px;
  color: var(--text-muted);
  stroke-width: 1.5;
}

.locked-state p {
  color: var(--text-muted);
  max-width: 300px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PARTICIPANT ACCESS CONTROL MODAL
   ═══════════════════════════════════════════════════════════════════════════ */
.access-status {
  text-align: center;
  padding: 16px 0;
}

.access-status p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.access-status strong {
  font-size: 1.1rem;
}

.status-locked {
  color: var(--ember);
}

.status-unlocked {
  color: var(--green-accent);
}

.access-desc {
  font-size: 0.8rem !important;
  color: var(--text-muted) !important;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCHOOL CUMULATIVE
   ═══════════════════════════════════════════════════════════════════════════ */
.dash-school-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.dash-school-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.dash-school-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dash-school-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green-pale);
  color: var(--green-dark);
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
}

.dash-school-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-school-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.dash-school-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dash-school-avg {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.dash-school-avg-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--green-dark);
  letter-spacing: -0.02em;
}

.dash-school-avg-max {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   OVERALL TAB
   ═══════════════════════════════════════════════════════════════════════════ */

/* Evaluation Tracking */
.dash-overall-tracking {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.dash-tracking-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.dash-tracking-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.dash-tracking-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-tracking-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 10px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
}

.dash-tracking-list {
  padding: 4px 0;
  max-height: 400px;
  overflow-y: auto;
}

.dash-tracking-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.dash-tracking-item:last-child {
  border-bottom: none;
}

.dash-tracking-item:hover {
  background: var(--surface-alt);
}

.dash-tracking-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-tracking-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dash-tracking-item-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
}

.dash-tracking-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Summary Analytics */
.dash-overall-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

.dash-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.dash-summary-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.dash-summary-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-summary-body {
  padding: 8px 0;
}

/* Rank rows in summary */
.dash-rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.dash-rank-row:last-child {
  border-bottom: none;
}

.dash-rank-row:hover {
  background: var(--surface-alt);
}

.dash-rank-team {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.dash-rank-score {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Judge Matrix */
.dash-judge-matrix {
  display: flex;
  flex-direction: column;
}

.dash-matrix-header,
.dash-matrix-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}

.dash-matrix-header {
  background: transparent;
}

.dash-matrix-header .dash-matrix-col {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dash-matrix-row:last-child {
  border-bottom: none;
}

.dash-matrix-row:hover {
  background: var(--surface-alt);
}

.dash-matrix-col {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.dash-matrix-row .dash-matrix-col:first-child {
  font-weight: 600;
  color: var(--text);
}

.rank-row:nth-child(1) .rank-badge {
  background: rgba(212,168,67,0.2);
  color: var(--wax);
}

.rank-row:nth-child(2) .rank-badge {
  background: rgba(200,200,210,0.15);
  color: var(--tear-light);
}

.rank-row:nth-child(3) .rank-badge {
  background: rgba(180,120,60,0.15);
  color: #B07838;
}

.rank-team {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
}

/* ── Judge Matrix ── */
.judge-matrix {
  display: flex;
  flex-direction: column;
}

.matrix-header {
  display: grid;
  grid-template-columns: 1fr 48px 48px;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.matrix-row {
  display: grid;
  grid-template-columns: 1fr 48px 48px;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  font-size: 0.85rem;
}

.matrix-row:last-child {
  border-bottom: none;
}

.matrix-row:hover {
  background: var(--surface-alt);
}

.matrix-col-name {
  font-weight: 600;
  color: var(--text);
}

.matrix-col-stat {
  text-align: center;
  font-weight: 600;
  color: var(--text-secondary);
}

.matrix-header .matrix-col-stat {
  color: var(--text-muted);
}

@media (max-width: 850px) {
  .dash-overall-tracking { grid-template-columns: 1fr }
  .dash-overall-summary { grid-template-columns: 1fr }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PANEL UI
   ═══════════════════════════════════════════════════════════════════════════ */
.panel-badge-hero {
  margin: 12px 0;
}

.panel-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green-dark);
  background: var(--green-pale);
  border: 1px solid var(--green-soft);
  letter-spacing: 0.02em;
}

.judge-score-chip {
  display: inline-block;
  padding: 3px 8px;
  margin: 2px 4px 2px 0;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.partner-score {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--green-mid);
  padding: 3px 10px;
  background: var(--green-pale-bg);
  border-radius: 6px;
}

.partner-ref-card {
  background: var(--surface);
  border: 1px solid var(--green-soft);
  border-left: 3px solid var(--green-mid);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.partner-ref-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--green-pale-bg);
  border-bottom: 1px solid var(--green-pale);
}

.partner-ref-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-dark);
}

.partner-ref-total {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark);
}

.partner-ref-body {
  padding: 12px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px;
}

.partner-ref-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.partner-ref-row:last-child {
  border-bottom: none;
}

.partner-ref-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.partner-ref-val {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.judge-score-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.judge-score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.judge-score-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.judge-score-total {
  font-weight: 700;
  font-size: 1rem;
  color: var(--green-dark);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCORE PAGE — Dribbble-inspired Layout
   Soft depth, warm accents, floating cards
   ═══════════════════════════════════════════════════════════════════════════ */

/* Sticky Score Topbar — frosted glass pill */
.score-topbar {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  z-index: 90;
  background: #ffffff;
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

@media (prefers-color-scheme: dark) {
  .score-topbar { background: #ffffff }
}

.score-topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.score-topbar-spacer {
  height: 62px;
}

.score-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.score-topbar-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.score-topbar-back:hover {
  background: var(--surface-alt);
  border-color: var(--border-hover);
  color: var(--text);
  transform: translateX(-2px);
}

.score-topbar-team {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.score-topbar-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-topbar-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.score-topbar-total {
  display: flex;
  align-items: baseline;
  gap: 4px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 14px;
}

.score-topbar-total-val {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.score-topbar-total-max {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Score Layout */
.score-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.score-layout .score-sidebar {
  display: none;
}

.score-layout:has(.score-sidebar) {
  grid-template-columns: 1fr 300px;
  gap: 28px;
}

.score-main {
  min-width: 0;
}

/* Team Hero — elevated floating card */
.score-team-hero {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: 20px;
  padding: 28px 32px;
  margin-bottom: 28px;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.03),
    0 4px 12px rgba(0,0,0,0.04),
    0 16px 40px rgba(0,0,0,0.02);
  position: relative;
  overflow: hidden;
}

.score-team-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green-mid), var(--green-accent), var(--green-soft));
  opacity: 0.7;
}

.score-team-hero.readonly-hero::before {
  background: linear-gradient(90deg, #7AACC8, #5B8C5A);
  opacity: 0.5;
}

.score-team-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.score-team-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}

.score-team-badges {
  display: flex;
  gap: 8px;
  align-items: center;
}

.score-team-school {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: block;
}

.score-participants {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.04);
}

.score-participant {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-alt);
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: 8px;
  padding: 4px 10px;
}

.score-participant-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}

.score-participant-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Criteria Cards — soft floating style */
.criteria-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (min-width: 1200px) {
  .criteria-list { grid-template-columns: repeat(2, 1fr); }
}

.criteria-card {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: 18px;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 1px 2px rgba(0,0,0,0.02),
    0 2px 8px rgba(0,0,0,0.03);
}

.criteria-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 2px 4px rgba(0,0,0,0.04),
    0 8px 24px rgba(0,0,0,0.06);
  border-color: rgba(17,94,59,0.12);
}

.criteria-card.criteria-filled {
  border-color: rgba(17,94,59,0.15);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(17,94,59,0.02) 100%);
}

.criteria-card-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px 0;
}

.criteria-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--surface-alt), var(--surface));
  border: 1px solid rgba(0,0,0,0.04);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.criteria-card.criteria-filled .criteria-num {
  background: linear-gradient(135deg, var(--green-mid), var(--green-accent));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(17,94,59,0.25);
}

.criteria-card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.criteria-label {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.criteria-max-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.criteria-card-body {
  padding: 16px 24px 22px;
}

/* Criteria Input Row */
.criteria-input-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.criteria-btnminus,
.criteria-btnplus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.06);
  background: var(--surface-alt);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.criteria-btnminus:hover:not(:disabled),
.criteria-btnplus:hover:not(:disabled) {
  background: var(--green-pale);
  border-color: rgba(17,94,59,0.15);
  color: var(--green-dark);
  transform: scale(1.05);
}

.criteria-btnminus:active:not(:disabled),
.criteria-btnplus:active:not(:disabled) {
  transform: scale(0.95);
}

.criteria-btnminus:disabled,
.criteria-btnplus:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.criteria-input-row input[type="number"] {
  width: 80px;
  padding: 10px 4px;
  border: 2px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.6rem;
  font-weight: 800;
  text-align: center;
  font-family: var(--font);
  outline: none;
  -moz-appearance: textfield;
  transition: all 0.2s ease;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.criteria-input-row input[type="number"]::-webkit-inner-spin-button,
.criteria-input-row input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.criteria-input-row input[type="number"]:focus {
  border-color: var(--green-mid);
  box-shadow: 0 0 0 4px rgba(17,94,59,0.08);
}

.criteria-input-row input[type="number"]:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: var(--surface-alt);
}

.criteria-slash {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 400;
  opacity: 0.5;
}

.criteria-max-val {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 24px;
  text-align: left;
}

/* Criteria Progress Bar — smooth gradient */
.criteria-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(0,0,0,0.04);
  border-radius: 3px;
  margin-top: 16px;
  overflow: hidden;
}

.criteria-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-mid), var(--green-accent));
  border-radius: 3px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Partner Hint */
.criteria-partner-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,0.04);
}

.criteria-partner-hint strong {
  color: var(--green-mid);
  font-weight: 600;
}

/* Score Footer — elevated card with gradient accent */
.score-footer {
  margin: 32px auto 0;
  padding: 20px 28px;
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.03),
    0 4px 12px rgba(0,0,0,0.04),
    0 16px 40px rgba(0,0,0,0.02);
  position: relative;
  overflow: hidden;
  max-width: 420px;
  width: 100%;
}

.score-footer::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green-mid), var(--green-accent), var(--green-soft));
  opacity: 0.5;
}

.score-footer-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.score-footer-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.score-footer-val-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
  background: rgba(17,94,59,0.06);
  border: 1px solid rgba(17,94,59,0.10);
  border-radius: 10px;
  padding: 5px 14px;
}

.score-footer-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--green-dark);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.score-footer-max {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.score-submit-btn {
  width: 100%;
  height: 40px;
  font-size: 0.85rem;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: all 0.2s ease;
}

.score-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(17,94,59,0.25);
}

.score-submit-btn:active {
  transform: translateY(0);
}

/* Score Sidebar — floating reference card */
.score-sidebar {
  position: sticky;
  top: 140px;
  align-self: start;
}

.score-sidebar-card {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: 20px;
  padding: 24px;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.02),
    0 4px 12px rgba(0,0,0,0.03),
    0 12px 32px rgba(0,0,0,0.02);
  position: relative;
  overflow: hidden;
}

.score-sidebar-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #7AACC8, var(--green-soft));
}

.score-sidebar-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.score-sidebar-head svg {
  color: #7AACC8;
}

.score-sidebar-total {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}

.score-sidebar-total span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.score-sidebar-judge {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 18px;
}

.score-sidebar-crits {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.score-sidebar-crit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid rgba(0,0,0,0.03);
}

.score-sidebar-crit:last-child {
  border-bottom: none;
}

.score-sidebar-crit-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.score-sidebar-crit-val {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.score-sidebar-crit-max {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.7rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCORE PAGE — Responsive
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 850px) {
  .score-topbar-inner { padding: 10px 20px }
  .score-topbar-name { font-size: 0.85rem }
  .score-topbar-meta { display: none }
  .score-topbar-total-val { font-size: 1rem }
  .score-topbar-total { padding: 5px 12px }
  .score-team-hero { padding: 22px 24px; border-radius: 16px }
  .score-team-name { font-size: 1.15rem }
  .criteria-list { grid-template-columns: 1fr; }
  .criteria-card { border-radius: 14px }
  .criteria-card-header { padding: 16px 20px 0 }
  .criteria-card-body { padding: 14px 20px 18px }
  .criteria-input-row input[type="number"] { width: 68px; font-size: 1.35rem }
  .criteria-btnminus,
  .criteria-btnplus { width: 36px; height: 36px; border-radius: 10px }
  .score-footer { padding: 16px 20px; border-radius: 12px; max-width: 360px }
  .score-footer-val { font-size: 1.2rem }
  .score-layout:has(.score-sidebar) { grid-template-columns: 1fr }
  .score-sidebar { position: static; margin-top: 24px }
  .score-sidebar-card { border-radius: 16px }
}

@media (max-width: 640px) {
  .score-topbar { top: 56px }
  .score-topbar-inner { padding: 8px 16px }
  .score-topbar-back { width: 32px; height: 32px; border-radius: 8px }
  .score-topbar-back svg { width: 16px; height: 16px }
  .score-topbar-name { font-size: 0.8rem }
  .score-topbar-spacer { height: 52px }
  .score-team-hero { padding: 18px 20px; margin-bottom: 20px }
  .score-team-name { font-size: 1.05rem }
  .criteria-card-header { padding: 14px 18px 0 }
  .criteria-card-body { padding: 12px 18px 16px }
  .criteria-num { width: 28px; height: 28px; font-size: 0.72rem; border-radius: 8px }
  .criteria-label { font-size: 0.85rem }
  .criteria-input-row input[type="number"] { width: 58px; font-size: 1.2rem; padding: 8px 2px; border-radius: 12px }
  .criteria-btnminus,
  .criteria-btnplus { width: 34px; height: 34px; border-radius: 10px }
  .score-footer { padding: 18px 20px }
  .score-footer-total { flex-direction: column; gap: 12px; align-items: flex-start }
  .score-footer-val-wrap { width: 100%; justify-content: center }
  .score-submit-btn { height: 48px; border-radius: 12px }
}

@media (max-width: 380px) {
  .score-topbar-right .badge { display: none }
  .score-topbar-total { padding: 4px 10px }
  .score-topbar-total-val { font-size: 0.9rem }
  .criteria-input-row input[type="number"] { width: 50px; font-size: 1.05rem }
  .criteria-btnminus,
  .criteria-btnplus { width: 30px; height: 30px }
}
