/* PLIBEE POS — 밝고 따뜻한 미니멀 (플리비 공통 색) */
:root {
  --cash: #f59a19; /* 그래프: 현금 */
  --transfer: #3d87b5; /* 그래프: 계좌이체 (색약 구분 검사 통과) */
  --card: #d0577e; /* 그래프: 카드 (현금·계좌이체와 함께 검사 통과) */
  --orange: #f59a19;
  --orange-dark: #d9840c;
  --orange-soft: rgba(245, 154, 25, 0.08);
  --orange-soft2: rgba(245, 154, 25, 0.16);
  --ink: #252724;
  --muted: #82847e;
  --line: #e9eae5;
  --paper: #fafbf8;
  --white: #ffffff;
  --danger: #c4473a;
  --radius: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family:
    "Noto Sans KR",
    -apple-system,
    BlinkMacSystemFont,
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button,
input {
  font: inherit;
  color: inherit;
}
h1,
h2,
h3,
p {
  margin: 0;
}
[hidden] {
  display: none !important;
}
.muted {
  color: var(--muted);
}
.accent {
  color: var(--orange-dark);
}

/* ----- 버튼 ----- */
.btn {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  cursor: pointer;
  font-weight: 600;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 14px;
}
.btn-block {
  width: 100%;
}
.btn-primary {
  background: var(--orange);
  color: var(--white);
}
.btn-primary:not(:disabled):hover {
  background: var(--orange-dark);
}
.btn-secondary {
  background: var(--ink);
  color: var(--white);
}
.btn-secondary:not(:disabled):hover {
  background: #3a3d38;
}
.btn-outline {
  border-color: var(--line);
  background: var(--white);
}
.btn-outline:not(:disabled):hover {
  background: var(--orange-soft);
  border-color: var(--orange-soft2);
}
.btn-ghost {
  color: var(--muted);
}
.btn-ghost:hover {
  background: var(--orange-soft);
  color: var(--ink);
}
.btn-danger-text {
  color: var(--danger);
  padding: 0 8px;
}
.btn-danger-text:hover {
  background: rgba(196, 71, 58, 0.08);
}
:focus-visible {
  outline: 3px solid var(--orange-soft2);
  outline-offset: 2px;
}

/* ----- 입력 ----- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.field-label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}
.field input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 16px; /* 16px 미만이면 아이폰에서 확대됨 */
}
.field input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft2);
}
.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 12px;
}
.field-narrow input {
  text-align: center;
}
.form-error {
  color: var(--danger);
  font-size: 14px;
}

/* ----- 브랜드 ----- */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-center {
  justify-content: center;
}
.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--orange);
  color: var(--white);
}
.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.brand-sub {
  font-size: 13px;
  color: var(--muted);
}

