:root {
  /* --- Palette (Venice Blue Theme) ----------------------------------- */
  --ink: #16587b; /* Darker Venice Blue */
  --ink-soft: #0077b6; /* Venice Blue (Primary) */
  --paper: #f5eedd; /* Merino (Background) */
  --surface: #ffffff;

  --hardwood: #f49f04; /* Rock Blue (Accent) */
  --hardwood-dk: #0077b6; /* Venice Blue */
  --teal: #0077b6; /* Venice Blue */
  --red: #e0402b;

  --text: #0077b6; /* Venice Blue */
  --text-muted: #5a7d91;
  --text-faint: #0077b6;
  --line: #0077b6;
  --line-soft: #dcd7c9;

  --radius: 10px;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --shadow-lg: 6px 6px 0 var(--ink);

  --topbar-h: 62px;
  --tabbar-h: 68px;

  --font-display: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Space Mono", "Courier New", monospace;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font-family: inherit;
}
::selection {
  background: var(--hardwood);
  color: #ffffff;
}
:focus-visible {
  outline: 3px solid var(--hardwood);
  outline-offset: 2px;
}

h1,
h2,
h3,
.font-display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
  text-transform: uppercase;
}
.mono,
.font-mono {
  font-family: var(--font-mono);
}

/* skeleton loading shimmer shared everywhere data is fetched */
.skel {
  position: relative;
  overflow: hidden;
  background: #e5dfd0;
  border-radius: 6px;
}
.skel::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 1.25s infinite;
}
@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* =========================================================================
   LOGIN — Venice Blue Court
   ========================================================================= */
.login-screen {
  min-height: 100vh;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.login-screen::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.3;
  background-image: repeating-linear-gradient(0deg, rgba(132, 179, 206, 0.1) 0 1px, transparent 1px 42px), repeating-linear-gradient(90deg, rgba(132, 179, 206, 0.1) 0 1px, transparent 1px 42px);
}
.login-top {
  position: relative;
  padding: 28px clamp(20px, 6vw, 72px) 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.login-top .mark {
  width: 34px;
  height: 34px;
  background: var(--hardwood);
  border: 2px solid var(--paper);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  color: var(--ink);
  font-size: 17px;
}
.login-top b {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-body {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  padding: 32px clamp(20px, 6vw, 72px) 48px;
  gap: 48px;
  flex-wrap: wrap;
}
.login-hero {
  flex: 1 1 420px;
  min-width: 0;
}
.login-hero .eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--hardwood);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.login-hero h1 {
  font-size: clamp(48px, 8vw, 96px);
  margin: 0;
  color: var(--paper);
}
.login-hero h1 span {
  color: var(--hardwood);
}
.login-hero p {
  font-size: 14.5px;
  color: #f49f04;
  max-width: 380px;
  margin: 14px 0 0;
}

.login-panel {
  flex: 0 1 380px;
  min-width: 290px;
  background: var(--paper);
  color: var(--ink);
  border: 2.5px solid var(--paper);
  box-shadow: 7px 7px 0 var(--hardwood);
  padding: 28px 26px;
}
.login-panel h2 {
  font-size: 24px;
  margin: 0 0 4px;
}
.login-panel .sub {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: #5a7d91;
  margin: 0 0 20px;
}
.login-error {
  display: none;
  background: #fbe2dc;
  border: 2px solid var(--red);
  color: #8a2617;
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 11px;
  margin-bottom: 14px;
}
.login-error.show {
  display: block;
}
.login-foot {
  margin-top: 18px;
  font-size: 11.5px;
  color: #5a7d91;
  text-align: center;
}

/* =========================================================================
   FORM ELEMENTS
   ========================================================================= */
.field {
  margin-bottom: 15px;
}
.field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}
.login-panel .field label {
  color: #0077b6;
}
.input,
select.input,
textarea.input {
  width: 100%;
  padding: 11px 12px;
  font-size: 14.5px;
  font-family: inherit;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  transition:
    box-shadow 0.12s,
    transform 0.12s;
}
.input:focus {
  outline: none;
  box-shadow: 3px 3px 0 var(--hardwood);
}
.input::placeholder {
  color: var(--text-faint);
}
.field-hint {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 5px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid var(--line);
  cursor: pointer;
  font-weight: 700;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.08s,
    box-shadow 0.08s;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}
