:root {
  --bg: #f3efe6;
  --bg-soft: #f8f5ef;
  --panel: rgba(255, 251, 245, 0.86);
  --panel-strong: #fff9ef;
  --line: rgba(86, 64, 38, 0.16);
  --ink: #23160d;
  --muted: #6f5b4b;
  --accent: #b15f2b;
  --accent-strong: #8e4012;
  --alert: #a12f2a;
  --alert-soft: #ffe4df;
  --ok: #246a4c;
  --ok-soft: #dff3e8;
  --warn: #8e5c0a;
  --warn-soft: #fff0c9;
  --shadow: 0 24px 64px rgba(72, 41, 16, 0.12);
  --radius: 22px;
  --sidebar: 280px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(255, 210, 144, 0.5), transparent 30%),
    linear-gradient(150deg, #f6f1e8 0%, #efe5d2 38%, #e7dcc7 100%);
  color: var(--ink);
  font-family: "Noto Sans KR", "Malgun Gothic", "Segoe UI Variable", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 22px;
  background: linear-gradient(180deg, rgba(49, 29, 16, 0.95), rgba(77, 43, 22, 0.92));
  color: #fff6ee;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.07);
}

.brand {
  margin-bottom: 28px;
}

.brand h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.25;
}

.brand p {
  margin: 10px 0 0;
  color: rgba(255, 239, 225, 0.72);
  font-size: 0.95rem;
}

.nav-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.nav-button {
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 247, 238, 0.08);
  color: #fff6ee;
  text-align: left;
  transition: transform 0.18s ease, background 0.18s ease;
}

.nav-button:hover,
.nav-button.is-active {
  transform: translateX(4px);
  background: linear-gradient(135deg, rgba(255, 190, 122, 0.26), rgba(255, 247, 238, 0.16));
}

.sidebar-foot {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 239, 225, 0.72);
  font-size: 0.92rem;
}

.page {
  padding: 26px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.topbar-leading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.title-wrap h2 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.title-wrap p {
  margin: 8px 0 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.mobile-nav-toggle,
.mobile-nav-backdrop {
  display: none;
}

.mobile-nav-toggle {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: none;
  align-items: center;
  justify-content: center;
}

.mobile-nav-toggle-lines {
  display: inline-grid;
  gap: 4px;
}

.mobile-nav-toggle-lines span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(880px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  padding: 24px;
}

.login-copy {
  padding: 20px;
  border-radius: 20px;
  background: linear-gradient(140deg, rgba(255, 244, 224, 0.82), rgba(255, 255, 255, 0.72));
  border: 1px solid rgba(177, 95, 43, 0.14);
}

.login-copy h1 {
  margin: 0 0 10px;
  font-size: 2rem;
}

.login-copy p {
  margin: 0;
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 14px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.panel {
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 22px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}

.hero-card {
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 248, 233, 0.88), rgba(255, 245, 228, 0.68));
  border: 1px solid rgba(177, 95, 43, 0.12);
}

.hero-card h3,
.section-head h3,
.stack-card h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.hero-card p,
.stack-card p,
.muted {
  color: var(--muted);
}

.pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.92rem;
}

.pill.emphasis {
  background: linear-gradient(135deg, rgba(177, 95, 43, 0.14), rgba(255, 255, 255, 0.82));
  border-color: rgba(177, 95, 43, 0.26);
}

.pill.pill-fallback {
  background: var(--warn-soft);
  border-color: rgba(142, 92, 10, 0.24);
  color: var(--warn);
}

.pill.pill-warning {
  background: var(--alert-soft);
  border-color: rgba(161, 47, 42, 0.28);
  color: var(--alert);
  font-weight: 700;
}

.admin-tab-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.checkbox-grid {
  display: grid;
  gap: 10px;
}

.checkbox-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(111, 91, 75, 0.14);
}

.checkbox-card.compact {
  padding: 10px 12px;
}

.checkbox-inline {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.compact-button {
  padding: 8px 12px;
  border-radius: 12px;
}

.table-row-active {
  background: rgba(177, 95, 43, 0.08);
}

.button {
  border: 0;
  border-radius: 16px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  box-shadow: 0 12px 26px rgba(177, 95, 43, 0.26);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  box-shadow: none;
  border: 1px solid var(--line);
}

.button.ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  border: 1px dashed var(--line);
}