/* ----- 로그인 ----- */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  padding: 36px 28px 28px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 28px;
}
.pin-input {
  letter-spacing: 0.6em;
  text-align: center;
  font-size: 22px !important;
}
.login-help {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* ----- POS 레이아웃 ----- */
.pos {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 16px 32px;
}
@media (min-width: 1024px) {
  .pos {
    padding: 28px 28px 40px;
  }
}
.pos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pos-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 22px;
  align-items: start;
}
@media (max-width: 759px) {
  .pos-body {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 760px) and (max-width: 1023px) {
  .pos-body {
    gap: 18px;
  }
}
.panel {
  min-width: 0;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  min-height: 36px;
}
.panel-head h2 {
  font-size: 18px;
  font-weight: 700;
}

/* ----- 시술 목록 ----- */
.cat-title {
  font-size: 14px;
  color: var(--muted);
  margin: 14px 0 8px;
}
.cat-title:first-child {
  margin-top: 0;
}
/* 네모 칸: 어디서나 한 줄에 2개 (휴대폰·PC 같은 모양으로 — 대표 결정) */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.svc {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  transition:
    background 0.15s,
    border-color 0.15s;
}
.svc:hover {
  background: var(--orange-soft);
  border-color: var(--orange-soft2);
}
.svc.in-cart {
  border-color: var(--orange);
  box-shadow: 0 0 0 1px var(--orange) inset;
  background: var(--orange-soft);
}
.svc-main {
  width: 100%;
  min-height: 104px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 10px;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  border-radius: var(--radius);
}
.svc-name {
  padding-right: 22px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.svc-bottom {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.svc-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 18px;
}
.svc-list {
  font-size: 12px;
  color: var(--muted);
}
.svc-price {
  font-size: 17px;
  font-weight: 800;
  color: var(--orange-dark);
}
.svc-rate {
  font-size: 11px;
  font-weight: 700;
  color: var(--orange-dark);
  background: var(--orange-soft2);
  border-radius: 999px;
  padding: 1px 6px;
}
.svc-qty {
  position: absolute;
  left: 8px;
  top: -8px;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--orange);
  color: var(--white);
  font-size: 12px;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
}
.svc-edit {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.svc-edit:hover {
  color: var(--ink);
  background: var(--orange-soft2);
}
.cat-title {
  margin: 16px 0 8px;
}

.empty {
  text-align: center;
  padding: 40px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.empty-title {
  font-weight: 700;
  font-size: 16px;
}
.empty-text {
  color: var(--muted);
  font-size: 14px;
  margin: 8px 0 18px;
}

/* ----- 장바구니 ----- */
.cart {
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 40px;
}
.cart li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
}
.cart-name {
  font-weight: 500;
  overflow-wrap: anywhere;
}
.cart-sub {
  font-size: 12px;
  color: var(--muted);
}
.qty {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.qty button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.qty button:hover {
  background: var(--orange-soft);
}
.qty span {
  min-width: 22px;
  text-align: center;
  font-weight: 600;
}
.cart-empty {
  font-size: 14px;
  padding: 8px 0 4px;
}

.totals {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}
.row-strong span {
  font-size: 17px;
  font-weight: 700;
}
.row-strong strong {
  font-size: 24px;
}

.cash-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.cash-box .field input {
  font-size: 18px;
  text-align: right;
}
.quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 6px;
}
.chip {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
  font-size: 13px;
}
.chip:hover {
  background: var(--orange-soft);
  border-color: var(--orange-soft2);
}
.short {
  color: var(--danger) !important;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0 10px;
}
.actions .btn {
  min-height: 52px;
  font-size: 16px;
}
.note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ----- 팝업 ----- */
.dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  color: var(--ink);
}
.dialog-sm {
  width: min(380px, calc(100vw - 32px));
}
.dialog::backdrop {
  background: rgba(37, 39, 36, 0.35);
}
.dialog h3 {
  font-size: 18px;
  margin-bottom: 18px;
}
.dialog form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.spacer {
  flex: 1;
}
.preview {
  font-size: 14px;
  color: var(--muted);
}
.preview strong {
  color: var(--orange-dark);
  font-size: 16px;
}
.confirm-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.confirm-body .big {
  font-size: 26px;
  font-weight: 800;
  color: var(--orange-dark);
}

/* ----- 알림 ----- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: 15px;
  z-index: 10;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

/* ----- 정산 ----- */
.date-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 20px 0 16px;
}
.round-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: none;
  border: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
.round-btn:not(:disabled):hover {
  background: var(--orange-soft);
  border-color: var(--orange-soft2);
}
.round-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.date-input {
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 16px;
}
.date-input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft2);
}
.date-label {
  font-weight: 700;
  font-size: 17px;
  margin-left: 4px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1023px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 599px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .card-main {
    grid-column: 1 / -1;
  }
}
.card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.card-main {
  background: var(--orange-soft);
  border-color: var(--orange-soft2);
}
.card-label {
  font-size: 14px;
  color: var(--muted);
}
.card-value {
  font-size: 26px;
  font-weight: 800;
  margin: 2px 0;
  overflow-wrap: anywhere;
}
.card-main .card-value {
  color: var(--orange-dark);
}
.card-sub {
  font-size: 13px;
  color: var(--muted);
  white-space: pre-line;
}
.note-left {
  text-align: left;
}