.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}
.btn-block {
  width: 100%;
}
.btn-primary {
  background: var(--hardwood);
  border-color: var(--ink);
  color: var(--ink);
}
.btn-dark {
  background: var(--ink);
  color: var(--paper);
}
.btn-ghost {
  background: var(--surface);
}
.btn-teal {
  background: var(--ink-soft);
  color: #fff;
}
.btn-danger {
  background: var(--red);
  color: #fff;
}
.btn-sm {
  padding: 7px 12px;
  font-size: 11.5px;
  box-shadow: 2px 2px 0 var(--ink);
}
.btn-sm:hover {
  box-shadow: 3px 3px 0 var(--ink);
}
.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
}
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.spin-sm {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: currentColor;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================================================================
   APP SHELL — top bar (desktop nav) + bottom tab bar (mobile nav)
   ========================================================================= */
.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  background: var(--ink);
  color: var(--paper);
  border-bottom: 2.5px solid var(--ink);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}
.topbar .brand .mark {
  width: 30px;
  height: 30px;
  background: var(--hardwood);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--ink);
}
.topbar .brand .mark-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
}
.topbar .brand b {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.02em;
  display: none;
}
@media (min-width: 560px) {
  .topbar .brand b {
    display: block;
  }
}

.topnav {
  display: none;
  flex: 1;
  gap: 2px;
}
@media (min-width: 860px) {
  .topnav {
    display: flex;
  }
}
.topnav a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  height: var(--topbar-h);
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #f49f04;
  border-bottom: 3px solid transparent;
}
.topnav a svg {
  width: 16px;
  height: 16px;
}
.topnav a:hover {
  color: var(--paper);
}
.topnav a.active {
  color: var(--paper);
  border-bottom-color: var(--hardwood);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-chip {
  display: none;
  align-items: center;
  gap: 8px;
}
@media (min-width: 860px) {
  .user-chip {
    display: flex;
  }
}
.user-chip .av {
  width: 30px;
  height: 30px;
  border: 2px solid var(--hardwood);
  background: var(--ink-soft);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--paper);
}
.user-chip b {
  display: block;
  font-size: 12.5px;
  color: var(--paper);
}
.user-chip span {
  display: block;
  font-size: 10px;
  color: #f49f04;
}

/* MODERNISED TABBAR - Venice Blue Theme */
.tabbar {
  display: flex;
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 25px;
  height: 64px;
  background: #ffffff;
  border-radius: 32px;
  box-shadow: 0 10px 30px rgba(22, 88, 123, 0.1);
  z-index: 1000;
  border: none;
}
@media (min-width: 860px) {
  .tabbar {
    display: none;
  }
}

.tabbar::before {
  content: "";
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  width: 96px;
  height: 50px;
  background: #ffffff;
  border-radius: 48px 48px 0 0;
  z-index: 0;
  box-shadow: 0 -10px 15px rgba(22, 88, 123, 0.05);
}

.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #f49f04;
  font-size: 11px;
  font-weight: 600;
  position: relative;
  z-index: 2;
  text-transform: none;
}
.tabbar a svg {
  width: 22px;
  height: 22px;
}
.tabbar a.active {
  color: var(--ink-soft); /* Venice Blue */
}

.tabbar a.scan-fab {
  overflow: visible;
}
.tabbar a.scan-fab .fab {
  position: absolute;
  top: -52px;
  left: 50%;
  transform: translateX(-50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--ink-soft); /* Venice Blue */
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(22, 88, 123, 0.35);
  z-index: 5;
}
.tabbar a.scan-fab:active .fab {
  transform: translateX(-50%) scale(0.9);
}
.tabbar a.scan-fab .fab svg {
  width: 26px;
  height: 26px;
}

.tabbar a.scan-fab span {
  margin-top: 36px;
  color: #f49f04;
  font-weight: 600;
  position: relative;
  z-index: 1;
}
.tabbar a.active.scan-fab span {
  color: var(--ink-soft);
}