.button.warn {
  background: linear-gradient(135deg, #c66b1b, #8d4f0b);
}

.button.danger {
  background: linear-gradient(135deg, #ba433f, #8e2d29);
}

.banner {
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.banner.info {
  background: rgba(255, 255, 255, 0.7);
}

.banner.success {
  background: var(--ok-soft);
  border-color: rgba(36, 106, 76, 0.18);
}

.banner.error {
  background: var(--alert-soft);
  border-color: rgba(161, 47, 42, 0.18);
}

.view {
  display: none;
  margin-top: 20px;
}

.view.is-active {
  display: block;
  animation: rise 0.3s ease;
}

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

.section-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 18px;
}

.stack {
  display: grid;
  gap: 18px;
}

.stack-card,
.table-card,
.form-card {
  padding: 20px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.88), rgba(246, 237, 218, 0.66));
  border: 1px solid rgba(177, 95, 43, 0.12);
}

.metric-card strong {
  display: block;
  font-size: 1.6rem;
  margin-top: 8px;
}

.summary-list,
.plain-list {
  display: grid;
  gap: 10px;
}

.list-row {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(177, 95, 43, 0.1);
}

.list-row.alert {
  background: var(--alert-soft);
}

.list-row.warn {
  background: var(--warn-soft);
}

.list-row.success {
  background: var(--ok-soft);
}

.list-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge.black {
  background: #3b1d1d;
  color: #fff0ef;
}

.badge.vip {
  background: #ffe4a8;
  color: #7d4c00;
}

.badge.route {
  background: rgba(36, 106, 76, 0.12);
  color: #185339;
}

.badge.warn {
  background: rgba(161, 47, 42, 0.12);
  color: #8e2d29;
}

.badge.status {
  background: rgba(0, 0, 0, 0.06);
  color: var(--muted);
}

.inline-link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.grid-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.form-card form,
.table-card form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 0.92rem;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid rgba(111, 91, 75, 0.18);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
}

.field textarea {
  min-height: 100px;
  resize: vertical;
}

.date-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.date-control > input[data-date-display] {
  letter-spacing: 0.02em;
}

.date-picker-slot {
  position: relative;
  min-width: 72px;
}

.date-picker-button {
  width: 100%;
  height: 100%;
  min-height: 48px;
  padding-inline: 12px;
  box-shadow: none;
}

.date-picker-slot:focus-within .date-picker-button {
  border-color: rgba(177, 95, 43, 0.36);
  box-shadow: 0 0 0 3px rgba(177, 95, 43, 0.12);
}

.date-picker-native {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.payment-form {
  display: grid;
  gap: 14px;
}

.charge-form {
  display: grid;
  gap: 14px;
}

.charge-item-list {
  display: grid;
  gap: 12px;
}

.admin-editor-list {
  display: grid;
  gap: 12px;
}

.charge-item-row {
  display: grid;
  grid-template-columns: 0.8fr 1.4fr 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed rgba(111, 91, 75, 0.18);
}

.admin-room-row,
.admin-code-row,
.admin-route-row,
.blacklist-row {
  display: grid;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed rgba(111, 91, 75, 0.18);
}

.admin-room-row {
  grid-template-columns: 0.8fr 0.7fr 1fr 0.8fr 1.2fr;
}

.admin-code-row,
.admin-route-row {
  grid-template-columns: 0.8fr 1.4fr 1fr;
}

.blacklist-row {
  grid-template-columns: 0.9fr 1fr 1.6fr 1fr auto;
}

.permission-set-row {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed rgba(111, 91, 75, 0.18);
}

.permission-set-row-head {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr auto;
  gap: 10px;
  align-items: end;
}

.permission-menu-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .charge-item-row,
  .admin-room-row,
  .admin-code-row,
  .admin-route-row,
  .blacklist-row,
  .permission-set-row-head,
  .permission-menu-grid {
    grid-template-columns: 1fr;
  }
}

.payment-detail-section {
  display: grid;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px dashed rgba(111, 91, 75, 0.18);
}

.payment-detail-section[hidden] {
  display: none;
}

.required-mark {
  color: #ba433f;
  font-weight: 700;
}

.no-spinner {
  appearance: textfield;
}

.no-spinner::-webkit-outer-spin-button,
.no-spinner::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  flex-wrap: wrap;
}

.range-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 220px)) auto;
  gap: 12px;
  align-items: end;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.table-wrap {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  background: rgba(255, 255, 255, 0.68);
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(86, 64, 38, 0.08);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: rgba(255, 249, 239, 0.94);
  color: var(--muted);
  font-size: 0.9rem;
}

.row-blacklist {
  background: rgba(255, 228, 223, 0.82);
}

.row-voided td {
  opacity: 0.62;
}

