/* HQ commerce uses the existing brand tokens and keeps tables scrollable. */
.commerce-page { min-width: 0; }
.commerce-page .topbar { display: flex; position: static; margin: 0 0 16px; border-radius: 8px; flex-wrap: wrap; gap: 16px; }
.commerce-page .topbar::before { display: none; }
.commerce-page .top-actions { display: flex; flex-wrap: wrap; }
.commerce-page button, .commerce-modal button { border-radius: 6px; white-space: normal; }
.commerce-page button:disabled, .commerce-modal button:disabled { opacity: .5; cursor: not-allowed; }
.commerce-tabs { overflow-x: auto; flex-wrap: nowrap; }
.commerce-tabs .tab-button { flex: 0 0 auto; white-space: nowrap; }
.commerce-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; padding: 20px 0; }
.commerce-toolbar label, .commerce-store-filter { display: grid; gap: 7px; color: var(--text-secondary); font-size: 13px; }
.commerce-toolbar label { min-width: 150px; }
.commerce-toolbar .count-label { margin-left: auto; align-self: center; }
.commerce-toolbar input, .commerce-toolbar select,
.commerce-modal input:not([type="checkbox"]), .commerce-modal select, .commerce-modal textarea {
  width: 100%; min-width: 0; min-height: 40px; padding: 9px 11px;
  border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--text-primary);
}
.commerce-toolbar input:focus, .commerce-toolbar select:focus,
.commerce-modal input:focus, .commerce-modal select:focus, .commerce-modal textarea:focus { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.commerce-page button:focus-visible, .commerce-modal button:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.commerce-toolbar .line-button { min-height: 40px; }
.commerce-store-filter .line-button { max-width: 300px; overflow-wrap: anywhere; text-align: left; }
.commerce-notice { margin: 0 0 16px; padding: 12px 14px; border-left: 3px solid var(--brand-primary); background: var(--surface-soft); color: var(--text-secondary); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.commerce-error, .commerce-modal-error:not(:empty) { margin: 12px 0; padding: 12px; background: #fff1f2; border: 1px solid #fecdd3; border-radius: 6px; color: #9f1239; line-height: 1.6; overflow-wrap: anywhere; }
.commerce-error .line-button { margin-left: 10px; }
.commerce-table-wrap { width: 100%; overflow-x: auto; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.commerce-page .commerce-table { display: table; }
.commerce-page .commerce-table thead { display: table-header-group; }
.commerce-page .commerce-table tbody { display: table-row-group; }
.commerce-page .commerce-table tr { display: table-row; padding: 0; border: 0; border-radius: 0; }
.commerce-page .commerce-table th, .commerce-page .commerce-table td { display: table-cell; width: auto; }
.commerce-page .commerce-table td::before { display: none; }
.commerce-page .commerce-table { width: 100%; min-width: 860px; border-collapse: collapse; table-layout: auto; }
.commerce-page .commerce-table th { background: var(--surface-tertiary); color: var(--text-secondary); font-size: 13px; text-align: left; }
.commerce-page .commerce-table th, .commerce-page .commerce-table td { padding: 14px 12px; border-bottom: 1px solid var(--border); line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.commerce-page .commerce-table td { font-size: 14px; max-width: 260px; }
.commerce-page .commerce-table td small { display: block; margin-top: 5px; color: var(--text-secondary); font-size: 12px; }
.commerce-page .commerce-table td .commerce-overdue { color: #b91c1c; font-weight: 700; }
.commerce-page .commerce-table td.commerce-empty { height: 160px; text-align: center; color: var(--text-secondary); }
.commerce-status { display: inline-block; padding: 4px 8px; border-radius: 4px; font-size: 12px; line-height: 1.5; font-weight: 600; overflow-wrap: anywhere; }
.commerce-status.waiting { color: #92400e; background: #fff4d6; }
.commerce-status.complete { color: #166534; background: #eaf8ef; }
.commerce-status.neutral { color: var(--text-secondary); background: var(--surface-tertiary); }
.commerce-pagination { display: flex; align-items: center; justify-content: end; gap: 14px; padding: 20px 0; font-size: 13px; }
.commerce-pagination .line-button { width: 40px; height: 40px; padding: 0; font-size: 22px; }
.commerce-backdrop { position: fixed; inset: 0; z-index: 150; background: rgb(24 32 51 / 40%); display: flex; align-items: center; justify-content: center; padding: 24px; }
body.commerce-modal-open { overflow: hidden; }
.commerce-modal { width: min(680px, 100%); max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border-radius: 8px; box-shadow: 0 12px 40px rgb(24 32 51 / 18%); color: var(--text-primary); }
.commerce-modal > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.commerce-modal h2 { margin: 0; font-size: 20px; line-height: 1.4; overflow-wrap: anywhere; }
.commerce-modal h3 { margin: 24px 0 12px; font-size: 15px; }
.commerce-modal > header button { width: 36px; height: 36px; min-width: 36px; padding: 0; font-size: 24px; }
.commerce-modal form { padding: 20px 24px 24px; }
.commerce-modal fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
.commerce-modal form > fieldset { display: grid; gap: 16px; }
.commerce-modal label { display: grid; min-width: 0; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.commerce-modal textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.commerce-modal input[readonly] { background: var(--surface-tertiary); }
.commerce-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.commerce-modal label.commerce-checkbox { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.commerce-checkbox input { width: 18px; height: 18px; accent-color: var(--brand-primary); }
.commerce-modal footer { display: flex; align-items: center; justify-content: end; flex-wrap: wrap; gap: 10px; border-top: 1px solid var(--border); padding-top: 18px; margin-top: 20px; }
.commerce-modal footer > span { margin-right: auto; font-size: 13px; }
.commerce-detail { display: grid; grid-template-columns: 120px minmax(0, 1fr); margin: 0; line-height: 1.6; font-size: 14px; }
.commerce-detail dt, .commerce-detail dd { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.commerce-detail dt { padding-right: 12px; color: var(--text-secondary); }
.commerce-history { margin: 0; padding: 0; list-style: none; }
.commerce-history li { padding: 12px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.commerce-history p { margin: 6px 0; white-space: pre-wrap; line-height: 1.6; }
.commerce-history small { color: var(--text-secondary); }
.commerce-store-search { display: flex; gap: 12px; align-items: end; }
.commerce-store-search label { flex: 1; }
.commerce-store-search button { flex-shrink: 0; min-height: 40px; }
.commerce-store-results { display: grid; gap: 0; }
.commerce-store-option { width: 100%; padding: 14px 10px; display: grid; gap: 6px; text-align: left; background: var(--surface); border: 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.commerce-store-option:hover { background: var(--surface-soft); }
.commerce-store-option span { color: var(--text-secondary); font-size: 12px; }
@media (max-width: 700px) {
  .commerce-page .topbar h1 { font-size: 22px; }
  .commerce-page .topbar { padding: 16px; }
  .commerce-page .topbar > div { width: 100%; }
  .commerce-page .topbar h1 { text-align: left; }
  .commerce-toolbar label { min-width: 0; flex: 1 1 140px; }
  .commerce-toolbar .count-label { flex-basis: 100%; }
  .commerce-backdrop { padding: 10px; }
  .commerce-modal { max-height: calc(100dvh - 20px); }
  .commerce-modal > header { padding: 16px; }
  .commerce-modal form { padding: 16px; }
  .commerce-form-grid { grid-template-columns: 1fr; }
  .commerce-detail { grid-template-columns: 96px minmax(0, 1fr); }
}

@font-face {
  font-family: "Pretendard";
  src: local("Pretendard Variable"), local("Pretendard");
  font-display: swap;
}

:root {
  --brand-primary: #5746e9;
  --brand-hover: #4f40d4;
  --surface: #ffffff;
  --surface-soft: #f8f8fe;
  --surface-tertiary: #f6f6f7;
  --border: #eceef2;
  --border-strong: #dcdee0;
  --text-primary: #182033;
  --text-secondary: #565c6a;
  --text-tertiary: #979ba3;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #16a34a;
  --sidebar-width: 260px;
  --figma-surface-primary: #ffffff;
  --figma-surface-secondary: #fdfdfd;
  --figma-surface-tertiary: #f6f6f7;
  --figma-surface-disabled: #f1f2f3;
  --figma-surface-brand-strong: #eeedfd;
  --figma-border-primary: #dcdee0;
  --figma-border-secondary: #f1f2f3;
  --figma-border-focus: #5746e9;
  --figma-text-primary: #182033;
  --figma-text-secondary: #565c6a;
  --figma-text-tertiary: #979ba3;
  --cursor-default: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Cdefs%3E%3Cfilter id='g' x='-70%25' y='-70%25' width='240%25' height='240%25'%3E%3CfeDropShadow dx='0' dy='0' stdDeviation='3.2' flood-color='%235746e9' flood-opacity='.58'/%3E%3CfeDropShadow dx='0' dy='0' stdDeviation='6' flood-color='%235746e9' flood-opacity='.22'/%3E%3C/filter%3E%3C/defs%3E%3Cpath filter='url(%23g)' d='M7 5.8 26.2 14.1c1.7.7 1.6 3.1-.2 3.6l-7.4 1.9-3.6 6.6c-.9 1.6-3.2 1.1-3.4-.7L7 5.8Z' fill='%235746e9' stroke='white' stroke-width='3' stroke-linejoin='round'/%3E%3Cpath d='M7 5.8 26.2 14.1c1.7.7 1.6 3.1-.2 3.6l-7.4 1.9-3.6 6.6c-.9 1.6-3.2 1.1-3.4-.7L7 5.8Z' fill='none' stroke='%23111827' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") 7 6, auto;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-primary);
  background: var(--surface);
  letter-spacing: 0;
}

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

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  background: var(--surface);
  cursor: var(--cursor-default);
}

.admin-shell a,
.admin-shell button,
.admin-shell [role="button"],
.admin-shell select,
.admin-shell input[type="checkbox"] {
  cursor: pointer;
}

.admin-shell input,
.admin-shell textarea,
.admin-shell input[type="search"] {
  cursor: text;
}

.sidebar {
  border-right: 1px solid var(--border);
  background: #fff;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.brand-block {
  display: flex;
  align-items: center;
  padding: 0 8px 24px;
  border-bottom: 1px solid var(--border);
}

.brand-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.brand-logo {
  width: 94px;
  height: auto;
  display: block;
}

.brand-character {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  object-fit: contain;
  filter: drop-shadow(0 7px 12px rgba(87, 70, 233, 0.16));
}

.brand-subtitle {
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 750;
  margin-top: 0;
  white-space: nowrap;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 18px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-session {
  margin-top: 16px;
  padding: 14px 8px 0;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-session span {
  display: block;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.sidebar-session strong {
  display: block;
  margin-top: 3px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.logout-button {
  min-width: 74px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.logout-button:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--surface-soft);
}

.nav-item {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  text-align: left;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 750;
}

.nav-item:hover,
.nav-item.active {
  background: var(--surface-soft);
  color: var(--brand-primary);
}

.nav-label {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nav-label > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #f1efff;
  color: var(--brand-primary);
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(87, 70, 233, 0.08);
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
  background: var(--brand-primary);
  color: #fff;
}

.nav-item em {
  min-width: 24px;
  height: 20px;
  padding: 0 7px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: var(--brand-primary);
  color: #fff;
  font-style: normal;
  font-size: 11px;
}

.main {
  min-width: 0;
  padding: 24px 32px 48px;
  background: #fff;
}

.topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbff 100%);
}

.breadcrumb {
  margin: 0 0 6px;
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 500;
}

.page-desc {
  margin: 7px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

h1, h2 { margin: 0; }
h1 { font-size: 26px; line-height: 1.25; font-weight: 800; }
h2 { font-size: 17px; line-height: 1.35; font-weight: 800; }

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.primary-button,
.ghost-button,
.line-button {
  height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
}

.primary-button { background: var(--brand-primary); color: #fff; }
.primary-button:hover { background: var(--brand-hover); }
.ghost-button { background: #fff; border-color: var(--border); color: var(--text-primary); }
.ghost-button.selected { background: var(--surface-soft); color: var(--brand-primary); border-color: #e2defd; }
.line-button { background: #fff; border-color: var(--border-strong); color: var(--text-primary); }
.text-button { border: 0; background: transparent; color: var(--brand-primary); font-size: 13px; font-weight: 700; }

.icon-button {
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

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

.summary-card {
  min-height: 132px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}

.summary-card span,
.summary-card small {
  display: block;
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 600;
}

.summary-card strong {
  display: block;
  margin: 16px 0 8px;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 800;
}

.summary-card.warning strong { color: var(--warning); }
.summary-card.danger strong { color: var(--danger); }

.operation-guide {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 14px;
  margin-bottom: 18px;
}

.use-flow,
.focus-board {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title span {
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: 800;
}

.section-title strong {
  color: var(--text-primary);
  font-size: 15px;
}

.use-flow ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.use-flow li {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.use-flow li b {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  font-size: 12px;
}

.use-flow li span {
  min-width: 0;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.focus-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.focus-item {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.focus-item span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.focus-item b {
  color: var(--text-primary);
  font-size: 14px;
}

.focus-item.success { border-color: #bbf7d0; background: #f0fdf4; }
.focus-item.success b { color: var(--success); }
.focus-item.warning { border-color: #fed7aa; background: #fff7ed; }
.focus-item.warning b { color: #b45309; }
.focus-item.danger { border-color: #fecaca; background: #fef2f2; }
.focus-item.danger b { color: #dc2626; }

.work-panel {
  border: 0;
  border-left: 1px solid #efedf8;
  border-radius: 18px 0 0 18px;
  background: #fff;
  padding: 26px 26px 32px;
  transition:
    transform 720ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 720ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 360ms ease;
  will-change: transform;
}

.side-work {
  position: fixed;
  z-index: 35;
  top: 0;
  right: 0;
  width: min(460px, calc(100vw - 96px));
  height: 100vh;
  overflow: visible;
  box-shadow: -24px 0 58px rgba(24, 32, 51, 0.12);
}

.side-work.open {
  transform: translateX(0);
}

.side-work.closed {
  transform: translateX(calc(100% - 16px));
  box-shadow: -8px 0 26px rgba(24, 32, 51, 0.06);
}

.panel-edge {
  position: absolute;
  left: -30px;
  top: 142px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 12px 28px rgba(87, 70, 233, 0.28);
  transition:
    transform 380ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 380ms ease,
    background-color 240ms ease;
  z-index: 2;
}

.panel-edge:hover {
  transform: translateX(-2px) scale(1.04);
  box-shadow: 0 16px 34px rgba(87, 70, 233, 0.34);
}

.panel-edge span {
  display: block;
  color: #fff;
  font-size: 36px;
  font-weight: 300;
  line-height: 1;
  transform: translateY(-3px);
}

.side-work.closed .work-header,
.side-work.closed .work-body {
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.side-work.open .work-header,
.side-work.open .work-body {
  opacity: 1;
  transition: opacity 300ms ease 180ms;
}

.work-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.work-header span {
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: 800;
}

.work-header h2 {
  margin-top: 0;
  font-size: 18px;
}

.work-header p {
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.work-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.work-body {
  display: grid;
  grid-template-columns: 1fr 1.35fr 0.95fr;
  gap: 10px;
}

.side-work .work-body {
  max-height: calc(100vh - 126px);
  overflow-y: auto;
  padding-right: 4px;
  grid-template-columns: 1fr;
  gap: 12px;
  scrollbar-width: thin;
}

.work-target,
.work-guidance,
.work-form,
.work-checklist,
.work-setup,
.related-actions {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.work-target strong,
.work-guidance strong,
.work-checklist strong,
.work-setup strong,
.related-actions strong {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
}

.work-target dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 10px;
  margin: 0;
}

.work-target dt,
.work-target dd {
  margin: 0;
}

.work-target dt {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 800;
}

.work-target dd {
  margin-top: 2px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.work-guidance {
  background: var(--surface-soft);
  border-color: rgba(87, 70, 233, 0.18);
}

.work-guidance div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.work-guidance span {
  color: var(--brand-primary);
  font-size: 11px;
  font-weight: 900;
}

.work-guidance strong {
  margin: 0;
  color: var(--text-primary);
  text-align: right;
}

.work-guidance p,
.work-guidance small {
  display: block;
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

.work-guidance small {
  margin-top: 6px;
  color: var(--brand-primary);
}

.work-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.work-form label span {
  display: block;
  margin-bottom: 5px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  word-break: keep-all;
}

.work-form input,
.work-form select,
.work-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-primary);
  outline: 0;
}

.work-form input,
.work-form select {
  height: 34px;
  padding: 0 10px;
}

.work-form textarea {
  min-height: 58px;
  padding: 9px 10px;
  resize: vertical;
}

.work-form label:last-child {
  grid-column: 1 / -1;
}

.wide-field {
  grid-column: 1 / -1;
}

.account-command,
.payment-flow,
.settlement-ledger,
.promo-builder,
.slot-board,
.analytics-command,
.permission-matrix,
.review-diff,
.reservation-route,
.moderation-box,
.reply-composer,
.publish-targets,
.setting-rollout,
.panel-action-rail,
.money-summary,
.activity-timeline {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.account-command,
.payment-flow,
.settlement-ledger,
.promo-builder,
.slot-board,
.analytics-command,
.permission-matrix,
.reservation-route,
.publish-targets,
.setting-rollout,
.money-summary,
.activity-timeline {
  display: grid;
  gap: 8px;
}

.settlement-ledger,
.promo-builder,
.slot-board,
.analytics-command,
.reservation-route,
.money-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-score {
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid rgba(87, 70, 233, 0.18);
}

.account-score span,
.activity-timeline span,
.settlement-ledger span,
.promo-builder span,
.slot-board span,
.analytics-command span,
.reservation-route span,
.money-summary span,
.review-diff span,
.moderation-box span,
.reply-composer span {
  display: block;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 800;
}

.account-score strong,
.activity-timeline strong,
.settlement-ledger strong,
.promo-builder strong,
.slot-board strong,
.analytics-command strong,
.reservation-route strong,
.money-summary strong,
.review-diff strong,
.moderation-box strong,
.reply-composer strong {
  display: block;
  margin-top: 3px;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.45;
}

.account-score small {
  display: block;
  margin-top: 5px;
  color: var(--brand-primary);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
}

.activity-timeline {
  position: relative;
}

.activity-timeline div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.activity-timeline div:last-child {
  border-bottom: 0;
}

.payment-flow,
.setting-rollout {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.payment-flow div,
.setting-rollout div {
  min-height: 62px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-tertiary);
  color: var(--text-secondary);
  text-align: center;
}

.payment-flow div.done,
.setting-rollout div.done {
  color: var(--brand-primary);
  background: var(--surface-soft);
  border-color: rgba(87, 70, 233, 0.22);
}

.payment-flow b,
.setting-rollout b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
}

.payment-flow span,
.setting-rollout span {
  font-size: 11px;
  font-weight: 800;
}

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

.permission-matrix label,
.publish-targets label {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 800;
}

.permission-matrix input,
.publish-targets input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-primary);
}

.review-diff {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  background: var(--surface-soft);
  border-color: rgba(87, 70, 233, 0.2);
}

.moderation-box {
  background: #fff8f2;
  border-color: #ffd8ac;
}

.reply-composer textarea {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  color: var(--text-primary);
  resize: vertical;
}

.panel-action-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rail-action,
.decision-grid button {
  min-height: 34px;
  border: 1px solid rgba(87, 70, 233, 0.18);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--brand-primary);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

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

.work-checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.related-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.work-checklist label {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.work-checklist input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-primary);
}

.work-checklist label span {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
}

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

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

.tabbar {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab-button {
  height: 36px;
  flex: 0 0 auto;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.tab-button.active {
  border-color: #e2defd;
  background: var(--surface-soft);
  color: var(--brand-primary);
}

.toolbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.search-field {
  width: min(420px, 100%);
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-field span {
  flex: 0 0 auto;
  min-width: 44px;
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  word-break: keep-all;
}

.search-field input,
.drawer-form input,
.drawer-form select,
.drawer-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-primary);
  outline: 0;
}

.search-field input {
  height: 36px;
  padding: 0 12px;
}

.search-field input:focus,
.drawer-form input:focus,
.drawer-form select:focus,
.drawer-form textarea:focus {
  border-color: var(--brand-primary);
}

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

.count-label {
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 700;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.panel.wide { grid-column: 1 / -1; }

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-header.compact { align-items: center; }
.panel-header p { margin: 6px 0 0; color: var(--text-tertiary); font-size: 13px; line-height: 1.55; }

.analytics-filter {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.analytics-filter label {
  width: min(520px, 100%);
  display: flex;
  align-items: center;
  gap: 10px;
}

.analytics-filter span,
.analytics-filter label > span {
  flex: 0 0 auto;
  min-width: 48px;
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  word-break: keep-all;
}

.analytics-filter select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--text-primary);
  outline: 0;
}

.analytics-filter select:focus {
  border-color: var(--brand-primary);
}

.analytics-period-state {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.analytics-period-state b {
  color: var(--brand-primary);
  font-size: 14px;
}

.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.analytics-kpis article {
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.analytics-kpis span {
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 800;
}

.analytics-kpis strong {
  color: var(--text-primary);
  font-size: 20px;
  line-height: 1.25;
}

.analytics-kpis small {
  color: var(--text-secondary);
  font-size: 12px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 16px;
}

.analytics-card {
  min-height: 330px;
}

.bar-chart {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(130px, 170px) minmax(180px, 1fr) minmax(110px, auto);
  gap: 8px 12px;
  align-items: center;
}

.bar-row b {
  color: var(--text-primary);
  font-size: 13px;
}

.bar-row strong,
.bar-row small {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-tertiary);
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-primary);
}

.bar-track.reservations span {
  background: #22c55e;
}

/* 예전 목업용 .trend-chart / .trend-column / .trend-bar 규칙은 삭제했습니다.
   대시보드·통계 차트가 같은 클래스명을 쓰는데, 여기 있던 min-height: 18px 때문에
   매출이 0인 날에도 막대가 그려졌습니다. 실제 규칙은 아래 대시보드 섹션에 있습니다. */

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

.record-card {
  min-height: 154px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.record-card:hover,
.record-card.selected {
  border-color: #d8d5fb;
  background: var(--surface-soft);
}

.record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.record-head strong {
  min-width: 0;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.4;
}

.record-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 12px;
  margin: 0;
}

.record-card dt,
.record-card dd {
  margin: 0;
  min-width: 0;
}

.record-card dt {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 800;
}

.record-card dd {
  margin-top: 3px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.record-action {
  display: inline-flex;
  align-items: center;
  height: 28px;
  margin-top: 13px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--brand-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.empty-state {
  padding: 22px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.table-wrap {
  margin-top: 8px;
  overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th, td {
  border-bottom: 1px solid var(--border);
  padding: 13px 12px;
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}
th { color: var(--text-secondary); background: var(--surface-tertiary); font-weight: 700; }
td:first-child { font-weight: 700; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: #fbfbff; }
tbody tr.selected td { background: var(--surface-soft); }

.ops-table td {
  vertical-align: middle;
}

.table-action {
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: var(--brand-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.status {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border: 0;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.status.on { color: var(--brand-primary); background: var(--surface-soft); }
.status.off { color: var(--text-secondary); background: var(--surface-tertiary); }
.status.locked { color: var(--text-tertiary); background: #f1f2f3; cursor: not-allowed; }

.state-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 20px;
  color: var(--text-secondary);
  background: var(--surface-tertiary);
  font-size: 12px;
  font-weight: 700;
}

.state-chip.success { color: var(--brand-primary); background: var(--surface-soft); }
.state-chip.warning { color: #b45309; background: #fff7ed; }
.state-chip.danger { color: #dc2626; background: #fef2f2; }

.detail-panel {
  position: sticky;
  top: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.detail-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setup-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setup-row {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.setup-row span {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
}

.setup-row b {
  min-width: 66px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 20px;
  font-size: 12px;
}

.setup-row.done {
  border-color: #d8d5fb;
  background: var(--surface-soft);
}

.setup-row.done b {
  color: var(--brand-primary);
  background: #fff;
}

.setup-row.warning {
  border-color: #fed7aa;
  background: #fff7ed;
}

.setup-row.warning b {
  color: #b45309;
  background: #fff;
}

.panel-divider {
  height: 1px;
  margin: 14px 0;
  background: var(--border);
}

.detail-row,
.module-tile {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.detail-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
}

.detail-row b {
  color: var(--brand-primary);
  font-size: 12px;
}

.memo-box {
  margin-top: 14px;
  padding: 13px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.memo-box b,
.memo-box p {
  display: block;
  margin: 0;
}

.memo-box b {
  font-size: 13px;
}

.memo-box p {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.payment-panel {
  margin-top: 16px;
}

.task-list,
.promo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-list li,
.promo-list div,
.ia-grid div {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 13px;
  background: #fff;
}

.task-list strong,
.task-list span,
.promo-list strong,
.promo-list p,
.ia-grid b,
.ia-grid span { display: block; }
.task-list strong,
.promo-list strong,
.ia-grid b { font-size: 14px; line-height: 1.45; }
.task-list span,
.promo-list p,
.ia-grid span { margin-top: 4px; color: var(--text-tertiary); font-size: 12px; line-height: 1.5; }
.promo-list p { margin-bottom: 0; }

.coupon-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  margin-bottom: 8px;
  border-radius: 20px;
  color: #fff;
  background: var(--brand-primary);
  font-size: 12px;
  font-weight: 700;
}
.coupon-chip.outline { color: var(--brand-primary); background: #fff; border: 1px solid var(--brand-primary); }

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

.module-tile {
  min-height: 88px;
  padding: 14px;
}

.module-tile b,
.module-tile span {
  display: block;
}

.module-tile b {
  font-size: 14px;
}

.module-tile span {
  margin-top: 8px;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.45;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  background: rgba(24, 32, 51, 0.18);
}

.drawer {
  width: min(430px, 100%);
  height: 100%;
  background: #fff;
  border-left: 1px solid var(--border);
  padding: 22px;
  box-shadow: -18px 0 40px rgba(24, 32, 51, 0.08);
}

.recovery-drawer {
  width: min(560px, 100%);
}

.recovery-drawer table {
  display: table;
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.recovery-drawer thead { display: table-header-group; }
.recovery-drawer tbody { display: table-row-group; }
.recovery-drawer tr { display: table-row; }
.recovery-drawer th,
.recovery-drawer td {
  display: table-cell;
  padding: 12px 6px;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: middle;
}
.recovery-drawer th:first-child { width: 34%; }
.recovery-drawer th:nth-child(2) { width: 25%; }
.recovery-drawer td::before { display: none; }
.recovery-drawer td button { min-width: 0; padding: 7px; white-space: nowrap; }
.recovery-drawer .detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.recovery-drawer .detail-grid dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.recovery-drawer .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.recovery-drawer input,
.recovery-drawer textarea { min-width: 0; width: 100%; }
.recovery-drawer .drawer-form { overflow-x: hidden; }

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.drawer-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 18px;
}

.drawer-form label span {
  display: block;
  margin-bottom: 7px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  word-break: keep-all;
}

.drawer-form input,
.drawer-form select {
  height: 40px;
  padding: 0 12px;
}

.drawer-form textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.5;
}

.drawer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  min-width: 220px;
  padding: 13px 15px;
  border-radius: 8px;
  background: var(--text-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 12px 34px rgba(24, 32, 51, 0.18);
}

.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 24px;
  background: #fff;
}

.login-panel {
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.login-brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.login-logo {
  display: block;
  width: 142px;
  height: auto;
}

.login-mascot {
  display: block;
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.login-brand h1 {
  margin: 0;
  font-size: 24px;
}

.login-brand p {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.65;
  word-break: keep-all;
}

.login-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
  border: 0;
  background: #fff;
}

.login-card label span {
  display: block;
  margin-bottom: 7px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  word-break: keep-all;
}

.login-card input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: 0;
}

.login-card input:focus {
  border-color: var(--brand-primary);
}

.login-error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .analytics-grid { grid-template-columns: 1fr; }
  .operation-guide { grid-template-columns: 1fr; }
  .use-flow ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-body { grid-template-columns: 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .workspace-grid { grid-template-columns: 1fr; }
  .detail-panel { position: static; }
  .record-grid { display: none; }
  .table-wrap { display: block; }
  .ia-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .login-page { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; width: 100%; height: auto; }
  .side-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar-session { margin-top: 12px; }
  .main { padding: 18px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .top-actions { flex-wrap: wrap; }
  .analytics-filter { align-items: flex-start; flex-direction: column; }
  .analytics-period-state { width: 100%; justify-content: space-between; }
  .analytics-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bar-row { grid-template-columns: 1fr; }
  .bar-row strong,
  .bar-row small { text-align: left; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .operation-guide { grid-template-columns: 1fr; }
  .focus-board { min-width: 0; }
  .work-header { flex-direction: column; }
  .work-actions { flex-wrap: wrap; }
  .work-form { grid-template-columns: 1fr; }
  .side-work {
    top: 8px;
    right: 0;
    width: min(430px, calc(100vw - 92px));
    max-height: calc(100vh - 16px);
  }
  .side-work .work-body { grid-template-columns: 1fr; }
  .side-work.closed { transform: translateX(calc(100% - 14px)); }
  .panel-edge {
    left: -29px;
    top: 138px;
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 560px) {
  .summary-grid, .analytics-kpis, .ia-grid, .side-nav, .record-grid { grid-template-columns: 1fr; }
  .use-flow ol { grid-template-columns: 1fr; }
  .trend-chart { gap: 6px; }
  .side-work .work-body { grid-template-columns: 1fr; }
  .side-work {
    top: 0;
    width: calc(100vw - 86px);
    max-height: 100vh;
  }
  .panel-edge {
    left: -28px;
    top: 132px;
    width: 42px;
    height: 42px;
  }
  .panel-edge span { font-size: 32px; }
  h1 { font-size: 23px; }
}

/* =============================== 가맹점 관리 =============================== */

.sort-header {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
}

.sort-header i {
  font-style: normal;
  font-size: 10px;
  color: var(--text-tertiary);
}

.sort-header.active,
.sort-header.active i { color: var(--brand-primary); }

.ops-table td.row-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.table-action.ghost {
  background: var(--surface-soft);
  color: var(--brand-primary);
}

.table-action.danger {
  background: #fef2f2;
  color: var(--danger);
}

.table-error { color: var(--danger); font-weight: 700; }

.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 4px 2px;
}

.page-button {
  min-width: 34px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.page-button.active {
  border-color: var(--brand-primary);
  background: var(--brand-primary);
  color: #fff;
}

.page-button:disabled { opacity: 0.45; cursor: default; }

.page-info {
  margin-left: auto;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 600;
}

.inline-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.inline-select select {
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
}

.form-group { margin-bottom: 18px; }

.form-group-title {
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
}

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

.form-grid .wide-field { grid-column: 1 / -1; }

.form-grid label span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text-primary);
}

.form-grid textarea {
  height: auto;
  padding: 10px 11px;
  line-height: 1.5;
  resize: vertical;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.form-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef2f2;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.panel-danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  padding: 14px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fffafa;
}

.panel-danger-zone b { display: block; font-size: 13px; }
.panel-danger-zone small { color: var(--text-tertiary); font-size: 12px; }

.danger-button {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 18px;
}

.history-row {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-primary);
  border-radius: 8px;
  background: var(--surface-soft);
}

.history-row.create { border-left-color: var(--success); }
.history-row.delete { border-left-color: var(--danger); }

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

.history-head b { font-size: 13px; }
.history-head span { color: var(--text-tertiary); font-size: 12px; }

.history-row p {
  margin: 6px 0 4px;
  font-size: 13px;
  color: var(--text-primary);
  word-break: break-all;
}

.history-row p i { font-style: normal; color: var(--text-tertiary); }
.history-row small { color: var(--text-secondary); font-size: 12px; }
.history-empty { padding: 20px; color: var(--text-tertiary); text-align: center; }

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

/* ---------------------- 오른쪽 패널/드로어 세로 스크롤 ---------------------- */

/* 헤더는 고정하고 본문만 스크롤되도록 드로어를 세로 플렉스로 잡습니다. */
.drawer {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-header { flex-shrink: 0; }

.drawer-form,
.history-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding-right: 6px;
}

/* 긴 폼에서도 등록/취소 버튼이 항상 보이도록 아래에 고정합니다. */
.drawer-actions {
  position: sticky;
  bottom: 0;
  flex-shrink: 0;
  margin-top: 4px;
  padding: 12px 0 2px;
  border-top: 1px solid var(--border);
  background: #fff;
}

/* 작업 패널도 높이를 계산값 대신 플렉스로 채워 항상 스크롤되게 합니다. */
.side-work {
  display: flex;
  flex-direction: column;
}

.side-work .work-header { flex-shrink: 0; }

.side-work .work-body {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
}

/* 드로어는 오른쪽 작업 패널(z-index 35)보다 위에 떠야 하고,
   토스트는 그 위에 떠야 합니다. */
.drawer-backdrop { z-index: 40; }
.toast { z-index: 50; }

/* ============================ 매장 콘텐츠 검수 ============================ */

.ops-table th.check-cell,
.ops-table td.check-cell {
  width: 38px;
  padding-right: 0;
  text-align: center;
}

.ops-table .check-cell input { width: 15px; height: 15px; }

.ops-table tr.urgent-row td:nth-child(2) { font-weight: 800; color: var(--danger); }

.line-button.muted { opacity: 0.55; }

.field-note {
  margin: 10px 0 0;
  color: var(--text-tertiary);
  font-size: 12px;
}

.form-grid label span small {
  margin-left: 4px;
  color: var(--text-tertiary);
  font-weight: 600;
}

/* 변경 전/후 나란히 비교 */
.diff-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.diff-side {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.diff-head {
  padding: 8px 11px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-tertiary);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.diff-head.after {
  background: var(--surface-soft);
  color: var(--brand-primary);
}

.diff-head small {
  margin-left: 5px;
  color: var(--text-tertiary);
  font-weight: 600;
}

.diff-body {
  max-height: 220px;
  overflow-y: auto;
  padding: 9px 11px;
  scrollbar-width: thin;
}

.diff-line {
  margin: 0 0 2px;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
}

.diff-line.removed { background: #fef2f2; color: #b91c1c; text-decoration: line-through; }
.diff-line.added { background: #f0fdf4; color: #15803d; font-weight: 700; }

.diff-empty {
  margin: 0;
  padding: 14px 4px;
  color: var(--text-tertiary);
  font-size: 12.5px;
  text-align: center;
}

/* 승인/반려/보류 즉시 처리 */
.quick-decision {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.decision-button {
  height: 40px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
}

.decision-button.approve { background: var(--brand-primary); color: #fff; }
.decision-button.reject { background: #fef2f2; border-color: #fecaca; color: var(--danger); }
.decision-button.hold { background: #fff7ed; border-color: #fed7aa; color: #b45309; }

.bulk-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 190px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.bulk-list li {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--surface-soft);
  font-size: 12.5px;
}

.bulk-list li b { color: var(--brand-primary); }

.bulk-list li em {
  float: right;
  font-style: normal;
  color: var(--text-tertiary);
  font-weight: 700;
}

.history-row.apply { border-left-color: #0ea5e9; }

@media (max-width: 900px) {
  .diff-board { grid-template-columns: minmax(0, 1fr); }
}

/* =============================== 사용자 관리 =============================== */

.user-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.user-summary div {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-soft);
  text-align: center;
}

.user-summary span {
  display: block;
  margin-bottom: 3px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 700;
}

.user-summary strong { font-size: 14px; }

/* =============================== 결제 관리 =============================== */

.payment-fees {
  padding: 18px 20px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

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

.payment-fee-grid h3 { margin: 8px 0 12px; font-size: 15px; }
.payment-fee-store { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.payment-fee-store select { min-width: 0; max-width: 100%; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.payment-fee-rows { display: grid; gap: 6px; }
.payment-fee-row { display: grid; grid-template-columns: minmax(105px, 1fr) 90px 14px 54px; align-items: center; gap: 8px; min-height: 40px; }
.payment-fee-row small { grid-column: 2 / -1; color: var(--text-tertiary); font-size: 11px; }
.payment-fee-input { width: 100%; min-width: 0; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: #fff; font: inherit; }

@media (max-width: 780px) {
  .payment-fee-grid { grid-template-columns: 1fr; gap: 18px; }
}

.method-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.method-summary div {
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-soft);
  text-align: center;
}

.method-summary span {
  display: block;
  margin-bottom: 4px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 700;
}

.method-summary strong { display: block; font-size: 14px; }
.method-summary small { color: var(--text-tertiary); font-size: 11px; }

.pg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.pg-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
}

.pg-card.warning { border-color: #fed7aa; background: #fffbf5; }

.pg-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.pg-head b { font-size: 13px; }
.pg-head span { color: var(--text-tertiary); font-size: 12px; font-weight: 700; }

.pg-card > strong {
  display: block;
  font-size: 22px;
  margin-bottom: 8px;
}

.pg-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-tertiary);
  overflow: hidden;
  margin-bottom: 8px;
}

.pg-bar i {
  display: block;
  height: 100%;
  background: var(--brand-primary);
}

.pg-card.warning .pg-bar i { background: var(--warning); }
.pg-card small { color: var(--text-secondary); font-size: 11.5px; }

.ops-table .status {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.ops-table .status.on { border-color: var(--brand-primary); color: var(--brand-primary); background: var(--surface-soft); }
.ops-table .status.off { border-color: var(--border-strong); color: var(--text-tertiary); }

@media (max-width: 1100px) {
  .method-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pg-grid { grid-template-columns: minmax(0, 1fr); }
}

/* =============================== 정산 관리 =============================== */

.ledger-board {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.ledger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 13px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.ledger-row:last-child { border-bottom: 0; }
.ledger-row span { color: var(--text-secondary); font-weight: 600; }
.ledger-row b { font-variant-numeric: tabular-nums; }
.ledger-row.minus b { color: var(--danger); }
.ledger-row.subtotal { background: var(--surface-tertiary); }
.ledger-row.subtotal span, .ledger-row.subtotal b { font-weight: 800; }

.ledger-row.total {
  background: var(--surface-soft);
  border-top: 2px solid var(--brand-primary);
}

.ledger-row.total span { color: var(--brand-primary); font-weight: 800; }
.ledger-row.total b { color: var(--brand-primary); font-size: 16px; font-weight: 800; }

.side-work[aria-label="정산 확정 처리"] .work-body {
  grid-template-columns: minmax(0, 1fr);
}
.side-work[aria-label="정산 확정 처리"] .work-body > * {
  min-width: 0;
}
.side-work[aria-label="정산 확정 처리"] .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.side-work[aria-label="정산 확정 처리"] .form-grid label {
  min-width: 0;
}

.line-button.full {
  display: block;
  width: 100%;
  height: 36px;
}

.form-group-title small {
  margin-left: 6px;
  color: var(--text-tertiary);
  font-size: 11.5px;
  font-weight: 600;
}

.ledger-table { max-height: 220px; overflow-y: auto; scrollbar-width: thin; }
.ledger-table table { font-size: 12.5px; }

.account-line {
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-soft);
  font-size: 13px;
}

.account-line b { margin-right: 6px; }
.account-line.missing { border-color: #fecaca; background: #fffafa; }
.account-line.missing b { color: var(--danger); }

/* ============================= 쿠폰/프로모션 ============================= */

.budget-cell { min-width: 130px; }

.budget-bar {
  height: 5px;
  border-radius: 3px;
  background: var(--surface-tertiary);
  overflow: hidden;
  margin-bottom: 3px;
}

.budget-bar i { display: block; height: 100%; background: var(--brand-primary); }
.budget-bar.warn i { background: var(--danger); }
.budget-cell small { color: var(--text-tertiary); font-size: 11px; }

.budget-bar.big {
  height: 8px;
  border-radius: 4px;
  margin: -6px 0 16px;
}

/* ============================= 광고/노출 관리 ============================= */

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

.slot-card {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
}

.slot-card.full { border-color: #fed7aa; background: #fffbf5; }
.slot-card.over { border-color: #fecaca; background: #fffafa; }

.slot-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.slot-head b { font-size: 13px; }
.slot-head span { color: var(--text-tertiary); font-size: 11.5px; font-weight: 700; }
.slot-card > strong { display: block; font-size: 19px; margin-bottom: 7px; }

.slot-dots { display: flex; gap: 4px; margin-bottom: 6px; }

.slot-dots i {
  width: 14px;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-tertiary);
}

.slot-dots i.on { background: var(--brand-primary); }
.slot-dots i.over { background: var(--danger); }
.slot-card small { color: var(--text-secondary); font-size: 11.5px; }
.slot-card.over small { color: var(--danger); font-weight: 700; }

.conflict-box {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
}

.conflict-box.over { border-color: #fecaca; background: #fffafa; }

.conflict-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.conflict-head b { font-size: 13px; }
.conflict-head span { color: var(--text-tertiary); font-size: 11.5px; font-weight: 700; }
.conflict-box.over .conflict-head span { color: var(--danger); }
.conflict-box p { margin: 0; color: var(--text-tertiary); font-size: 12.5px; }
.conflict-box ul { margin: 0; padding: 0; list-style: none; }

.conflict-box li {
  padding: 6px 0;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
}

.conflict-box li:first-child { border-top: 0; }
.conflict-box li em { float: right; font-style: normal; color: var(--text-tertiary); font-weight: 700; }

.panel-header h2 small {
  margin-left: 6px;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 600;
}

/* ============================= 리뷰/신고 관리 ============================= */

.rating-cell { color: #f59e0b; letter-spacing: -1px; white-space: nowrap; }

.review-original {
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-primary);
  border-radius: 9px;
  background: var(--surface-soft);
}

.review-stars {
  margin-bottom: 6px;
  color: #f59e0b;
  font-size: 15px;
  letter-spacing: -1px;
}

.review-original p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

.report-list { display: flex; flex-direction: column; gap: 9px; margin-top: 10px; }

.report-card {
  padding: 11px 13px;
  border: 1px solid #fecaca;
  border-radius: 9px;
  background: #fffafa;
}

.report-card.closed { border-color: var(--border); background: var(--surface-soft); }

.report-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.report-head b { font-size: 13px; color: var(--danger); }
.report-card.closed .report-head b { color: var(--text-primary); }
.report-head span { color: var(--text-tertiary); font-size: 11.5px; font-weight: 700; }

.report-card p {
  margin: 0 0 9px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}

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

.report-form select,
.report-form input {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: #fff;
  font-size: 12px;
  min-width: 0;
}

.report-form input { grid-column: 1 / 3; }
.report-form button { height: 32px; }
.report-card > small { display: block; margin-top: 6px; color: var(--text-tertiary); font-size: 11.5px; }

/* =============================== 고객센터 =============================== */

.thread { display: flex; flex-direction: column; gap: 9px; }

.thread-item {
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.thread-item.inquiry { border-left: 3px solid var(--text-tertiary); background: var(--surface-tertiary); }
.thread-item.reply { border-left: 3px solid var(--brand-primary); background: var(--surface-soft); }
.thread-item.internal { border-left: 3px solid var(--warning); background: #fffbf5; border-style: dashed; }

.thread-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.thread-head b { font-size: 12.5px; }
.thread-item.internal .thread-head b { color: #b45309; }
.thread-head span { color: var(--text-tertiary); font-size: 11.5px; font-weight: 700; }

.thread-delete {
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-tertiary);
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: underline;
}

.thread-delete:hover { color: var(--danger); }

.thread-item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ============================= 운영 정책/공지 ============================= */

.channel-picker { display: flex; flex-wrap: wrap; gap: 7px; }

.channel-picker label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: #fff;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
}

.channel-picker label.on {
  border-color: var(--brand-primary);
  background: var(--surface-soft);
  color: var(--brand-primary);
}

.channel-picker input { width: 14px; height: 14px; }
.channel-picker label span { margin: 0; }

.version-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

.version-row {
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface-soft);
}

.version-row.current { border-left-color: var(--brand-primary); background: #fff; }

.version-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.version-head b { font-size: 13px; }
.version-row.current .version-head b { color: var(--brand-primary); }
.version-head span { color: var(--text-tertiary); font-size: 11.5px; font-weight: 700; }

.version-row p {
  margin: 0 0 4px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.version-row small { color: var(--text-tertiary); font-size: 11.5px; }

/* ============================== 관리자/권한 ============================== */

.perm-block { margin-bottom: 14px; }

.perm-label {
  margin-bottom: 7px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.perm-label small { margin-left: 5px; color: var(--text-tertiary); font-weight: 600; }

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

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

.perm-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
}

.perm-grid label.on { border-color: var(--brand-primary); background: var(--surface-soft); color: var(--brand-primary); }
.perm-grid label.locked { opacity: 0.7; cursor: default; }
.perm-grid input { width: 13px; height: 13px; flex-shrink: 0; }
.perm-grid label span { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.self-tag {
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--brand-primary);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 800;
}

.login-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 210px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.login-row {
  display: grid;
  grid-template-columns: 46px 92px 1fr;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}

.login-row.ok b { color: var(--brand-primary); }
.login-row.fail { border-color: #fecaca; background: #fffafa; }
.login-row.fail b { color: var(--danger); }
.login-row span { color: var(--text-secondary); font-weight: 700; }
.login-row small { color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================== 시스템 설정 ============================== */

.usage-note {
  margin: 0 0 12px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-primary);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.55;
}

.ops-table tr.muted-row td { opacity: 0.55; }
.quick-decision.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* =============================== 통계/분석 =============================== */

.chart-legend { display: flex; gap: 12px; align-items: center; }

.chart-legend .legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.chart-legend .legend::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--brand-primary);
}

.chart-legend .legend.reservations::before { border-radius: 50%; background: var(--warning); }

.trend-chart {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 8px;
  height: 220px;
  padding: 10px 4px 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

/* 구간이 하나뿐일 때 막대가 화면 전체로 늘어나지 않도록 폭을 제한합니다. */
.trend-col {
  flex: 1 1 46px;
  min-width: 46px;
  max-width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.trend-bar-wrap {
  position: relative;
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 0;
}

.trend-bar {
  display: block;
  width: 60%;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--brand-primary), #8b7cf0);
}

.trend-dot {
  position: absolute;
  left: 50%;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: var(--warning);
  border: 2px solid #fff;
  z-index: 1;
}

.trend-col b { margin-top: 6px; font-size: 11.5px; }
.trend-col span { color: var(--text-tertiary); font-size: 11px; font-weight: 600; }

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

.share-list { display: flex; flex-direction: column; gap: 11px; }

.share-row {
  display: grid;
  grid-template-columns: 88px 1fr 46px;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
}

.share-row > span { color: var(--text-secondary); font-weight: 700; }
.share-row > b { text-align: right; font-variant-numeric: tabular-nums; }

.share-row small {
  grid-column: 2 / 4;
  color: var(--text-tertiary);
  font-size: 11.5px;
  margin-top: -4px;
}

.share-bar { height: 8px; border-radius: 4px; background: var(--surface-tertiary); overflow: hidden; }
.share-bar i { display: block; height: 100%; background: var(--brand-primary); }

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

.mini-kpi div {
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-soft);
}

.mini-kpi span { display: block; color: var(--text-tertiary); font-size: 11px; font-weight: 700; margin-bottom: 3px; }
.mini-kpi strong { display: block; font-size: 14px; margin-bottom: 2px; }
.mini-kpi small { color: var(--text-tertiary); font-size: 11px; }

.rank-bar { width: 90px; height: 7px; border-radius: 4px; background: var(--surface-tertiary); overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: var(--brand-primary); }

@media (max-width: 1100px) {
  .analytics-split { grid-template-columns: minmax(0, 1fr); }
  .mini-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =============================== 대시보드 =============================== */

.queue-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}

.queue-row {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.queue-row:hover { border-color: #ddd8ff; background: var(--surface-soft); }
.queue-row i {
  width: 5px;
  height: 32px;
  border-radius: 999px;
  background: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(87, 70, 233, 0.08);
}
.queue-row.warning i { background: var(--warning); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.09); }
.queue-row.danger i { background: var(--danger); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.09); }
.queue-main { min-width: 0; }
.queue-main b {
  display: block;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-main small {
  display: block;
  margin-top: 3px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-count {
  min-width: 38px;
  color: var(--brand-primary);
  font-size: 17px;
  font-weight: 900;
  text-align: right;
}
.queue-row.warning .queue-count { color: #b45309; }
.queue-row.danger .queue-count { color: var(--danger); }
.queue-next {
  display: none;
}

@media (max-width: 1480px) {
  .queue-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
  .queue-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .queue-list { grid-template-columns: 1fr; }
}

.activity-list { display: flex; flex-direction: column; gap: 6px; }

.activity-row {
  display: grid;
  grid-template-columns: 120px 1fr 90px;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  text-align: left;
}

.activity-row:hover { background: var(--surface-soft); }

.activity-row em {
  font-style: normal;
  color: var(--brand-primary);
  font-size: 11.5px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-row b { display: block; font-size: 13px; margin-bottom: 2px; }

.activity-row span {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-row i { font-style: normal; color: var(--text-tertiary); }
.activity-row small { color: var(--text-tertiary); font-size: 11px; text-align: right; line-height: 1.5; }

@media (max-width: 900px) {
  .activity-row { grid-template-columns: 1fr; gap: 4px; }
  .activity-row small { text-align: left; }
}

/* ------------------------------ 접속 세션 ------------------------------- */
.muted-text {
  color: var(--text-tertiary);
  font-style: normal;
  font-size: 12px;
}

.session-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  font-size: 13px;
}

.session-inline b {
  color: var(--text-primary);
}

.session-inline .line-button.muted {
  opacity: 0.5;
}

/* ---------------------------- 가맹점 계정 관리 ---------------------------- */
.account-list { display: flex; flex-direction: column; gap: 6px; }

.account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
}
.account-row.off { opacity: 0.6; }
.account-row > div:first-child { min-width: 0; }
.account-row b { display: block; font-size: 13px; font-weight: 800; }
.account-row span { display: block; font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.account-row small { display: block; margin-top: 2px; font-size: 11px; color: var(--text-tertiary); }
.account-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 5px; }

.account-form {
  margin-top: 10px;
  padding: 13px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: #fff;
}

/* ------------------------- 영업시간 요약 (관리자) ------------------------- */
.hours-summary {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
}
.hours-summary > div span { display: block; font-size: 11px; font-weight: 700; color: var(--text-tertiary); margin-bottom: 3px; }
.hours-summary > div b { font-size: 12.5px; font-weight: 700; line-height: 1.5; }

.hours-week { display: flex; flex-wrap: wrap; gap: 4px; }
.hours-week span {
  padding: 4px 8px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}
.hours-week span.off { background: var(--surface-tertiary); color: var(--text-tertiary); }
.hours-week em { display: block; font-style: normal; font-size: 10.5px; color: var(--brand-primary); font-weight: 800; }
.hours-week span.off em { color: var(--text-tertiary); }

/* ---------------------- Figma app extension responsive --------------------- */
@media (max-width: 520px) {
  html,
  body {
    min-height: 100%;
    background: #fff;
    scrollbar-width: none;
  }

  body {
    overflow-x: hidden;
  }

  html::-webkit-scrollbar,
  body::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .admin-shell {
    display: block;
    width: 390px;
    max-width: 390px;
    min-height: 844px;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(24, 32, 51, 0.04);
  }

  .admin-shell::before {
    content: "9:41";
    position: sticky;
    top: 0;
    z-index: 31;
    display: flex;
    align-items: center;
    height: 62px;
    padding: 0 53px;
    background: #fff;
    color: #000;
    font-size: 15px;
    font-weight: 800;
  }

  .admin-shell::after {
    content: "";
    position: fixed;
    left: 50%;
    top: 24px;
    z-index: 32;
    width: 78px;
    height: 16px;
    transform: translateX(116px);
    background:
      linear-gradient(#000, #000) 0 7px / 3px 7px no-repeat,
      linear-gradient(#000, #000) 5px 4px / 3px 10px no-repeat,
      linear-gradient(#000, #000) 10px 1px / 3px 13px no-repeat,
      radial-gradient(circle at 31px 8px, transparent 0 3px, #000 3.5px 4.5px, transparent 5px) 0 0 / 45px 16px no-repeat,
      linear-gradient(#000, #000) 31px 7px / 10px 2px no-repeat,
      linear-gradient(#000, #000) 33px 10px / 6px 2px no-repeat,
      linear-gradient(#000, #000) 35px 13px / 2px 2px no-repeat,
      linear-gradient(#000, #000) 53px 3px / 20px 10px no-repeat;
    pointer-events: none;
  }

  .main {
    width: 390px;
    max-width: 390px;
    padding: 0 20px 112px;
    background: #fff;
  }

  .sidebar {
    position: fixed;
    left: 50%;
    right: auto;
    top: auto;
    bottom: 0;
    z-index: 50;
    width: min(390px, 100vw);
    height: 86px;
    transform: translateX(-50%);
    display: block;
    padding: 0 0 8px;
    border: 0;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    overflow: hidden;
  }

  .sidebar::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 8px;
    width: 120px;
    height: 5px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: #000;
  }

  .brand-block,
  .sidebar-session {
    display: none;
  }

  .side-nav {
    display: flex;
    flex-direction: row;
    gap: 0;
    height: 52px;
    padding: 0 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .side-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    min-width: 66px;
    height: 52px;
    flex: 0 0 66px;
    justify-content: center;
    padding: 5px 3px 3px;
    border-radius: 0;
    color: var(--text-tertiary);
    background: transparent;
  }

  .nav-item.active,
  .nav-item:hover {
    color: var(--brand-primary);
    background: transparent;
  }

  .nav-label {
    flex-direction: column;
    gap: 2px;
    width: 100%;
  }

  .nav-label > span {
    max-width: 62px;
    font-size: 10px;
    line-height: 16px;
    font-weight: 800;
    text-align: center;
  }

  .nav-icon {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    color: inherit;
    font-size: 10px;
  }

  .nav-item.active .nav-icon,
  .nav-item:hover .nav-icon {
    background: var(--surface-soft);
    color: var(--brand-primary);
  }

  .nav-item em {
    position: absolute;
    top: 4px;
    right: 14px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
  }

  .topbar {
    position: sticky;
    top: 62px;
    z-index: 30;
    min-height: 54px;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 24px;
    gap: 0;
    align-items: center;
    margin: 0 -20px 12px;
    padding: 0 20px;
    border: 0;
    border-radius: 0;
    background: #fff;
  }

  .topbar::before {
    content: "";
    width: 24px;
    height: 24px;
    background: url("./assets/figma-sync/search-back.svg") center / contain no-repeat;
  }

  .topbar > div:first-child {
    grid-column: 2;
    min-width: 0;
  }

  .breadcrumb,
  .page-desc {
    display: none;
  }

  h1 {
    text-align: center;
    font-size: 20px;
    line-height: 28px;
    font-weight: 700;
  }

  .top-actions {
    display: none;
  }

  .summary-grid,
  .analytics-kpis,
  .ia-grid,
  .mini-kpi {
    width: 350px;
    max-width: 100%;
    margin: 0 auto 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .summary-card,
  .panel,
  .payment-panel,
  .detail-panel,
  .work-target,
  .work-guidance,
  .work-form,
  .work-checklist,
  .work-setup,
  .related-actions {
    border-radius: 12px;
  }

  .summary-card {
    min-height: 98px;
    padding: 14px 16px;
    border-color: var(--figma-border-primary);
    background: var(--figma-surface-secondary);
  }

  .summary-card strong {
    margin: 8px 0 4px;
    font-size: 22px;
    line-height: 30px;
  }

  .operation-guide,
  .content-grid,
  .workspace-grid,
  .analytics-grid,
  .analytics-split {
    width: 350px;
    max-width: 100%;
    margin-inline: auto;
    grid-template-columns: 1fr;
  }

  .panel {
    width: 350px;
    max-width: 100%;
    margin-inline: auto;
    border-color: var(--figma-border-primary);
    box-shadow: none;
  }

  .panel-header {
    gap: 10px;
    align-items: flex-start;
  }

  .panel-header h2 {
    font-size: 18px;
    line-height: 26px;
  }

  .panel-header p {
    font-size: 13px;
    line-height: 20px;
  }

  .use-flow ol {
    grid-template-columns: 1fr;
  }

  .tabbar,
  .toolbar,
  .analytics-filter {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .tabbar::-webkit-scrollbar,
  .toolbar::-webkit-scrollbar,
  .analytics-filter::-webkit-scrollbar {
    display: none;
  }

  .tab-button,
  .ghost-button,
  .line-button,
  .primary-button {
    min-height: 44px;
    border-radius: 8px;
  }

  .toolbar input[type="search"],
  .analytics-filter select,
  .analytics-filter input,
  .toolbar select {
    height: 44px;
    border-radius: 22px;
  }

  .toolbar input[type="search"] {
    padding-left: 44px;
    background:
      url("./assets/figma-sync/search-24.svg") 12px center / 24px 24px no-repeat,
      #fdfdfd;
  }

  .toolbar,
  .tabbar {
    width: 350px;
    max-width: 100%;
    margin-inline: auto;
  }

  .table-wrap {
    overflow: visible;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 12px;
  }

  .ops-table tr,
  tbody tr {
    position: relative;
    min-height: 84px;
    padding: 12px 16px;
    border: 1px solid var(--figma-border-primary);
    border-radius: 12px;
    background: #fff;
  }

  .ops-table td,
  tbody td {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 6px 0;
    border: 0;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 22px;
  }

  .ops-table td::before,
  tbody td::before {
    content: attr(data-label);
    flex: 0 0 84px;
    color: var(--text-secondary);
    font-weight: 500;
  }

  .ops-table td.row-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .ops-table td.row-actions::before {
    margin-right: auto;
  }

  .side-work {
    width: min(390px, calc(100vw - 54px));
    border-radius: 18px 0 0 18px;
  }

  .side-work.closed {
    transform: translateX(calc(100% - 12px));
  }

  .panel-edge {
    top: 132px;
  }

  .queue-list {
    width: 350px;
    max-width: 100%;
    margin: 0 auto;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 0 0 12px;
  }

  .queue-row {
    min-height: 84px;
    grid-template-columns: 5px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px 16px;
    border-color: var(--figma-border-primary);
    border-radius: 12px;
    background: var(--figma-surface-secondary);
  }

  .queue-row i {
    width: 4px;
    height: 40px;
  }

  .queue-main b {
    font-size: 14px;
    line-height: 22px;
  }

  .queue-main small {
    margin-top: 2px;
    font-size: 12px;
    line-height: 18px;
    font-weight: 500;
  }

  .queue-count {
    min-width: 48px;
    font-size: 18px;
    line-height: 26px;
  }

  .queue-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 28px;
    border-radius: 999px;
    background: var(--figma-surface-brand-strong);
    color: var(--brand-primary);
    font-size: 12px;
    font-weight: 800;
  }
}
