:root {
  --ink: #142433;
  --ink-soft: #61707d;
  --navy: #15364a;
  --navy-deep: #0d2534;
  --sky: #e7f1f2;
  --sky-dark: #cfe2e4;
  --cream: #fbfaf7;
  --paper: #ffffff;
  --line: #dfe6e7;
  --mint: #c8e9dd;
  --mint-deep: #1f7c63;
  --orange: #f2a65a;
  --orange-soft: #fff0dc;
  --red: #d85c5c;
  --red-soft: #ffe7e3;
  --purple: #7564b8;
  --shadow: 0 20px 60px rgba(19, 48, 65, .08);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  font-family: "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 12% -10%, rgba(200, 233, 221, .68), transparent 30rem),
    var(--cream);
  color: var(--ink);
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.site-header {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  letter-spacing: -.04em;
  font-size: 20px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px 12px 12px 4px;
  color: var(--paper);
  background: var(--navy);
  font-size: 16px;
  box-shadow: 5px 5px 0 var(--mint);
}

.header-nav { display: flex; align-items: center; gap: 8px; }
.nav-link {
  padding: 10px 13px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}
.nav-link:hover, .nav-link.active { color: var(--navy); background: var(--sky); }

.page-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding-bottom: 72px; }
.eyebrow {
  color: var(--mint-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.045em; }
h1 { margin-bottom: 14px; font-size: clamp(34px, 5vw, 62px); line-height: 1.05; }
h2 { margin-bottom: 8px; font-size: 27px; }
h3 { margin-bottom: 6px; font-size: 17px; }
.muted { color: var(--ink-soft); }
.small { font-size: 12px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(390px, 1.1fr);
  gap: 72px;
  align-items: center;
  min-height: 500px;
  padding: 48px 0 54px;
}
.hero-copy { padding: 14px 0; }
.hero-copy p { max-width: 460px; color: var(--ink-soft); font-size: 17px; line-height: 1.7; }
.hero-note { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.pill, .status-badge, .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.pill { padding: 10px 13px; background: var(--paper); border: 1px solid var(--line); color: var(--ink-soft); }
.pill.mint { background: var(--mint); border-color: transparent; color: #165744; }

.booking-card, .surface {
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(223,230,231,.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.booking-card { padding: 30px; }
.booking-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 22px; }
.booking-head h2 { margin-bottom: 5px; }
.step-label { color: var(--ink-soft); font-size: 12px; font-weight: 700; }

.form-section { margin-top: 21px; }
.form-label { display: block; margin-bottom: 8px; color: var(--ink); font-size: 12px; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 13px 14px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
input:focus, textarea:focus, select:focus { border-color: var(--navy); box-shadow: 0 0 0 4px rgba(21,54,74,.08); }
textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
input[type="date"] { color-scheme: light; }

.office-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.office-choice {
  min-height: 64px;
  padding: 8px 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}
.office-choice:hover { border-color: var(--navy); }
.office-choice.selected { border-color: var(--navy); background: var(--navy); color: #fff; box-shadow: 0 6px 14px rgba(21,54,74,.18); }
.office-choice:disabled { opacity: .42; cursor: not-allowed; }

.primary-button, .secondary-button, .danger-button, .icon-button {
  border: 0;
  border-radius: 12px;
  font-weight: 800;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.primary-button { width: 100%; margin-top: 22px; padding: 15px 18px; background: var(--navy); color: #fff; box-shadow: 0 9px 18px rgba(21,54,74,.18); }
.primary-button:hover { transform: translateY(-1px); background: var(--navy-deep); }
.secondary-button { padding: 10px 13px; background: var(--sky); color: var(--navy); }
.secondary-button:hover { background: var(--sky-dark); }
.danger-button { padding: 9px 12px; background: var(--red-soft); color: var(--red); }
.danger-button:hover { background: #ffd8d1; }
.icon-button { min-width: 32px; height: 32px; background: #f0f4f4; color: var(--navy); }
.icon-button:hover { background: var(--sky-dark); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

.form-error { display: none; margin: 13px 0 0; padding: 11px 13px; border-radius: 11px; background: var(--red-soft); color: #9d3939; font-size: 12px; font-weight: 700; }
.form-error.show { display: block; }
.success-card { display: none; }
.success-card.show { display: block; }
.success-icon { width: 50px; height: 50px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 16px; background: var(--mint); color: var(--mint-deep); font-size: 24px; }
.ticket {
  margin: 22px 0;
  padding: 18px;
  border: 1px dashed #9db8b5;
  border-radius: 16px;
  background: #f4fbf7;
}
.ticket-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #dcece7; }
.ticket-row:last-child { border-bottom: 0; }
.ticket-row span { color: var(--ink-soft); font-size: 12px; }
.ticket-row strong { font-size: 15px; }
.ticket-row.emphasis strong { color: var(--mint-deep); font-size: 23px; }

.section { padding: 55px 0 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-head p { margin-bottom: 0; color: var(--ink-soft); font-size: 13px; }
.office-overview { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.overview-card { padding: 18px; min-height: 145px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; }
.overview-card.off { opacity: .56; }
.overview-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 20px; }
.overview-top h3 { margin: 0; font-size: 14px; }
.overview-count { font-size: 31px; font-weight: 800; letter-spacing: -.08em; }
.overview-count small { margin-left: 3px; color: var(--ink-soft); font-size: 12px; letter-spacing: 0; }
.next-time { color: var(--ink-soft); font-size: 12px; }

.app-page { min-height: 100vh; }
.app-main { padding: 24px 0 72px; }
.page-intro { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.page-intro h1 { margin-bottom: 8px; font-size: clamp(32px, 4vw, 46px); }
.page-intro p { margin: 0; color: var(--ink-soft); }
.date-control { display: flex; align-items: center; gap: 8px; min-width: 190px; }
.date-control input { padding: 11px 12px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .65fr); gap: 18px; }
.queue-surface { min-width: 0; padding: 23px; }
.side-surface { padding: 23px; }
.surface-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.surface-title h2 { margin: 0; font-size: 20px; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; color: var(--mint-deep); font-size: 11px; font-weight: 800; }
.live-dot::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: #35a87e; box-shadow: 0 0 0 4px rgba(53,168,126,.12); }
.tab-row { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 18px; }
.tab-button { flex: 1 0 auto; padding: 12px 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink-soft); font-size: 12px; font-weight: 800; white-space: nowrap; }
.tab-button.active { border-color: var(--navy); background: var(--navy); color: #fff; }
.tab-number { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 4px; border-radius: 99px; background: rgba(255,255,255,.2); font-size: 10px; }
.tab-button:not(.active) .tab-number { background: var(--sky); color: var(--navy); }

.queue-list { display: grid; gap: 10px; }
.queue-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.queue-item.current { border-color: #aacfc1; background: #f2fbf6; }
.queue-number { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--sky); color: var(--navy); font-size: 14px; font-weight: 900; }
.queue-item.current .queue-number { background: var(--mint); color: var(--mint-deep); }
.queue-main { min-width: 0; }
.queue-name-line { display: flex; align-items: center; gap: 7px; min-width: 0; }
.queue-name-line strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-sub { overflow: hidden; margin-top: 5px; color: var(--ink-soft); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.queue-purpose { overflow: hidden; margin-top: 4px; color: var(--ink-soft); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.queue-actions { display: flex; flex-direction: column; align-items: end; gap: 7px; }
.queue-actions-row { display: flex; gap: 5px; }
.queue-actions .primary-button, .queue-actions .secondary-button, .queue-actions .danger-button { width: auto; margin: 0; padding: 8px 11px; font-size: 11px; box-shadow: none; }
.queue-state { color: var(--ink-soft); font-size: 11px; font-weight: 800; }
.tag { padding: 6px 8px; }
.tag.urgent { background: var(--orange-soft); color: #a56016; }
.tag.current { background: var(--mint); color: var(--mint-deep); }
.tag.done { background: #eef0f0; color: #788083; }
.tag.waiting { background: var(--sky); color: var(--navy); }
.empty-state { padding: 48px 20px; text-align: center; color: var(--ink-soft); }
.empty-state .empty-symbol { margin-bottom: 10px; font-size: 29px; }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--ink); }

.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 25px; }
.metric { padding: 15px; border-radius: 15px; background: var(--sky); }
.metric:nth-child(2) { background: var(--mint); }
.metric:nth-child(3) { background: var(--orange-soft); }
.metric:nth-child(4) { background: #eeeafa; }
.metric-label { color: var(--ink-soft); font-size: 11px; font-weight: 800; }
.metric-value { display: block; margin-top: 8px; font-size: 25px; letter-spacing: -.06em; }
.helper-box { padding: 15px; border-radius: 15px; background: #f6f6f2; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.helper-box strong { display: block; margin-bottom: 5px; color: var(--ink); }
.refresh-note { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; color: var(--ink-soft); font-size: 11px; }

.admin-grid { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
.admin-grid > *, .admin-column { width: 100%; min-width: 0; }
.admin-column { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 18px; }
.settings-surface, .table-surface { padding: 23px; }
.narrow-main { max-width: 680px; }
.status-card { max-width: 620px; margin: 48px auto 0; padding: 30px; }
.status-card h1 { margin-bottom: 10px; }
.status-card .ticket { margin: 25px 0 15px; }
.button-link { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.push-receipt { margin: 12px 0 18px; padding: 12px 14px; border-radius: 12px; background: var(--mint); color: var(--mint-deep); font-size: 12px; font-weight: 800; }
.push-setup { margin-top: 15px; padding: 14px; border-radius: 14px; background: #f0f7f5; }
.push-setup p { margin: 0 0 10px; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.push-setup .secondary-button { margin-top: 8px; }
.push-status { min-height: 17px; margin-top: 8px; color: var(--mint-deep); font-size: 11px; font-weight: 800; }
.notification-read { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 10px; }
.push-test-box { margin-top: 14px; padding: 14px; border-radius: 14px; background: #f0f7f5; }
.push-test-box > strong { display: block; margin-bottom: 6px; }
.push-test-box p { margin: 0 0 12px; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.push-test-box select { width: 100%; margin-top: 7px; }
.push-test-box .secondary-button { width: 100%; margin-top: 10px; }
.push-test-message { min-height: 17px; margin-top: 8px; color: var(--mint-deep); font-size: 11px; font-weight: 800; }
.setting-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.setting-field label { display: block; margin-bottom: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 800; }
.office-toggle-list { display: grid; gap: 8px; margin-top: 18px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border-radius: 12px; background: #f6f8f7; }
.toggle-row span { font-size: 12px; font-weight: 800; }
.toggle { position: relative; width: 39px; height: 22px; display: inline-block; }
.toggle input { position: absolute; width: 0; height: 0; opacity: 0; }
.toggle-track { position: absolute; inset: 0; border-radius: 99px; background: #c8d0d0; transition: .18s; }
.toggle-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .18s; }
.toggle input:checked + .toggle-track { background: var(--mint-deep); }
.toggle input:checked + .toggle-track::after { transform: translateX(17px); }
.settings-message { min-height: 17px; margin: 10px 0 0; color: var(--mint-deep); font-size: 11px; font-weight: 800; }

.table-wrap { min-width: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 650px; }
th { padding: 11px 9px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 10px; text-align: left; white-space: nowrap; }
td { padding: 13px 9px; border-bottom: 1px solid #edf0ef; font-size: 12px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.table-primary { font-weight: 800; }
.table-secondary { margin-top: 4px; color: var(--ink-soft); font-size: 11px; }
.inline-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.inline-actions button { padding: 7px 9px; border: 0; border-radius: 8px; background: var(--sky); color: var(--navy); font-size: 10px; font-weight: 800; }
.inline-actions button:hover { background: var(--sky-dark); }
.inline-actions button.warn { background: var(--orange-soft); color: #a56016; }
.inline-actions button.cancel { background: var(--red-soft); color: var(--red); }
.notification-status { font-size: 11px; font-weight: 800; }
.notification-status.mock { color: #a56016; }
.notification-status.sent { color: var(--mint-deep); }
.notification-status.pending { color: #a56016; }
.notification-status.failed { color: var(--red); }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: 340px; padding: 13px 16px; border-radius: 12px; background: var(--navy-deep); color: #fff; box-shadow: var(--shadow); font-size: 12px; font-weight: 700; opacity: 0; pointer-events: none; transform: translateY(10px); transition: .22s; }
.toast.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.footer-note { margin-top: 52px; color: var(--ink-soft); font-size: 11px; text-align: center; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 18px; min-height: auto; }
  .hero-copy { padding-top: 18px; }
  .office-overview { grid-template-columns: repeat(3, 1fr); }
  .dashboard-grid, .admin-grid, .admin-column { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .site-header, .page-shell { width: min(100% - 28px, 1180px); }
  .site-header { min-height: 68px; }
  .brand { font-size: 17px; }
  .header-nav { gap: 0; }
  .nav-link { padding: 8px; font-size: 11px; }
  .hero { padding-top: 25px; }
  h1 { font-size: 38px; }
  .booking-card { padding: 20px; border-radius: 20px; }
  .office-picker { grid-template-columns: repeat(3, 1fr); }
  .office-choice { min-height: 55px; }
  .form-grid, .setting-row { grid-template-columns: 1fr; }
  .office-overview { grid-template-columns: repeat(2, 1fr); }
  .section-head, .page-intro { align-items: flex-start; flex-direction: column; }
  .date-control { width: 100%; }
  .date-control input { flex: 1; }
  .queue-surface, .side-surface, .settings-surface, .table-surface { padding: 17px; }
  .status-card { margin-top: 24px; padding: 20px; }
  .queue-item { grid-template-columns: 35px minmax(0, 1fr); gap: 10px; }
  .queue-actions { grid-column: 2; align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .queue-actions-row { flex-wrap: wrap; }
  .metric-grid { gap: 7px; }
  .toast { right: 14px; bottom: 14px; left: 14px; max-width: none; }
}
