:root {
  --admin-bg: #faf6f2;
  --admin-panel: #ffffff;
  --admin-border: #eadfd6;
  --admin-text: #1c1410;
  --admin-muted: #7c6a5d;
  --admin-primary: #2563EB;
  --admin-primary-dark: #1d4ed8;
  --admin-danger: #dc2626;
  --admin-ok: #059669;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "Malgun Gothic", sans-serif;
  background: var(--admin-bg);
  color: var(--admin-text);
}

.hidden { display: none !important; }

.admin-installer-card {
  margin-top: 16px;
  background: var(--admin-panel);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 20px;
}

.admin-dashboard-stores-card {
  margin-top: 16px;
  background: var(--admin-panel);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 20px;
}
.admin-dashboard-stores-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.admin-dashboard-stores-head h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}
.admin-dashboard-stores-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.admin-dashboard-stores-search {
  margin: 0;
}
.admin-dashboard-stores-search input {
  min-width: 160px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: #fff;
  color: var(--admin-text);
  font-size: 0.9rem;
}
.admin-dashboard-stores-count {
  white-space: nowrap;
}
.admin-dashboard-stores-wrap {
  max-height: min(52vh, 520px);
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.admin-dashboard-stores-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
  border-collapse: collapse;
}
.admin-dashboard-stores-table th,
.admin-dashboard-stores-table td {
  white-space: nowrap;
  padding: 10px 12px;
  border: 1px solid #d8dee8;
}
.admin-dashboard-stores-table th {
  background: #f1f5f9;
  border-bottom-color: #c5cedb;
}
.admin-dashboard-stores-table td.admin-actions {
  min-width: 120px;
}

.admin-installer-card h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.admin-installer-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px dashed var(--admin-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--admin-panel) 88%, #94a3b8);
}

.admin-installer-field {
  display: grid;
  grid-template-rows: auto 36px;
  gap: 6px;
  margin: 0;
  min-width: 0;
}

.admin-installer-label {
  font-size: 0.88rem;
  line-height: 1.25;
  min-height: 1.1em;
}

.admin-installer-label-spacer {
  visibility: hidden;
  user-select: none;
}

.admin-installer-control,
.admin-installer-form select,
.admin-installer-form input[type="text"] {
  width: 100%;
  height: 36px;
  min-width: 0;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--admin-panel);
  color: var(--admin-text);
}

.admin-installer-field-platform {
  width: 160px;
}

.admin-installer-field-grow {
  flex: 1 1 200px;
  min-width: 180px;
}

.admin-installer-field-version {
  width: 120px;
}

.admin-installer-field-file {
  flex: 1 1 320px;
  min-width: 280px;
}

.admin-installer-file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: transparent;
}

.admin-installer-file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-panel);
  color: var(--admin-text);
  cursor: pointer;
  font-size: 0.92rem;
  white-space: nowrap;
}

.admin-installer-file-hint {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-installer-check-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  font-size: 0.88rem;
  white-space: nowrap;
}

.admin-installer-submit {
  height: 36px;
  padding: 0 14px;
  white-space: nowrap;
}

.admin-installer-table .num {
  text-align: right;
  white-space: nowrap;
}

.admin-installer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  white-space: nowrap;
}

.installer-row-latest {
  background: color-mix(in srgb, #38bdf8 12%, var(--admin-panel));
}

/* Admin login — centered card + left illustration (pre TEXT v521) */
.admin-login-screen {
  width: 100%;
  min-height: 100vh;
  background: #eff0f2;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  box-sizing: border-box;
}
.admin-login-card-shell {
  display: flex;
  flex-direction: row;
  width: min(860px, 100%);
  min-height: 520px;
  background: #fff;
  border: none;
  border-radius: 15px;
  box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.2);
  overflow: hidden;
  margin: 0;
  outline: none;
}
.admin-login-card-shell:focus-within {
  outline: none;
}
.admin-login-brand {
  flex: 0 0 48%;
  min-width: 0;
  min-height: 520px;
  border-radius: 15px 0 0 15px;
  padding: 0;
  background: #eef0f3;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}
.admin-login-brand-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  border-radius: 0;
  margin: 0;
}
.admin-login-form-wrap {
  flex: 1;
  min-width: 0;
  padding: 44px 52px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}
.admin-login-lang-row {
  position: absolute;
  top: 28px;
  right: 40px;
  text-align: right;
}
.admin-login-lang {
  min-width: 112px;
  padding: 7px 30px 7px 12px;
  border: 1px solid #c5ccd6;
  border-radius: 6px;
  font-size: 0.84rem;
  color: #334155;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2364748b' d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
}
.admin-login-heading {
  margin: 0 0 36px;
  font-size: clamp(2.4rem, 4vw, 3.2rem);
  font-weight: 300;
  letter-spacing: 0.08em;
  color: #9aa3ad;
  line-height: 1;
}
.admin-login-fields {
  display: grid;
  gap: 4px;
}
.admin-login-field {
  display: grid;
  gap: 6px;
  margin: 0;
}
.admin-login-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.02em;
}
.admin-login-field input {
  width: 100%;
  height: 48px;
  padding: 0 18px;
  border: 1px solid #c8d0da;
  border-radius: 999px;
  font-size: 0.96rem;
  background: #fff;
  color: #1f2937;
}
.admin-login-field-icon {
  position: relative;
  display: block;
}
.admin-login-field-icon input {
  padding-left: 46px;
}
.admin-login-input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  display: flex;
}
.admin-login-field input:focus {
  outline: 2px solid rgba(0, 93, 245, 0.3);
  border-color: var(--admin-primary);
}
.admin-login-turnstile {
  margin-top: 16px;
  min-height: 65px;
  display: flex;
  justify-content: center;
}
.admin-login-turnstile.hidden {
  display: none;
}
.admin-login-submit-wrap {
  margin-top: 24px;
}
.admin-login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #60a5fa 0%, #2563EB 55%, #1d4ed8 100%);
  color: #fff;
  font-size: 1.08rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.32);
}
.admin-login-submit:hover {
  background: linear-gradient(180deg, #3b82f6 0%, #2563EB 55%, #1d4ed8 100%);
}
.admin-login-submit-icon {
  display: flex;
}
.admin-login-form-wrap .admin-error {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--admin-danger);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 900px) {
  .admin-login-card-shell {
    flex-direction: column;
    min-height: auto;
  }
  .admin-login-brand {
    flex: none;
    min-height: 280px;
    height: 42vw;
    max-height: 360px;
  }
  .admin-login-form-wrap {
    padding: 32px 28px 36px;
  }
  .admin-login-lang-row {
    position: static;
    margin-bottom: 16px;
  }
  .admin-login-heading {
    margin-bottom: 24px;
  }
}
.admin-login-card {
  width: min(420px, 100%);
  background: var(--admin-panel);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  padding: 28px;
  display: grid;
  gap: 14px;
}
.admin-login-card h1 { margin: 0 0 4px; font-size: 1.35rem; }
.admin-login-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.admin-login-actions .btn-primary,
.admin-login-actions .btn-ghost {
  width: 100%;
  padding: 11px 12px;
  font-size: 1rem;
}
.admin-login-card label { display: grid; gap: 6px; font-size: 0.92rem; }
.admin-login-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  font-size: 1rem;
}
.admin-login-card select,
.admin-header-lang select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fff;
}
.admin-header-lang select { width: auto; min-width: 7rem; }
.admin-header-actions { display: flex; align-items: center; gap: 12px; }

