:root {
  color-scheme: light;
  --navy: #102a43;
  --navy-2: #173f5f;
  --blue: #1769e0;
  --blue-dark: #0f52b5;
  --amber: #f5a623;
  --amber-soft: #fff4da;
  --green: #147d64;
  --red: #c33a3a;
  --ink: #132238;
  --muted: #5e6c7d;
  --line: #d9e2ec;
  --surface: #ffffff;
  --canvas: #eef3f8;
  --shadow: 0 14px 34px rgba(16, 42, 67, 0.11);
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 16px; line-height: 1.55; }
button, input, select { font: inherit; }
button { touch-action: manipulation; }

.topbar {
  background: var(--navy);
  color: white;
  padding: 16px clamp(16px, 4vw, 34px);
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; }
.institution-name { font-size: clamp(1.08rem, 2vw, 1.35rem); font-weight: 900; line-height: 1.2; }
.top-meta-left { margin-top: 4px; text-align: left; }
.display-event-name { margin-top: 4px; color: #d7e7f5; font-size: clamp(0.98rem, 1.4vw, 1.18rem); font-weight: 750; }
.display-body .institution-name { font-size: clamp(1.4rem, 2.4vw, 2rem); }
.top-meta { color: #d7e7f5; font-size: 0.9rem; text-align: right; }
.shell { width: min(1180px, calc(100% - 28px)); margin: 24px auto 48px; }
.shell.narrow { width: min(660px, calc(100% - 28px)); }
.stack { display: grid; gap: 18px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 32px);
}
.card.flat { box-shadow: none; }
.card.callout { border: 2px solid var(--amber); background: linear-gradient(145deg, #fff, var(--amber-soft)); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.55rem, 5vw, 2.35rem); line-height: 1.2; letter-spacing: -0.04em; margin-bottom: 10px; }
h2 { font-size: clamp(1.22rem, 3vw, 1.55rem); line-height: 1.3; letter-spacing: -0.025em; margin-bottom: 12px; }
h3 { font-size: 1.05rem; margin-bottom: 8px; }
.lead { color: var(--muted); font-size: 1.03rem; margin-bottom: 0; }
.muted { color: var(--muted); }
.eyebrow { color: var(--blue-dark); font-size: 0.84rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }
.ticket-number { font-size: clamp(3.8rem, 18vw, 7rem); line-height: 1; font-weight: 900; letter-spacing: -0.06em; color: var(--navy); margin: 20px 0; font-variant-numeric: tabular-nums; }
.seat-number { font-size: clamp(3rem, 12vw, 6rem); line-height: 1; font-weight: 900; color: var(--blue); margin: 16px 0; }
.center { text-align: center; }
.status-pill { display: inline-flex; align-items: center; min-height: 32px; padding: 5px 12px; border-radius: 999px; font-size: 0.88rem; font-weight: 800; background: #e6edf5; color: var(--navy); }
.status-WAITING { background: #e8f1ff; color: #1558b0; }
.status-CALLED { background: #fff0c7; color: #865800; }
.status-IN_PROGRESS { background: #dff6ee; color: #07634c; }
.status-COMPLETED { background: #e7ecf2; color: #526171; }
.status-NO_SHOW, .status-CANCELLED { background: #fde7e7; color: #a52828; }
.status-OPEN, .status-OPERATIONAL { background: #dff6ee; color: #07634c; }
.status-CLOSING, .status-BREAK { background: #fff0c7; color: #865800; }
.status-CLOSED, .status-PREPARING { background: #e7ecf2; color: #526171; }

.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 24px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label { display: grid; place-items: center; min-height: 78px; border: 2px solid var(--line); border-radius: 14px; background: white; cursor: pointer; font-size: 1.1rem; font-weight: 800; }
.choice input:focus-visible + label { outline: 3px solid rgba(23, 105, 224, .28); outline-offset: 2px; }
.choice input:checked + label { border-color: var(--blue); color: var(--blue-dark); background: #edf5ff; }

.btn { border: 0; border-radius: 13px; min-height: 52px; padding: 12px 18px; font-weight: 850; cursor: pointer; transition: transform .12s ease, filter .12s ease; }
.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(23, 105, 224, .32); outline-offset: 2px; }
.btn:disabled { cursor: wait; opacity: .55; }
.btn.primary { background: var(--blue); color: white; }
.btn.primary:hover { background: var(--blue-dark); }
.btn.success { background: var(--green); color: white; }
.btn.warning { background: var(--amber); color: #332000; }
.btn.danger { background: var(--red); color: white; }
.btn.secondary { background: #e7edf4; color: var(--navy); }
.btn.ghost { background: transparent; color: inherit; border: 1px solid var(--line); }
.btn.wide { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.button-row .btn { flex: 1 1 170px; }
.admin-reset-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid #ebc3c3;
  border-radius: 14px;
  background: #fff8f8;
}
.admin-reset-panel p { margin: 5px 0 0; color: var(--muted); font-size: .9rem; }
.admin-reset-panel .btn { flex: 0 0 auto; }
.admin-reset-panel .btn:disabled { cursor: not-allowed; opacity: .45; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric { padding: 18px; border-radius: 14px; background: #f5f8fb; border: 1px solid var(--line); }
.metric span { display: block; color: var(--muted); font-size: 0.86rem; }
.metric strong { display: block; margin-top: 5px; font-size: 1.65rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.info-list { display: grid; gap: 0; margin: 18px 0 0; }
.info-row { display: flex; justify-content: space-between; gap: 18px; padding: 13px 0; border-top: 1px solid var(--line); }
.info-row dt { color: var(--muted); }
.info-row dd { margin: 0; font-weight: 800; text-align: right; }

.notice { border-radius: 12px; padding: 13px 15px; background: #edf5ff; color: #174f93; font-weight: 650; }
.notice.error { background: #fdeaea; color: #9b2929; }
.notice.success { background: #dff6ee; color: #07634c; }
.notice.warning { background: var(--amber-soft); color: #725000; }
.notice.offline { position: sticky; top: 0; z-index: 20; border-radius: 0; text-align: center; }
.hidden { display: none !important; }

.login-panel { max-width: 480px; margin: 8vh auto; }
.field { display: grid; gap: 7px; margin: 16px 0; }
.field label { font-weight: 750; }
.field input, .field select { width: 100%; min-height: 50px; padding: 10px 13px; border: 1px solid #b8c6d4; border-radius: 11px; background: white; color: var(--ink); }
.field input:focus, .field select:focus { border-color: var(--blue); outline: 3px solid rgba(23, 105, 224, .17); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { padding: 12px 13px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--navy); color: white; font-size: 0.88rem; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f6f9fc; }
.seat-status { min-height: 44px; padding: 7px 10px; border: 1px solid #b8c6d4; border-radius: 8px; background: white; color: var(--ink); }
.mini-btn { border: 1px solid #b8c6d4; background: white; border-radius: 8px; min-height: 44px; padding: 8px 11px; font-weight: 750; cursor: pointer; }
.mini-btn.danger { border-color: #e5a3a3; color: #a52828; }
.mini-btn.primary { border-color: #8ab8f0; color: #1257ad; }
.mini-btn:disabled { cursor: not-allowed; opacity: .42; }
.event-name-form { display: grid; gap: 7px; margin-top: 18px; max-width: 560px; }
.event-name-form label, .filter-field { color: var(--muted); font-size: .88rem; font-weight: 750; }
.event-name-controls { display: flex; gap: 8px; }
.event-name-controls input, .event-name-controls select { min-width: 0; flex: 1 1 auto; min-height: 44px; padding: 8px 11px; border: 1px solid #b8c6d4; border-radius: 8px; color: var(--ink); }
.event-name-controls input:focus, .event-name-controls select:focus, .filter-field select:focus { border-color: var(--blue); outline: 3px solid rgba(23, 105, 224, .17); }
.seat-actions { display: flex; align-items: center; gap: 8px; }
.admin-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.ticket-toolbar { display: flex; align-items: end; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.ticket-search-form { display: grid; gap: 5px; }
.ticket-search-form > label { color: var(--muted); font-size: .88rem; font-weight: 750; }
.ticket-search-controls { display: flex; gap: 6px; }
.ticket-search-controls input { width: 180px; min-height: 44px; padding: 8px 11px; border: 1px solid #b8c6d4; border-radius: 8px; color: var(--ink); font-weight: 750; text-transform: uppercase; }
.ticket-search-controls input:focus { border-color: var(--blue); outline: 3px solid rgba(23, 105, 224, .17); }
.filter-field { display: grid; gap: 5px; min-width: 150px; }
.filter-field select { min-height: 44px; padding: 7px 34px 7px 10px; border: 1px solid #b8c6d4; border-radius: 8px; background: white; color: var(--ink); font-weight: 700; }
.ticket-filter-summary { margin: -4px 0 10px; color: var(--muted); font-size: .88rem; text-align: right; }

.display-body { background: #061a2c; color: white; min-height: 100vh; }
.display-body .topbar { background: #061a2c; border-bottom: 1px solid #26445e; }
.display-shell { width: min(1540px, calc(100% - 36px)); margin: 24px auto; }
.display-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(620px, 1fr)); gap: 18px; }
.display-card {
  min-height: 180px;
  border: 2px solid #31536f;
  border-radius: 20px;
  background: #0d2a43;
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(230px, 1.35fr) minmax(170px, 0.85fr);
  overflow: hidden;
}
.display-card.status-CALLED { border-color: #ffbf3f; box-shadow: 0 0 0 2px rgba(255, 191, 63, 0.15); }
.display-card.status-IN_PROGRESS { border-color: #45c59b; }
.display-card.status-COMPLETED { border-color: #6f8aa2; opacity: 0.88; }
.display-cell {
  min-width: 0;
  padding: 22px 24px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}
.display-cell + .display-cell { border-left: 1px solid #31536f; }
.display-field-label {
  color: #a9c0d3;
  font-size: clamp(0.9rem, 1.3vw, 1.05rem);
  font-weight: 750;
  letter-spacing: 0.08em;
}
.display-seat-badge {
  width: clamp(88px, 8vw, 112px);
  aspect-ratio: 1;
  margin-top: 10px;
  border: 5px solid #7ebcff;
  border-radius: 50%;
  background: #102f4a;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  color: white;
  box-shadow: inset 0 0 0 4px rgba(126, 188, 255, 0.12);
}
.display-seat-badge strong {
  align-self: center;
  font-size: clamp(2.8rem, 5vw, 4.6rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.display-seat-badge span { font-size: 1.15rem; font-weight: 850; }
.display-ticket {
  margin-top: 12px;
  color: white;
  font-size: clamp(3.4rem, 6.5vw, 6.4rem);
  line-height: 0.95;
  font-weight: 950;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.display-card.status-CALLED .display-ticket { color: #ffd16d; }
.display-status {
  min-width: 140px;
  margin-top: 16px;
  padding: 13px 18px;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 900;
  white-space: nowrap;
}
.display-card.status-CALLED .display-status { color: #ffd16d; background: rgba(255, 191, 63, 0.12); }
.display-card.status-IN_PROGRESS .display-status { color: #76e0bd; background: rgba(69, 197, 155, 0.12); }
.display-card.status-COMPLETED .display-status { color: #c5d5e2; background: rgba(197, 213, 226, 0.1); }
.empty-state { padding: 54px 20px; text-align: center; color: var(--muted); }
.display-body .empty-state { grid-column: 1 / -1; color: #c5d5e2; }
.footer-time { margin-top: 18px; text-align: right; color: var(--muted); font-size: 0.88rem; }
.display-body .footer-time { color: #adc3d5; }

@media (max-width: 760px) {
  .topbar { align-items: flex-start; }
  .admin-section-heading { align-items: stretch; flex-direction: column; }
  .admin-reset-panel { align-items: stretch; flex-direction: column; }
  .admin-reset-panel .btn { width: 100%; }
  .ticket-toolbar { display: grid; grid-template-columns: 1fr; }
  .ticket-search-form, .filter-field { width: 100%; }
  .ticket-search-controls input { min-width: 0; width: auto; flex: 1 1 auto; }
  .grid.two, .grid.three, .metrics { grid-template-columns: 1fr 1fr; }
  .card { border-radius: 15px; }
  .shell { margin-top: 14px; }
  .display-grid { grid-template-columns: 1fr; }
  .display-card { grid-template-columns: minmax(110px, 0.7fr) minmax(180px, 1.25fr) minmax(135px, 0.8fr); }
  .display-cell { padding: 18px 12px; }
  .display-seat-badge { border-width: 4px; }
  .display-status { min-width: 116px; padding: 11px 12px; }
}
@media (max-width: 480px) {
  .grid.two, .grid.three, .metrics { grid-template-columns: 1fr; }
  .choice-grid { gap: 7px; }
  .choice label { min-height: 70px; }
  .top-meta { display: none; }
  .button-row { display: grid; grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

