:root {
  color-scheme: light;
  --blue-900: #0b1f44;
  --blue-800: #12346b;
  --blue-600: #2563eb;
  --cyan-500: #0891b2;
  --green-600: #12805c;
  --amber-600: #b7791f;
  --red-600: #dc2626;
  --ink: #0f172a;
  --muted: #64748b;
  --soft: #f4f7fb;
  --surface: #ffffff;
  --line: #dbe5f2;
  --shadow: 0 24px 80px rgba(11, 31, 68, 0.22);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(120deg, rgba(37, 99, 235, 0.16), transparent 34%),
    linear-gradient(150deg, #f8fbff 0%, #e8eef8 48%, #f7fafc 100%);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  touch-action: manipulation;
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.stage {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.device {
  position: relative;
  width: min(430px, 100%);
  height: min(900px, calc(100dvh - 48px));
  min-height: 760px;
  overflow: hidden;
  border: 1px solid rgba(219, 229, 242, 0.9);
  border-radius: 34px;
  background: var(--soft);
  box-shadow: var(--shadow);
}

.app-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.92) 100%);
  border-bottom: 1px solid rgba(219, 229, 242, 0.8);
}

.toast {
  position: absolute;
  top: 92px;
  left: 16px;
  right: 16px;
  z-index: 12;
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #bde8d8;
  border-radius: 18px;
  background: #f4fff9;
  color: #0f6a4f;
  box-shadow: 0 18px 48px rgba(11, 31, 68, 0.2);
  animation: toastIn 220ms ease both;
}

.toast.is-leaving {
  animation: toastOut 220ms ease both;
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #fff;
  background: var(--green-600);
  font-weight: 950;
}

.toast p {
  color: inherit;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
}

.toast-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: inherit;
  background: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
}

.toast-warn {
  border-color: #f3dda2;
  background: #fffaf0;
  color: #7a4d00;
}

.toast-warn .toast-icon {
  background: var(--amber-600);
}

.toast-danger {
  border-color: #f5caca;
  background: #fff0f0;
  color: #a21b1b;
}

.toast-danger .toast-icon {
  background: var(--red-600);
}

.toast-info {
  border-color: #c7d8f6;
  background: #eef5ff;
  color: var(--blue-800);
}

.toast-info .toast-icon {
  background: var(--blue-600);
}

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

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px) scale(0.98); }
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--blue-900), var(--blue-600));
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
}

.overline,
p,
h1,
h2,
h3,
h4 {
  margin: 0;
}

.overline {
  color: var(--blue-600);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.app-header h1 {
  margin-top: 2px;
  font-size: 22px;
  line-height: 1.1;
}

.icon-button,
.chip-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--blue-800);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.notify-button {
  position: relative;
  flex: 0 0 46px;
}

.notify-button:hover {
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.14);
}

.notify-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--red-600);
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
}

.notification-panel {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  align-items: start;
  padding: 78px 14px 16px;
  background: rgba(15, 23, 42, 0.28);
}

.notification-sheet {
  display: grid;
  gap: 12px;
  max-height: min(660px, calc(100dvh - 128px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(11, 31, 68, 0.28);
  overflow: hidden;
}

.notification-log {
  display: grid;
  gap: 10px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 2px;
}

.notification-item {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue-600);
  border-radius: 14px;
  background: #f8fbff;
}

.notification-item p {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
}

.notification-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.notification-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.notification-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eaf1ff;
  color: var(--blue-800);
  font-size: 11px;
  font-weight: 950;
}

.notification-ok {
  border-left-color: var(--green-600);
  background: #f4fff9;
}

.notification-warn {
  border-left-color: var(--amber-600);
  background: #fffaf0;
}

.notification-danger {
  border-left-color: var(--red-600);
  background: #fff0f0;
}

.notification-info {
  border-left-color: var(--blue-600);
}

.icon-button:active,
.chip-button:active,
.tab:active,
.primary:active,
.secondary:active,
.confirm:active,
.provider:active {
  transform: scale(0.97);
}

.content {
  height: calc(100% - 82px);
  overflow-y: auto;
  padding: 16px 16px 106px;
  scroll-behavior: smooth;
}

