:root {
  --blue-deep: #061732;
  --blue-dark: #0a2240;
  --blue-brand: #1a266a;
  --blue-mid: #143a6b;
  --blue-bright: #2476d2;
  --red: #e31f2a;
  --red-dark: #b51924;
  --yellow: #ffed00;
  --green: #009447;
  --surface: #ffffff;
  --background: #f4f6fa;
  --line: #e3e7ee;
  --text: #0a2240;
  --muted: #5a6a83;
  --gold: #d89f16;
  --silver: #8a95a5;
  --bronze: #a96332;
  --shadow: 0 12px 32px rgba(10, 34, 64, .09);
  --radius: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Barlow", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
.hidden { display: none !important; }
.auth-required .app-shell, .auth-required .mobile-nav, .auth-required .view-mode-switch { visibility: hidden; }

.top-strip { display: grid; grid-template-columns: 1fr 1fr 1fr; height: 4px; }
.top-strip i:nth-child(1) { background: var(--red); }
.top-strip i:nth-child(2) { background: var(--yellow); }
.top-strip i:nth-child(3) { background: var(--blue-bright); }

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  color: white;
  background: var(--blue-brand);
  border-bottom: 3px solid var(--red);
  box-shadow: 0 5px 20px rgba(6, 23, 50, .2);
}
.header-inner {
  width: min(1500px, 100%);
  min-height: 76px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  padding: 0;
  color: white;
  background: transparent;
  text-align: left;
}
.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--red);
  border: 2px solid rgba(255,255,255,.92);
  box-shadow: inset 0 -8px 0 rgba(0,0,0,.08);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .04em;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.08; }
