:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --panel-soft: #eef3f5;
  --ink: #172026;
  --muted: #66737c;
  --line: #dbe3e7;
  --brand: #0f766e;
  --brand-strong: #075e58;
  --accent: #c2410c;
  --cash: #166534;
  --card: #1d4ed8;
  --danger: #b91c1c;
  --warn: #b7791f;
  --shadow: 0 18px 45px rgba(23, 32, 38, .10);
  --touch: 46px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Noto Sans", "Noto Sans KR", Arial, "Helvetica Neue", sans-serif;
  letter-spacing: 0;
}

body.logged-out .app-shell {
  display: none;
}

body:not(.logged-out) .login-screen {
  display: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sprite {
  display: none;
}

.inventory-entry-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.inventory-entry-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.inventory-list {
  display: grid;
  gap: 10px;
}

.inventory-low {
  border-color: rgba(185, 28, 28, .45);
}

@media (max-width: 900px) {
  .inventory-entry-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.login-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .18), transparent 42%),
    linear-gradient(315deg, rgba(194, 65, 12, .14), transparent 38%),
    var(--bg);
}

.login-card {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card label,
.printer-panel label,
.staff-detail label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.login-brand {
  color: var(--ink);
  margin-bottom: 6px;
}

.login-brand .brand-mark {
  background: #101820;
  color: #ffffff;
}

.login-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

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

.quick-login button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  font-weight: 700;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 18px;
  background: #101820;
  color: #f7fafc;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #f7fafc;
  color: #101820;
  font-weight: 800;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-block strong,
.brand-block span,
.operator-panel strong,
.operator-panel span {
  display: block;
}

.brand-block span,
.operator-panel span,
.status-line {
  color: #b9c3ca;
  font-size: 13px;
  margin-top: 4px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: #d8e0e5;
  text-align: left;
}

.nav-btn.active,
.nav-btn:hover {
  background: #26333b;
  color: #ffffff;
}

.operator-panel {
  margin-top: auto;
  padding: 14px;
  border-radius: 8px;
  background: #1a252d;
}

.logout-btn {
  width: 100%;
  min-height: 34px;
  margin-top: 12px;
  border: 1px solid #34434d;
  border-radius: 8px;
  background: transparent;
  color: #d8e0e5;
}

.logout-btn:hover {
  background: #26333b;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-line i {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: #22c55e;
}

.workspace {
  min-width: 0;
  padding: 22px;
}

.topbar,
.section-head,
.order-title,
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 18px;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
}

h3 {
  font-size: 16px;
}

.topbar-actions,
.section-actions,
.payment-methods {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.section-actions {
  justify-content: flex-end;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.language-select {
  min-width: 126px;
  min-height: var(--touch);
}

.icon-btn,
.primary-btn,
.secondary-btn,
.checkout-btn,
.qty-btn,
.payment-chip,
.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch);
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.icon-btn {
  width: var(--touch);
  padding: 0;
}

.primary-btn,
.secondary-btn {
  padding: 0 16px;
  font-weight: 750;
}

.primary-btn,
.checkout-btn {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
  font-weight: 700;
}

.primary-btn:hover,
.checkout-btn:hover {
  background: var(--brand-strong);
}

.secondary-btn:hover,
.icon-btn:hover {
  border-color: #b8c6cd;
  background: var(--panel-soft);
}

.secondary-btn.active,
.icon-btn.active {
  border-color: var(--brand);
  background: #e6f5f1;
  color: var(--brand-strong);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.danger-icon {
  border-color: #fecaca;
  background: #fff1f2;
  color: var(--danger);
}

.danger-icon:hover {
  border-color: #fca5a5;
  background: #fee2e2;
}

.danger-btn {
  padding: 0 14px;
  border-color: #fecaca;
  background: #fff1f2;
  color: var(--danger);
}

.nav-btn[hidden],
.topbar-actions [hidden] {
  display: none;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.sales-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 16px;
  align-items: start;
}

.shift-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.shift-tile {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  text-align: left;
}

button.shift-tile {
  cursor: pointer;
}

button.shift-tile:hover {
  border-color: var(--brand);
}

.shift-tile span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.shift-tile strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.menu-pane,
.order-pane,
.report-panels section,
.member-detail,
.operator-panel,
dialog .dialog-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.menu-pane,
.order-pane {
  min-height: calc(100vh - 104px);
  padding: 14px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(360px, 100%);
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  min-width: 0;
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 10px;
  scrollbar-width: thin;
}

.category-tabs button,
.payment-chip {
  min-width: max-content;
  padding: 0 16px;
}

.category-tabs button {
  min-height: var(--touch);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 750;
}

.category-tabs button.active,
.payment-chip.active {
  border-color: var(--brand);
  background: #e6f5f1;
  color: var(--brand-strong);
  font-weight: 700;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
  gap: 10px;
}

.menu-item {
  display: grid;
  grid-template-rows: 74px auto;
  min-height: 164px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .04);
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.menu-item:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .08);
}