.content.locked {
  padding-bottom: 28px;
}

.screen {
  display: none;
  animation: screenIn 220ms ease both;
}

.screen.active {
  display: grid;
  gap: 14px;
}

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

.hero {
  display: grid;
  grid-template-columns: 1fr 104px;
  gap: 16px;
  min-height: 194px;
  padding: 18px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 55%),
    linear-gradient(145deg, var(--blue-900), var(--blue-800));
  color: #fff;
  overflow: hidden;
}

.hero-copy {
  align-self: end;
}

.hero h2 {
  margin-top: 12px;
  font-size: 33px;
  line-height: 0.98;
}

.hero p {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1.42;
}

.hero-meter {
  align-self: stretch;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
}

.hero-meter strong {
  font-size: 48px;
  line-height: 1;
}

.hero-meter span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.badge-live {
  color: #dffaf3;
  background: rgba(18, 128, 92, 0.32);
  border-color: rgba(129, 230, 189, 0.42);
}

.badge-sync,
.badge-ok {
  color: #0f6a4f;
  background: #e7f7f0;
  border-color: #bde8d8;
}

.badge-warn {
  color: #8a5a0f;
  background: #fff7df;
  border-color: #f3dda2;
}

.badge-neutral {
  color: #526170;
  background: #f1f5f9;
  border-color: #dbe5f2;
}

.badge-admin {
  color: #234e9f;
  background: #eaf1ff;
  border-color: #c8d9ff;
}

.metrics,
.role-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.metrics article,
.role-grid div {
  min-height: 106px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.metrics span,
.role-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metrics strong,
.role-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--blue-900);
  font-size: 30px;
  line-height: 1;
}

.metrics small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.section-block,
.admin-panel,
.auth-card,
.scanner,
.bib-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.section-block,
.admin-panel,
.auth-card {
  padding: 16px;
}

.section-block.compact p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title h3 {
  font-size: 18px;
}

.status-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.status-list div {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f8fbff;
}

.status-list p {
  font-size: 14px;
  font-weight: 800;
}