.brand-copy strong {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
}
.brand-copy small { margin-top: 4px; color: #b8c5da; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.event-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  color: #dbe5f3;
  background: rgba(6,23,50,.25);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.event-status span, .live-label i { width: 7px; height: 7px; border-radius: 50%; background: #3ec76a; box-shadow: 0 0 0 4px rgba(62,199,106,.15); }
.view-mode-switch { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border: 1px solid rgba(255,255,255,.22); border-radius: 7px; }
.view-mode-switch button { min-height: 38px; padding: 0 10px; border: 0; color: #c7d3e5; background: rgba(6,23,50,.22); font-size: 11px; font-weight: 700; }
.view-mode-switch button.active { color: var(--blue-deep); background: var(--yellow); }
.user-presence {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  background: rgba(6,23,50,.22);
}
.presence-title { padding: 0 3px; color: #b8c5da; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.presence-person {
  min-width: 104px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border-radius: 6px;
  color: #aab8cf;
  background: rgba(255,255,255,.045);
}
.presence-person i { width: 7px; height: 7px; border-radius: 50%; background: #71809a; box-shadow: 0 0 0 3px rgba(113,128,154,.13); }
.presence-person span { min-width: 0; }
.presence-person strong, .presence-person small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.presence-person strong { color: #d6deea; font-size: 10px; line-height: 1.15; }
.presence-person small { margin-top: 2px; color: #8999b1; font-size: 8px; text-transform: uppercase; }
.presence-person.online { background: rgba(62,199,106,.11); }
.presence-person.online i { background: #3ec76a; box-shadow: 0 0 0 3px rgba(62,199,106,.16); }
.presence-person.online strong { color: white; }
.presence-person.online small { color: #8de8a8; }
.presence-person.current { outline: 1px solid rgba(255,214,0,.55); }
.admin-button {
  min-width: 156px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 7px;
  padding: 7px 11px;
  color: white;
  background: rgba(255,255,255,.08);
  font-weight: 600;
  text-align: left;
}
.admin-button.is-admin { border-color: rgba(62,199,106,.45); background: rgba(62,199,106,.14); }
.session-icon { flex: 0 0 auto; font-size: 18px; }
.session-copy { min-width: 0; display: flex; flex-direction: column; }
.session-copy small, .session-copy strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.session-copy small { color: #aebdd1; font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.session-copy strong { margin-top: 2px; color: white; font-size: 10px; line-height: 1.1; }

.app-shell { width: min(1500px, 100%); min-height: calc(100vh - 83px); margin: 0 auto; display: grid; grid-template-columns: 230px 1fr; }
.side-nav {
  position: sticky;
  top: 83px;
  align-self: start;
  height: calc(100vh - 83px);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  background: var(--blue-deep);
  color: #aab8cf;
}
.side-nav nav { display: grid; gap: 6px; }
.nav-item {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 5px;
  padding: 0 13px;
  color: #aab8cf;
  background: transparent;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
}
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active { color: white; border-left-color: var(--red); background: rgba(36,118,210,.18); }
.nav-icon { width: 22px; text-align: center; font-size: 18px; }
.side-event {
  margin-top: auto;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.09);
  border-top: 3px solid var(--red);
  border-radius: 7px;
  background: rgba(255,255,255,.035);
}
.side-event span { display: block; color: #7ab3ed; font-size: 11px; letter-spacing: .12em; }
.side-event strong { display: block; margin: 5px 0; color: white; font-family: "Barlow Condensed"; font-size: 25px; text-transform: uppercase; }
.side-event small { color: #7f91ad; line-height: 1.4; }

.content { min-width: 0; padding: 34px clamp(18px, 4vw, 52px) 70px; }
.observatory-home-access { min-height: 82px; margin: 0 0 16px; padding: 14px 17px; display: grid; grid-template-columns: 52px minmax(0,1fr) auto; align-items: center; gap: 14px; border: 1px solid #b9cce3; border-left: 5px solid var(--red); border-radius: 11px; color: inherit; background: linear-gradient(110deg,#fff,#edf5ff); box-shadow: 0 5px 18px rgba(16,28,80,.06); text-decoration: none; transition: transform .18s,border-color .18s,box-shadow .18s; }
.observatory-home-access:hover { border-color: var(--blue-bright); transform: translateY(-1px); box-shadow: 0 9px 24px rgba(16,28,80,.1); }
.observatory-home-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--blue-brand); font-size: 24px; }
.observatory-home-copy { min-width: 0; }
.observatory-home-copy small,.observatory-home-copy strong,.observatory-home-copy > span { display: block; }
.observatory-home-copy small { color: var(--red); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.observatory-home-copy strong { margin: 3px 0; color: var(--blue-brand); font-family: "Barlow Condensed"; font-size: 21px; line-height: 1.05; text-transform: uppercase; }
.observatory-home-copy > span { color: var(--muted); font-size: 11px; }
.observatory-home-arrow { padding: 9px 11px; border-radius: 8px; color: white; background: var(--blue-brand); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.operational-strip { margin: 0 0 18px; padding: 13px 16px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; border: 1px solid #cdd9e9; border-left: 4px solid var(--blue-bright); border-radius: 10px; background: #edf5ff; }
.operational-strip > div { display: flex; align-items: center; gap: 11px; }
.operational-strip p { margin: 0; }
.operational-strip strong, .operational-strip small { display: block; }
.operational-strip strong { color: var(--blue-brand); font-size: 13px; }
.operational-strip small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.role-icon { font-size: 24px; }
.flow-arrow { color: var(--blue-bright); font-size: 24px; font-weight: 800; }
.view { display: none; animation: viewIn .22s ease; }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.page-heading {
  margin-bottom: 28px;
  padding-bottom: 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 2px solid var(--blue-brand);
}
.page-heading h1, .panel-heading h2, .app-dialog h2 {
  margin: 3px 0 5px;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}
.page-heading h1 { font-size: clamp(34px, 4vw, 48px); color: var(--blue-brand); }
.page-heading p, .app-dialog p { margin: 0; color: var(--muted); }
.starting-order-draw-panel { margin: -8px 0 20px; padding: 15px 16px; display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; gap: 14px; border: 1px solid #e8c66b; border-radius: 11px; background: #fff8dd; }
.starting-order-draw-panel.completed { border-color: #8ecdaa; background: #eaf8f0; }
.draw-status-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.75); font-size: 22px; }
.starting-order-draw-panel small,.starting-order-draw-panel strong,.starting-order-draw-panel p { display: block; }
.starting-order-draw-panel small { color: #8a6500; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.starting-order-draw-panel.completed small { color: #08703b; }
.starting-order-draw-panel strong { margin-top: 3px; color: var(--blue-brand); font-size: 13px; }
.starting-order-draw-panel p { margin-top: 4px; color: var(--muted); font-size: 10px; }
.starting-order-draw-actions { display: flex; align-items: stretch; gap: 8px; }
.starting-order-draw-panel button { min-height: 43px; padding: 7px 14px; border: 0; border-radius: 7px; color: white; background: var(--blue-brand); font-size: 10px; font-weight: 900; }
.starting-order-draw-panel button.reset-draw-button { border: 1px solid #a72a35; color: #991f2a; background: white; }
.starting-order-draw-panel button:disabled { opacity: .55; cursor: wait; }
.mat-preassignment-panel { margin: 0 0 20px; padding: 15px 16px; display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; gap: 14px; border: 1px solid #bdd3ec; border-radius: 11px; background: #eef6ff; }
.mat-preassignment-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: white; font-size: 22px; }
.mat-preassignment-panel small,.mat-preassignment-panel strong,.mat-preassignment-panel p { display: block; }
.mat-preassignment-panel small { color: var(--blue-bright); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.mat-preassignment-panel strong { margin-top: 3px; color: var(--blue-brand); font-size: 13px; }
.mat-preassignment-panel p { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.mat-preassignment-panel button { min-height: 43px; padding: 7px 14px; border: 1px solid var(--blue-brand); border-radius: 7px; color: var(--blue-brand); background: white; font-size: 10px; font-weight: 900; }
.mat-preassignment-panel button:disabled { opacity: .55; cursor: wait; }
.eyebrow, .panel-kicker {
  color: var(--red);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.date-card { min-width: 138px; padding: 11px 16px; border-radius: 7px; color: white; background: var(--blue-brand); text-align: center; border-top: 4px solid var(--red); }
.date-card span, .date-card small { display: block; font-size: 10px; letter-spacing: .13em; }
.date-card strong { display: block; margin: -2px 0; font-family: "Barlow Condensed"; font-size: 36px; }

.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi-card {
  position: relative;
  min-height: 132px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 4px 12px rgba(10,34,64,.04);
}
.kpi-card::before { content: ""; position: absolute; top: 0; left: 0; width: 5px; height: 100%; background: var(--blue-bright); }
.kpi-card.red::before { background: var(--red); }
.kpi-card.yellow::before { background: #e2bb00; }
.kpi-card.green::before { background: var(--green); }
.kpi-icon { position: absolute; top: 15px; right: 15px; font-size: 22px; filter: saturate(.85); }
.kpi-label { display: block; padding-right: 30px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.kpi-value { display: block; margin: 5px 0 3px; color: var(--blue-brand); font-family: "Barlow Condensed"; font-size: 38px; font-weight: 900; line-height: 1; }
.kpi-note { color: #7a879b; font-size: 12px; }

.dashboard-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.panel-heading { min-height: 76px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { color: var(--blue-brand); font-size: 24px; }
.wide-panel { grid-column: 1 / -1; }
.count-badge { min-width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--red); font-family: "Barlow Condensed"; font-size: 22px; font-weight: 800; }
.mat-process-panel #unassignedCount { width: auto; min-width: 0; height: auto; padding: 9px 13px; border-radius: 999px; white-space: nowrap; font-size: 17px; line-height: 1; }
.medal-summary { padding: 24px 20px 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.medal-item { padding: 16px 12px; border-radius: 9px; background: var(--background); text-align: center; border: 1px solid var(--line); }
.medal-dot { width: 34px; height: 34px; margin: 0 auto 7px; display: grid; place-items: center; border-radius: 50%; color: white; box-shadow: inset 0 -4px 0 rgba(0,0,0,.12); font-weight: 800; }
.medal-dot.gold { background: var(--gold); }
.medal-dot.silver { background: var(--silver); }
.medal-dot.bronze { background: var(--bronze); }
.medal-item strong { display: block; color: var(--blue-brand); font-family: "Barlow Condensed"; font-size: 28px; }
.medal-item span { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.medal-breakdown { margin: 3px 20px 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.medal-breakdown > div { min-width: 0; padding: 10px 11px; border-left: 3px solid var(--blue-bright); border-radius: 6px; background: #edf5ff; }
.medal-breakdown strong, .medal-breakdown span, .medal-breakdown small { display: block; }
.medal-breakdown strong { overflow: hidden; color: var(--blue-brand); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.medal-breakdown span { margin-top: 3px; color: var(--blue-deep); font-size: 12px; font-weight: 700; }
.medal-breakdown small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.panel-note { margin: 5px 20px 20px; color: #7b8798; font-size: 12px; }
.result-progress { padding: 24px 20px; }
.progress-numbers { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.progress-numbers strong { font-family: "Barlow Condensed"; color: var(--blue-brand); font-size: 36px; }
.progress-numbers span { color: var(--muted); font-size: 13px; }
.progress-track { height: 12px; overflow: hidden; border-radius: 999px; background: #e8ecf3; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue-bright), var(--green)); }
.progress-caption { margin-top: 12px; color: var(--muted); font-size: 13px; }
.text-button { border: 0; padding: 8px 0; color: var(--red); background: transparent; font-weight: 700; }
.compact-list { padding: 0 20px 12px; }
.compact-row { padding: 13px 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.compact-row:last-child { border-bottom: 0; }
.compact-row strong { font-size: 14px; }
.compact-row small { display: block; margin-top: 3px; color: var(--muted); }
.review-pill { padding: 5px 9px; border-radius: 999px; color: #6f5700; background: #fff7c5; font-size: 11px; font-weight: 700; }

.toolbar { margin-bottom: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.search-box { min-width: min(340px, 100%); flex: 1; display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.search-box span { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.search-box input { width: 100%; min-height: 46px; border: 0; outline: 0; color: var(--text); background: transparent; }
.toolbar select, .organization-settings select { min-height: 46px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: white; }

.category-list, .results-list { display: grid; gap: 10px; }
.category-row, .result-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 96px 96px 150px 68px;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  box-shadow: 0 3px 10px rgba(10,34,64,.035);
}
.category-row:hover, .result-row:hover { border-color: #b9c8db; }
.category-name strong, .result-name strong { display: block; font-family: "Barlow Condensed"; font-size: 19px; color: var(--blue-brand); text-transform: uppercase; }
.belt-icon { position: relative; width: 29px; height: 7px; margin-right: 9px; display: inline-block; vertical-align: 3px; border-radius: 2px; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.belt-icon::after { content: ""; position: absolute; left: 12px; top: -3px; width: 8px; height: 13px; border-radius: 2px; background: inherit; transform: rotate(8deg); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.belt-icon.colored { background: linear-gradient(90deg, #f2c500 0 32%, #e31f2a 32% 66%, #2476d2 66%); }
.belt-icon.black { background: #111827; }
.category-name small, .result-name small { color: var(--muted); }
.row-stat { text-align: center; }
.row-stat strong { display: block; color: var(--blue-brand); font-size: 18px; }
.row-stat span { color: var(--muted); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.row-stat small { margin-top: 2px; display: block; color: #8a94a3; font-size: 8px; text-transform: uppercase; }
.status-pill { justify-self: center; padding: 6px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.status-pill.active, .status-pill.complete { color: #006d35; background: #e0f6e9; }
.status-pill.review, .status-pill.pending { color: #7a5e00; background: #fff5bf; }
.status-pill.inactive { color: #687486; background: #e9edf2; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--blue-brand); background: white; font-size: 19px; }
.icon-button:hover { color: white; border-color: var(--blue-brand); background: var(--blue-brand); }
.category-toggle { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; font-weight: 700; }
.category-actions { display: grid; justify-items: center; gap: 5px; }
.category-competing-button { width: 100%; max-width: 140px; }
.mat-select { min-height: 30px; max-width: 125px; border: 1px solid var(--line); border-radius: 6px; color: var(--blue-brand); background: white; font-size: 11px; font-weight: 700; }
.icon-button.labeled { width: auto; min-width: 58px; height: auto; min-height: 58px; padding: 6px 9px; grid-template-rows: auto auto; gap: 2px; line-height: 1.1; font-size: 12px; font-weight: 700; }
.icon-button.labeled > span:first-child { font-size: 15px; }
.switch { position: relative; width: 42px; height: 24px; border: 0; border-radius: 999px; background: #c9d0da; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; transition: transform .2s; }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(18px); }

.result-filter-row, .ranking-filters, .mat-filter-row { margin-bottom: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.mat-filter-row { margin-top: -3px; margin-bottom: 18px; }
.result-selector-row { margin-top: -8px; }
.result-selector-row select:first-child { min-width: 190px; }
.result-selector-row select:last-child { min-width: min(360px, 100%); flex: 1; }
.mat-summary { padding: 0 20px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.mat-summary > div { padding: 10px; border-radius: 8px; background: var(--background); }
.mat-summary span, .mat-summary small { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.mat-summary strong { color: var(--blue-brand); font-size: 20px; }
.current-clock { color: var(--blue-brand); font-family: "Barlow Condensed"; font-size: 27px; font-weight: 800; letter-spacing: .04em; }
.competition-clock { padding: 18px; display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)) auto; gap: 9px; align-items: stretch; }
.clock-stat { padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--background); }
.clock-stat > span, .clock-stat small { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.clock-stat strong { display: block; margin-top: 4px; color: var(--blue-brand); font-size: 17px; }
.clock-status.running { color: var(--green); }
.clock-status.paused { color: #a06900; }
.clock-actions { display: grid; align-content: center; gap: 6px; }
.clock-actions button { white-space: nowrap; }
.mat-process { padding: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mat-lane { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--background); }
.mat-lane header { padding: 13px 14px 10px; display: flex; justify-content: space-between; align-items: center; }
.mat-lane header span, .mat-lane header strong { display: block; }
.mat-lane header span { color: var(--blue-brand); font-family: "Barlow Condensed"; font-size: 19px; font-weight: 800; text-transform: uppercase; }
.mat-lane header strong { color: var(--muted); font-size: 11px; }
.mat-lane header b { color: var(--red); font-size: 20px; }
.lane-progress { height: 5px; background: #dbe2ec; }
.lane-progress i { height: 100%; display: block; background: var(--green); }
.process-list { max-height: 640px; overflow: auto; }
.process-phase { border-bottom: 1px solid var(--line); background: white; }
.process-phase:last-child { border-bottom: 0; }
.process-phase > header { min-height: 48px; padding: 8px 13px; display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; background: #edf4fd; border-bottom: 1px solid #cfdded; }
.process-phase > header span { padding: 4px 7px; border-radius: 999px; color: white; background: var(--blue-brand); font-family: "Barlow"; font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.process-phase > header strong { color: var(--blue-brand); font-size: 13px; }
.process-phase > header small { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.process-phase.phase-para-hapkido > header { background: #f3edff; border-bottom-color: #dfd2f4; }
.process-phase.phase-para-hapkido > header span { background: #7045a0; }
.process-phase.phase-absoluto > header { background: #edf0f4; border-bottom-color: #d4d9e1; }
.process-phase.phase-absoluto > header span { background: #161b23; }
.process-item { padding: 10px 13px; display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); background: white; }
.process-item:last-child { border-bottom: 0; }
.process-item strong, .process-item small { display: block; }
.process-item strong { color: var(--blue-brand); font-size: 12px; text-transform: uppercase; }
.process-item small, .process-item time { color: var(--muted); font-size: 10px; }
.process-state { width: 8px; height: 8px; border-radius: 50%; background: #aab4c2; }
.process-state.complete { background: var(--green); }
.process-state.running { background: var(--red); box-shadow: 0 0 0 4px rgba(227,31,42,.1); }
.process-state.competing { background: var(--red); box-shadow: 0 0 0 5px rgba(227,31,42,.14); animation: live-pulse 1.4s infinite; }
.process-item.is-competing { border-left: 4px solid var(--red); background: #fff4f4; }
.process-state.paused { background: #d5a500; }
@keyframes live-pulse { 50% { box-shadow: 0 0 0 9px rgba(227,31,42,0); } }
.filter-chip { border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; color: var(--muted); background: white; font-weight: 600; font-size: 13px; }
.filter-chip.active { color: white; border-color: var(--blue-brand); background: var(--blue-brand); }
.result-row { grid-template-columns: minmax(210px, 1fr) 80px 105px minmax(145px, auto) minmax(150px, auto) 68px; }
.competing-button { min-height: 38px; padding: 6px 10px; border: 1px solid var(--red); border-radius: 7px; color: var(--red); background: white; font-size: 10px; font-weight: 800; line-height: 1.15; }
.competing-button.active { color: white; background: var(--red); box-shadow: 0 0 0 4px rgba(227,31,42,.1); }
.competing-button:disabled { color: #8d98a7; border-color: #cbd2dc; background: #eef1f5; }
.publish-medal-button { min-height: 38px; padding: 6px 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--blue-bright); border-radius: 7px; color: var(--blue-brand); background: #eef6ff; font-size: 10px; font-weight: 800; line-height: 1.15; }
.publish-medal-button.published { color: #006d35; border-color: var(--green); background: #e0f6e9; }
.publish-medal-button:disabled { color: #8d98a7; border-color: #cbd2dc; background: #eef1f5; cursor: not-allowed; }
.observatory-link { min-height: 54px; padding: 8px 13px; display: inline-flex; align-items: center; gap: 9px; border: 1px solid #bcd3f1; border-radius: 9px; color: var(--blue-brand); background: #eef6ff; text-decoration: none; box-shadow: 0 3px 10px rgba(10,34,64,.04); }
.observatory-link > span:first-child { font-size: 22px; }
.observatory-link strong,.observatory-link small { display: block; }
.observatory-link strong { font-size: 13px; }
.observatory-link small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.status-pill.competing { color: #a10d16; background: #ffe0e2; }

.live-label { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.ranking-tabs { display: grid; grid-template-columns: 1fr 1fr; max-width: 520px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.ranking-tabs button { min-height: 45px; border: 0; background: white; color: var(--muted); font-weight: 700; }
.ranking-tabs button.active { color: white; background: var(--blue-brand); }
.ranking-admin-actions { min-width: min(100%,360px); display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.final-ranking-status { max-width: 360px; color: var(--muted); font-size: 10px; line-height: 1.3; text-align: right; }
.final-ranking-publish-button { min-height: 42px; padding: 7px 13px; border: 1px solid var(--blue-bright); border-radius: 7px; color: white; background: var(--blue-bright); font-size: 10px; font-weight: 900; }
.final-ranking-publish-button.published { color: #006d35; border-color: var(--green); background: #e0f6e9; }
.final-ranking-publish-button:disabled { opacity: .55; cursor: wait; }
.ranking-podium { margin: 24px 0 18px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 14px; }
.podium-card { min-height: 142px; padding: 18px; display: flex; flex-direction: column; justify-content: flex-end; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: var(--shadow); text-align: center; }
.podium-card.first { min-height: 176px; border-top: 5px solid var(--gold); }
.podium-card.second { border-top: 5px solid var(--silver); }
.podium-card.third { border-top: 5px solid var(--bronze); }
.podium-rank { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.podium-card strong { margin: 7px 0; color: var(--blue-brand); font-family: "Barlow Condensed"; font-size: 21px; line-height: 1; text-transform: uppercase; }
.podium-card b { color: var(--red); font-size: 22px; }
.table-panel { overflow: hidden; }
.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px; color: white; background: var(--blue-brand); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; text-align: left; }
td { padding: 13px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
td.number, th.number { text-align: center; }
.medal-mini { width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 50%; color: white; font-size: 11px; font-weight: 800; }
.medal-mini.gold { background: var(--gold); }
.medal-mini.silver { background: var(--silver); }
.medal-mini.bronze { background: var(--bronze); }

.participant-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.participant-card { padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.participant-card.withdrawn { background: #e5e7eb; filter: grayscale(.7); }
.participant-top { display: flex; align-items: flex-start; gap: 11px; }
.avatar { width: 39px; height: 39px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--blue-brand); font-family: "Barlow Condensed"; font-weight: 800; }
.participant-card strong { color: var(--blue-brand); font-size: 14px; }
.participant-card small { display: block; margin-top: 3px; color: var(--muted); }
.entity-tag { display: inline-block; margin-top: 8px; padding: 3px 7px; border-radius: 4px; color: #285b9b; background: #edf5ff; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.entity-tag.territorial { color: #8c2730; background: #fff0f0; }
.category-tags { margin-top: 11px; display: flex; gap: 5px; flex-wrap: wrap; }
.category-tags span { padding: 4px 7px; border-radius: 4px; color: #536176; background: var(--background); font-size: 10px; }
.category-tags span.role-tag { color: #174f8f; background: #e8f2ff; font-weight: 800; }
.category-tags span.withdrawn { color: #4b5563; background: #d1d5db; text-decoration: line-through; }
.list-meta { margin: 0 0 10px; color: var(--muted); font-size: 13px; }

.locked-panel { max-width: 520px; margin: 50px auto; padding: 40px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); text-align: center; }
.locked-panel h2 { margin-bottom: 7px; color: var(--blue-brand); font-family: "Barlow Condensed"; text-transform: uppercase; }
.locked-panel p { color: var(--muted); }
.lock-symbol { width: 46px; height: 46px; margin: 0 auto 14px; display: grid; place-items: center; border: 2px solid var(--blue-brand); border-radius: 50%; color: var(--red); }
.settings-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 18px; }
.points-form { padding: 20px; }
.point-scope { margin-bottom: 22px; }
.point-scope h3 { margin: 0 0 11px; color: var(--blue-brand); font-family: "Barlow Condensed"; font-size: 19px; text-transform: uppercase; }
.point-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.point-fields label, .app-dialog label { color: var(--muted); font-size: 12px; font-weight: 700; }
.point-fields input, .app-dialog input { width: 100%; min-height: 43px; margin-top: 5px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; outline: 0; }
.point-fields input:focus, .app-dialog input:focus { border-color: var(--blue-bright); box-shadow: 0 0 0 3px rgba(36,118,210,.1); }
.organization-settings { max-height: 510px; overflow: auto; }
.observer-access-panel { grid-column: 1 / -1; }
.panel-help { margin: 0; padding: 12px 17px; color: var(--muted); background: #f4f7fb; font-size: 11px; line-height: 1.45; }
.small-link-button { padding: 8px 10px; border-radius: 7px; color: var(--blue-brand); background: #edf4fd; font-size: 10px; font-weight: 800; text-decoration: none; text-transform: uppercase; }
.observer-users { max-height: 620px; overflow: auto; }
.observer-user-row { padding: 13px 16px; display: grid; grid-template-columns: minmax(240px,1.3fr) minmax(145px,.7fr) minmax(210px,1fr) 110px auto; align-items: end; gap: 10px; border-bottom: 1px solid var(--line); }
.observer-user-row:last-child { border-bottom: 0; }
.observer-user-row label { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.observer-user-row input[type="text"],.observer-user-row input[type="password"] { width: 100%; min-height: 40px; margin-top: 5px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: white; }
.observer-entity strong { margin-top: 6px; display: block; color: var(--blue-brand); font-size: 11px; line-height: 1.2; text-transform: uppercase; }
.observer-active { min-height: 40px; display: flex; align-items: center; gap: 7px; }
.observer-active input { width: 18px; height: 18px; }
.observer-user-row .secondary-button { min-height: 40px; }
.reset-panel { grid-column: 1 / -1; border-color: #e8b7bb; background: #fffafa; }
.reset-summary-panel { margin-bottom: 16px; }
.panel-kicker.danger { color: #ad1723; }
.reset-warning-icon { font-size: 24px; }
.reset-panel-body { padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.reset-panel-body strong { display: block; color: #a61f28; font-size: 13px; text-transform: uppercase; }
.reset-panel-body p { max-width: 800px; margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.reset-competition-button { min-height: 46px; flex: 0 0 auto; padding: 0 16px; border: 1px solid #9f1d27; border-radius: 8px; color: white; background: #b4232e; font-size: 11px; font-weight: 900; letter-spacing: .03em; box-shadow: 0 6px 14px rgba(180,35,46,.18); }
.reset-competition-button:hover { background: #951b25; }
.reset-competition-button:disabled { opacity: .55; cursor: wait; }
.reset-confirmation-note { margin: 0; padding: 10px 18px; color: #8b4349; background: #fff0f1; font-size: 10px; font-weight: 700; }
.organization-row { padding: 12px 17px; display: grid; grid-template-columns: 1fr 130px; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.organization-row:last-child { border-bottom: 0; }
.organization-row strong { font-size: 13px; }
.organization-row small { display: block; color: var(--muted); }
.mat-officials { padding: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mat-official-form { padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--background); }
.mat-official-form h3 { margin: 0 0 11px; color: var(--blue-brand); font-family: "Barlow Condensed"; text-transform: uppercase; }
.mat-official-form label { display: block; margin-bottom: 9px; color: var(--muted); font-size: 11px; font-weight: 700; }
.mat-official-form input { width: 100%; min-height: 39px; margin-top: 4px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.official-record-grid { display: grid; gap: 8px; margin-bottom: 12px; }
.official-record { margin: 0; padding: 9px; display: grid; grid-template-columns: 1fr 1.35fr 1fr; gap: 7px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.official-record legend { padding: 0 5px; color: var(--blue-brand); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.official-record label { margin: 0; }
.mat-official-form .secondary-button.full { width: 100%; }
.venue-plan-link { display: block; padding: 14px; background: #eef2f6; }
.venue-plan-link img { width: 100%; height: auto; display: block; border-radius: 8px; box-shadow: 0 8px 24px rgba(6,23,50,.14); }
.audit-panel { grid-column: 1 / -1; }
.audit-log { max-height: 460px; overflow: auto; }
.audit-status { margin: 0; padding: 11px 16px; color: #6a7382; background: #f3f5f8; font-size: 12px; }
.audit-status.active { color: #08733f; background: #eaf8f0; font-weight: 800; }
.audit-row { padding: 13px 17px; display: grid; grid-template-columns: 34px minmax(180px, 1fr) minmax(170px, .7fr); gap: 11px; align-items: center; border-bottom: 1px solid var(--line); }
.audit-row:last-child { border-bottom: 0; }
.audit-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #edf5ff; }
.audit-row strong, .audit-row small { display: block; }
.audit-row strong { color: var(--blue-brand); font-size: 13px; text-transform: uppercase; }
.audit-row small { margin-top: 3px; color: var(--muted); }
.audit-actor { text-align: right; }
.audit-actor strong { font-size: 12px; }
.export-panel { grid-column: 1 / -1; }
.export-buttons { padding: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.export-button { min-height: 92px; padding: 16px; display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 11px; border: 1px solid var(--line); border-radius: 9px; color: inherit; background: var(--background); text-decoration: none; }
.export-button > span { grid-row: 1 / 3; font-size: 28px; }
.export-button strong { color: var(--blue-brand); }
.export-button small { color: var(--muted); }
.export-button:hover { border-color: var(--blue-bright); background: #edf5ff; }
.accreditation-admin-panel { grid-column: 1 / -1; border-color: #d8c36d; background: linear-gradient(120deg,#fff,#fffcf0); }
.admin-only-badge { padding: 6px 9px; border-radius: 999px; color: #765908; background: #fff1ae; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.accreditation-toolbar { padding: 14px 17px; display: grid; grid-template-columns: 1.5fr 1fr 1.2fr; gap: 9px; background: #f5f7fa; }
.accreditation-toolbar label { margin: 0; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.accreditation-toolbar label span { display: block; margin-bottom: 5px; }
.accreditation-toolbar input,.accreditation-toolbar select { width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: white; }
.accreditation-list-heading { padding: 11px 17px; display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.accreditation-list-heading strong { color: var(--blue-brand); text-transform: uppercase; }
.accreditation-people { max-height: 480px; padding: 0 17px 17px; overflow: auto; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.accreditation-person { min-width: 0; padding: 11px; display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 9px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.accreditation-avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--blue-brand); font-family: "Barlow Condensed"; font-weight: 900; }
.accreditation-person strong,.accreditation-person small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.accreditation-person strong { color: var(--blue-brand); font-size: 11px; text-transform: uppercase; }
.accreditation-person small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.accreditation-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px; }
.accreditation-actions button { min-height: 32px; padding: 0 9px; border: 1px solid #b6c9e1; border-radius: 6px; color: var(--blue-brand); background: #f1f6fd; font-size: 9px; font-weight: 900; }
.vip-credential-form { margin: 0 17px 17px; padding: 13px; display: grid; grid-template-columns: 1fr 1fr 1fr auto; align-items: end; gap: 9px; border: 1px solid #dfc158; border-radius: 9px; background: #fff7d4; }
.vip-credential-form > div { align-self: center; display: grid; grid-template-columns: 34px 1fr; }
.vip-credential-form > div > span { grid-row: 1 / 3; font-size: 28px; color: #a67a09; }
.vip-credential-form > div strong,.vip-credential-form > div small { display: block; }
.vip-credential-form > div strong { color: #765908; }
.vip-credential-form > div small { color: #8c792d; font-size: 9px; }
.vip-credential-form label { margin: 0; font-size: 9px; font-weight: 800; }
.vip-print-button { min-height: 43px; padding: 0 13px; border: 0; border-radius: 7px; color: white; background: #9b7210; font-size: 10px; font-weight: 900; }
.print-credential { display: none; }
.credential-card { width: 148mm; height: 210mm; overflow: hidden; position: relative; color: #17213c; background: white; font-family: "Barlow",Arial,sans-serif; }
.credential-stripe { height: 7mm; display: grid; grid-template-columns: repeat(3,1fr); }
.credential-stripe i:nth-child(1),.credential-stripe i:nth-child(3) { background: #e31f2a; }
.credential-stripe i:nth-child(2) { background: #f4c425; }
.credential-card header { height: 44mm; padding: 6mm 8mm; display: flex; align-items: center; gap: 6mm; color: #101c50; background: white; border-bottom: .8mm solid #d9e0ea; }
.credential-official-logos { flex: 0 0 auto; display: flex; align-items: center; gap: 3mm; }
.credential-official-logos > span { width: 27mm; height: 29mm; padding: 1.8mm; display: grid; place-items: center; background: white; }
.credential-official-logos img { width: 100%; height: 100%; display: block; object-fit: contain; }
.credential-event-title strong,.credential-event-title small { display: block; }
.credential-event-title strong { font-family: "Barlow Condensed"; font-size: 6.3mm; line-height: .95; }
.credential-event-title small { margin-top: 2mm; color: #596985; font-size: 3.3mm; }
.credential-body { height: 94mm; padding: 15mm 11mm 8mm; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.credential-body > span { color: #e31f2a; font-size: 4mm; font-weight: 900; letter-spacing: .5mm; }
.credential-body h1 { max-width: 124mm; margin-top: 7mm; color: #101c50; font-size: 12mm; line-height: .95; overflow-wrap: anywhere; }
.credential-body > strong { margin-top: 8mm; padding: 3mm 6mm; border-radius: 20mm; color: white; background: #2476d2; font-size: 4mm; letter-spacing: .3mm; }
.credential-body > p { max-width: 115mm; margin-top: 6mm; color: #53617a; font-size: 4.2mm; font-weight: 700; line-height: 1.2; text-transform: uppercase; }
.credential-access { width: 122mm; margin: 0 auto; padding: 5mm; border: .8mm solid #101c50; border-radius: 3mm; color: #101c50; font-family: "Barlow Condensed"; font-size: 8mm; font-weight: 900; text-align: center; }
.credential-card > footer { position: absolute; inset: auto 0 0; height: 32mm; min-height: 0; padding: 8mm 11mm; display: flex; align-items: center; justify-content: space-between; color: white; background: #101c50; font-size: 4mm; }
.credential-card.vip .credential-body > span { color: #9b7210; }
.credential-card.vip .credential-body > strong { background: #9b7210; }
.credential-card.vip .credential-access { color: #9b7210; border-color: #c99b27; background: #fff6cf; }
.credential-card.vip .credential-stripe i { background: linear-gradient(90deg,#9b7210,#f1ce62,#9b7210); }
.credential-card.vip header { border-bottom-color: #d6b74d; }
.vip-emblem { position: absolute; right: -7mm; top: 55mm; color: rgba(201,155,39,.13); font-size: 78mm; line-height: 1; transform: rotate(9deg); }
.credential-card.vip .credential-body,.credential-card.vip .credential-access { position: relative; z-index: 1; }
body[data-mode="pista"] .result-row { min-height: 76px; border-left: 5px solid var(--red); }
body[data-mode="pista"] .result-name strong { font-size: 22px; }
body[data-mode="pista"] .result-row .icon-button { min-height: 48px; }

.primary-button, .secondary-button {
  min-height: 43px;
  border-radius: 7px;
  padding: 0 17px;
  font-weight: 700;
}
.primary-button { border: 1px solid var(--red); color: white; background: var(--red); }
.primary-button:hover { background: var(--red-dark); }
.secondary-button { border: 1px solid var(--line); color: var(--text); background: white; }
.primary-button.full { width: 100%; margin-top: 5px; }
.locked-panel .primary-button { margin-top: 12px; }

.app-dialog { width: min(520px, calc(100% - 28px)); max-height: calc(100vh - 28px); padding: 0; overflow: auto; border: 0; border-radius: 13px; box-shadow: 0 30px 80px rgba(6,23,50,.35); }
.app-dialog::backdrop { background: rgba(6,23,50,.72); backdrop-filter: blur(3px); }
.app-dialog form { position: relative; padding: 30px; }
.app-dialog h2 { margin: 8px 0 9px; color: var(--blue-brand); font-size: 30px; }
.app-dialog p { margin-bottom: 20px; }
.app-dialog label { display: block; margin-bottom: 12px; }
.dialog-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--muted); background: var(--background); font-size: 22px; }
.score-dialog { width: min(1080px, calc(100% - 28px)); }
.score-rule { margin: -8px 0 18px; padding: 10px 12px; display: flex; gap: 8px; border-radius: 7px; color: #285b9b; background: #edf5ff; font-size: 12px; }
.score-sheet-import { margin: 0 0 18px; padding: 15px; border: 1px solid #b9d1ed; border-radius: 10px; background: linear-gradient(115deg,#f7fbff,#edf5ff); }
.score-sheet-import-copy { display: flex; align-items: center; gap: 11px; }
.sheet-import-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: white; background: var(--blue-brand); font-size: 21px; }
.score-sheet-import-copy strong,.score-sheet-import-copy small { display: block; }
.score-sheet-import-copy strong { color: var(--blue-brand); font-size: 13px; text-transform: uppercase; }
.score-sheet-import-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.score-sheet-import-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.sheet-photo-button { min-height: 43px; margin: 0 !important; padding: 0 14px; display: inline-flex !important; align-items: center; border: 1px solid var(--red); border-radius: 7px; color: #fff !important; background: var(--red); font-size: 12px; font-weight: 800; cursor: pointer; }
.sheet-photo-button > span { margin-right: 7px; font-size: 16px; }
.sheet-photo-button.gallery { border-color: var(--blue-brand); background: var(--blue-brand); }
.sheet-photo-button input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.score-sheet-preview { margin-top: 12px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.score-sheet-preview figure { margin: 0; overflow: hidden; border: 1px solid #c6d3e2; border-radius: 8px; background: white; }
.score-sheet-preview img { width: 100%; aspect-ratio: 1.414/1; display: block; object-fit: cover; }
.score-sheet-preview figcaption { padding: 6px 8px; overflow: hidden; color: var(--muted); font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.score-sheet-progress { margin-top: 12px; padding: 10px; border-radius: 8px; background: white; }
.score-sheet-progress > span { height: 6px; overflow: hidden; display: block; border-radius: 9px; background: #dce6f2; }
.score-sheet-progress > span i { width: 0; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg,var(--blue-bright),var(--red)); transition: width .2s; }
.score-sheet-progress strong,.score-sheet-progress small { display: block; }
.score-sheet-progress strong { margin-top: 8px; color: var(--blue-brand); font-size: 11px; }
.score-sheet-progress small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.score-sheet-report { margin-top: 12px; border: 1px solid #cad7e6; border-radius: 8px; background: white; }
.sheet-report-summary { padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #dce4ee; }
.sheet-report-summary strong { color: var(--blue-brand); font-size: 12px; text-transform: uppercase; }
.sheet-report-summary span { color: var(--muted); font-size: 10px; }
.sheet-report-rows { max-height: 210px; overflow: auto; }
.sheet-report-rows article { padding: 8px 11px; display: grid; grid-template-columns: 23px 1fr; gap: 7px; border-bottom: 1px solid #edf0f4; }
.sheet-report-rows article > span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: white; background: #198754; font-size: 10px; }
.sheet-report-rows article.review > span { background: #b77905; }
.sheet-report-rows strong,.sheet-report-rows small { display: block; }
.sheet-report-rows strong { color: var(--blue-brand); font-size: 10px; }
.sheet-report-rows small { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.sheet-review-note { margin: 0 !important; padding: 10px 12px; color: #6f4c00; background: #fff7d6; font-size: 10px; line-height: 1.4; }
.sheet-import-error { padding: 12px; color: #a61f28; background: #fff2f3; }
.sheet-import-error strong,.sheet-import-error span { display: block; }
.sheet-import-error span { margin-top: 4px; font-size: 10px; }
.score-entries { display: grid; gap: 8px; }
.score-entry { padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--background); }
.score-entry.ocr-updated { border-left: 5px solid #1d8a50; }
.score-entry.ocr-review { border-left-color: #d49a19; background: #fffdf4; }
.score-entry.withdrawn { border-color: #aab2bd; background: #e5e7eb; filter: grayscale(.7); }
.score-entry.withdrawn input, .score-entry.withdrawn select { color: #737b86; background: #d5d9df; }
.score-entry-head { margin-bottom: 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.score-method { display: flex; align-items: flex-end; gap: 8px; }
.score-method label { margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; }
.score-method select { min-height: 32px; display: block; margin-top: 3px; border: 1px solid var(--line); border-radius: 6px; background: white; font-size: 12px; }
.score-entry strong { display: block; color: var(--blue-brand); font-size: 13px; }
.score-entry small { color: var(--muted); }
.score-entry input { margin: 0; background: white; }
.score-entry .current-medal { margin-top: 4px; display: inline-block; color: var(--red); font-size: 11px; font-weight: 700; }
.withdrawal-note { margin-top: 6px; display: block; color: #4b5563 !important; font-size: 11px; font-weight: 800; }
.withdrawal-button { min-height: 32px; padding: 5px 8px; border: 1px solid #6b7280; border-radius: 6px; color: #4b5563; background: white; font-size: 10px; font-weight: 800; }
.withdrawal-button.restore { color: #006d35; border-color: #009447; }
.clear-score-button { min-height: 32px; padding: 5px 8px; border: 1px solid #c8323b; border-radius: 6px; color: #a61f28; background: white; font-size: 10px; font-weight: 800; }
.judge-grid { display: grid; grid-template-columns: repeat(5, minmax(76px, 1fr)); gap: 7px; }
.judge-grid label, .score-extras label { margin: 0; }
.judge-score.discarded { color: #8b5e00; border-color: #e6bf2d; background: #fff9d8; text-decoration: line-through; }
.score-extras { margin-top: 10px; display: grid; grid-template-columns: minmax(210px,.75fr) minmax(390px,1.5fr) minmax(150px,.55fr); gap: 9px; align-items: stretch; }
.direct-score-field { display: none !important; }
.tie-field { display: none !important; }
.tie-field.visible { display: block !important; }
.score-entry.direct-mode .judge-grid { display: none; }
.score-entry.direct-mode .direct-score-field { display: flex !important; flex-direction: column; justify-content: flex-end; }
.score-panel-heading { margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.score-panel-heading strong { font-size: 11px; text-transform: uppercase; }
.score-panel-heading span { color: var(--muted); font-size: 10px; font-weight: 700; }
.time-entry-panel,.deduction-panel { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.time-entry-fields { display: grid; grid-template-columns: 64px 10px 64px auto; align-items: end; gap: 7px; }
.time-entry-fields label { color: var(--muted); font-size: 10px; font-weight: 700; }
.time-entry-fields input { width: 100%; }
.time-separator { padding-bottom: 11px; color: var(--blue-brand); font-size: 20px; font-weight: 800; text-align: center; }
.time-feedback { grid-column: 1 / -1; min-height: 16px; color: var(--muted); font-size: 10px; }
.time-feedback.valid { color: #08723a; font-weight: 700; }
.time-feedback.penalized { color: #b4232c; font-weight: 700; }
.deduction-panel { grid-column: 1 / -1; }
.deduction-grid { display: grid; grid-template-columns: repeat(4,minmax(145px,1fr)); gap: 8px; }
.deduction-grid > label,.time-deduction-card { min-height: 70px; padding: 9px; border: 1px solid #e1e6ee; border-radius: 7px; color: var(--text); background: #f8fafc; font-size: 10px; font-weight: 700; }
.deduction-grid > label > small { display: block; margin: 2px 0 7px; }
.deduction-grid > label > input[type="number"] { width: 100%; }
.check-deduction { display: flex !important; align-items: center; gap: 9px; }
.check-deduction input { width: 18px; height: 18px; flex: 0 0 auto; }
.check-deduction span small { display: block; margin-top: 3px; }
.time-deduction-card { display: flex; flex-direction: column; justify-content: center; }
.time-deduction-card span { font-weight: 700; }
.time-deduction-card strong { margin: 4px 0; color: var(--red); font-size: 18px; }
.deduction-summary { margin: 8px 0 0 !important; color: var(--muted); font-size: 10px; line-height: 1.4; }
.score-entry.disqualified { border-color: #d42b36; box-shadow: inset 4px 0 #d42b36; }
.score-entry.disqualified .deduction-total,.score-entry.disqualified .deduction-summary { color: #a61f28; font-weight: 800; }
.timer-button { min-height: 43px; padding: 0 12px; border: 1px solid var(--blue-bright); border-radius: 7px; color: var(--blue-brand); background: white; font-size: 12px; font-weight: 700; }
.score-calculation { margin-top: 10px; padding: 9px 11px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 6px; color: var(--muted); background: white; font-size: 12px; }
.score-calculation b { color: var(--red); font-size: 15px; }
.dialog-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 9px; }
.danger-button { min-height: 43px; margin-right: auto; padding: 0 14px; border: 1px solid #c8323b; border-radius: 7px; color: #a61f28; background: #fff5f5; font-weight: 800; }
.form-error { min-height: 19px; color: var(--red) !important; font-size: 13px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 28px; max-width: calc(100% - 30px); padding: 12px 17px; border-radius: 8px; color: white; background: var(--blue-deep); box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, 15px); pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.empty-state { padding: 32px 20px; border: 1px dashed #bdc7d5; border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.55); text-align: center; }
.mobile-nav { display: none; }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 190px 1fr; }
  .side-nav { padding-inline: 11px; }
  .settings-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .competition-clock { grid-template-columns: repeat(3, 1fr); }
  .observer-user-row { grid-template-columns: minmax(210px,1fr) 1fr 1.2fr; }
  .observer-active,.observer-user-row .secondary-button { align-self: center; }
}

@media (max-width: 760px) {
  body { padding-bottom: calc(69px + env(safe-area-inset-bottom)); }
  .header-inner { min-height: 0; padding: 9px 14px 10px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(132px, 148px); gap: 8px 10px; }
  .brand { min-width: 0; }
  .brand-mark { width: 43px; height: 43px; flex: 0 0 auto; }
  .brand-copy { min-width: 0; }
  .brand-copy strong { font-size: 19px; }
  .brand-copy small { max-width: 205px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .event-status { display: none; }
  .user-presence { grid-column: 1 / -1; grid-row: 2; width: 100%; padding: 5px; display: grid; grid-template-columns: auto repeat(2, minmax(0, 1fr)); }
  .presence-title { text-align: center; }
  .presence-person { min-width: 0; padding: 4px 6px; }
  .view-mode-switch { grid-column: 1 / -1; grid-row: 3; width: 100%; margin-left: 0; }
  .view-mode-switch button { width: auto; min-width: 0; padding: 0 8px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; white-space: nowrap; }
  .view-mode-switch button span { font-size: 17px; }
  .admin-button { grid-column: 2; grid-row: 1; width: auto; min-width: 0; max-width: 148px; min-height: 43px; overflow: hidden; padding: 5px 8px; border-radius: 7px; }
  .session-icon { font-size: 16px; }
  .session-copy strong { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .app-shell { display: block; min-height: auto; }
  .side-nav { display: none; }
  .content { padding: 24px 14px 30px; }
  .observer-user-row { grid-template-columns: 1fr; align-items: stretch; }
  .observer-user-row .secondary-button { width: 100%; }
  .accreditation-toolbar,.vip-credential-form { grid-template-columns: 1fr; }
  .accreditation-people { grid-template-columns: 1fr; }
  .reset-panel-body { align-items: stretch; flex-direction: column; }
  .reset-competition-button { width: 100%; }
  .page-heading { align-items: flex-start; margin-bottom: 20px; padding-bottom: 15px; }
  .starting-order-draw-panel { grid-template-columns: 40px minmax(0,1fr); }
  .starting-order-draw-actions { grid-column: 1/-1; width: 100%; flex-direction: column; }
  .starting-order-draw-panel button { width: 100%; }
  .mat-preassignment-panel { grid-template-columns: 40px minmax(0,1fr); }
  .mat-preassignment-panel button { grid-column: 1/-1; width: 100%; }
  .ranking-admin-actions { width: 100%; min-width: 0; align-items: stretch; }
  .final-ranking-status { max-width: none; text-align: left; }
  .final-ranking-publish-button { width: 100%; }
  .page-heading h1 { font-size: 36px; }
  .date-card { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .kpi-card { min-height: 115px; padding: 16px 14px; }
  .kpi-value { font-size: 33px; }
  .operational-strip { grid-template-columns: 1fr; gap: 10px; }
  .observatory-home-access { grid-template-columns: 44px minmax(0,1fr); padding: 12px; gap: 11px; }
  .observatory-home-icon { width: 44px; height: 44px; }
  .observatory-home-copy strong { font-size: 18px; }
  .observatory-home-copy > span { display: none; }
  .observatory-home-arrow { grid-column: 1/-1; width: 100%; text-align: center; }
  .flow-arrow { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 12px; }
  .wide-panel { grid-column: auto; }
  .panel-heading { min-height: 67px; padding: 15px; }
  .panel-heading h2 { font-size: 21px; }
  .mat-process-panel .panel-heading { align-items: flex-start; flex-direction: column; gap: 9px; }
  .mat-process-panel #unassignedCount { align-self: flex-start; }
  .medal-summary { padding: 17px 13px 9px; gap: 7px; }
  .medal-item { padding: 12px 6px; }
  .medal-dot { width: 29px; height: 29px; }
  .medal-breakdown { margin-inline: 13px; grid-template-columns: 1fr; }
  .toolbar { display: grid; grid-template-columns: 1fr; }
  .toolbar > * { width: 100%; min-width: 0; max-width: 100%; }
  .search-box { min-width: 0; }
  .category-row { grid-template-columns: minmax(0,1fr) auto auto; gap: 8px; padding: 13px; }
  .result-row { grid-template-columns: 1fr auto; gap: 8px; padding: 13px; }
  .category-row .category-name { grid-column: 1 / -1; }
  .category-row .row-stat { grid-row: 2; min-width: 78px; text-align: left; }
  .category-row .team-stat { grid-column: 1; }
  .category-row .athlete-stat { grid-column: 2; }
  .category-actions { grid-column: 1 / -1; grid-row: 3; justify-items: start; }
  .category-competing-button { max-width: none; }
  .category-toggle { justify-content: flex-start; }
  .category-row .icon-button { grid-column: 3; grid-row: 2; }
  .result-row .icon-button { grid-column: 2; grid-row: 1 / span 2; }
  .result-row .row-stat { grid-column: 1; text-align: left; }
  .result-row .competing-button { grid-column: 1; justify-self: start; }
  .result-row .publish-medal-button { grid-column: 1; justify-self: start; }
  .observatory-link { width: 100%; margin-top: 10px; justify-content: center; }
  .ranking-podium { gap: 7px; }
  .podium-card { min-height: 132px; padding: 11px 8px; }
  .podium-card.first { min-height: 155px; }
  .podium-card strong { font-size: 16px; }
  .participant-list { grid-template-columns: 1fr; }
  .audit-row { grid-template-columns: 32px 1fr; }
  .audit-actor { grid-column: 2; text-align: left; }
  .export-buttons { grid-template-columns: 1fr; }
  .mat-officials { grid-template-columns: 1fr; }
  .official-record { grid-template-columns: 1fr; }
  .judge-grid { grid-template-columns: repeat(3, 1fr); }
  .score-extras { grid-template-columns: 1fr; }
  .score-sheet-preview { grid-template-columns: 1fr; }
  .score-sheet-import-actions > * { width: 100%; justify-content: center; }
  .sheet-report-summary { align-items: flex-start; flex-direction: column; }
  .deduction-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .time-entry-panel,.deduction-panel { grid-column: 1; }
  .score-entry-head { flex-direction: column; }
  .score-method { width: 100%; flex-wrap: wrap; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions .danger-button { width: 100%; margin-right: 0; order: -1; }
  .dialog-actions .publish-medal-button { flex: 1; }
  .timer-button { align-self: end; }
  .score-calculation { align-items: flex-start; flex-direction: column; gap: 4px; }
  .competition-clock { grid-template-columns: 1fr 1fr; }
  .mat-process { grid-template-columns: 1fr; }
  .clock-actions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .mobile-nav {
    position: fixed;
    z-index: 40;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(64px + env(safe-area-inset-bottom));
    padding: 5px 5px env(safe-area-inset-bottom);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid rgba(255,255,255,.1);
    background: var(--blue-deep);
    box-shadow: 0 -8px 24px rgba(6,23,50,.18);
  }
  .mobile-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 6px; color: #8293ae; background: transparent; font-size: 10px; }
  .mobile-nav button span { font-size: 18px; }
  .mobile-nav button.active { color: white; background: rgba(36,118,210,.18); }
  .app-dialog form { padding: 25px 19px; }
  .dialog-actions { position: sticky; bottom: 0; margin: 18px -19px -25px; padding: 13px 19px; background: white; border-top: 1px solid var(--line); }
}

@media (max-width: 390px) {
  .header-inner { grid-template-columns: minmax(0, 1fr) minmax(126px, 136px); }
  .brand { gap: 8px; }
  .brand-mark { width: 39px; height: 39px; font-size: 18px; }
  .brand-copy strong { font-size: 18px; white-space: nowrap; }
  .admin-button { max-width: 136px; }
  .presence-title { display: none; }
  .user-presence { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-copy small { max-width: 165px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-label { font-size: 10px; }
  .kpi-note { font-size: 11px; }
  .ranking-podium { grid-template-columns: 1fr; align-items: stretch; }
  .podium-card, .podium-card.first { min-height: 0; }
  .deduction-grid { grid-template-columns: 1fr; }
  .time-entry-fields { grid-template-columns: 1fr 10px 1fr; }
  .timer-button { grid-column: 1 / -1; width: 100%; }
}

@page { size: A5 portrait; margin: 0; }
@media print {
  html,body { width: 148mm; height: 210mm; margin: 0 !important; padding: 0 !important; background: white !important; }
  body.printing-credential > *:not(#printCredential) { display: none !important; }
  body.printing-credential #printCredential { width: 148mm; height: 210mm; margin: 0; display: block !important; }
  .credential-card { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