.admin-app { min-height: 100vh; }
.admin-app:not(.hidden) {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
.admin-shell {
  display: flex;
  min-height: 100vh;
  background: #f4f5f7;
}
.admin-app:not(.hidden) .admin-shell {
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}
.admin-sidebar {
  flex-shrink: 0;
  width: 248px;
  display: flex;
  flex-direction: column;
  background: #f8f9fb;
  border-right: 1px solid #e5e7eb;
  color: #111827;
}
.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 14px 12px;
}
.admin-sidebar-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
}
.admin-sidebar-brand-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-sidebar-title {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #111827;
}
.admin-sidebar-title .accent { color: #2563eb; }
.admin-sidebar-subtitle {
  font-size: 0.72rem;
  color: #6b7280;
  font-weight: 600;
}
.admin-sidebar-search {
  position: relative;
  margin: 0 12px 10px;
}
.admin-sidebar-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
  display: flex;
}
.admin-sidebar-search-input {
  width: 100%;
  box-sizing: border-box;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #111827;
  font-size: 0.86rem;
  outline: none;
}
.admin-sidebar-search-input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.admin-sidebar-nav.admin-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 8px 12px;
  margin: 0;
  border: none;
  background: transparent;
}
.admin-sidebar-nav .admin-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #374151;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.admin-sidebar-nav .admin-tab:hover:not(.active) {
  background: rgba(0, 0, 0, 0.04);
}
.admin-sidebar-nav .admin-tab.active {
  background: #eff6ff;
  color: #1d4ed8;
}
.admin-tab-icon {
  display: flex;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.9;
}
.admin-tab-icon svg {
  width: 20px;
  height: 20px;
}
.admin-tab-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-sidebar-nav .admin-tab.is-nav-filtered-out {
  display: none !important;
}
.admin-sidebar-foot {
  flex-shrink: 0;
  display: grid;
  gap: 8px;
  padding: 10px 12px 14px;
  border-top: 1px solid #e5e7eb;
}
.admin-theme-btn {
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.admin-theme-btn:hover { background: #bfdbfe; }
.admin-sidebar-logout {
  width: 100%;
  height: 38px;
  border-radius: 999px;
}
.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.admin-app:not(.hidden) .admin-main {
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}
.admin-main-header.admin-header {
  background-color: #fff;
  background-image: none;
  color: #111827;
  border-bottom: 1px solid #e5e7eb;
  padding: 14px 24px;
  flex-shrink: 0;
}
.admin-main-header .admin-header-user { color: #4b5563; }
.admin-main-header .admin-header-lang select {
  background: #fff;
  color: #111827;
  border-color: #e5e7eb;
}
.admin-main-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0;
  background: #f4f5f7;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.admin-header-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
  min-width: 0;
}
.admin-header h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.admin-header-logo-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-header-logo {
  display: block;
  flex-shrink: 0;
}

.admin-header-logo-brand {
  height: 32px;
  width: auto;
  max-width: 132px;
  object-fit: contain;
  background: #fff;
  border-radius: 5px;
  padding: 3px 8px;
}

.admin-header-mark {
  height: 30px;
  width: 30px;
  border-radius: 8px;
  object-fit: cover;
}

.admin-header-wordmark {
  height: 22px;
  width: auto;
  max-width: 96px;
  object-fit: contain;
  background: #fff;
  border-radius: 5px;
  padding: 4px 8px;
}

.admin-header-wordmark-text {
  display: inline-block;
  font-family: "Montserrat", "Segoe UI", system-ui, sans-serif;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #fff;
  white-space: nowrap;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.admin-header-wordmark-text .accent {
  color: #dbeafe;
}
.admin-header-logo-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}
.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.admin-header-user {
  font-size: 0.9rem;
  color: #4b5563;
  white-space: nowrap;
}

/* 가로 탭은 사이드바 네비로 대체 — 레거시 규칙 무력화 */
.admin-tabs:not(.admin-sidebar-nav) {
  display: none;
}

.admin-panel {
  display: none;
  padding: 20px 24px 32px;
}
.admin-panel.active { display: block; }

/* 공지: 페이지 전체 스크롤 막고, 내용보기/글쓰기 카드 안쪽만 스크롤 */
html.admin-notices-lock,
html.admin-notices-lock body {
  height: 100%;
  overflow: hidden;
}
.admin-app.admin-notices-inner-scroll .admin-main-body {
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
}
.admin-main-body:has(#tab-notices.active) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#tab-notices.admin-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding-bottom: 16px;
}
.admin-notices-board {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.admin-notices-pane {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.admin-notices-detail-pane {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.admin-notices-detail-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  background: var(--admin-panel, #fff);
  border: 1px solid var(--admin-border, #e5e7eb);
  border-radius: 12px;
  padding: 20px 22px 18px;
}
form.admin-notices-detail-card {
  margin: 0;
}
.admin-notices-detail-heading {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  flex: 0 0 auto;
}
.admin-notices-scroll-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}
.admin-notices-scroll-body .admin-notice-view-dl {
  display: block;
  flex: none;
  min-height: 0;
  margin: 0;
}
.admin-notices-scroll-body .admin-notice-view-row-body {
  flex: none;
  min-height: 0;
}
.admin-notices-detail-card > .admin-notice-view-dl {
  /* legacy — scroll now on .admin-notices-scroll-body */
  flex: none;
  overflow: visible;
  min-height: 0;
}
.admin-notices-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  margin-top: 0;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

.admin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* Dashboard summary — title above value boxes; label ≈ installer label size, value ≈ 3× prior */
#dashboardCards.admin-dashboard-stats,
.admin-dashboard-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: start;
}
.admin-stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.admin-stat-label {
  display: block;
  margin: 0;
  padding: 0 2px;
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  line-height: 1.25;
  min-height: 1.1em;
}
.admin-stat-box {
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 12px;
  padding: 10px 8px;
  min-height: 48px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.admin-stat-box strong {
  display: block;
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
  line-height: 1.1;
  word-break: break-word;
}
@media (max-width: 1100px) {
  #dashboardCards.admin-dashboard-stats,
  .admin-dashboard-stats {
    grid-template-columns: repeat(6, minmax(100px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .admin-stat-label {
    font-size: 0.84rem;
  }
  .admin-stat-box {
    min-height: 44px;
    padding: 8px 6px;
  }
  .admin-stat-box strong {
    font-size: 1.25rem;
  }
}
@media (max-width: 720px) {
  #dashboardCards.admin-dashboard-stats,
  .admin-dashboard-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow-x: visible;
  }
  .admin-stat-box strong {
    font-size: 1.2rem;
  }
}
@media (max-width: 480px) {
  #dashboardCards.admin-dashboard-stats,
  .admin-dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-stat-box {
    min-height: 42px;
  }
  .admin-stat-box strong {
    font-size: 1.15rem;
  }
}

.admin-card {
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 14px;
  padding: 18px 18px 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  min-height: 120px;
}
.admin-card span {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}
.admin-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #111827;
}

.admin-installer-card {
  margin-top: 16px;
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.admin-analytics-toolbar {
  align-items: flex-end;
}

.admin-analytics-toolbar label {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.88rem;
}

.admin-analytics-toolbar input[type="date"],
.admin-analytics-toolbar select {
  height: 36px;
  min-width: 150px;
  padding: 0 10px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  font: inherit;
}

.admin-analytics-toolbar #analyticsSearchBtn {
  height: 36px;
  margin: 0;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.admin-toolbar-stores {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  overflow: visible;
  padding-bottom: 0;
}

.admin-toolbar-stores .admin-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.admin-toolbar-stores .admin-toolbar-row button {
  flex: 0 0 auto;
  width: auto;
}

.admin-toolbar-stores .admin-toolbar-row-views {
  justify-content: space-between;
  row-gap: 8px;
}

.admin-toolbar-stores .admin-toolbar-row-views .admin-view-toggle {
  flex: 0 1 auto;
  flex-wrap: wrap;
  max-width: 100%;
}

.admin-toolbar-stores .admin-toolbar-row-views .admin-view-toggle .btn-ghost {
  white-space: nowrap;
}

.admin-toolbar-stores .admin-toolbar-row-views .admin-toolbar-actions {
  flex: 0 1 auto;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 100%;
}

.admin-toolbar-stores .admin-toolbar-actions .admin-toolbar-register-btn {
  white-space: nowrap;
}

.admin-toolbar-stores #storeMgmtSearch {
  flex: 1 1 220px;
  min-width: 200px;
  max-width: 420px;
  height: 36px;
}

.admin-toolbar-users .admin-unified-search {
  flex: 1 1 320px;
  min-width: 280px;
  max-width: 640px;
}

.admin-toolbar-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}
.admin-toolbar-stores .admin-toolbar-actions {
  flex-wrap: wrap;
}
.admin-toolbar input:not([type="checkbox"]):not([type="radio"]),
.admin-toolbar select {
  padding: 8px 10px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  min-width: 180px;
}
.admin-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.admin-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 0;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

.admin-field-ok {
  color: #15803d;
}

.admin-field-err {
  color: #b91c1c;
}

.hint.admin-field-ok {
  color: #15803d;
  font-weight: 500;
}

.hint.admin-field-err {
  color: #b91c1c;
  font-weight: 500;
}

.admin-input-err {
  border-color: #b91c1c !important;
  box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.15);
}

.admin-label-required::after {
  content: " *";
  color: #b91c1c;
  font-weight: 600;
}

.admin-table-wrap {
  overflow: auto;
  background: var(--admin-panel);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.admin-table th,
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  vertical-align: middle;
}
.admin-table th {
  background: #f8fafc;
  font-weight: 600;
  white-space: nowrap;
}
.admin-table tr:hover td { background: #fafcff; }

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.status-pill.active { background: #dcfce7; color: #166534; }
.status-pill.suspended { background: #fef3c7; color: #92400e; }
.status-pill.terminated { background: #fee2e2; color: #991b1b; }
.status-pill.inactive { background: #e2e8f0; color: #475569; }

.btn-primary,
.btn-ghost,
.btn-danger,
.btn-link {
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.92rem;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-primary {
  background: var(--admin-primary);
  color: #fff;
  border-color: var(--admin-primary);
}
.btn-primary:hover:not(:disabled) { background: var(--admin-primary-dark); }
.btn-primary:disabled,
.btn-ghost:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-ghost {
  background: var(--admin-panel);
  color: var(--admin-text);
  border-color: var(--admin-border);
}

.btn-refresh {
  gap: 0.35rem;
}

.btn-refresh-icon {
  display: inline-flex;
  flex-shrink: 0;
  line-height: 0;
  color: #2563EB;
}

.btn-refresh.is-loading .btn-refresh-icon svg {
  animation: adminRefreshSpin 0.8s linear infinite;
}

@keyframes adminRefreshSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.btn-refresh[aria-busy="true"] {
  opacity: 0.85;
  cursor: progress;
}

.btn-refresh-icon svg {
  display: block;
}

.btn-action-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  color: var(--admin-text);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-panel);
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn-action-close-icon {
  font-size: 0.82rem;
  line-height: 1;
}

.btn-action-close:active {
  color: #2563EB;
  border-color: #2563EB;
  background: #eff6ff;
}

.btn-refresh.touch-sm,
.btn-action-close.touch-sm {
  height: 35px;
  min-height: 35px;
  padding: 0 0.75rem;
  font-size: 0.88rem;
  line-height: 1;
}

.admin-header .btn-ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.88rem;
}
.admin-header .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.65);
}
.btn-danger {
  background: var(--admin-panel);
  color: var(--admin-danger);
  border-color: #fecaca;
}
.btn-link {
  background: transparent;
  color: var(--admin-primary);
  padding: 0;
}
.btn-icon {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
}

.admin-dialog {
  border: none;
  border-radius: 14px;
  padding: 0;
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}
.admin-dialog form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 24px);
}
.admin-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.admin-dialog-head,
.admin-dialog-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--admin-border);
  flex-shrink: 0;
}
.admin-dialog-foot {
  border-bottom: none;
  border-top: 1px solid var(--admin-border);
  justify-content: flex-end;
  gap: 8px;
}
.admin-dialog-head h2 { margin: 0; font-size: 1.05rem; }
.admin-dialog-body-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.admin-dialog-scroll-top {
  position: absolute;
  right: 18px;
  bottom: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 1px solid var(--admin-border);
  border-radius: 999px;
  background: #fff;
  color: var(--admin-text, #0f172a);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.admin-dialog-scroll-top:hover {
  background: #f8fafc;
  transform: translateY(-1px);
}
.admin-dialog-scroll-top.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
}
.admin-dialog-body {
  padding: 16px;
  display: grid;
  gap: 12px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(72vh, 720px);
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.admin-dialog-md {
  width: min(680px, calc(100vw - 28px));
}
.admin-dialog-lg {
  width: min(920px, calc(100vw - 32px));
}
.admin-dialog-xl {
  width: min(1180px, calc(100vw - 24px));
}
.admin-dialog-full {
  width: calc(100vw - 12px);
  max-width: none;
  height: calc(100vh - 12px);
  max-height: calc(100vh - 12px);
  margin: auto;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}
.admin-dialog-full .admin-dialog-head {
  padding: 16px 22px;
}
.admin-dialog-full .admin-dialog-head h2 {
  font-size: 1.28rem;
}
.admin-dialog-full .admin-dialog-foot {
  padding: 14px 22px;
}
.admin-dialog-full .admin-dialog-body {
  padding: 18px 22px 24px;
  gap: 16px;
  max-height: none;
  flex: 1 1 auto;
}
.admin-dialog-full .admin-dialog-body input,
.admin-dialog-full .admin-dialog-body select,
.admin-dialog-full .admin-dialog-body textarea {
  padding: 11px 13px;
  font-size: 0.96rem;
}
.admin-dialog-full form {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: none;
  min-height: 0;
}
.admin-dialog-xl .admin-dialog-head {
  padding: 18px 28px;
}
.admin-dialog-xl .admin-dialog-head h2 {
  font-size: 1.32rem;
}
.admin-dialog-xl .admin-dialog-foot {
  padding: 16px 28px;
}
.admin-dialog-xl .admin-dialog-body {
  padding: 22px 28px 28px;
  gap: 18px;
  max-height: min(88vh, 920px);
}
.admin-dialog-xl .admin-dialog-body input,
.admin-dialog-xl .admin-dialog-body select,
.admin-dialog-xl .admin-dialog-body textarea {
  padding: 11px 13px;
  font-size: 0.96rem;
}
.admin-dialog-xl .admin-dialog-body label {
  font-size: 0.93rem;
}
.admin-form-section-label {
  margin: 4px 0 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--admin-text, #0f172a);
  letter-spacing: -0.01em;
}
.admin-form-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  margin: 4px 0 0;
}
.admin-form-section-head .admin-form-section-label {
  margin: 0;
  flex-shrink: 0;
}
.admin-form-section-hint {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.35;
  flex: 1;
  min-width: min(100%, 280px);
}
.admin-dialog-lg .admin-dialog-head {
  padding: 18px 28px;
}
.admin-dialog-lg .admin-dialog-head h2 {
  font-size: 1.28rem;
}
.admin-dialog-lg .admin-dialog-foot {
  padding: 16px 28px;
}
.admin-dialog-lg .admin-dialog-body {
  padding: 20px 28px 24px;
  gap: 16px;
  max-height: min(78vh, 820px);
}
.admin-dialog-lg .admin-dialog-body input,
.admin-dialog-lg .admin-dialog-body select,
.admin-dialog-lg .admin-dialog-body textarea {
  padding: 10px 12px;
  font-size: 0.95rem;
  min-height: 44px;
}
.admin-dialog-lg .admin-dialog-body textarea {
  min-height: 80px;
}
.admin-dialog-lg .admin-dialog-body label {
  font-size: 0.92rem;
}
.admin-form-layout {
  display: grid;
  gap: 16px 24px;
}
.admin-form-span-full {
  grid-column: 1 / -1;
}
.admin-form-col {
  display: grid;
  gap: 12px;
  align-content: start;
}
@media (min-width: 768px) {
  .admin-form-layout {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 767px) {
  .admin-form-layout {
    grid-template-columns: 1fr;
  }
}
.admin-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  align-items: start;
}
.admin-form-row > * {
  min-width: 0;
}
.admin-form-row-3 {
  grid-template-columns: 1fr;
}
.admin-form-row-4 {
  grid-template-columns: 1fr;
}
.admin-form-row-compact {
  gap: 10px;
  align-items: end;
}
.admin-form-compact-label {
  display: grid;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--admin-muted, #64748b);
  min-width: 0;
}
.admin-form-compact-label .admin-form-compact-input,
.admin-form-compact-label .admin-form-compact-select {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--admin-text, #0f172a);
  padding: 7px 8px;
  min-width: 0;
  width: 100%;
}
.admin-form-compact-select {
  padding-right: 24px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.admin-form-compact-input.admin-input-readonly {
  padding: 7px 8px;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}
.admin-form-row-company-affiliation {
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .admin-form-row-company-affiliation {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
.admin-form-asp-id-label {
  min-width: 0;
}
.admin-form-store-register {
  max-width: 960px;
  margin: 0 auto;
}
.admin-form-row-store-org {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: end;
  width: 100%;
}
@media (max-width: 900px) {
  .admin-form-row-store-org {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .admin-form-row-store-org {
    grid-template-columns: 1fr;
  }
}
.admin-form-stacked {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.admin-form-stacked-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px 14px;
  align-items: center;
}
.admin-form-stacked-label {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--admin-text, #1e293b);
  line-height: 1.3;
  white-space: nowrap;
  display: block;
}
.admin-form-row-store-rep {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: end;
  width: 100%;
}
@media (max-width: 720px) {
  .admin-form-row-store-rep {
    grid-template-columns: 1fr;
  }
}
.admin-form-stacked-control {
  min-width: 0;
}
.admin-form-stacked-control input,
.admin-form-stacked-control select,
.admin-form-stacked-control textarea {
  width: 100%;
  box-sizing: border-box;
}
.admin-form-stacked-control textarea {
  min-height: 72px;
  resize: vertical;
}
.admin-form-postal-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
  min-width: 0;
}
.admin-form-postal-row input {
  flex: 1 1 auto;
  min-width: 0;
}
.admin-postal-search-btn {
  flex: 0 0 auto;
  min-width: 42px;
  padding: 0 10px;
  font-size: 0.95rem;
  line-height: 1;
}
@media (max-width: 640px) {
  .admin-form-stacked-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
.admin-form-asp-id-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
  min-width: 0;
}
.admin-form-asp-id-row .admin-form-compact-input {
  flex: 1 1 auto;
  min-width: 0;
}
.admin-asp-id-check-btn {
  flex: 0 0 auto;
  min-width: 72px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  height: auto;
  align-self: stretch;
}
.admin-asp-id-status {
  flex: 0 0 auto;
  align-self: center;
  margin: 0;
  padding: 0;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  min-width: 3.2em;
}
.admin-asp-id-status.hidden {
  display: none;
}
@media (min-width: 768px) {
  .admin-form-row-3 {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.15fr) minmax(0, 0.7fr);
  }
  .admin-form-row-4 {
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 0.95fr) minmax(0, 0.52fr) minmax(0, 1.15fr);
  }
  /* 본사(지사) · 대리점 · 회사 · 코드 · ASP · 매장명 */
  .admin-form-row-store-top {
    grid-template-columns:
      minmax(0, 0.9fr) minmax(0, 0.85fr) minmax(0, 0.9fr) minmax(0, 0.42fr) minmax(0, 1.05fr) minmax(0, 0.95fr);
  }
}
@media (min-width: 1200px) {
  .admin-form-row-4 {
    grid-template-columns: minmax(0, 0.75fr) minmax(0, 0.9fr) minmax(0, 0.48fr) minmax(0, 1.2fr);
  }
  .admin-form-row-store-top {
    grid-template-columns:
      minmax(0, 0.95fr) minmax(0, 0.9fr) minmax(0, 0.95fr) minmax(0, 0.4fr) minmax(0, 1.1fr) minmax(0, 1fr);
  }
}
.admin-form-row-contact {
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .admin-form-row-contact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.admin-form-row-contact3 {
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .admin-form-row-contact3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.admin-form-row-super-admin {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: end;
  width: 100%;
}
@media (max-width: 720px) {
  .admin-form-row-super-admin {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .admin-form-row-super-admin {
    grid-template-columns: 1fr;
  }
}
.admin-form-row-store-login {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: end;
  width: 100%;
}
@media (max-width: 560px) {
  .admin-form-row-store-login {
    grid-template-columns: 1fr;
  }
}
.admin-form-row-store-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px 12px;
  align-items: end;
  width: 100%;
}
@media (min-width: 768px) {
  .admin-form-row-store-meta {
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 0.6fr) minmax(0, 0.42fr) minmax(0, 1.4fr);
  }
  .admin-form-row-store-meta-edit {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.admin-form-row-biz {
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .admin-form-row-biz {
    grid-template-columns: minmax(0, 0.42fr) minmax(0, 1.58fr);
  }
}
.admin-form-row > label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  min-width: 0;
  width: 100%;
}
.admin-dialog-body label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  min-width: 0;
}
.admin-dialog-body label.admin-form-stacked-label {
  display: block;
  gap: 0;
  white-space: nowrap;
  align-self: center;
}
.admin-form-stacked-label.is-required {
  color: var(--admin-text, #1e293b);
}
.admin-form-row-store-asp {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 10px 12px;
  align-items: end;
  width: 100%;
}
.admin-form-row-store-asp-edit {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 720px) {
  .admin-form-row-store-asp,
  .admin-form-row-store-asp-edit {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 721px) and (max-width: 900px) {
  .admin-form-row-store-asp-edit {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.admin-dialog-body input,
.admin-dialog-body select,
.admin-dialog-body textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  font: inherit;
}
.admin-dialog-body select {
  padding-right: 28px;
}
.admin-dialog-body textarea { min-height: 72px; resize: vertical; }
.admin-dialog-body input.admin-input-readonly,
.admin-dialog-body input[readonly]:not([type="checkbox"]) {
  background: #f1f5f9;
  color: var(--admin-muted);
  cursor: default;
  min-height: 42px;
}

.admin-error { color: var(--admin-danger); font-size: 0.9rem; margin: 0; }
.admin-toast-host {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 8px;
  z-index: 9999;
}
.admin-toast {
  background: #111827;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.92rem;
}
.admin-toast.err { background: #991b1b; }

.hint { color: var(--admin-muted); font-size: 0.88rem; margin: 0; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-actions-text {
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  white-space: nowrap;
}
.admin-actions-text .btn-link {
  padding: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.admin-action-sep {
  display: inline-block;
  margin: 0 6px;
  color: var(--admin-muted, #94a3b8);
  font-weight: 400;
  user-select: none;
}
.admin-action-danger {
  color: var(--admin-danger, #dc2626) !important;
}

.admin-remote-login-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 72px;
}

.admin-remote-login-cell .btn-link {
  padding: 0;
}

.admin-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-top: 12px;
}
.admin-inline-form label {
  display: grid;
  gap: 6px;
  min-width: 180px;
  flex: 1;
  font-size: 0.9rem;
}
.admin-inline-form input {
  padding: 8px 10px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
}
.admin-file-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.admin-import-result {
  margin: 0 24px 12px;
  padding: 10px 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  color: #065f46;
  font-size: 0.9rem;
}

.type-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.82rem;
  background: #e0e7ff;
  color: #3730a3;
}
.type-pill.individual {
  background: #dbeafe;
  color: #1d4ed8;
}

.agency-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.82rem;
  white-space: nowrap;
}
.agency-pill.agency {
  background: #dbeafe;
  color: #1d4ed8;
}
.agency-pill.direct {
  background: #f1f5f9;
  color: #475569;
}

.admin-dialog-wide {
  width: min(1120px, 98vw);
  max-width: none;
}
.admin-dialog-pos-settings[open] {
  display: flex;
  flex-direction: column;
  width: min(1440px, 98vw);
  height: min(94vh, 960px);
  max-width: none;
  overflow: hidden;
}
.admin-dialog-pos-settings .admin-dialog-head {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  background: #fff;
}
.admin-dialog-pos-settings .admin-dialog-body-fill {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  padding: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}
.admin-dialog-pos-settings .admin-pos-settings-frame {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}
.admin-main-body:has(#tab-asp-settings.active) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#tab-asp-settings.admin-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding-bottom: 12px;
}
.admin-app.admin-asp-settings-inner-scroll .admin-main-body {
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
}
html.admin-asp-settings-lock,
html.admin-asp-settings-lock body {
  height: 100%;
  overflow: hidden;
}
.admin-asp-settings-board {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  height: 100%;
}
.admin-asp-settings-toolbar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.admin-asp-settings-store-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
}
.admin-asp-settings-store-select {
  min-width: 220px;
  max-width: min(420px, 100%);
  flex: 1 1 220px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font: inherit;
}
.admin-asp-settings-hint {
  flex: 0 0 auto;
  margin: 0;
}
.admin-asp-settings-empty {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #d1d5db;
  border-radius: 12px;
  background: #f8fafc;
  min-height: 200px;
}
.admin-asp-settings-empty.hidden,
.admin-asp-settings-frame-wrap.hidden {
  display: none !important;
}
.admin-asp-settings-frame-wrap {
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
}
.admin-asp-settings-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #f8fafc;
}
html[data-admin-theme="dark"] .admin-asp-settings-store-label {
  color: #e5e7eb;
}
html[data-admin-theme="dark"] .admin-asp-settings-store-select {
  background: #111827;
  border-color: #374151;
  color: #f3f4f6;
}
html[data-admin-theme="dark"] .admin-asp-settings-empty,
html[data-admin-theme="dark"] .admin-asp-settings-frame-wrap {
  background: #0f172a;
  border-color: #334155;
}
.admin-stores-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
  border-collapse: collapse;
}
.admin-stores-table .admin-actions {
  flex-wrap: nowrap;
  white-space: nowrap;
}
.admin-stores-table td.admin-actions {
  min-width: 280px;
}
.admin-dashboard-stores-table td.admin-actions,
.admin-stores-table td.admin-actions .btn-link {
  white-space: nowrap;
}
.admin-stores-table th,
.admin-stores-table td {
  white-space: nowrap;
  padding: 10px 12px;
  border: 1px solid #d8dee8;
}
.admin-stores-table th {
  background: #f1f5f9;
  border-bottom-color: #c5cedb;
}
.admin-stores-table .admin-actions .btn-pos-settings {
  flex: 0 0 auto;
  padding: 6px 10px;
  font-size: 12px;
}
.admin-store-network {
  font-size: 12px;
  line-height: 1.35;
  min-width: 120px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.admin-store-network a {
  white-space: nowrap;
}
.admin-store-network-sep {
  color: var(--admin-muted);
  margin: 0 2px;
}
.btn-pos-settings-close {
  position: relative;
  z-index: 3;
  min-width: 36px;
  min-height: 36px;
}
.admin-terminal-list {
  margin-top: 8px;
  overflow-x: auto;
}
.admin-terminal-list .admin-table {
  width: 100%;
  min-width: 1080px;
}
.admin-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.admin-terminal-list .admin-actions {
  flex-wrap: nowrap;
  white-space: nowrap;
}
.admin-terminal-list td.admin-actions {
  min-width: 340px;
}
.admin-terminal-list .admin-actions .btn-ghost {
  flex: 0 0 auto;
  padding: 6px 10px;
  font-size: 12px;
}
.admin-scope-hint {
  margin: 0 0 10px;
}
.admin-scope-hint code {
  font-family: ui-monospace, monospace;
  font-size: 0.92em;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
}
.admin-scope-code {
  font-family: ui-monospace, monospace;
  font-size: 0.92em;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  color: #1e40af;
}
.admin-access-level {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}
.level-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.level-pill.platform { background: #ede9fe; color: #5b21b6; }
.level-pill.head_office { background: #e0e7ff; color: #3730a3; }
.level-pill.headquarters { background: #cffafe; color: #0e7490; }
.level-pill.agency { background: #dbeafe; color: #1d4ed8; }
.level-pill.company { background: #dcfce7; color: #166534; }
.level-pill.store { background: #dbeafe; color: #1d4ed8; }
.admin-access-table .admin-access-platform { background: #faf5ff; }
.hint-inline {
  font-size: 12px;
  color: #64748b;
}
.admin-auth-key-field textarea {
  width: 100%;
  font-family: ui-monospace, monospace;
  font-size: 13px;
}

.pos-auth-expired {
  color: #dc2626;
  font-weight: 600;
}

.admin-org-tree-panel {
  margin: 0 24px 24px;
  padding: 16px 18px;
  background: var(--admin-panel);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
}
.admin-tree-empty { padding: 24px; text-align: center; }

.admin-tree-root,
.admin-tree-children {
  list-style: none;
  margin: 0;
  padding: 0;
}
.admin-tree-children {
  margin-left: 0;
}
.admin-tree-node:not(.expanded) > .admin-tree-children {
  display: none;
}
.admin-tree-node:not(.expanded) > .admin-tree-row .admin-tree-toggle {
  transform: rotate(-90deg);
}
.admin-tree-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  padding-left: calc(8px + var(--depth, 0) * 20px);
  border-radius: 8px;
}
.admin-tree-row:hover {
  background: #f8fafc;
}
.admin-tree-toggle {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--admin-muted);
  font-size: 0.75rem;
  flex-shrink: 0;
}
.admin-tree-spacer {
  width: 24px;
  flex-shrink: 0;
}
.admin-tree-badge {
  display: inline-block;
  min-width: 72px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  flex-shrink: 0;
}
.admin-tree-badge.platform { background: #1e293b; color: #fff; }
.admin-tree-badge.agency { background: #dbeafe; color: #1d4ed8; }
.admin-tree-badge.franchise { background: #e0e7ff; color: #3730a3; }
.admin-tree-badge.individual { background: #dbeafe; color: #1d4ed8; }
.admin-tree-badge.store { background: #dcfce7; color: #166534; }
.admin-tree-badge.terminal { background: #f3e8ff; color: #6b21a8; }
.admin-tree-label { font-weight: 500; }
.admin-tree-code {
  color: var(--admin-muted);
  font-size: 0.85rem;
}
.admin-tree-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.admin-tree-node.inactive-node .admin-tree-label {
  color: var(--admin-muted);
  text-decoration: line-through;
}
.admin-view-toggle {
  display: inline-flex;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  overflow: hidden;
}
.admin-view-toggle .btn-ghost {
  border: none;
  border-radius: 0;
}
.admin-view-toggle .btn-ghost.active {
  background: var(--admin-primary);
  color: #fff;
}

@media (max-width: 760px) {
  .admin-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .admin-header-actions {
    justify-content: space-between;
    width: 100%;
  }
  .admin-toolbar input:not([type="checkbox"]):not([type="radio"]),
  .admin-toolbar select { min-width: 140px; flex: 1; }
  .admin-form-row {
    grid-template-columns: 1fr;
  }
  .admin-dialog,
  .admin-dialog-md,
  .admin-dialog-lg,
  .admin-dialog-xl,
  .admin-dialog-full {
    width: calc(100vw - 8px);
    height: calc(100vh - 8px);
    max-height: calc(100vh - 8px);
  }
  .admin-dialog-full .admin-dialog-body {
    max-height: none;
  }
  .admin-dialog-body {
    padding: 14px 16px;
    max-height: min(72vh, none);
  }
  .admin-dialog-lg .admin-dialog-body,
  .admin-dialog-xl .admin-dialog-body {
    padding: 16px;
    max-height: min(78vh, none);
  }
  .admin-dialog-scroll-top {
    right: 12px;
    bottom: 10px;
  }
}

@media (min-width: 1200px) {
  .admin-dialog-lg {
    width: min(960px, calc(100vw - 48px));
  }
  .admin-dialog-xl {
    width: min(1220px, calc(100vw - 40px));
  }
  .admin-dialog-xl .admin-dialog-body {
    max-height: min(90vh, 960px);
  }
}

@media (min-width: 1600px) {
  .admin-dialog-xl {
    width: min(1280px, calc(100vw - 64px));
  }
}

.admin-perm-tier-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.admin-perm-tier-tab {
  border: 1px solid var(--admin-border, #d8dee8);
  background: var(--admin-panel, #fff);
  color: var(--admin-text, #1c1410);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}

.admin-perm-tier-tab.active {
  background: var(--admin-primary, #2563EB);
  border-color: var(--admin-primary, #2563EB);
  color: #fff;
}

.admin-perm-matrix-wrap {
  border: 1px solid var(--admin-border, #d8dee8);
  border-radius: 10px;
  background: var(--admin-panel, #fff);
  color: var(--admin-text, #1c1410);
  padding: 12px 16px;
  max-height: min(72vh, 860px);
  overflow: auto;
}

.admin-perm-group {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--admin-border, #e8ecf2);
}

.admin-perm-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.admin-perm-group-pos {
  padding-left: 10px;
  border-left: 3px solid var(--admin-primary, #2563EB);
}

.admin-perm-group-pos h3 {
  color: var(--admin-primary, #2563EB);
}

.admin-perm-group h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.admin-perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px 14px;
}

.admin-perm-grid label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.35;
}

.admin-perm-actions {
  margin-top: 14px;
}

.admin-operator-form select[name="permissionTier"] {
  width: 100%;
}

.admin-analytics-cards {
  margin-top: 12px;
}

.admin-analytics-cards .admin-card span,
.admin-analytics-cards .admin-card strong {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
}

.admin-analytics-cards .admin-card span {
  color: var(--admin-muted);
  font-weight: 600;
}

.admin-analytics-cards .admin-card strong {
  margin-top: 6px;
}

.admin-card-note strong {
  color: var(--admin-ok);
  font-size: 0.92rem;
}

.admin-analytics-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.admin-analytics-block {
  background: var(--admin-panel);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 16px;
}

.admin-analytics-block-wide {
  margin-top: 16px;
}

.admin-analytics-block h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.admin-analytics-chart {
  min-height: 220px;
}

.admin-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 200px;
  padding-top: 8px;
}

.admin-bar-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.admin-bar-fill {
  width: 100%;
  max-width: 48px;
  background: linear-gradient(180deg, #60a5fa, var(--admin-primary));
  border-radius: 6px 6px 2px 2px;
  min-height: 4px;
}

.admin-bar-label {
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--admin-muted);
  text-align: center;
  line-height: 1.25;
}

@media (max-width: 960px) {
  .admin-analytics-grid {
    grid-template-columns: 1fr;
  }
  .admin-shell {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }
  .admin-sidebar-nav.admin-tabs {
    flex-direction: row;
    flex-wrap: wrap;
    overflow: visible;
  }
  .admin-sidebar-nav .admin-tab {
    width: auto;
    flex: 1 1 auto;
  }
  .admin-main {
    min-height: 0;
  }
}

.admin-sidebar-section {
  margin: 12px 12px 4px;
  padding: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #80868b;
}
.admin-account-card {
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  max-width: 720px;
}
.admin-account-card h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}
.admin-notice-editor-dl .admin-notice-view-row dd input[type="text"],
.admin-notice-editor-dl .admin-notice-view-row dd select,
.admin-notice-editor-dl .admin-notice-view-row dd textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 40px;
  border: 1px solid var(--admin-border, #d1d5db);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  background: #fff;
  color: inherit;
}
.admin-notice-editor-dl .admin-notice-view-row dd textarea {
  min-height: 220px;
  height: min(48vh, 420px);
  resize: vertical;
  line-height: 1.55;
  font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace;
  font-size: 0.9rem;
}
.admin-notice-inline-check {
  font-weight: 500 !important;
}
html[data-admin-theme="dark"] .admin-notices-detail-actions {
  border-top-color: #2a2e36;
}
html[data-admin-theme="dark"] .admin-notice-editor-dl .admin-notice-view-row dd input[type="text"],
html[data-admin-theme="dark"] .admin-notice-editor-dl .admin-notice-view-row dd select,
html[data-admin-theme="dark"] .admin-notice-editor-dl .admin-notice-view-row dd textarea {
  background: #1f232b;
  border-color: #2a2e36;
  color: #f3f4f6;
}
.admin-notices-toolbar {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
}
.admin-notices-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.admin-notices-search select,
.admin-notices-search input[type="search"] {
  min-height: 38px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: inherit;
}
.admin-notices-search input[type="search"] {
  min-width: 220px;
}
.admin-notices-table-wrap {
  border-radius: 8px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.admin-notices-table thead th {
  background: #4b5563;
  color: #fff;
  font-weight: 600;
  border-bottom-color: #374151;
}
.admin-notices-table td.center,
.admin-notices-table th.center {
  text-align: center;
}
.admin-notices-table td.num,
.admin-notices-table th.num {
  text-align: right;
  width: 72px;
  white-space: nowrap;
}
.admin-notice-title-link {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  max-width: 100%;
}
.admin-notice-title-link:hover {
  color: #1d4ed8;
}
.admin-notice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4b5563;
}
.admin-notice-icon-check {
  color: #111827;
}
.admin-notice-actions {
  white-space: nowrap;
}
.admin-notice-actions .btn-ghost,
.admin-notice-actions .btn-danger {
  margin: 0 2px;
}
.admin-notices-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 4px 0 8px;
  flex-shrink: 0;
}
.admin-page-btn {
  min-width: 40px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  font-size: 0.85rem;
  cursor: pointer;
}
.admin-page-btn:hover:not(:disabled) {
  background: #f3f4f6;
}
.admin-page-btn.active {
  background: #e5e7eb;
  font-weight: 700;
}
.admin-page-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.admin-form-check {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.admin-form-check input {
  width: auto !important;
  margin: 0;
}
.admin-notice-view-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 14px;
  color: var(--admin-muted);
  font-size: 0.88rem;
}
.admin-notice-view-body {
  padding-top: 4px;
}
.admin-notice-view-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 12px 16px;
  align-items: start;
  padding: 14px 4px;
  border-bottom: 1px solid #e5e7eb;
}
@media (max-width: 640px) {
  .admin-notice-view-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
.admin-notice-view-row:first-child {
  padding-top: 4px;
}
.admin-notice-view-row dt {
  margin: 0;
  font-weight: 700;
  color: #374151;
  white-space: nowrap;
}
.admin-notice-view-row dd {
  margin: 0;
  color: #111827;
  word-break: break-word;
}
.admin-notice-view-row-body {
  border-bottom: 0;
  min-height: 200px;
  flex: 1;
}
.admin-notice-view-dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.admin-notice-view-content {
  white-space: pre-wrap;
  line-height: 1.65;
  font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace;
  font-size: 0.9rem;
  min-height: 200px;
}
.admin-notice-file-link {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
.admin-notice-view-foot {
  justify-content: flex-end;
}
html[data-admin-theme="dark"] .admin-notice-view-row {
  border-bottom-color: #2a2e36;
}
html[data-admin-theme="dark"] .admin-notice-view-row dt {
  color: #d1d5db;
}
html[data-admin-theme="dark"] .admin-notice-view-row dd {
  color: #f3f4f6;
}
html[data-admin-theme="dark"] .admin-notice-file-link {
  color: #93c5fd;
}
.admin-service-inquiry-toolbar {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-service-inquiry-toolbar input[type="search"] {
  min-width: min(420px, 100%);
  min-height: 38px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}
.admin-profile-card {
  max-width: 960px;
}
.admin-profile-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.admin-profile-form-body {
  display: grid;
  gap: 12px;
  padding: 8px 0 0;
  overflow: auto;
}
.admin-profile-form-body .admin-form-row {
  margin: 0;
}
.admin-profile-details {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
}
.admin-profile-details > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #e8eaed;
  border-radius: 10px;
  background: #f8fafc;
}
.admin-profile-details dt {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--admin-muted);
}
.admin-profile-details dd {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
}
html[data-admin-theme="dark"] .admin-sidebar-section { color: #9ca3af; }
html[data-admin-theme="dark"] .admin-account-card,
html[data-admin-theme="dark"] .admin-profile-details > div {
  background: #1a1d24;
  border-color: #2a2e36;
}
html[data-admin-theme="dark"] .admin-notices-search select,
html[data-admin-theme="dark"] .admin-notices-search input[type="search"],
html[data-admin-theme="dark"] .admin-page-btn {
  background: #1f232b;
  border-color: #2a2e36;
  color: #f3f4f6;
}
html[data-admin-theme="dark"] .admin-page-btn.active {
  background: #374151;
}
html[data-admin-theme="dark"] .admin-notice-title-link {
  color: #93c5fd;
}
html[data-admin-theme="dark"] .admin-notice-icon {
  color: #d1d5db;
}
html[data-admin-theme="dark"] {
  --admin-bg: #0f1115;
  --admin-panel: #1a1d24;
  --admin-border: #2a2e36;
  --admin-text: #f3f4f6;
  --admin-muted: #9ca3af;
}
html[data-admin-theme="dark"] body {
  background: #0f1115;
  color: #f3f4f6;
}
html[data-admin-theme="dark"] .admin-shell {
  background: #0f1115;
}
html[data-admin-theme="dark"] .admin-sidebar {
  background: #16181d;
  border-right-color: #2a2e36;
  color: #f3f4f6;
}
html[data-admin-theme="dark"] .admin-sidebar-title { color: #f3f4f6; }
html[data-admin-theme="dark"] .admin-sidebar-subtitle { color: #9ca3af; }
html[data-admin-theme="dark"] .admin-sidebar-search-input {
  background: #1f232b;
  border-color: #2a2e36;
  color: #f3f4f6;
}
html[data-admin-theme="dark"] .admin-sidebar-nav .admin-tab {
  color: #d1d5db;
}
html[data-admin-theme="dark"] .admin-sidebar-nav .admin-tab.active {
  background: #1e3a5f;
  color: #93c5fd;
}
html[data-admin-theme="dark"] .admin-sidebar-foot {
  border-top-color: #2a2e36;
}
html[data-admin-theme="dark"] .admin-theme-btn {
  background: #1e3a5f;
  color: #93c5fd;
}
html[data-admin-theme="dark"] .admin-main-header.admin-header {
  background: #16181d;
  border-bottom-color: #2a2e36;
  color: #f3f4f6;
}
html[data-admin-theme="dark"] .admin-main-body {
  background: #0f1115;
}
html[data-admin-theme="dark"] .admin-card,
html[data-admin-theme="dark"] .admin-installer-card,
html[data-admin-theme="dark"] .admin-dashboard-stores-card,
html[data-admin-theme="dark"] .admin-stat-box {
  background: #1a1d24;
  border-color: #2a2e36;
}
html[data-admin-theme="dark"] .admin-dashboard-stores-search input {
  background: #1f232b;
  color: #f3f4f6;
  border-color: #3f4654;
}
html[data-admin-theme="dark"] .admin-card strong,
html[data-admin-theme="dark"] .admin-stat-box strong {
  color: #f3f4f6;
}
html[data-admin-theme="dark"] .admin-stat-label {
  color: #94a3b8;
}

.admin-loyalty-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.admin-loyalty-toolbar input[type="search"] {
  flex: 1;
  min-width: 160px;
}
.admin-loyalty-store-filter {
  flex: 0 1 140px;
  max-width: 160px;
  min-width: 100px;
}
.admin-loyalty-panel .admin-scope-hint {
  margin: 0 0 8px;
}
.admin-loyalty-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
  align-items: stretch;
  min-height: calc(100vh - 168px);
}
@media (max-width: 1100px) {
  .admin-loyalty-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }
}
.admin-loyalty-list-pane {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.admin-loyalty-list {
  flex: 1;
  overflow: auto;
  max-height: calc(100vh - 220px);
}
.admin-loyalty-table {
  font-size: 0.9rem;
  white-space: nowrap;
}
.admin-loyalty-table th,
.admin-loyalty-table td {
  padding: 7px 8px;
}
.admin-loyalty-row {
  cursor: pointer;
  transition: background 0.12s ease;
}
.admin-loyalty-row:hover { background: #f1f5f9; }
.admin-loyalty-row.is-selected {
  background: #fff7ed;
  box-shadow: inset 3px 0 0 #f97316;
}
.admin-loyalty-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
}
.admin-loyalty-pager-info {
  font-size: 0.85rem;
  color: var(--admin-muted);
}
.admin-loyalty-pager-btns {
  display: flex;
  gap: 6px;
}
.admin-loyalty-detail {
  min-width: 0;
  max-width: 300px;
  height: calc(100vh - 168px);
  overflow: hidden;
}
.admin-loyalty-detail-card {
  border: 1px solid #e8eaed;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  overflow: hidden;
}
.admin-loyalty-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.admin-loyalty-detail-head h3 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.25;
}
.admin-loyalty-status-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  white-space: nowrap;
}
.admin-loyalty-dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0;
  flex-shrink: 0;
}
.admin-loyalty-dl > div {
  display: grid;
  gap: 1px;
  padding: 5px 7px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}
.admin-loyalty-dl-span { grid-column: 1 / -1; }
.admin-loyalty-dl dt { margin: 0; font-size: 0.7rem; color: var(--admin-muted); }
.admin-loyalty-dl dd { margin: 0; font-weight: 600; font-size: 0.84rem; word-break: break-all; }
.admin-loyalty-adjust { flex-shrink: 0; }
.admin-loyalty-adjust-row {
  display: grid;
  grid-template-columns: 1fr 64px;
  gap: 6px;
}
.admin-loyalty-adjust-row select,
.admin-loyalty-adjust-row input {
  min-width: 0;
  font-size: 0.82rem;
  padding: 5px 6px;
}
.admin-loyalty-adjust-row input[type="text"] { grid-column: 1 / -1; }
.admin-loyalty-adjust-row .btn-primary { grid-column: 1 / -1; }
.admin-loyalty-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex-shrink: 0;
}
.admin-loyalty-status-actions .btn-ghost {
  padding: 4px 8px;
  font-size: 0.78rem;
}
.admin-loyalty-ledger-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-shrink: 0;
}
.admin-loyalty-ledger-head h4 {
  margin: 0;
  font-size: 0.88rem;
}
.admin-loyalty-tx-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.admin-loyalty-tx {
  font-size: 0.78rem;
  width: 100%;
}
.admin-loyalty-tx th,
.admin-loyalty-tx td {
  padding: 4px 5px;
  white-space: nowrap;
}
.admin-loyalty-tx td.is-use { color: #b91c1c; font-weight: 600; }
.admin-loyalty-tx td.is-earn { color: #047857; font-weight: 600; }

/* ── Dark theme: buttons / inputs / panels (흰 배경 + 흰 글씨 방지) ── */
html[data-admin-theme="dark"] .btn-ghost,
html[data-admin-theme="dark"] .admin-file-btn.btn-ghost,
html[data-admin-theme="dark"] .admin-sidebar-logout {
  background: #1f232b;
  color: #e5e7eb;
  border-color: #3f4654;
}
html[data-admin-theme="dark"] .btn-ghost:hover:not(:disabled),
html[data-admin-theme="dark"] .admin-file-btn.btn-ghost:hover,
html[data-admin-theme="dark"] .admin-sidebar-logout:hover {
  background: #2a303c;
  border-color: #5b6474;
  color: #f9fafb;
}
html[data-admin-theme="dark"] .btn-danger {
  background: #1f232b;
  color: #fca5a5;
  border-color: #7f1d1d;
}
html[data-admin-theme="dark"] .btn-action-close {
  background: #1f232b;
  color: #e5e7eb;
  border-color: #3f4654;
}
html[data-admin-theme="dark"] .btn-action-close:active {
  background: #1e3a5f;
  color: #93c5fd;
  border-color: #2563eb;
}
html[data-admin-theme="dark"] .btn-refresh-icon {
  color: #93c5fd;
}
html[data-admin-theme="dark"] .admin-view-toggle {
  border-color: #3f4654;
  background: #16181d;
}
html[data-admin-theme="dark"] .admin-view-toggle .btn-ghost {
  background: transparent;
  color: #d1d5db;
  border-color: transparent;
}
html[data-admin-theme="dark"] .admin-view-toggle .btn-ghost.active {
  background: var(--admin-primary);
  color: #fff;
}
html[data-admin-theme="dark"] .admin-main-header.admin-header {
  color: #f3f4f6;
}
html[data-admin-theme="dark"] .admin-main-header .admin-header-user {
  color: #9ca3af;
}
html[data-admin-theme="dark"] .admin-main-header .admin-header-lang select,
html[data-admin-theme="dark"] .admin-header-lang select,
html[data-admin-theme="dark"] .admin-login-lang {
  background: #1f232b;
  color: #f3f4f6;
  border-color: #3f4654;
}
html[data-admin-theme="dark"] .admin-main-header .btn-ghost {
  background: #1f232b;
  color: #e5e7eb;
  border: 1px solid #3f4654;
  border-radius: 999px;
}
html[data-admin-theme="dark"] .admin-main-header .btn-ghost:hover {
  background: #2a303c;
  border-color: #5b6474;
}
html[data-admin-theme="dark"] .admin-toolbar input:not([type="checkbox"]):not([type="radio"]),
html[data-admin-theme="dark"] .admin-toolbar select,
html[data-admin-theme="dark"] .admin-select,
html[data-admin-theme="dark"] .admin-inline-form input,
html[data-admin-theme="dark"] .admin-dialog input,
html[data-admin-theme="dark"] .admin-dialog select,
html[data-admin-theme="dark"] .admin-dialog textarea,
html[data-admin-theme="dark"] .admin-form-row input,
html[data-admin-theme="dark"] .admin-form-row select,
html[data-admin-theme="dark"] .admin-form-row textarea,
html[data-admin-theme="dark"] .admin-profile-form input,
html[data-admin-theme="dark"] .admin-profile-form select,
html[data-admin-theme="dark"] .admin-profile-form textarea,
html[data-admin-theme="dark"] .admin-loyalty-toolbar input,
html[data-admin-theme="dark"] .admin-loyalty-toolbar select,
html[data-admin-theme="dark"] .admin-loyalty-adjust-row input,
html[data-admin-theme="dark"] .admin-loyalty-adjust-row select {
  background: #1f232b;
  color: #f3f4f6;
  border-color: #3f4654;
}
html[data-admin-theme="dark"] .admin-toolbar input::placeholder,
html[data-admin-theme="dark"] .admin-dialog input::placeholder,
html[data-admin-theme="dark"] .admin-loyalty-toolbar input::placeholder {
  color: #6b7280;
}
html[data-admin-theme="dark"] .admin-table-wrap,
html[data-admin-theme="dark"] .admin-org-tree-panel,
html[data-admin-theme="dark"] .admin-panel,
html[data-admin-theme="dark"] .admin-notices-detail-card,
html[data-admin-theme="dark"] .admin-profile-card,
html[data-admin-theme="dark"] .admin-loyalty-detail-card,
html[data-admin-theme="dark"] .admin-dialog,
html[data-admin-theme="dark"] .admin-dialog .admin-dialog-body {
  background: #1a1d24;
  color: #f3f4f6;
  border-color: #2a2e36;
}
html[data-admin-theme="dark"] .admin-dialog-head,
html[data-admin-theme="dark"] .admin-dialog-foot {
  background: #16181d;
  border-color: #2a2e36;
}
html[data-admin-theme="dark"] .admin-table th {
  background: #16181d;
  color: #d1d5db;
  border-color: #2a2e36;
}
html[data-admin-theme="dark"] .admin-table td {
  border-color: #2a2e36;
  color: #e5e7eb;
}
html[data-admin-theme="dark"] .admin-dashboard-stores-table th,
html[data-admin-theme="dark"] .admin-stores-table th {
  background: #16181d;
  border-color: #3a404c;
}
html[data-admin-theme="dark"] .admin-dashboard-stores-table td,
html[data-admin-theme="dark"] .admin-stores-table td {
  border-color: #3a404c;
}
html[data-admin-theme="dark"] .admin-table tbody tr:hover td {
  background: #22262f;
}
html[data-admin-theme="dark"] .admin-loyalty-row:hover {
  background: #22262f;
}
html[data-admin-theme="dark"] .admin-loyalty-row.is-selected {
  background: #2a2419;
  box-shadow: inset 3px 0 0 #f97316;
}
html[data-admin-theme="dark"] .admin-loyalty-dl > div {
  background: #16181d;
  border-color: #2a2e36;
}
html[data-admin-theme="dark"] .admin-tree-row:hover {
  background: #22262f;
}
html[data-admin-theme="dark"] .admin-tree-code,
html[data-admin-theme="dark"] .hint,
html[data-admin-theme="dark"] .admin-scope-hint {
  color: #9ca3af;
}
html[data-admin-theme="dark"] .status-pill.active {
  background: #14532d;
  color: #bbf7d0;
}
html[data-admin-theme="dark"] .status-pill.suspended {
  background: #78350f;
  color: #fde68a;
}
html[data-admin-theme="dark"] .status-pill.terminated,
html[data-admin-theme="dark"] .status-pill.inactive {
  background: #374151;
  color: #e5e7eb;
}
html[data-admin-theme="dark"] .admin-import-result {
  background: #052e1c;
  border-color: #166534;
  color: #bbf7d0;
}
html[data-admin-theme="dark"] .admin-input-readonly,
html[data-admin-theme="dark"] input.admin-input-readonly {
  background: #16181d;
  color: #9ca3af;
}
html[data-admin-theme="dark"] .admin-dialog-body input,
html[data-admin-theme="dark"] .admin-dialog-body select,
html[data-admin-theme="dark"] .admin-dialog-body textarea,
html[data-admin-theme="dark"] .admin-profile-form-body input,
html[data-admin-theme="dark"] .admin-profile-form-body select,
html[data-admin-theme="dark"] .admin-profile-form-body textarea,
html[data-admin-theme="dark"] .admin-dialog-body input.admin-input-readonly,
html[data-admin-theme="dark"] .admin-dialog-body input[readonly]:not([type="checkbox"]),
html[data-admin-theme="dark"] .admin-profile-form-body input.admin-input-readonly,
html[data-admin-theme="dark"] .admin-profile-form-body input[readonly]:not([type="checkbox"]),
html[data-admin-theme="dark"] .admin-form-compact-input.admin-input-readonly {
  background: #1f232b;
  color: #e5e7eb;
  border-color: #3f4654;
}
html[data-admin-theme="dark"] .admin-dialog-body input.admin-input-readonly,
html[data-admin-theme="dark"] .admin-dialog-body input[readonly]:not([type="checkbox"]),
html[data-admin-theme="dark"] .admin-profile-form-body input.admin-input-readonly,
html[data-admin-theme="dark"] .admin-profile-form-body input[readonly]:not([type="checkbox"]),
html[data-admin-theme="dark"] .admin-form-compact-input.admin-input-readonly {
  background: #16181d;
  color: #d1d5db;
}
html[data-admin-theme="dark"] .admin-perm-tier-tab {
  background: #1f232b;
  color: #e5e7eb;
  border-color: #3f4654;
}
html[data-admin-theme="dark"] .admin-perm-tier-tab:hover {
  background: #2a303c;
  color: #f9fafb;
}
html[data-admin-theme="dark"] .admin-perm-tier-tab.active {
  background: var(--admin-primary);
  border-color: var(--admin-primary);
  color: #fff;
}
html[data-admin-theme="dark"] .admin-perm-matrix-wrap {
  background: #1a1d24;
  border-color: #2a2e36;
  color: #e5e7eb;
}
html[data-admin-theme="dark"] .admin-perm-group {
  border-bottom-color: #2a2e36;
}
html[data-admin-theme="dark"] .admin-perm-grid label {
  color: #e5e7eb;
}
html[data-admin-theme="dark"] .admin-perm-group-pos h3 {
  color: #93c5fd;
}
html[data-admin-theme="dark"] .admin-installer-form {
  background: #16181d;
  border-color: #3f4654;
}
html[data-admin-theme="dark"] .admin-installer-control,
html[data-admin-theme="dark"] .admin-installer-form select,
html[data-admin-theme="dark"] .admin-installer-form input[type="text"],
html[data-admin-theme="dark"] .admin-installer-file-btn {
  background: #1f232b;
  color: #f3f4f6;
  border-color: #3f4654;
}
html[data-admin-theme="dark"] .admin-installer-label,
html[data-admin-theme="dark"] .admin-installer-check-wrap {
  color: #e5e7eb;
}
html[data-admin-theme="dark"] .admin-installer-file-hint {
  color: #9ca3af;
}
html[data-admin-theme="dark"] .admin-table tbody tr td {
  background: #1a1d24;
}
html[data-admin-theme="dark"] .admin-table tr:hover td,
html[data-admin-theme="dark"] .admin-table tbody tr:hover td {
  background: #22262f;
}
html[data-admin-theme="dark"] .installer-row-latest,
html[data-admin-theme="dark"] .installer-row-latest td {
  background: #152033;
  color: #e5e7eb;
}
html[data-admin-theme="dark"] .installer-row-latest:hover td {
  background: #1a2740;
}
html[data-admin-theme="dark"] .admin-notices-detail-card,
html[data-admin-theme="dark"] .admin-profile-board {
  color: #f3f4f6;
}
html[data-admin-theme="dark"] .admin-card {
  background: #1a1d24;
  border-color: #2a2e36;
}
html[data-admin-theme="dark"] .type-pill {
  background: #312e81;
  color: #c7d2fe;
}
html[data-admin-theme="dark"] .agency-pill.agency {
  background: #1e3a5f;
  color: #93c5fd;
}
html[data-admin-theme="dark"] .level-pill.platform { background: #4c1d95; color: #ddd6fe; }
html[data-admin-theme="dark"] .level-pill.head_office { background: #312e81; color: #c7d2fe; }
html[data-admin-theme="dark"] .level-pill.headquarters { background: #155e75; color: #a5f3fc; }
html[data-admin-theme="dark"] .level-pill.agency { background: #1e3a5f; color: #93c5fd; }
html[data-admin-theme="dark"] .level-pill.company { background: #14532d; color: #bbf7d0; }
html[data-admin-theme="dark"] .level-pill.store { background: #1e3a5f; color: #93c5fd; }
html[data-admin-theme="dark"] .admin-login-card,
html[data-admin-theme="dark"] .admin-login-box,
html[data-admin-theme="dark"] .admin-login-card-shell,
html[data-admin-theme="dark"] .admin-login-form-wrap {
  background: #1a1d24;
  border-color: #2a2e36;
  color: #f3f4f6;
}
html[data-admin-theme="dark"] .admin-login-card input,
html[data-admin-theme="dark"] .admin-login-box input,
html[data-admin-theme="dark"] .admin-login-card select,
html[data-admin-theme="dark"] .admin-login-box select,
html[data-admin-theme="dark"] .admin-login-field input,
html[data-admin-theme="dark"] .admin-login-lang {
  background: #1f232b;
  color: #f3f4f6;
  border-color: #3f4654;
}
html[data-admin-theme="dark"] .admin-login-heading,
html[data-admin-theme="dark"] .admin-login-label {
  color: #e5e7eb;
}
html[data-admin-theme="dark"] .admin-login-screen {
  background: #0f1115;
}