.view {
  flex: 1;
  padding: 22px 20px calc(24px + 100px);
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}
@media (min-width: 860px) {
  .view {
    padding: 26px 28px 48px;
  }
}

.view-head {
  margin-bottom: 20px;
}
.view-head h1 {
  font-size: clamp(28px, 4vw, 36px);
  margin: 0;
}
.view-head p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 4px 0 0;
  font-weight: 600;
}
.view-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

/* =========================================================================
   BENTO DASHBOARD
   ========================================================================= */
.bento {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 16px;
}
@media (max-width: 760px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ring-tile {
  grid-column: span 2;
  grid-row: span 2;
  background: var(--ink);
  color: var(--paper);
  border: 2.5px solid var(--ink);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}
@media (max-width: 760px) {
  .ring-tile {
    grid-column: span 2;
    flex-direction: column;
    text-align: center;
  }
}
.ring-tile .ring-wrap {
  position: relative;
  width: 132px;
  height: 132px;
  flex-shrink: 0;
}
.ring-tile .ring-wrap svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-tile .ring-num {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-tile .ring-num b {
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1;
}
.ring-tile .ring-num span {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: #f49f04;
  text-transform: uppercase;
}
.ring-tile .ring-info .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hardwood);
}
.ring-tile .ring-info h3 {
  font-size: 22px;
  margin: 4px 0;
  text-transform: none;
}
.ring-tile .ring-info p {
  font-size: 11.5px;
  color: #f49f04;
  margin: 0;
  font-weight: 600;
}

.num-tile {
  grid-column: span 2;
  background: var(--surface);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
}
@media (min-width: 760px) {
  .num-tile {
    grid-column: span 2;
  }
}
.num-tile .label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.num-tile .num {
  font-family: var(--font-display);
  font-size: 34px;
  margin-top: 2px;
}
.num-tile.tone-teal .num {
  color: var(--ink-soft);
}
.num-tile.tone-red .num {
  color: var(--red);
}
.num-tile.tone-hardwood .num {
  color: var(--hardwood);
}
.num-tile .foot {
  font-size: 10.5px;
  color: var(--text-faint);
  margin-top: 2px;
  font-weight: 600;
}

/* =========================================================================
   CARD / PANEL
   ========================================================================= */
.card {
  background: var(--surface);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-sm);
  border-radius: 8px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 2px solid var(--line-soft);
  flex-wrap: wrap;
}
.card-head h2 {
  font-size: 19px;
  margin: 0;
  text-transform: none;
  font-family: var(--font-body);
  font-weight: 800;
}
.card-head .desc {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 600;
}
.card-body {
  padding: 18px;
}
.card-body.pad-0 {
  padding: 0;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar .input,
.toolbar select {
  min-width: 150px;
}
.search-input {
  position: relative;
}
.search-input .input {
  padding-left: 36px;
}
.search-input svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-faint);
}

/* =========================================================================
   TABLE
   ========================================================================= */
.table-wrap {
  overflow-x: auto;
}
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 640px;
}
table.tbl th {
  text-align: left;
  padding: 10px 16px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid var(--line);
  font-weight: 800;
  background: #fdfaf0;
}
table.tbl td {
  padding: 12px 16px;
  border-bottom: 1.5px solid var(--line-soft);
  vertical-align: middle;
}
table.tbl tbody tr:hover {
  background: #fdfaf0;
}
table.tbl tbody tr:last-child td {
  border-bottom: none;
}
.cell-name {
  font-weight: 700;
}
.cell-sub {
  color: var(--text-faint);
  font-size: 11.5px;
}
.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1.5px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.tag-hadir {
  background: var(--ink-soft);
  color: #fff;
}
.tag-telat {
  background: var(--red);
  color: #fff;
}
.tag-aktif {
  background: var(--ink-soft);
  color: #fff;
}
.tag-nonaktif {
  background: #e5dfd0;
  color: #5a7d91;
}
.tag-neutral {
  background: var(--hardwood);
  color: var(--ink);
}