.block {
  margin-top: 28px;
}
.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.block-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
}
.block-head .block-title {
  margin-bottom: 10px;
}
.month-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  white-space: nowrap;
}
.table th,
.table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.table th {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: var(--paper);
}
.table tbody tr:last-child td {
  border-bottom: 0;
}
.table tfoot td {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  font-weight: 700;
  background: var(--paper);
}
.table .num {
  text-align: right;
}
.table .strong {
  font-weight: 700;
}
.table .center {
  text-align: center;
}
.table-click tbody tr {
  cursor: pointer;
}
.table-click tbody tr:hover {
  background: var(--orange-soft);
}
.table-click tbody tr.selected {
  background: var(--orange-soft2);
}

.pay-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.pay-list:empty {
  display: none;
}
.pay-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.pay-row:last-child {
  border-bottom: 0;
}
.pay-time {
  flex: none;
  width: 46px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pay-mid {
  flex: 1;
  min-width: 0;
}
.pay-items {
  font-weight: 500;
  overflow-wrap: anywhere;
}
.pay-sub {
  font-size: 13px;
  color: var(--muted);
}
.pay-right {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pay-amount {
  font-size: 16px;
  min-width: 80px;
  text-align: right;
}
.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
}
.badge-cash {
  background: var(--orange-soft2);
  color: var(--orange-dark);
}
.badge-transfer {
  background: rgba(61, 135, 181, 0.12);
  color: #2f6d93;
}
.empty-line {
  padding: 14px 2px;
  font-size: 14px;
}
@media (max-width: 560px) {
  .pay-row {
    flex-wrap: wrap;
  }
  .pay-right {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ----- 화면 크기별 (PC ≥ 1024 / 태블릿 600~1023 / 휴대폰 < 600) ----- */
.mobile-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--white);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}
.mobile-bar-info {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.mobile-bar-info span {
  font-size: 14px;
  color: var(--muted);
}
.mobile-bar-info strong {
  font-size: 20px;
  color: var(--orange-dark);
}
.mobile-bar .btn {
  min-height: 46px;
  padding: 0 22px;
}
@media (min-width: 760px) {
  .mobile-bar {
    display: none !important;
  }
}
@media (max-width: 759px) {
  body:has(.mobile-bar:not([hidden])) .pos {
    padding-bottom: 96px;
  }
  body:has(.mobile-bar:not([hidden])) .toast {
    bottom: calc(88px + env(safe-area-inset-bottom));
  }
  .pos-body {
    gap: 32px;
  }
  #cart-panel {
    scroll-margin-top: 12px;
  }
}

/* 태블릿·PC: 결제 칸이 화면을 따라오게 */
@media (min-width: 760px) {
  #cart-panel {
    position: sticky;
    top: 16px;
    padding: 16px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--white);
  }
}

/* 휴대폰 */
@media (max-width: 599px) {
  .pos {
    padding-top: 14px;
  }
  .pos-header {
    padding-bottom: 14px;
  }
  .brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }
  .brand-title {
    font-size: 18px;
  }
  .header-right {
    gap: 6px;
  }
  .row-strong strong {
    font-size: 22px;
  }
  .dialog {
    padding: 20px 18px;
  }
  .field-row {
    grid-template-columns: minmax(0, 1fr) 100px;
  }
  .date-bar {
    gap: 6px;
  }
  .date-input {
    flex: 1;
    min-width: 0;
  }
  .date-label {
    width: 100%;
    margin: 4px 0 0;
  }
  .card {
    padding: 14px 16px;
  }
  .card-value {
    font-size: 22px;
  }
  .table th,
  .table td {
    padding: 10px 10px;
    font-size: 14px;
  }
  .col-count {
    display: none;
  }
}
@media (max-width: 380px) {
  .header-right .btn-ghost {
    padding: 0 8px;
  }
}
@media (min-width: 1024px) {
  #cart-panel {
    padding: 18px 20px;
  }
}

/* ----- 금액 표시 ----- */
.money-num {
  letter-spacing: -0.01em;
}
.money-unit {
  font-size: 0.58em;
  font-weight: 600;
  margin-left: 2px;
  opacity: 0.75;
}