.status-list strong {
  color: var(--muted);
  font-size: 12px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.dot.ok { background: var(--green-600); }
.dot.warn { background: var(--amber-600); }

.scanner {
  padding: 14px;
  background: #07111f;
  color: #fff;
}

.scan-top,
.scan-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.privacy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.privacy svg {
  width: 16px;
  height: 16px;
}

.viewfinder {
  position: relative;
  display: grid;
  place-items: center;
  height: 340px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(145deg, #101c2e, #060b12);
  background-size: 28px 28px, 28px 28px, auto;
}

.dni-frame {
  position: absolute;
  width: 88%;
  height: 54%;
}

.dni-frame span {
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: #62e6bd;
}

.dni-frame span:nth-child(1) { left: 0; top: 0; border-top: 3px solid; border-left: 3px solid; }
.dni-frame span:nth-child(2) { right: 0; top: 0; border-top: 3px solid; border-right: 3px solid; }
.dni-frame span:nth-child(3) { left: 0; bottom: 0; border-bottom: 3px solid; border-left: 3px solid; }
.dni-frame span:nth-child(4) { right: 0; bottom: 0; border-bottom: 3px solid; border-right: 3px solid; }

.scan-line {
  position: absolute;
  width: 72%;
  height: 2px;
  background: #62e6bd;
  box-shadow: 0 0 22px #62e6bd;
  animation: scan 2.2s ease-in-out infinite;
}

@keyframes scan {
  0%, 100% { transform: translateY(-78px); opacity: 0.55; }
  50% { transform: translateY(78px); opacity: 1; }
}

.viewfinder p {
  position: relative;
  z-index: 1;
  margin-top: 202px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 900;
}

.action-grid,
.provider-grid,
.checkin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.checkin-actions {
  margin-top: 0;
}

.primary,
.secondary,
.confirm,
.provider {
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

.primary,
.confirm {
  color: #fff;
  background: linear-gradient(135deg, var(--blue-600), var(--cyan-500));
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
}

.secondary {
  color: var(--blue-800);
  background: #eef5ff;
}

.secondary.dark {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.confirm {
  width: 100%;
}

.bib-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px;
  text-align: center;
}

.bib-card strong {
  color: var(--blue-900);
  font-size: 104px;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.bib-card h2 {
  font-size: 24px;
  line-height: 1.1;
}

.bib-card p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.scan-modal {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: start center;
  padding: 70px 14px 18px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.22), rgba(15, 23, 42, 0.58)),
    rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(5px);
}

.scan-modal.hidden {
  display: none;
}

.scan-dialog {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
  max-height: calc(100dvh - 112px);
  overflow-y: auto;
  padding: 20px 16px 16px;
  border: 1px solid rgba(189, 232, 216, 0.95);
  border-radius: 22px;
  background:
    linear-gradient(180deg, #f4fff9 0%, #ffffff 44%),
    #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  font-weight: 900;
  cursor: pointer;
}

.scan-dialog strong {
  width: min(168px, 68%);
  padding: 7px 10px 9px;
  border-radius: 20px;
  color: #0f6a4f;
  background: #e7f7f0;
  font-size: 76px;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.scan-dialog h3 {
  max-width: 100%;
  font-size: 23px;
  line-height: 1.18;
}

.scan-dialog p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.scan-dialog .match-count {
  width: 100%;
  padding: 7px 10px;
  border-radius: 12px;
  color: #0f6a4f;
  background: rgba(231, 247, 240, 0.88);
  font-size: 12px;
  font-weight: 900;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
}

.modal-actions .confirm {
  background: linear-gradient(135deg, #0f8b68, #16a37b);
  box-shadow: 0 12px 28px rgba(15, 139, 104, 0.24);
}

#modalIncidentBtn {
  color: #7a4d00;
  background: #fff3d6;
}

#modalIncidentBtn:hover {
  box-shadow: 0 10px 24px rgba(183, 121, 31, 0.16);
}

.modal-candidates {
  width: 100%;
  max-height: 268px;
  overflow-y: auto;
  margin-top: 6px;
  padding-right: 2px;
}

.modal-candidates .candidate {
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: start;
  min-height: 82px;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #fbfdff;
}

.modal-candidates .candidate-bib {
  min-width: 50px;
  height: 50px;
  border-radius: 12px;
}

.modal-candidates .candidate .badge {
  grid-column: 1 / -1;
  justify-self: start;
  margin-left: 62px;
}

.modal-candidates .candidate h4 {
  font-size: 15px;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.modal-candidates .candidate p {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
}

.doc-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.doc-list article {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbff;
}

.doc-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: var(--blue-600);
  background: #eaf1ff;
}

.doc-list h4 {
  font-size: 14px;
}

.doc-list p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.chip-button {
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  color: var(--blue-600);
  font-size: 12px;
  font-weight: 900;
}

.chip-button svg {
  width: 16px;
  height: 16px;
}

.admin-panel,
.auth-card {
  display: grid;
  gap: 14px;
}

.file-drop {
  display: grid;
  place-items: center;
  min-height: 184px;
  padding: 18px;
  border: 1.5px dashed #adc3e9;
  border-radius: 18px;
  background: #f8fbff;
  text-align: center;
  cursor: pointer;
}

.file-drop svg {
  width: 34px;
  height: 34px;
  color: var(--blue-600);
}

.file-drop strong {
  margin-top: 10px;
}

.file-drop span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.file-drop input {
  display: none;
}

.wave-upload-grid {
  display: grid;
  gap: 10px;
}

.wave-file-upload {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 4px 12px;
  align-items: center;
  min-height: 76px;
  padding: 12px;
  border: 1.5px dashed #adc3e9;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fbff, #ffffff);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.wave-file-upload:active {
  transform: scale(0.99);
}

.wave-file-upload span {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #eaf1ff;
  color: var(--blue-800);
  font-size: 12px;
  font-weight: 950;
  text-align: center;
}

.wave-file-upload strong {
  color: var(--blue-900);
  font-size: 14px;
  line-height: 1.2;
}

.wave-file-upload small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.wave-file-upload input {
  display: none;
}

.file-selected {
  min-height: 42px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
  text-align: center;
}

.file-selected.has-file {
  border-color: #bde8d8;
  background: #f4fff9;
  color: #0f6a4f;
}

.auth-card h2 {
  font-size: 28px;
  line-height: 1.05;
}

.auth-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

label {
  display: grid;
  gap: 7px;
  color: #243044;
  font-size: 13px;
  font-weight: 900;
}

input,
select {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.provider {
  border: 1px solid var(--line);
  color: var(--blue-800);
  background: #fff;
}

.hidden {
  display: none !important;
}

.otp-card {
  margin-top: 14px;
}

.otp-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.otp-row input {
  padding: 0;
  text-align: center;
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.bottom-tabs {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  min-height: 78px;
  padding: 8px;
  border: 1px solid rgba(219, 229, 242, 0.92);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 50px rgba(11, 31, 68, 0.18);
  backdrop-filter: blur(18px);
}

.tab {
  display: grid;
  place-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 60px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: #6b7b8e;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.tab svg {
  width: 22px;
  height: 22px;
}

.tab span {
  font-size: 11px;
  font-weight: 900;
}

.tab.active {
  color: var(--blue-600);
  background: #eaf1ff;
}

@media (max-width: 520px) {
  .stage {
    padding: 0;
  }

  .device {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .content {
    padding-left: 14px;
    padding-right: 14px;
  }
}

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

.badge-danger {
  color: #a21b1b;
  background: #fff0f0;
  border-color: #f5caca;
}

.ocr-input {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.82);
}

.ocr-input input {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.ocr-input input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.ocr-input input:focus {
  border-color: #62e6bd;
  box-shadow: 0 0 0 4px rgba(98, 230, 189, 0.14);
}

.candidate-list,
.participant-list,
.absent-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.candidate,
.participant-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.candidate {
  cursor: pointer;
  text-align: left;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.candidate.selected {
  border-color: #8fb2ff;
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.14);
}

.candidate:active,
.participant-row:active {
  transform: scale(0.99);
}

.candidate-bib,
.row-bib {
  display: grid;
  place-items: center;
  min-width: 48px;
  height: 48px;
  border-radius: 15px;
  background: #eaf1ff;
  color: var(--blue-800);
  font-size: 18px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.candidate h4,
.participant-row h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
}

.candidate p,
.participant-row p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.participant-row.checked {
  border-color: #bde8d8;
  background: linear-gradient(135deg, #f4fff9, #ffffff);
}

.participant-row.checked .row-bib {
  background: #e7f7f0;
  color: #0f6a4f;
}

.participant-row.checked-out {
  border-color: #f3dda2;
  background: linear-gradient(135deg, #fffaf0, #ffffff);
}

.participant-row.checked-out .row-bib {
  background: #fff7df;
  color: #8a5a0f;
}

.participant-actions {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.mini-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--blue-800);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.checked .mini-button {
  color: #0f6a4f;
  border-color: #bde8d8;
  background: #e7f7f0;
}

.search-field {
  margin-top: 14px;
}

.manual-form {
  display: grid;
  gap: 18px;
}

.two-fields {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 12px;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

.collapsible-block > summary {
  cursor: pointer;
  list-style: none;
  padding-bottom: 2px;
}

.collapsible-block > summary::-webkit-details-marker {
  display: none;
}

.collapsible-block > summary::after {
  content: "";
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background:
    linear-gradient(45deg, transparent 46%, var(--blue-800) 47% 53%, transparent 54%) 12px 9px / 10px 10px no-repeat,
    linear-gradient(135deg, transparent 46%, var(--blue-800) 47% 53%, transparent 54%) 12px 15px / 10px 10px no-repeat,
    #eef5ff;
  transition: transform 180ms ease, background-color 180ms ease;
}

.collapsible-block[open] > summary::after {
  transform: rotate(180deg);
}

.collapsible-block[open] {
  box-shadow: 0 14px 32px rgba(11, 31, 68, 0.07);
}

.collapsible-block .absent-list,
.collapsible-block .participant-list {
  padding-top: 2px;
}

label {
  gap: 9px;
}

input,
select {
  min-height: 52px;
  padding: 0 15px;
  border-radius: 15px;
}

.manual-form > .primary,
.quick-enrollment > .secondary,
.exit-panel > .secondary {
  margin-top: 2px;
}

.search-field {
  margin-top: 16px;
}

.quick-enrollment {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #f3dda2;
  border-radius: 18px;
  background: #fffaf0;
}

.exit-panel {
  display: grid;
  gap: 14px;
  border-color: #fed7aa;
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 64%);
}

.exit-panel .section-title h3 {
  color: #7c2d12;
}

.exit-panel .badge {
  color: #7a4d00;
  background: #fff3d6;
  border-color: #f3dda2;
}

.exit-panel input {
  border-color: #fed7aa;
  background: #fffdf8;
}

.exit-panel input:focus {
  border-color: var(--amber-600);
  box-shadow: 0 0 0 4px rgba(183, 121, 31, 0.14);
}

.exit-panel > .secondary {
  color: #fff;
  background: linear-gradient(135deg, #9a5b00, #c27803);
  box-shadow: 0 12px 28px rgba(154, 91, 0, 0.2);
}

.exit-result {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 8px 12px;
  align-items: center;
  min-height: 100px;
  padding: 14px;
  border: 1px solid #fed7aa;
  border-radius: 16px;
  background: #fffaf0;
}

.exit-result > .badge,
.exit-result h4,
.exit-result p {
  grid-column: 2;
}

.exit-result h4 {
  color: #7c2d12;
  font-size: 16px;
}

.exit-result p {
  color: #755533;
  font-size: 13px;
  line-height: 1.35;
}

.exit-bib {
  grid-row: 1 / span 3;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: #fff3d6;
  color: #7c2d12;
  font-size: 19px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.exit-ready {
  border-color: #b8d4ff;
  background: #eef5ff;
}

.exit-ready .exit-bib {
  background: #dbeafe;
  color: var(--blue-800);
}

.exit-ready h4 {
  color: var(--blue-900);
}

.exit-ready p {
  color: #334155;
}

.exit-out {
  border-color: #f3dda2;
  background: #fffaf0;
}

.exit-out .exit-bib {
  background: #fff3d6;
  color: #8a5a0f;
}

.exit-not-entered {
  border-color: #f5caca;
  background: #fff0f0;
}

.exit-not-entered .exit-bib {
  background: #fee2e2;
  color: #a21b1b;
}

.exit-not-entered h4 {
  color: #7f1d1d;
}

.exit-not-entered p {
  color: #7f1d1d;
}

.official-results,
.assigned-list,
.test-list {
  display: grid;
  gap: 8px;
}

.assigned-chip,
.test-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbff;
}

.assigned-chip span,
.test-row h4 {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.assigned-chip button {
  min-height: 32px;
  border: 0;
  border-radius: 10px;
  background: #eaf1ff;
  color: var(--blue-800);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.test-row {
  align-items: center;
}

.test-row.active {
  border-color: #bde8d8;
  background: #f4fff9;
}

.test-row p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.test-actions {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.mini-button.danger {
  color: #a21b1b;
  border-color: #f5caca;
  background: #fff0f0;
}

.incident-doc {
  display: grid;
  gap: 8px;
  max-height: 260px;
  margin-top: 14px;
  overflow-y: auto;
}

.incident-doc p {
  padding: 10px 12px;
  border: 1px solid #f3dda2;
  border-radius: 14px;
  background: #fffaf0;
  color: #533b10;
  font-size: 12px;
  line-height: 1.35;
}

.wave-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.wave-group + .wave-group {
  margin-top: 10px;
}

.absent-list article {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 62px;
  padding: 10px;
  border-radius: 16px;
  background: #f8fbff;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 92px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
}

.form-error {
  min-height: 18px;
  color: var(--red-600) !important;
  font-size: 13px !important;
  font-weight: 800;
}

.confirm:disabled,
.primary:disabled,
.secondary:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

.bottom-tabs.locked {
  grid-template-columns: 1fr;
}

.bottom-tabs.locked .tab:not([data-screen="login"]) {
  display: none;
}

.bottom-tabs:not(.is-admin) {
  grid-template-columns: repeat(4, 1fr);
}

.bottom-tabs:not(.is-admin) .admin-tab {
  display: none;
}

.bottom-tabs.locked {
  grid-template-columns: 1fr;
}