.empty-state {
  text-align: center;
  padding: 52px 20px;
  color: var(--text-muted);
}
.empty-state svg {
  width: 40px;
  height: 40px;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.empty-state h3 {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 15px;
  margin: 0 0 4px;
  color: var(--text);
  text-transform: none;
}
.empty-state p {
  font-size: 12.5px;
  margin: 0;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  font-size: 11.5px;
  color: var(--text-muted);
  border-top: 2px solid var(--line-soft);
  font-weight: 600;
}

/* skeleton rows for table loading state */
.skel-row td {
  padding: 12px 16px;
}
.skel-row .skel {
  height: 14px;
  width: 100%;
}

/* =========================================================================
   MODAL
   ========================================================================= */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 46, 65, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 18px;
}
.modal-backdrop.show {
  display: flex;
  animation: fadeIn 0.12s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.modal {
  background: var(--surface);
  border: 2.5px solid var(--ink);
  box-shadow: 8px 8px 0 var(--hardwood);
  border-radius: 10px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  animation: pop 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.modal.modal-lg {
  max-width: 640px;
}
.modal-head {
  padding: 20px 20px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.modal-head h3 {
  font-size: 22px;
  margin: 0;
}
.modal-head .desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 600;
}
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-faint);
  padding: 4px;
}
.modal-body {
  padding: 16px 20px 20px;
}
.modal-foot {
  padding: 14px 20px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
.form-grid .field.full {
  grid-column: 1/-1;
}
@media (max-width: 520px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================================
   TOAST
   ========================================================================= */
.toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: calc(100vw - 32px);
}
.toast {
  background: var(--ink);
  color: var(--paper);
  padding: 12px 15px;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--hardwood);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 230px;
  border-radius: 6px;
  animation: toastIn 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast.ok {
  box-shadow: 3px 3px 0 var(--hardwood);
}
.toast.err {
  box-shadow: 3px 3px 0 var(--red);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.toast svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.veil {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(245, 238, 221, 0.7);
  display: grid;
  place-items: center;
  z-index: 400;
}
.veil .spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid var(--line-soft);
  border-top-color: var(--ink-soft);
  animation: spin 0.7s linear infinite;
}

/* =========================================================================
   SCAN PAGE
   ========================================================================= */
.scan-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 980px) {
  .scan-layout {
    grid-template-columns: 1fr 360px;
    align-items: start;
  }
}

.mode-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.scanner-card {
  background: var(--ink);
  border: 2.5px solid var(--ink);
  box-shadow: var(--shadow-lg);
  border-radius: 10px;
  overflow: hidden;
}
.scanner-viewport {
  aspect-ratio: 1/1;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  position: relative;
  background: #000;
}
@media (min-width: 520px) {
  .scanner-viewport {
    aspect-ratio: 4/3;
    max-width: none;
  }
}
#reader {
  width: 100%;
  height: 100%;
}
#reader video {
  object-fit: cover;
}
.scanner-frame {
  position: absolute;
  top: 14%;
  left: 14%;
  right: 14%;
  bottom: 14%;
  border: 3px solid rgba(132, 179, 206, 0.4);
  border-radius: 16px;
  pointer-events: none;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.32);
}
.scanner-frame::before,
.scanner-frame::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
}
.scanner-frame::before {
  top: -3px;
  left: -3px;
  border-top: 4px solid var(--hardwood);
  border-left: 4px solid var(--hardwood);
  border-radius: 8px 0 0 0;
}
.scanner-frame::after {
  bottom: -3px;
  right: -3px;
  border-bottom: 4px solid var(--hardwood);
  border-right: 4px solid var(--hardwood);
  border-radius: 0 0 8px 0;
}
.scanner-status {
  padding: 12px 16px;
  color: var(--paper);
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 600;
}
.scanner-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hardwood);
  box-shadow: 0 0 0 4px rgba(132, 179, 206, 0.2);
}
.scanner-toggle {
  padding: 0 16px 14px;
  display: flex;
  gap: 8px;
}

.manual-input-row {
  display: flex;
  gap: 8px;
}
.manual-input-row .input {
  font-family: var(--font-mono);
}