/* ----- 월 매출: 금액 타일 ----- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.tile {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  min-width: 0;
}
.tile-main {
  background: var(--orange-soft);
  border-color: var(--orange-soft2);
}
.tile-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}
.tile-value {
  font-size: 26px;
  font-weight: 800;
  margin: 4px 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile-main .tile-value {
  color: var(--orange-dark);
}
.tile-sub {
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 599px) {
  .tiles {
    gap: 10px;
  }
  .tile {
    padding: 14px;
  }
  .tile-value {
    font-size: 21px;
  }
}

/* 범례 색 표시 (글자는 검정 그대로, 옆의 네모가 색을 알려 줌) */
.key {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}
.key-cash {
  background: var(--cash);
}
.key-transfer {
  background: var(--transfer);
}

/* ----- 월 매출: 막대그래프 ----- */
.chart-card {
  position: relative;
  padding: 16px 16px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.chart-title {
  font-weight: 700;
}
.legend {
  display: flex;
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
  color: var(--ink);
}
.legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.chart {
  width: 100%;
}
.chart svg {
  display: block;
  overflow: visible;
}
.chart .grid {
  stroke: var(--line);
  stroke-width: 1;
}
.chart .axis-base {
  stroke: #d6d8d1;
  stroke-width: 1;
}
.chart .tick {
  fill: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.chart .tick-selected {
  fill: var(--ink);
  font-weight: 700;
}
.chart .band-selected {
  fill: var(--orange-soft);
}
.chart .bar-cash {
  fill: var(--cash);
}
.chart .bar-transfer {
  fill: var(--transfer);
}
.chart .hit {
  fill: transparent;
  cursor: pointer;
  outline: none;
}
.chart .hit:focus-visible {
  fill: rgba(37, 39, 36, 0.06);
}
.chart-hint {
  font-size: 12px;
  margin-top: 6px;
}
.chart-tip {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  min-width: 150px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  font-size: 13px;
}
.tip-date {
  font-weight: 700;
  margin-bottom: 6px;
}
.tip-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 1px 0;
}
.tip-name {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.tip-val {
  font-variant-numeric: tabular-nums;
}
.tip-total {
  margin-top: 4px;
  padding-top: 5px;
  border-top: 1px solid var(--line);
  font-weight: 700;
}
.tip-total .tip-name {
  color: var(--ink);
}

/* 표로 보기 */
.table-details {
  margin-top: 12px;
}
.table-details summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 14px;
}
.table-details summary::-webkit-details-marker {
  display: none;
}
.table-details summary::before {
  content: "▸";
  color: var(--muted);
}
.table-details[open] summary::before {
  content: "▾";
}
.table-details[open] summary {
  margin-bottom: 10px;
}

/* ----- 방문 분석 ----- */
.block-desc {
  font-size: 13px;
  margin: -4px 0 12px;
}
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  margin-bottom: 10px;
}
.seg button {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
}
.seg button:hover {
  background: var(--orange-soft);
  color: var(--ink);
}
.seg button[aria-selected="true"] {
  background: var(--orange);
  color: var(--white);
  font-weight: 600;
}
.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.chart-wide {
  grid-column: 1 / -1;
}
@media (max-width: 759px) {
  .chart-grid {
    grid-template-columns: 1fr;
  }
}
.chart .bar-visit {
  fill: var(--cash);
}
.chart .bar-label {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.chart-tip-fixed {
  position: fixed;
}
.range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.range-sep {
  color: var(--muted);
}
.month-select {
  height: 38px;
  padding: 0 30px 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 16px,
    calc(100% - 11px) 16px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.month-select:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft2);
}
@media (max-width: 599px) {
  .block-head:has(.range) {
    flex-wrap: wrap;
  }
  .range {
    width: 100%;
  }
  .month-select {
    flex: 1;
    min-width: 0;
  }
}