.settlement-summary-row td {
  background: rgba(255, 249, 239, 0.92);
  border-top: 1px solid rgba(86, 64, 38, 0.12);
}

.settlement-group-row td {
  background: rgba(248, 239, 225, 0.96);
  border-top: 1px solid rgba(177, 95, 43, 0.18);
}

.settlement-group-row strong {
  margin-right: 10px;
}

.settlement-group-subtotal-row td {
  background: rgba(255, 252, 247, 0.96);
  border-top: 1px dashed rgba(111, 91, 75, 0.18);
}

.settlement-summary-row.is-total td {
  background: rgba(243, 233, 214, 0.94);
}

.settlement-summary-row td:last-child {
  white-space: nowrap;
}

.group-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(177, 95, 43, 0.12);
  background: rgba(255, 252, 247, 0.76);
}

.group-members {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.group-member-row {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.8fr 0.8fr 0.8fr 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px dashed rgba(111, 91, 75, 0.18);
}

.group-member-row .field {
  gap: 4px;
}

.subtle {
  font-size: 0.9rem;
  color: var(--muted);
}

.empty-state {
  padding: 26px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  border-radius: 18px;
  border: 1px dashed var(--line);
}

.status-grid {
  display: grid;
  gap: 18px;
}

.occupancy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.occupancy-card {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.86), rgba(255, 240, 210, 0.66));
  border: 1px solid rgba(177, 95, 43, 0.12);
}

.log-list {
  display: grid;
  gap: 12px;
}

.log-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(111, 91, 75, 0.12);
}

.footer-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.checkout-summary-row {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 16px;
  align-items: end;
  margin-top: 16px;
}

.checkout-balance-panel {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(177, 95, 43, 0.16);
  background: rgba(255, 255, 255, 0.78);
}

.checkout-balance-panel.is-clear {
  background: linear-gradient(135deg, rgba(231, 247, 235, 0.95), rgba(255, 255, 255, 0.85));
  border-color: rgba(66, 125, 76, 0.22);
}

.checkout-balance-panel.is-mismatch {
  background: linear-gradient(135deg, rgba(255, 235, 231, 0.98), rgba(255, 255, 255, 0.85));
  border-color: rgba(161, 47, 42, 0.24);
}

.checkout-balance-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.checkout-balance-amount {
  font-size: 1.8rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.checkout-balance-panel.is-mismatch .checkout-balance-amount {
  color: var(--alert);
}

.checkout-balance-hint {
  font-size: 0.92rem;
  color: var(--muted);
}

.availability-button {
  width: 100%;
  border: 1px solid rgba(177, 95, 43, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  padding: 12px;
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.availability-button strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.availability-button:hover,
.availability-button.is-active {
  transform: translateY(-1px);
  border-color: rgba(177, 95, 43, 0.3);
  box-shadow: 0 12px 24px rgba(72, 41, 16, 0.1);
}

.availability-detail {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 248, 236, 0.72);
  border: 1px solid rgba(177, 95, 43, 0.12);
}

.availability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.availability-column {
  display: grid;
  gap: 12px;
}

.availability-column h4 {
  margin: 0;
  font-size: 1rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(35, 22, 13, 0.42);
  backdrop-filter: blur(8px);
}

.modal-shell {
  width: min(960px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(250, 244, 233, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 28px 80px rgba(35, 22, 13, 0.28);
}

.modal-shell-wide {
  width: min(1180px, 100%);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 22px 24px 0;
}

.modal-head h3 {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.modal-body {
  padding: 20px 24px 24px;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 18px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

@media (max-width: 1200px) {
  .section-grid,
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .toolbar-row {
    flex-direction: column;
    align-items: stretch;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .group-member-row,
  .charge-item-row,
  .modal-grid,
  .checkout-summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    position: relative;
  }

  .login-panel {
    grid-template-columns: 1fr;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .mobile-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 880;
    border: 0;
    background: rgba(35, 22, 13, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .app-shell.mobile-nav-open .mobile-nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 900;
    width: min(86vw, 320px);
    height: 100vh;
    overflow: auto;
    transform: translateX(-100%);
    transition: transform 0.24s ease;
  }

  .app-shell.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  .page {
    padding: 18px;
  }

  .metric-grid,
  .grid-two,
  .grid-three,
  .occupancy-grid,
  .availability-grid,
  .modal-grid,
  .checkout-summary-row {
    grid-template-columns: 1fr;
  }

  .range-form {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-leading {
    align-items: flex-start;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal-head {
    flex-direction: column;
    align-items: stretch;
  }
}