.scan-result {
  min-height: 200px;
}
.result-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 36px 18px;
  color: var(--text-faint);
  text-align: center;
}
.result-card {
  display: none;
  padding: 20px;
  text-align: center;
  animation: pop 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.result-card.show {
  display: block;
}
.result-icon {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
}
.result-icon.ok {
  background: var(--ink-soft);
  color: #fff;
}
.result-icon.late {
  background: var(--red);
  color: #fff;
}
.result-icon.err {
  background: #e5dfd0;
  color: #5a7d91;
}
.result-icon svg {
  width: 30px;
  height: 30px;
}
.result-name {
  font-family: var(--font-display);
  font-size: 25px;
  margin: 0 0 2px;
  text-transform: none;
}
.result-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 10px;
  font-weight: 600;
}
.result-time {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  display: inline-block;
  padding: 5px 11px;
  border-radius: 6px;
}

.today-list {
  max-height: 320px;
  overflow-y: auto;
}
.today-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  border-bottom: 1.5px solid var(--line-soft);
}
.today-row:last-child {
  border-bottom: none;
}
.today-row .av {
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--ink);
  background: var(--hardwood);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 11px;
  flex-shrink: 0;
}
.today-row .meta {
  flex: 1;
  min-width: 0;
}
.today-row .meta b {
  display: block;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.today-row .meta span {
  font-size: 10.5px;
  color: var(--text-faint);
}
.today-row .t {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

/* =========================================================================
   PLAYER TICKET CARD — Venice Blue Theme
   ========================================================================= */
.ticket {
  position: relative;
  width: 300px;
  background: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  color: var(--paper);
  font-family: var(--font-body);
}
.ticket-top {
  padding: 16px 16px 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.ticket-top .brand {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hardwood);
}
.ticket-top .name {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 4px 0 0;
  line-height: 1.05;
  text-transform: none;
}
.ticket-top .grp {
  font-size: 10.5px;
  color: #f49f04;
  margin-top: 2px;
  font-weight: 600;
}
.ticket-num {
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--hardwood);
  line-height: 1;
  flex-shrink: 0;
}
.ticket-divider {
  position: relative;
  height: 0;
  border-top: 2px dashed rgba(245, 238, 221, 0.2);
}
.ticket-divider::before,
.ticket-divider::after {
  content: "";
  position: absolute;
  top: -10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--paper);
}
.ticket-divider::before {
  left: -10px;
}
.ticket-divider::after {
  right: -10px;
}
.ticket-bottom {
  background: var(--paper);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ticket-bottom .qr-box {
  width: 96px;
  height: 96px;
  background: #fff;
  border: 1.5px solid var(--ink);
  padding: 4px;
  flex-shrink: 0;
}
.ticket-bottom .qr-box canvas,
.ticket-bottom .qr-box img {
  width: 100%;
  height: 100%;
}
.ticket-bottom .meta {
  min-width: 0;
}
.ticket-bottom .code {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink);
  font-weight: 700;
}
.ticket-bottom .club {
  font-size: 9.5px;
  color: #5a7d91;
  margin-top: 4px;
  line-height: 1.4;
}

.ticket-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: flex-start;
}

@media print {
  body * {
    visibility: hidden;
  }
  #print-area,
  #print-area * {
    visibility: visible;
  }
  #print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 0;
    margin: 0;
  }
  .ticket {
    break-inside: avoid;
  }
  .ticket-divider::before,
  .ticket-divider::after {
    background: #fff;
  }
  .no-print {
    display: none !important;
  }
}

/* =========================================================================
   UTILITIES
   ========================================================================= */
.flex {
  display: flex;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-8 {
  gap: 8px;
}
.gap-10 {
  gap: 10px;
}
.gap-12 {
  gap: 12px;
}
.mt-0 {
  margin-top: 0;
}
.mb-0 {
  margin-bottom: 0;
}
.text-muted {
  color: var(--text-muted);
}
.text-sm {
  font-size: 12.5px;
}
.w-full {
  width: 100%;
}
.hidden {
  display: none !important;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 8px 0;
}