/* ----- 현금 정산 (시작 금액·사용한 돈·마감 확인) ----- */
.drawer {
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
}
.drawer-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.drawer-head .block-title {
  margin-bottom: 12px;
}
.drawer-note {
  font-size: 13px;
}
.flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(
      0,
      1fr
    ) auto minmax(0, 1.2fr);
  align-items: stretch;
  gap: 8px;
}
.flow-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  border: 1px solid transparent;
  text-align: left;
}
.flow-edit {
  cursor: pointer;
  border-color: var(--line);
  background: var(--white);
  font: inherit;
  color: inherit;
}
.flow-edit:hover {
  background: var(--orange-soft);
  border-color: var(--orange-soft2);
}
.edit-mark {
  color: var(--muted);
  font-size: 12px;
}
.flow-label {
  font-size: 13px;
  color: var(--muted);
}
.flow-value {
  font-size: 20px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.flow-empty {
  font-size: 15px;
  font-weight: 700;
  color: var(--orange-dark);
}
.flow-result {
  background: var(--orange-soft);
  border-color: var(--orange-soft2);
}
.flow-result .flow-value {
  color: var(--orange-dark);
}
.flow-op {
  align-self: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--muted);
}
@media (max-width: 899px) {
  .flow {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .flow-op {
    display: none;
  }
}

.drawer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
@media (max-width: 759px) {
  .drawer-grid {
    grid-template-columns: 1fr;
  }
}
.drawer-panel {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-width: 0;
}
.panel-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}
.exp-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}
.exp-list:empty {
  display: none;
}
.exp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.exp-info {
  flex: 1;
  min-width: 0;
}
.exp-name {
  font-weight: 500;
  overflow-wrap: anywhere;
}
.exp-sub {
  font-size: 12px;
  color: var(--muted);
}
.exp-amt {
  flex: none;
}
.exp-del {
  flex: none;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 4px;
  border-radius: 8px;
}
.exp-del:hover {
  color: var(--danger);
  background: rgba(196, 71, 58, 0.08);
}
.exp-form,
.count-form {
  display: flex;
  gap: 6px;
}
.exp-form input,
.count-form input {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 16px;
  min-width: 0;
}
.exp-form input:focus,
.count-form input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft2);
}
.exp-form #exp-item {
  flex: 1.4;
}
.exp-form #exp-amount {
  flex: 1;
  text-align: right;
}
.count-form input {
  flex: 1;
  text-align: right;
}
.exp-form .btn,
.count-form .btn {
  min-height: 38px;
  flex: none;
}
.count-result {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}
.count-icon {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  color: var(--white);
}
.count-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.count-warn {
  width: 100%;
  font-size: 12px;
  color: var(--danger);
}
.is-ok {
  background: rgba(131, 160, 120, 0.14);
}
.is-ok .count-icon {
  background: #5f8a52;
}
.is-short {
  background: rgba(196, 71, 58, 0.08);
}
.is-short .count-icon {
  background: var(--danger);
}
.is-over {
  background: var(--orange-soft);
}
.is-over .count-icon {
  background: var(--orange-dark);
}
#opening-suggest {
  align-self: flex-start;
}

/* 추가 할인 */
.field-extra {
  margin: 6px 0 4px;
}
.extra-minus {
  color: var(--danger);
  font-weight: 600;
}

/* 카드 매출 */
.key-card {
  background: var(--card);
}
.chart .bar-card {
  fill: var(--card);
}
.card-edit {
  display: flex;
  flex-direction: column;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.card-edit:hover {
  background: var(--orange-soft);
  border-color: var(--orange-soft2);
}
.card-edit .card-label,
.card-edit .card-value,
.card-edit .card-sub {
  display: block;
}
.dialog-desc {
  font-size: 14px;
  margin: -8px 0 4px;
}
.panel-note {
  font-size: 12px;
  margin-top: 6px;
}
.panel-note a {
  color: var(--orange-dark);
}

/* ----- 재고·지출 ----- */
.tabs {
  display: flex;
  gap: 4px;
  margin: 18px 0 16px;
  border-bottom: 1px solid var(--line);
}
.tabs button {
  height: 44px;
  padding: 0 18px;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.tabs button:hover {
  color: var(--ink);
}
.tabs button[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--orange);
}

.stock-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 759px) {
  .stock-list {
    grid-template-columns: 1fr;
  }
}
.stock-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.stock-row.is-low {
  border-color: rgba(196, 71, 58, 0.35);
}
.stock-info {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  padding: 0;
  font: inherit;
  color: inherit;
}
.stock-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.stock-sub {
  font-size: 12px;
  color: var(--muted);
}
.stock-qty {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 3px;
}
.stock-qty strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.stock-qty span {
  font-size: 13px;
  color: var(--muted);
}
.is-low .stock-qty strong {
  color: var(--danger);
}
.stock-acts {
  flex: none;
  display: flex;
  gap: 6px;
}
.stock-acts .btn {
  min-height: 36px;
  padding: 0 12px;
}
.badge-low {
  background: rgba(196, 71, 58, 0.1);
  color: var(--danger);
}
.badge-in {
  background: rgba(61, 135, 181, 0.12);
  color: #2f6d93;
}
.badge-out {
  background: var(--orange-soft2);
  color: var(--orange-dark);
}
.badge-adjust {
  background: var(--paper);
  color: var(--muted);
  border: 1px solid var(--line);
}

