/* ── 기본 리셋 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

:root {
  --bg:          #1a1a1a;
  --surface:     #242424;
  --border:      #3a3a3a;
  --header-bg:   #2d2d2d;
  --header-txt:  #ffffff;
  --total-bg:    #1a3a1a;
  --total-txt:   #90ee90;
  --weekend-bg:  #2e1a1a;
  --weekend-txt: #ff9090;
  --cell-hover:  #2a3a4a;
  --accent:      #4a9eff;
  --danger:      #ff5555;
  --warning:     #ffaa00;
  --muted:       #888;
  --txt:         #e0e0e0;
  --txt-dim:     #aaa;
  --topbar-h:    50px;   /* top-bar 고정 높이 — thead sticky top 기준 */
}

body {
  background: var(--bg);
  color: var(--txt);
  font-family: 'Segoe UI', 'Noto Sans KR', sans-serif;
  font-size: 13px;
  height: 100vh;
  overflow: hidden;       /* 스크롤은 table-wrap이 담당 */
  display: flex;
  flex-direction: column;
}

/* ── 상단 헤더 ── */
.top-bar {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar h1 {
  font-size: 15px;
  font-weight: 700;
  color: var(--header-txt);
  margin-right: auto;
}

.top-bar select,
.top-bar button {
  background: #333;
  border: 1px solid var(--border);
  color: var(--txt);
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 13px;
  cursor: pointer;
}

.top-bar select:focus,
.top-bar button:hover {
  border-color: var(--accent);
  outline: none;
}

.top-bar .label {
  color: var(--txt-dim);
  font-size: 12px;
}

.btn-refresh {
  background: #2a3a2a !important;
  border-color: #4a8a4a !important;
  color: var(--total-txt) !important;
}

/* ── 테이블 래퍼 ── */
.table-wrap {
  overflow: auto;       /* x·y 모두 스크롤 — sticky의 기준점이 됨 */
  max-height: calc(100vh - var(--topbar-h) - 28px);
  padding-bottom: 8px;
}

/* ── 근무표 테이블 ── */
table {
  /* border-collapse: separate 필수 — collapse는 sticky와 충돌 */
  border-collapse: separate;
  border-spacing: 0;
  white-space: nowrap;
  min-width: 100%;
}

/* 모든 셀: 우측 + 하단 테두리만 */
th, td {
  border-right:  1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
  padding: 4px 6px;
  min-width: 40px;
}

/* 첫 번째 열(좌측) + 전체 상단 테두리 보완 */
th:first-child,
td:first-child { border-left: 1px solid var(--border); }

thead th        { border-top: 1px solid var(--border); }

/* ── 헤더행 (상단 sticky) ── */
thead th {
  background: var(--header-bg);
  color: var(--header-txt);
  font-weight: 700;
  font-size: 12px;
  position: sticky;
  top: 0;   /* table-wrap 기준 0 — top-bar와 분리된 scroll context */
  z-index: 10;
}

/* ── 직원명 열 (좌측 sticky) ── */
.name-col {
  min-width: 76px;
  max-width: 100px;
  font-weight: 600;
  position: sticky;
  left: 0;
  z-index: 5;
  background: var(--surface);
}

thead .name-col {
  background: var(--header-bg);
  z-index: 20;  /* 교차점: 최우선 */
}

/* ── 날짜 열 ── */
.day-col {
  min-width: 40px;
  font-size: 11px;
}

.dow {
  display: block;
  font-size: 10px;
  color: var(--txt-dim);
  font-weight: 400;
  line-height: 1.2;
}

/* ── 주말 ── */
.weekend {
  background: var(--weekend-bg);
  color: var(--weekend-txt);
}

thead .weekend {
  background: #3a2020;
  color: var(--weekend-txt);
}

.weekend .dow { color: #cc7070; }

/* ── 합계 열 (우측 sticky) ── */
.total-col {
  background: var(--total-bg);
  color: var(--total-txt);
  font-weight: 700;
  min-width: 54px;
  position: sticky;
  right: 0;
  z-index: 5;
  border-left: 2px solid #2a5a2a; /* 구분선 강조 */
}

thead .total-col {
  background: var(--total-bg);
  z-index: 20;
}

/* ── tbody 기본 셀 배경 ── */
tbody td {
  background: var(--surface);
  height: 30px;
}

/* ── 행 hover (sticky 셀은 filter로 처리) ── */
tbody tr:hover td:not(.name-col):not(.total-col):not(.weekend) {
  background: var(--cell-hover);
}

tbody tr:hover td.weekend {
  background: #3a2828;
}

tbody tr:hover td.name-col,
tbody tr:hover td.total-col {
  filter: brightness(1.15);
}

/* 특수 입력값 */
.note-무단 {
  color: var(--danger);
  font-weight: 700;
  font-size: 11px;
}

.note-퇴사 {
  color: var(--warning);
  font-weight: 700;
  font-size: 11px;
}

/* 빈 상태 */
.empty {
  color: var(--muted);
  padding: 40px !important;
  font-size: 14px;
}

/* 로딩 */
.loading-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--muted);
  font-size: 14px;
  gap: 10px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── 셀 편집 ── */
.cell-input {
  cursor: pointer;
  transition: background 0.1s;
}

.cell-input:hover {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

.cell-editor {
  width: 100%;
  background: #1a2a3a;
  border: 2px solid var(--accent);
  border-radius: 2px;
  color: #fff;
  font-size: 12px;
  text-align: center;
  padding: 1px 2px;
  outline: none;
  box-sizing: border-box;
}

/* 저장 중 */
.saving {
  opacity: 0.5;
}

/* 저장 성공 플래시 */
.flash-ok {
  animation: flashOk 0.5s ease;
}

@keyframes flashOk {
  0%   { background: #1a4a1a; }
  100% { background: inherit; }
}

/* 저장 실패 플래시 */
.flash-error {
  animation: flashErr 0.5s ease;
}

@keyframes flashErr {
  0%   { background: #4a1a1a; }
  100% { background: inherit; }
}

/* 에러 */
.error-wrap {
  padding: 24px;
  background: #2e1010;
  border: 1px solid #aa3333;
  border-radius: 6px;
  margin: 16px;
  color: #ff9090;
}

/* 상태바 */
.status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 6px 20px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 16px;
}

.status-bar .ok   { color: var(--total-txt); }
.status-bar .err  { color: var(--danger); }

/* ══ 직원 관리 버튼 ══════════════════════════════════════ */
.btn-emp {
  background: #2a2a4a !important;
  border-color: #5555aa !important;
  color: #aaaaff !important;
}
.btn-emp:hover { border-color: #8888ff !important; }

/* ══ 모달 ══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 60px;
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 640px;
  max-width: 96vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--header-txt);
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
}
.modal-close:hover { background: #444; color: #fff; }

.modal-body {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── 섹션 타이틀 ── */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 12px;
  color: var(--txt-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── 직원 목록 ── */
.emp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  margin-bottom: 6px;
  background: #1e1e1e;
  gap: 10px;
}

.emp-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.emp-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--txt);
}

.emp-type {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
}
.type-33 { background: #2a3a1a; color: #90cc60; }
.type-4d { background: #1a2a4a; color: #6090cc; }

.emp-wage {
  font-size: 11px;
  color: var(--txt-dim);
}

.emp-meta {
  font-size: 11px;
  color: #666;
}

.emp-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-edit, .btn-del, .btn-add, .btn-cancel, .btn-save {
  border: 1px solid;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.btn-edit   { background: #2a3040; border-color: #445; color: #aac; }
.btn-del    { background: #3a1a1a; border-color: #844; color: #f88; }
.btn-add    { background: #1a3a1a; border-color: #484; color: #8f8; }
.btn-cancel { background: #2a2a2a; border-color: #555; color: #aaa; }
.btn-save   { background: #1a3a6a; border-color: #48a; color: #8cf; width: 100%; padding: 8px; font-size: 13px; }

.btn-edit:hover   { border-color: #88aadd; }
.btn-del:hover    { border-color: #ff6666; }
.btn-add:hover    { border-color: #66ff66; }
.btn-save:hover   { border-color: #66ccff; }

.emp-empty { color: var(--muted); font-size: 13px; padding: 16px 0; text-align: center; }
.error-inline { color: var(--danger); font-size: 12px; padding: 8px; }

/* ── 추가/수정 폼 ── */
.emp-form-wrap {
  border: 1px solid #445;
  border-radius: 6px;
  padding: 16px;
  background: #1a1a2a;
}

.emp-form-wrap.hidden { display: none; }

.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.form-row label {
  width: 110px;
  font-size: 12px;
  color: var(--txt-dim);
  flex-shrink: 0;
}

.form-row label em {
  color: var(--danger);
  font-style: normal;
  margin-left: 2px;
}

.form-row input,
.form-row select {
  flex: 1;
  background: #222;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--txt);
  padding: 6px 8px;
  font-size: 13px;
}

.form-row input:focus,
.form-row select:focus {
  border-color: var(--accent);
  outline: none;
}

.form-row .unit {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

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

/* ══ 급여 계산 버튼 ══════════════════════════════════════ */
.btn-payroll {
  background: #3a2a1a !important;
  border-color: #aa7733 !important;
  color: #ffcc66 !important;
}
.btn-payroll:hover { border-color: #ffaa44 !important; }

/* ══ 급여 계산 모달 ══════════════════════════════════════ */
.modal-wide { width: 900px; max-width: 98vw; }

.pay-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.btn-calc {
  background: #2a4a1a;
  border: 1px solid #4a8a2a;
  color: #aaff66;
  border-radius: 4px;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 700;
}
.btn-calc:hover    { border-color: #88ff44; }
.btn-calc:disabled { opacity: 0.5; cursor: default; }

.btn-save-all {
  background: #1a3a6a;
  border: 1px solid #3a6aaa;
  color: #88ccff;
  border-radius: 4px;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 700;
}
.btn-save-all:hover    { border-color: #66aaff; }
.btn-save-all:disabled { opacity: 0.5; cursor: default; }

.btn-finalize {
  background: #3a1a00; border: 1px solid #aa5500;
  color: #ffaa44; border-radius: 4px;
  padding: 6px 16px; font-size: 13px; cursor: pointer; font-weight: 700;
}
.btn-finalize:hover { border-color: #ff8800; }

.btn-unfinalize {
  background: #2a0000; border: 1px solid #880000;
  color: #ff8888; border-radius: 4px;
  padding: 6px 16px; font-size: 13px; cursor: pointer; font-weight: 700;
}
.btn-unfinalize:hover { border-color: #ff4444; }

.btn-excel {
  background: #003a20; border: 1px solid #007744;
  color: #44ffaa; border-radius: 4px;
  padding: 6px 16px; font-size: 13px; cursor: pointer; font-weight: 700;
}
.btn-excel:hover { border-color: #00ff88; }

.pay-status { font-size: 12px; color: var(--muted); }

/* ── 급여 결과 테이블 ── */
.pay-table {
  width: 100%;
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.pay-table th,
.pay-table td {
  border-right:  1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 7px 10px;
  text-align: center;
  vertical-align: middle;
}

.pay-table th:first-child,
.pay-table td:first-child { border-left: 1px solid var(--border); }
.pay-table thead th       { border-top: 1px solid var(--border); background: var(--header-bg); color: var(--header-txt); font-weight: 700; }

.pay-name  { text-align: left; font-weight: 600; }
.pay-num   { text-align: right; font-family: monospace; font-size: 12px; }
.pay-final { color: var(--total-txt); font-weight: 700; }
.pay-adj   { min-width: 90px; }

.adj-input {
  width: 90px;
  background: #222;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--txt);
  padding: 3px 6px;
  font-size: 12px;
  text-align: right;
}
.adj-input:focus { border-color: var(--accent); outline: none; }

.pay-actions { white-space: nowrap; }

.btn-detail, .btn-save-pay {
  border: 1px solid;
  border-radius: 3px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
  margin: 0 2px;
}
.btn-detail   { background: #222; border-color: #555; color: #aaa; }
.btn-save-pay { background: #1a3a1a; border-color: #4a8a4a; color: #90ee90; }
.btn-detail:hover   { border-color: #888; }
.btn-save-pay:hover { border-color: #88ff88; }

/* 배지 */
.badge-pending { background: #3a2a00; color: #ffaa00; font-size: 10px; padding: 1px 5px; border-radius: 3px; margin-left: 4px; }
.badge-final   { background: #1a3a6a; color: #88aaff; font-size: 10px; padding: 2px 7px; border-radius: 3px; }

/* ── 주간 상세 패널 ── */
.week-detail {
  border: 1px solid #445;
  border-radius: 6px;
  margin-top: 12px;
  background: #0e0e1a;
  overflow-x: auto;
}

.week-detail.hidden { display: none; }

.week-detail-header {
  background: #1a1a3a;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #aaaaff;
  border-bottom: 1px solid #334;
}

.week-table {
  width: 100%;
  min-width: 520px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
}

.week-table th,
.week-table td {
  border-right: 1px solid #334;
  border-bottom: 1px solid #334;
  padding: 5px 10px;
  text-align: center;
}

.week-table th:first-child,
.week-table td:first-child { border-left: 1px solid #334; }
.week-table thead th { background: #1a1a3a; color: #8888cc; border-top: 1px solid #334; }

.week-total-row td { background: #1a2a1a; color: var(--total-txt); font-weight: 700; }

.row-pending td { background: #1a1200; }

.week-tag     { color: var(--txt-dim); font-size: 10px; }
.tag-pending  { color: #ffaa00; font-weight: 700; }

/* 월바뀜 주 행 */
.row-resolve td { background: #001a0a; }
.row-pending td { background: #1a1200; }

/* 차액 조정 금액 */
.pay-adj-amt { color: #66ddaa; font-weight: 700; }

/* 해소 배지 */
.badge-resolved { background: #003a20; color: #44cc88; font-size: 10px; padding: 1px 5px; border-radius: 3px; margin-left: 4px; }

/* ── 하단 대기 표시바 ── */
.pending-bar {
  color: var(--warning);
  font-weight: 600;
  background: #2a1a00;
  padding: 1px 10px;
  border-radius: 3px;
  border: 1px solid #554400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
}
.pending-bar.hidden { display: none; }

/* ── 급여 모달 내 대기 현황 패널 ── */
.pending-summary {
  margin-top: 10px;
  padding: 10px 14px;
  background: #1a1000;
  border: 1px solid #554400;
  border-radius: 5px;
}
.pending-summary.hidden { display: none; }

.pending-summary-title {
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffcc66;
}

.pending-item {
  padding: 2px 0;
  font-size: 12px;
  color: #ffaa44;
}

/* ── 로그인 오버레이 ── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 44px 40px;
  width: 380px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.login-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--header-txt);
  margin-bottom: 6px;
}

.login-sub {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 28px;
}

.login-store-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}

.store-btn {
  padding: 12px 22px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #2a2a2a;
  color: var(--txt);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s;
}
.store-btn:hover  { border-color: var(--accent); }
.store-btn.active { border-color: var(--accent); background: #1a2a3a; color: var(--accent); }
.store-btn-authed { border-color: #2a6a2a !important; color: #88ee88 !important; }

.login-pw-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}
.login-pw-wrap.hidden { display: none; }

.login-store-label {
  font-weight: 700;
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 2px;
}

.login-pw {
  background: #222;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--txt);
  padding: 11px 14px;
  font-size: 15px;
  text-align: center;
  letter-spacing: 0.15em;
}
.login-pw:focus { border-color: var(--accent); outline: none; }

.login-submit {
  background: #1a3a6a;
  border: 1px solid #3a6aaa;
  color: #88ccff;
  border-radius: 6px;
  padding: 11px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.login-submit:hover { border-color: #66aaff; }

.login-err {
  color: var(--danger);
  font-size: 12px;
}
.login-err.hidden { display: none; }

/* ── 매장명 배지 + 로그아웃 ── */
.store-name-badge {
  color: var(--accent) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  background: #1a2a3a !important;
  padding: 3px 10px !important;
  border-radius: 4px !important;
  border: 1px solid #2a4a6a !important;
}

.store-name-btn {
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.store-name-btn:hover {
  background: #1e3450 !important;
  border-color: var(--accent) !important;
}

.btn-logout {
  background: #2a1a1a !important;
  border-color: #664444 !important;
  color: #ff8888 !important;
  font-size: 11px !important;
  margin-left: auto;
}

/* ══ 모바일 반응형 ══════════════════════════════════════ */
@media (max-width: 640px) {
  :root { --topbar-h: auto; }

  body { font-size: 12px; }

  .top-bar {
    flex-wrap: wrap;
    padding: 8px 10px;
    gap: 6px;
    height: auto;
  }

  .top-bar h1 {
    font-size: 13px;
    width: 100%;
    margin-right: 0;
  }

  .top-bar .label { display: none; }

  .top-bar select,
  .top-bar button {
    font-size: 12px;
    padding: 6px 8px;
  }

  .store-name-badge {
    font-size: 11px;
    padding: 2px 7px;
  }

  .btn-logout { margin-left: 0; }

  .status-bar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 5px 10px;
    font-size: 10px;
  }

  .pending-bar { max-width: 100%; font-size: 10px; }

  .modal { width: 100% !important; max-width: 100vw; border-radius: 0; }
  .modal-header { border-radius: 0; }
  .modal-overlay { padding-top: 0; align-items: flex-end; }

  .login-box { width: 92vw; padding: 32px 20px; }
  .store-btn  { padding: 10px 14px; font-size: 13px; }

  .pay-controls { flex-wrap: wrap; gap: 6px; }

  th, td { padding: 3px 4px; font-size: 11px; min-width: 32px; }
  .name-col { min-width: 60px; max-width: 80px; font-size: 11px; }
  .day-col  { min-width: 32px; }
  .dow      { font-size: 9px; }
}

/* ── 기본시급 설정 ── */
.default-wage-section {
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.default-wage-hint {
  font-size: 11px;
  color: var(--muted);
  margin-left: 8px;
}

.default-wage-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 8px;
}

.default-wage-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.default-wage-row label {
  font-size: 12px;
  color: var(--txt-dim);
  white-space: nowrap;
}

.default-wage-row input {
  width: 90px;
  background: #222;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--txt);
  padding: 4px 6px;
  font-size: 12px;
  text-align: right;
}

.default-wage-row input:focus { border-color: var(--accent); outline: none; }

.btn-save-defaults {
  background: #1a2a3a;
  border: 1px solid #2a5a8a;
  color: #88bbff;
  border-radius: 4px;
  padding: 4px 14px;
  font-size: 12px;
  cursor: pointer;
}

.btn-save-defaults:hover { border-color: var(--accent); }

/* ── 지급 내역 버튼 ── */
.btn-history {
  background: #1a2a3a !important;
  border-color: #2a5a8a !important;
  color: #88bbff !important;
}
.btn-history:hover { border-color: var(--accent) !important; }

/* 지급 내역 합계 행 */
.hist-total-row td {
  background: var(--total-bg);
  color: var(--total-txt);
  font-weight: 700;
  border-top: 2px solid var(--border);
}

/* ── 매장 전환 버튼 ── */
.btn-switch {
  background: #2a2a1a !important;
  border-color: #7a7a2a !important;
  color: #dddd88 !important;
}
.btn-switch:hover { border-color: #aaaa44 !important; }

/* ── 테이블 전용 스크롤 wrapper ── */
#pay-result-wrap,
#hist-result-wrap {
  min-width: 0;   /* flex item이 테이블 너비만큼 늘어나는 것 방지 */
}

.tbl-scroll {
  overflow-x: scroll;
  overflow-y: visible;
  scrollbar-width: auto;
  scrollbar-color: #888 #2a2a2a;
}
.tbl-scroll::-webkit-scrollbar         { display: block; height: 14px; }
.tbl-scroll::-webkit-scrollbar-track   { background: #2a2a2a; }
.tbl-scroll::-webkit-scrollbar-thumb   { background: #888; border-radius: 4px; }
.tbl-scroll::-webkit-scrollbar-thumb:hover { background: #bbb; }

/* week-detail 스크롤 (Firefox) */
.week-detail {
  scrollbar-width: thin;
  scrollbar-color: #555 #0e0e1a;
}
.week-detail::-webkit-scrollbar { height: 8px; }
.week-detail::-webkit-scrollbar-track { background: #0e0e1a; }
.week-detail::-webkit-scrollbar-thumb { background: #555; border-radius: 4px; }
.week-detail::-webkit-scrollbar-thumb:hover { background: #888; }