.dish-art {
  display: grid;
  place-items: center;
  position: relative;
  color: rgba(255, 255, 255, .92);
  font-size: 26px;
  font-weight: 800;
  overflow: hidden;
}

.dish-art span {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .34);
  backdrop-filter: blur(2px);
}

.dish-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.menu-item.sold-out {
  opacity: .58;
}

.sold-out-label {
  display: inline-block;
  margin-top: 5px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 900;
}

.dish-art.food {
  background: linear-gradient(135deg, #0f766e, #67a13a);
}

.dish-art.drink {
  background: linear-gradient(135deg, #1d4ed8, #0891b2);
}

.dish-art.dessert {
  background: linear-gradient(135deg, #be123c, #d97706);
}

.dish-art.retail {
  background: linear-gradient(135deg, #334155, #7c3aed);
}

.menu-info {
  display: grid;
  align-content: space-between;
  gap: 6px;
  padding: 10px;
}

.menu-info strong {
  display: block;
  min-height: 42px;
  line-height: 1.25;
  font-size: 15px;
}

.menu-meta,
.order-meta,
.table-meta,
.member-meta {
  color: var(--muted);
  font-size: 13px;
}

.price-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.price-line span {
  font-weight: 800;
  color: var(--brand-strong);
}

.price-line svg {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 8px;
  background: #ecfdf5;
  color: var(--brand-strong);
}

.menu-empty {
  grid-column: 1 / -1;
}

.order-pane {
  position: sticky;
  top: 22px;
  display: grid;
  grid-template-rows: auto auto minmax(160px, 1fr) auto auto auto auto;
  max-height: calc(100vh - 44px);
}

.order-title {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.table-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.table-tools .secondary-btn {
  min-height: 40px;
  padding: 0 8px;
  font-size: 13px;
}

select,
.discount-row input,
.dialog-card input,
.dialog-card select,
.login-card input,
.login-card select,
.printer-panel input,
.printer-panel select,
.note-box input,
.staff-detail input,
.staff-detail select {
  min-height: var(--touch);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
}

.note-box {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.order-list {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 150px;
  max-height: none;
  overflow: auto;
  padding: 10px 0;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 210px;
  border: 1px dashed #c7d2d9;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

.order-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.order-item-thumb {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--brand-strong);
  font-weight: 800;
}

.order-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.qty-control {
  display: grid;
  grid-template-columns: 38px 32px 38px;
  align-items: center;
  text-align: center;
  font-weight: 800;
}

.qty-btn {
  min-height: 38px;
  width: 38px;
  padding: 0;
  font-size: 18px;
  font-weight: 900;
  border-color: #d4e0e5;
  background: #f8fafc;
}

.remove-btn {
  border: 0;
  background: transparent;
  color: var(--danger);
  min-height: 34px;
  padding: 4px 0;
  font-weight: 750;
  text-align: left;
}

.discount-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.discount-row label,
.dialog-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.totals-box {
  display: grid;
  gap: 7px;
  padding: 12px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.totals-box div,
.change-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.totals-box span,
.change-row span {
  color: var(--muted);
}

.grand-total {
  padding-top: 8px;
  border-top: 1px solid #cbd8de;
  font-size: 19px;
}

.payment-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.checkout-btn {
  width: 100%;
  min-height: 54px;
  border: 0;
  font-size: 16px;
}

.table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.table-mode-hint {
  min-height: 0;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.table-mode-hint.active {
  min-height: 36px;
  padding: 9px 12px;
  border: 1px solid #b7d8d2;
  border-radius: 8px;
  background: #f0fdfa;
  color: var(--brand-strong);
}

.table-grid.floor-plan {
  position: relative;
  display: block;
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(#eef3f6 1px, transparent 1px),
    linear-gradient(90deg, #eef3f6 1px, transparent 1px),
    #fbfcfd;
  background-size: 48px 48px;
  overflow: hidden;
}

.table-grid.floor-plan .table-card {
  position: absolute;
  width: clamp(132px, 18vw, 180px);
  min-height: 118px;
  cursor: pointer;
  touch-action: none;
}

.table-grid.layout-editing .table-card {
  cursor: grab;
  box-shadow: var(--shadow);
}

.table-grid.layout-editing .table-card:active {
  cursor: grabbing;
}

.table-grid.table-action-mode .table-card {
  outline: 2px solid transparent;
}

.table-card.action-source {
  outline: 3px solid var(--brand) !important;
  outline-offset: 2px;
}

.table-card,
.metric,
.kitchen-ticket {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.table-card {
  min-height: 126px;
  padding: 13px;
  text-align: left;
}

.table-card.busy {
  border-color: #f59e0b;
  background: #fffbeb;
}

.table-card.ready {
  border-color: #22c55e;
  background: #f0fdf4;
}

.table-card h3 {
  margin-bottom: 8px;
}

.table-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.table-card.busy .table-badge {
  background: #fde68a;
  color: #92400e;
}

.table-card.ready .table-badge {
  background: #bbf7d0;
  color: #166534;
}

.kitchen-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.kitchen-ticket {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.ticket-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.ticket-head span {
  color: var(--muted);
  font-size: 13px;
}

.ticket-items {
  display: grid;
  gap: 6px;
  padding-left: 18px;
}

.ticket-note {
  padding: 10px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 14px;
  font-weight: 700;
}

.ticket-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: .52;
}

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

.metric {
  padding: 16px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

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

.report-panels {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 12px;
  margin-top: 12px;
}

.report-panels section {
  padding: 16px;
}

.invoice-template-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr);
  gap: 12px;
  margin-top: 16px;
}

.menu-admin-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}

.menu-admin-list,
.menu-admin-summary,
.print-area-manager,
.menu-item-dialog-card,
.menu-import-dialog-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.menu-admin-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.print-area-manager {
  grid-template-columns: minmax(220px, .55fr) minmax(260px, .65fr) minmax(0, 1fr);
  align-items: center;
}

.print-area-manager h3 {
  margin-top: 4px;
  font-size: 18px;
}

.print-area-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.print-area-create input {
  min-height: var(--touch);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}

.print-area-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.print-area-chip {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 8px;
  min-height: 50px;
  min-width: 170px;
  padding: 7px 7px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.print-area-chip strong,
.print-area-chip small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.print-area-chip small {
  color: var(--muted);
  font-size: 12px;
}

.print-area-chip .icon-btn {
  grid-row: 1 / span 2;
  grid-column: 2;
  width: 36px;
  min-height: 36px;
}

.menu-admin-summary article {
  min-height: 72px;
  padding: 12px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.menu-admin-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.menu-admin-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.menu-admin-list {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  max-height: calc(100vh - 260px);
  overflow: auto;
}

.menu-admin-empty {
  grid-column: 1 / -1;
  min-height: 180px;
}

.menu-admin-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 74px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
}

.menu-admin-card.active {
  border-color: var(--brand);
  box-shadow: inset 4px 0 0 var(--brand);
}

.menu-admin-card.sold-out {
  opacity: .62;
}

.menu-admin-card small,
.menu-admin-card em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.menu-admin-card em {
  color: var(--danger);
  font-style: normal;
  font-weight: 800;
}

.menu-admin-thumb {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background-color: var(--brand);
  background-position: center;
  background-size: cover;
  color: #ffffff;
  font-weight: 900;
}

.menu-dialog-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
}

.menu-image-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px dashed #b7c7d0;
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--brand-strong);
  font-size: 42px;
  font-weight: 900;
  overflow: hidden;
}

.menu-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-dialog-fields {
  display: grid;
  gap: 10px;
}

.menu-item-dialog-card {
  width: 100%;
}

#menu-item-dialog {
  width: min(760px, calc(100vw - 24px));
}

#menu-import-dialog {
  width: min(680px, calc(100vw - 24px));
}

.menu-import-dialog-card textarea {
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
  resize: vertical;
}

.menu-item-dialog-card label,
.menu-import-dialog-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.menu-item-dialog-card input,
.menu-item-dialog-card select,
.menu-import-dialog-card input {
  min-height: var(--touch);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}

.invoice-template-form,
.invoice-preview-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.invoice-template-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.invoice-template-form input {
  min-height: var(--touch);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}

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

.invoice-preview {
  width: min(100%, 340px);
  min-height: 560px;
  margin: 0 auto;
  padding: 18px 14px;
  overflow: auto;
  border: 1px solid #d7dde2;
  border-radius: 4px;
  background: #ffffff;
  color: #000000;
  font-family: "Noto Sans Mono", "Noto Sans KR", "Segoe UI Mono", "Malgun Gothic", Consolas, monospace;
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.invoice-preview > span {
  display: block;
}

.invoice-preview .receipt-heading,
.invoice-preview .receipt-footer {
  text-align: center;
  overflow-wrap: anywhere;
}

.invoice-preview .receipt-items {
  text-align: left;
  font-family: Consolas, "Courier New", monospace;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-items: end;
  gap: 8px;
  height: 260px;
  margin-top: 18px;
  border-bottom: 1px solid var(--line);
}

.bar {
  display: grid;
  align-items: end;
  gap: 8px;
  height: 100%;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.bar i {
  display: block;
  width: 100%;
  min-height: 6px;
  border-radius: 6px 6px 0 0;
  background: var(--brand);
}

.best-sellers {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.best-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.member-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.staff-layout {
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.staff-page-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: calc(100vh - 110px);
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.staff-subnav {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: #fbfcfd;
}

.staff-subnav button {
  min-height: 46px;
  border: 0;
  border-left: 4px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #3f3f46;
  font-size: 16px;
  font-weight: 750;
  text-align: left;
}

.staff-subnav button.active {
  border-left-color: var(--brand);
  color: var(--ink);
}

.staff-content-panel {
  min-width: 0;
  padding: 18px 20px;
}

.staff-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(240px, .9fr) minmax(190px, .72fr) auto auto auto;
  align-items: center;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.staff-toolbar h2 {
  font-size: 24px;
}

.staff-search-box {
  width: 100%;
}

#staff-role-filter {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: #2563eb;
  font-weight: 750;
}

.staff-table-wrap {
  overflow: auto;
}

.staff-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  font-size: 15px;
}

.role-table {
  min-width: 1080px;
}

.staff-table th,
.staff-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.role-table td:nth-child(4) {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 520px;
}

.staff-table th {
  background: #f1f3f5;
  color: #3f3f46;
  font-size: 15px;
  font-weight: 850;
}

.staff-table tbody tr {
  cursor: pointer;
}

.staff-table tbody tr:hover,
.staff-table tbody tr.active {
  background: #f8fafc;
}

.staff-name-cell {
  display: inline-grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.staff-edit-btn {
  min-height: 36px;
  padding: 0 12px;
}

.staff-dialog-card {
  gap: 14px;
}

.printer-layout {
  display: block;
  margin-top: 16px;
}

.member-card,
.staff-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .035);
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.member-card.active,
.staff-card.active {
  border-color: var(--brand);
  box-shadow: inset 4px 0 0 var(--brand);
}

.member-card:hover,
.staff-card:hover {
  border-color: #9db2bc;
  transform: translateY(-1px);
}

.member-detail,
.staff-detail,
.printer-panel {
  min-height: 360px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.member-list,
.staff-list {
  display: grid;
  gap: 10px;
  align-content: start;
  max-height: calc(100vh - 164px);
  overflow: auto;
  padding: 2px;
}

.person-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #e6f5f1;
  color: var(--brand-strong);
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
}

.person-avatar.large {
  width: 64px;
  height: 64px;
  font-size: 28px;
}

.person-main {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.person-main strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-main small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  max-width: 120px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.status-badge.success {
  background: #dcfce7;
  color: #166534;
}

.status-badge.muted {
  background: #f1f5f9;
  color: var(--muted);
}

.detail-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.detail-hero h2 {
  margin-top: 8px;
  font-size: 24px;
}

.detail-actions {
  margin-top: 14px;
}

.detail-actions .primary-btn {
  width: 100%;
}

.detail-subtitle {
  margin-top: 16px;
  font-size: 15px;
}

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

.staff-form .check-row,
.staff-form .primary-btn {
  grid-column: 1 / -1;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.permission-chip {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 9px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.permission-toggle {
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.permission-toggle input {
  width: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--brand);
  flex: 0 0 16px;
}

.permission-toggle:has(input:disabled) {
  cursor: default;
}

.permission-help {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.permission-chip.on {
  background: #dcfce7;
  color: #166534;
}

.permission-chip.compact {
  display: inline-flex;
  min-height: 28px;
  font-size: 11px;
}

.printer-panel {
  display: grid;
  align-content: start;
  gap: 10px;
}

.printer-list-panel {
  min-height: auto;
}

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

.station-printer-row {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.station-printer-row header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.station-printer-fields {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 8px;
}

.android-bridge-panel {
  border-color: #b7d8d2;
  background: #f0fdfa;
}

.printer-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

#view-printers.android-mode .network-box,
#view-printers.android-mode #scan-lan-printers-btn {
  display: none;
}

.printer-note {
  background: #fbfcfd;
}

.check-row {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: var(--ink) !important;
}

.check-row input {
  width: 18px;
  height: 18px;
  min-height: 0;
}

.printer-status-list {
  display: grid;
  gap: 10px;
}

.printer-compact-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.printer-compact-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.printer-compact-card strong,
.printer-compact-card p,
.printer-compact-card small {
  display: block;
}

.printer-compact-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.printer-compact-card small {
  margin-top: 4px;
  color: var(--muted);
}

.printer-card-actions {
  display: grid;
  gap: 8px;
}

.printer-dialog-card {
  width: 100%;
}

#printer-dialog {
  width: min(560px, calc(100vw - 24px));
}

.printer-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.printer-area-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.printer-area-create input {
  min-height: var(--touch);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}

.printer-dialog-card label,
.printer-dialog-card input,
.printer-dialog-card select,
.printer-dialog-card button {
  min-width: 0;
}

.found-printer-list {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.found-printer-list .printer-found {
  min-height: var(--touch);
  text-align: left;
  justify-content: flex-start;
  padding: 0 12px;
}

.printer-help {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.network-box {
  display: grid;
  gap: 10px;
}

.network-links {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.network-links a {
  color: var(--brand-strong);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.printer-found {
  min-height: 34px;
  border: 1px solid #b7d8d2;
  border-radius: 8px;
  background: #e6f5f1;
  color: var(--brand-strong);
  font-weight: 800;
}

.printer-status-list div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.printer-status-list strong,
.printer-status-list span {
  display: block;
}

.printer-status-list span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.member-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.member-stats div {
  padding: 12px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.member-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

dialog {
  width: min(460px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  border: 0;
  padding: 0;
  background: transparent;
  overflow: visible;
}

dialog::backdrop {
  background: rgba(12, 18, 24, .48);
}

.dialog-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  width: 100%;
  max-height: calc(100vh - 24px);
  overflow: auto;
}

.dialog-card menu {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.split-items {
  display: grid;
  gap: 8px;
  max-height: 36vh;
  overflow: auto;
}

#shift-dialog {
  width: min(760px, calc(100vw - 24px));
}

.shift-dialog-card label,
.cash-movement-form input,
.cash-movement-form select {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.shift-dialog-card input,
.cash-movement-form input,
.cash-movement-form select {
  min-height: var(--touch);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
}

.shift-empty-panel,
.shift-meta-panel,
.shift-total-grid article,
.movement-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.shift-empty-panel {
  display: grid;
  gap: 6px;
  padding: 14px;
  background: #f8fafc;
}

.shift-empty-panel p {
  color: var(--muted);
}

.shift-meta-panel,
.shift-total-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.shift-meta-panel div,
.shift-total-grid article {
  padding: 12px;
}

.shift-meta-panel span,
.shift-total-grid span,
.movement-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.shift-meta-panel strong,
.shift-total-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.shift-total-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cash-movement-form {
  display: grid;
  grid-template-columns: .8fr 1fr minmax(0, 1.3fr) auto;
  gap: 8px;
}

.movement-list {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
}

.movement-list article {
  padding: 10px;
}

.movement-list .empty-state.compact {
  min-height: 72px;
}

.close-shift-btn {
  min-height: var(--touch);
  justify-content: center;
}

.split-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.split-row strong {
  display: block;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #101820;
  color: #ffffff;
  box-shadow: var(--shadow);
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .brand-block div:not(.brand-mark),
  .nav-btn {
    font-size: 0;
  }

  .nav-btn {
    justify-content: center;
  }

  .operator-panel {
    display: none;
  }

  .member-list,
  .staff-list {
    max-height: 320px;
  }

  .staff-page-shell {
    grid-template-columns: 1fr;
  }

  .staff-subnav {
    display: flex;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .staff-subnav button {
    min-width: max-content;
    border-left: 0;
    border-bottom: 3px solid transparent;
  }

  .staff-subnav button.active {
    border-bottom-color: var(--brand);
  }

  .staff-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .print-area-manager {
    grid-template-columns: 1fr;
  }

  .shift-meta-panel,
  .shift-total-grid,
  .cash-movement-form {
    grid-template-columns: 1fr;
  }

  .staff-toolbar h2 {
    grid-column: 1 / -1;
  }

  .sales-grid,
  .shift-strip,
  .report-panels,
  .invoice-template-layout,
  .menu-admin-layout,
  .member-layout,
  .staff-layout,
  .printer-layout {
    grid-template-columns: 1fr;
  }

  .order-pane {
    position: static;
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 10px;
  }

  .brand-block,
  .operator-panel {
    display: none;
  }

  .nav-list {
    grid-template-columns: repeat(7, 1fr);
  }

  .workspace {
    padding: 14px;
  }

  .topbar,
  .section-head,
  .order-title {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topbar-actions > * {
    width: 100%;
  }

  .section-actions,
  .table-tools,
  .payment-methods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-actions .secondary-btn,
  .table-tools .secondary-btn,
  .payment-chip {
    width: 100%;
  }

  .search-box {
    width: 100%;
  }

  .menu-pane,
  .order-pane {
    min-height: auto;
    padding: 12px;
  }

  .menu-grid,
  .shift-strip,
  .table-grid,
  .kitchen-board,
  .report-grid,
  .member-stats,
  .permission-grid {
    grid-template-columns: 1fr;
  }

  .discount-row {
    grid-template-columns: 1fr;
  }

  .template-toggles {
    grid-template-columns: 1fr;
  }

  .station-printer-fields {
    grid-template-columns: 1fr;
  }

  .staff-toolbar {
    grid-template-columns: 1fr;
  }

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

  .printer-dialog-actions {
    grid-template-columns: 1fr;
  }

  .printer-area-create {
    grid-template-columns: 1fr;
  }

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

  .menu-dialog-grid {
    grid-template-columns: 1fr;
  }

  .menu-image-preview {
    max-height: 220px;
  }

  .table-grid.floor-plan {
    min-height: 560px;
  }

  .table-grid.floor-plan .table-card {
    width: 138px;
  }
}
#inventory-voucher-dialog { position: fixed; inset: 0; margin: auto; width: min(540px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 18px; overflow-y: auto; box-shadow: 0 24px 80px rgba(0, 0, 0, .25); }
#inventory-voucher-dialog::backdrop { background: rgba(10, 30, 28, .55); backdrop-filter: blur(3px); }
#inventory-voucher-dialog .dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
#inventory-voucher-dialog .dialog-head h2 { margin: 0; }
#inventory-voucher-form { display: grid; gap: 16px; }
#inventory-voucher-form label { display: grid; gap: 8px; }
#inventory-voucher-note { width: 100%; box-sizing: border-box; padding: 12px; border: 1px solid #cbdedd; border-radius: 10px; font: inherit; resize: vertical; }
#inventory-voucher-error { color: #b42318; margin: 0; }
.inventory-voucher-entry { padding: 16px; border: 1px solid #cbdedd; border-radius: 12px; overflow-wrap: anywhere; }
.inventory-voucher-entry > span { display: block; margin-top: 6px; color: #587579; font-size: 13px; }
.inventory-voucher-entry p { margin: 8px 0 0; white-space: pre-wrap; }