.move-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.move-list:empty {
  display: none;
}
.move-list-plain {
  border: 0;
  max-height: 60vh;
  overflow-y: auto;
}
.move-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.move-row:last-child {
  border-bottom: 0;
}
.move-row .badge {
  flex: none;
  min-width: 52px;
  text-align: center;
}
.move-mid {
  min-width: 0;
}
.move-main {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.move-sub {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.exp-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
}
.exp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.exp-head .card-value {
  color: var(--orange-dark);
}
.exp-date {
  font-size: 14px;
}
.exp-form-big input {
  height: 44px;
}
.exp-form-big .btn {
  min-height: 44px;
}
.exp-card .exp-list {
  margin-top: 12px;
}

.seg-wide {
  display: flex;
  width: 100%;
}
.seg-wide button {
  flex: 1;
  height: 38px;
  font-size: 14px;
}
.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stepper input {
  flex: 1;
  min-width: 0;
  height: 48px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
}
.stepper input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft2);
}
.stepper .round-btn {
  width: 48px;
  height: 48px;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  cursor: pointer;
  margin-bottom: 8px;
}
.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--orange);
}
#m-cash-wrap {
  display: flex;
  flex-direction: column;
}
@media (max-width: 599px) {
  .tabs button {
    flex: 1;
    padding: 0 8px;
  }
  .stock-acts .btn {
    padding: 0 10px;
  }
}

/* 로그인: 한 번호로 여러 가맹점일 때 고르기 */
.store-pick {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.store-pick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.store-pick-btn {
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
}
.store-pick-btn:hover {
  background: var(--orange-soft);
  border-color: var(--orange);
}

/* 비밀번호 바꾸기 */
.pin-notice {
  margin-top: 18px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--orange-soft);
  color: var(--orange-dark);
  font-size: 14px;
  text-align: center;
}
.pin-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

/* 홈 화면에 바로가기 추가 */
.login-body {
  padding-bottom: 116px;
}
.install-app {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 12px 12px;
  border: 1px solid #f3d8b1;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(100, 64, 12, 0.1);
  cursor: pointer;
  font-weight: 700;
  text-align: left;
}
.install-app img {
  border-radius: 11px;
}
.install-app small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 400;
  color: #777a73;
}
.install-app > span:last-child {
  color: var(--orange-dark);
  font-size: 24px;
  margin-left: 4px;
}
.install-app:hover {
  background: #fffaf2;
  border-color: var(--orange);
}
.install-dialog {
  width: min(440px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  padding: 32px 24px 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--ink);
  background: var(--white);
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(37, 39, 36, 0.18);
}
.install-dialog::backdrop {
  background: rgba(37, 39, 36, 0.4);
}
.install-close {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  font-size: 28px;
  cursor: pointer;
}
.install-preview {
  display: block;
  margin: 0 auto 16px;
  border-radius: 18px;
}
.install-dialog h2 {
  font-size: 20px;
  text-align: center;
}
.install-intro {
  margin: 10px 0 24px;
  font-size: 14px;
  text-align: center;
  color: #686c64;
}
.install-dialog section {
  background: var(--paper);
  border-radius: 14px;
  padding: 16px;
  margin-top: 12px;
}
.install-dialog h3 {
  font-size: 15px;
}
.install-dialog ol {
  margin: 10px 0 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.7;
}
.install-dialog li + li {
  margin-top: 8px;
}
.install-note {
  margin: 18px 0;
  font-size: 12px;
  color: #686c64;
  line-height: 1.7;
}
@media (max-width: 400px) {
  .install-app {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
}
