/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand */
  --brand: #4F46E5;
  --brand-hover: #4338CA;
  --brand-light: #EEF2FF;
  --brand-text: #6366F1;

  /* Sidebar */
  --sidebar-bg: #0F172A;
  --sidebar-hover: #1E293B;
  --sidebar-active: #1E293B;
  --sidebar-text: #94A3B8;
  --sidebar-text-active: #F1F5F9;
  --sidebar-border: #1E293B;
  --sidebar-width: 240px;

  /* Surface */
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;

  /* Text */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;

  /* Status */
  --success: #10B981;
  --success-bg: #ECFDF5;
  --success-text: #065F46;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --warning-text: #92400E;
  --danger: #EF4444;
  --danger-bg: #FEF2F2;
  --danger-text: #991B1B;
  --info: #3B82F6;
  --info-bg: #EFF6FF;
  --info-text: #1E40AF;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.05);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
}

html { font-size: 14px; }

body {
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ============================================================
   Layout — Sidebar + Main
   ============================================================ */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  transition: transform .25s;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo-icon {
  width: 32px; height: 32px;
  background: var(--brand);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 15px;
  font-weight: 700;
  color: #F1F5F9;
  letter-spacing: -.3px;
}

.sidebar-logo-text span {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--sidebar-text);
  margin-top: 1px;
  letter-spacing: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--sidebar-text);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 10px 10px 6px;
  margin-top: 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s, color .15s;
  cursor: pointer;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

.sidebar-link.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
}

.sidebar-link.active .nav-icon { color: var(--brand-text); }

.nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: .8;
}

.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid var(--sidebar-border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
}

.user-card:hover { background: var(--sidebar-hover); }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--sidebar-text-active); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 11px; color: var(--sidebar-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Main content ── */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
}

.topbar {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-content {
  padding: 28px;
  flex: 1;
  overflow-x: hidden;
  max-width: 100%;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .1s;
  white-space: nowrap;
  line-height: 1;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 2px rgba(79,70,229,.3);
}
.btn-primary:hover { background: var(--brand-hover); }

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 1px 2px rgba(16,185,129,.3);
}
.btn-success:hover { background: #059669; }

.btn-outline {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn-outline:hover { background: var(--surface-2); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--surface-2); }

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid #FECACA;
}
.btn-danger:hover { background: #FEE2E2; }

.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-lg { padding: 11px 24px; font-size: 15px; }
.btn-block { width: 100%; }

.btn svg { width: 15px; height: 15px; }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-body { padding: 22px; }
.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ============================================================
   Stats Grid
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.stat-card-info { display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: .03em; text-transform: uppercase; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text-primary); letter-spacing: -.5px; line-height: 1; }
.stat-change { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.blue { background: var(--info-bg); color: var(--info); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.orange { background: var(--warning-bg); color: var(--warning); }
.stat-icon.purple { background: var(--brand-light); color: var(--brand); }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
}

.table thead tr {
  border-bottom: 1px solid var(--border);
}

.table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.table td {
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover td { background: var(--surface-2); }

.table .text-muted { color: var(--text-muted); font-size: 12.5px; }

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
}

.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-new                                         { background: var(--info-bg);         color: var(--info-text); }
.badge-collected, .badge-draft                     { background: var(--info-bg);         color: var(--info-text); }
.badge-dispatched, .badge-sent                     { background: var(--warning-bg);      color: var(--warning-text); }
.badge-tracking_uploaded                           { background: #EDE9FE;                color: #6D28D9; }
.badge-completed, .badge-confirmed, .badge-active  { background: var(--success-bg);      color: var(--success-text); }
.badge-pending                                     { background: var(--warning-bg);      color: var(--warning-text); }
.badge-expired, .badge-cancelled                   { background: var(--danger-bg);       color: var(--danger-text); }

/* ============================================================
   Forms
   ============================================================ */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 9px 13px;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-primary);
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control { resize: vertical; min-height: 90px; }

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

.form-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.form-divider::before, .form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-check input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--brand);
  cursor: pointer;
}
.form-check label {
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

/* ============================================================
   Alerts / Flash messages
   ============================================================ */
.alerts { position: fixed; top: 16px; right: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: 360px; }

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: slideIn .25s ease;
  border: 1px solid;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.alert-success { background: var(--success-bg); color: var(--success-text); border-color: #A7F3D0; }
.alert-danger   { background: var(--danger-bg);  color: var(--danger-text);  border-color: #FECACA; }
.alert-warning  { background: var(--warning-bg); color: var(--warning-text); border-color: #FDE68A; }
.alert-info     { background: var(--info-bg);    color: var(--info-text);    border-color: #BFDBFE; }

/* ============================================================
   Auth pages
   ============================================================ */
.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-panel-left {
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
}

.auth-panel-left-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-logo-icon {
  width: 36px; height: 36px;
  background: var(--brand);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.auth-logo-text {
  font-size: 18px;
  font-weight: 800;
  color: #F1F5F9;
  letter-spacing: -.3px;
}

.auth-headline {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 0;
}

.auth-headline h2 {
  font-size: 32px;
  font-weight: 800;
  color: #F1F5F9;
  line-height: 1.3;
  letter-spacing: -.5px;
  margin-bottom: 16px;
}

.auth-headline p {
  font-size: 15px;
  color: var(--sidebar-text);
  line-height: 1.8;
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 32px;
}

.auth-feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sidebar-text);
  font-size: 13.5px;
}

.auth-feature-item span:first-child {
  width: 22px; height: 22px;
  background: rgba(99,102,241,.25);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  color: #A5B4FC;
  flex-shrink: 0;
}

.auth-bottom {
  font-size: 12px;
  color: #475569;
}

.auth-panel-right {
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.auth-form-wrap {
  width: 100%;
  max-width: 420px;
}

.auth-form-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -.4px;
}

.auth-form-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.auth-footer-link {
  text-align: center;
  margin-top: 22px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.auth-footer-link a {
  color: var(--brand);
  font-weight: 600;
}

/* ============================================================
   Dashboard grid
   ============================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ============================================================
   Page header
   ============================================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.page-header-left { display: flex; flex-direction: column; gap: 3px; }
.page-title { font-size: 20px; font-weight: 800; color: var(--text-primary); letter-spacing: -.4px; }
.page-desc { font-size: 13px; color: var(--text-muted); }

.page-header-actions { display: flex; gap: 8px; }

/* ============================================================
   Empty state
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
  color: var(--text-muted);
  gap: 10px;
}

.empty-state-icon {
  font-size: 36px;
  opacity: .4;
}

.empty-state-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-state-desc {
  font-size: 13px;
  text-align: center;
  max-width: 280px;
  line-height: 1.6;
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  padding: 16px 0 4px;
}

.page-link {
  min-width: 32px; height: 32px;
  padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: background .1s;
}

.page-link:hover { background: var(--surface-2); }
.page-link.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ============================================================
   Payment / Subscription
   ============================================================ */
.payment-layout {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.payment-container {
  width: 100%;
  max-width: 960px;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 32px;
  align-items: start;
}

.payment-left h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.5px;
  margin-bottom: 10px;
}

.payment-left p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 28px;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.feature-check {
  width: 22px; height: 22px;
  background: var(--success-bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.payment-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.payment-card-header {
  background: var(--sidebar-bg);
  padding: 28px 28px 24px;
  text-align: center;
}

.payment-card-header .plan-label {
  font-size: 11px;
  font-weight: 700;
  color: #A5B4FC;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.payment-card-header .plan-price {
  font-size: 44px;
  font-weight: 900;
  color: #F1F5F9;
  letter-spacing: -1px;
  line-height: 1;
}

.payment-card-header .plan-price sup {
  font-size: 20px;
  font-weight: 600;
  vertical-align: top;
  margin-top: 10px;
  margin-right: 2px;
}

.payment-card-header .plan-price sub {
  font-size: 15px;
  font-weight: 400;
  color: #94A3B8;
  vertical-align: baseline;
}

.payment-card-header .plan-desc {
  font-size: 12px;
  color: #64748B;
  margin-top: 8px;
}

.payment-card-body { padding: 28px; }

.payment-plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.payment-plan-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.payment-plan-features li::before {
  content: '✓';
  width: 18px; height: 18px;
  background: var(--success-bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--success);
  font-size: 10px;
  font-weight: 900;
  flex-shrink: 0;
}

.payment-notice {
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 14px;
  line-height: 1.6;
}

/* ============================================================
   Misc utilities
   ============================================================ */
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-4 { margin-top: 16px; }
.text-sm { font-size: 12.5px; }
.text-muted { color: var(--text-muted); }
.font-mono { font-family: 'SF Mono', 'Consolas', monospace; }

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

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11.5px;
  color: var(--text-secondary);
  font-family: 'SF Mono', monospace;
}

/* ── 미구독 안내 배너 ── */
.sub-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 28px;
  background: #FFFBEB;
  border-bottom: 1px solid #FDE68A;
  font-size: 13px;
  color: #92400E;
}
.sub-banner-link {
  margin-left: 6px;
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}
.sub-banner-link:hover { text-decoration: underline; }

/* ============================================================
   팜오더 커스텀 팝업 (fo-popup)
   ============================================================ */
.fo-popup-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: foPopupFadeIn 0.15s ease-out;
}
@keyframes foPopupFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.fo-popup-box {
  background: #fff;
  border-radius: 12px;
  min-width: 360px;
  max-width: 480px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  overflow: hidden;
  animation: foPopupSlideUp 0.2s ease-out;
}
@keyframes foPopupSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.fo-popup-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  gap: 10px;
}
.fo-popup-icon  { font-size: 20px; }
.fo-popup-title { font-size: 16px; font-weight: 600; color: #333; flex: 1; }
.fo-popup-close {
  background: none; border: none; font-size: 24px;
  color: #999; cursor: pointer; padding: 0;
  line-height: 1; width: 28px; height: 28px; border-radius: 4px;
}
.fo-popup-close:hover { background: #f5f5f5; color: #333; }
.fo-popup-body  { padding: 20px; font-size: 14px; line-height: 1.6; color: #444; }
.fo-popup-footer {
  display: flex; justify-content: flex-end;
  gap: 8px; padding: 12px 20px 16px;
}
.fo-popup-btn {
  padding: 8px 20px; border-radius: 6px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  border: none; transition: background 0.15s;
}
.fo-popup-btn-confirm { background: #3b82f6; color: #fff; }
.fo-popup-btn-confirm:hover { background: #2563eb; }
.fo-popup-btn-cancel  { background: #f3f4f6; color: #444; }
.fo-popup-btn-cancel:hover  { background: #e5e7eb; }
.fo-popup-error   .fo-popup-btn-confirm { background: #ef4444; }
.fo-popup-error   .fo-popup-btn-confirm:hover { background: #dc2626; }
.fo-popup-warning .fo-popup-btn-confirm { background: #f59e0b; }
.fo-popup-warning .fo-popup-btn-confirm:hover { background: #d97706; }

/* ============================================================
   P1-5: 자세히 보기 섹션 (판매가 계산 / BEP 계산)
   ============================================================ */
.advanced-section {
  margin-top: 24px;
  border-top: 1px solid #e5e7eb;
  padding-top: 16px;
}
.btn-toggle-advanced {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #4b5563;
  width: 100%;
  text-align: left;
  transition: background 0.2s;
}
.btn-toggle-advanced:hover { background: #f3f4f6; }
.calc-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
}
.calc-card h4 { margin: 0 0 12px; font-size: 15px; color: #111827; }
.calc-row { display: flex; gap: 12px; margin-bottom: 10px; }
.calc-input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}
.calc-input-group label { font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.calc-input-group input,
.calc-input-group select {
  padding: 8px 32px 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}
.calc-input-group .unit {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-size: 12px;
  color: #9ca3af;
  pointer-events: none;
}
.calc-result {
  margin-top: 16px;
  padding: 12px;
  background: #f0f9ff;
  border-radius: 6px;
}
.result-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}
.result-row-final {
  border-top: 1px solid #bfdbfe;
  margin-top: 6px;
  padding-top: 10px;
  font-weight: 700;
  font-size: 15px;
}
.result-label { color: #4b5563; }
.result-value { color: #111827; font-weight: 600; }
.result-value-discount { color: #ef4444; }
.result-value-final { color: #2563eb; font-size: 17px; }
.btn-apply-price {
  background: #3b82f6;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.btn-apply-price:hover { background: #2563eb; }
.calc-hint { margin: 8px 0 0; font-size: 11px; color: #6b7280; }
@media (max-width: 600px) {
  .calc-row { flex-direction: column; }
}

/* ===========================================================
 * 회계관리 공통 스타일 (P1-6)
 * =========================================================== */

.accounting-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px;
}

.vat-status-banner {
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.vat-status-banner.vat-safe    { background: #f0fdf4; border-left-color: #22c55e; }
.vat-status-banner.vat-warning { background: #fffbeb; border-left-color: #f59e0b; }
.vat-status-banner.vat-danger  { background: #fef2f2; border-left-color: #ef4444; }

.vat-banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.vat-banner-left { flex: 1; }

.vat-banner-left strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
    color: #111827;
}

.vat-message { font-size: 13px; color: #4b5563; }

.vat-banner-right { min-width: 200px; }

.vat-progress {
    width: 100%;
    height: 8px;
    background: rgba(0,0,0,0.06);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 4px;
}

.vat-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    transition: width 0.3s;
}

.vat-status-banner.vat-warning .vat-progress-bar { background: linear-gradient(90deg, #f59e0b, #d97706); }
.vat-status-banner.vat-danger  .vat-progress-bar { background: linear-gradient(90deg, #ef4444, #dc2626); }

.vat-banner-right small {
    font-size: 11px;
    color: #6b7280;
    display: block;
    text-align: right;
}

.accounting-page .page-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.accounting-page .page-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.accounting-page .page-subtitle {
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
}

.placeholder-card {
    background: #f9fafb;
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
}

.placeholder-icon { font-size: 48px; margin-bottom: 16px; }

.placeholder-card h3 { font-size: 18px; color: #4b5563; margin: 0 0 8px 0; }

.placeholder-card p { font-size: 13px; color: #6b7280; margin: 0; line-height: 1.6; }

.placeholder-card .feature-list {
    text-align: left;
    max-width: 400px;
    margin: 16px auto 0 auto;
    padding: 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.placeholder-card .feature-list li { font-size: 12px; color: #4b5563; padding: 4px 0; }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 900px) { .dashboard-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .dashboard-grid { grid-template-columns: 1fr; } }

.dashboard-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.2s;
}

.dashboard-card:hover { box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05); }

.dashboard-card .card-label  { font-size: 12px; color: #6b7280; margin-bottom: 8px; }
.dashboard-card .card-value  { font-size: 22px; font-weight: 700; color: #111827; margin-bottom: 4px; }
.dashboard-card .card-change { font-size: 12px; color: #6b7280; }

.dashboard-card.is-placeholder { background: #f9fafb; border-style: dashed; }
.dashboard-card.is-placeholder .card-value { color: #9ca3af; }

.dashboard-card.color-blue  .card-value { color: #2563eb; }
.dashboard-card.color-green .card-value { color: #16a34a; }
.dashboard-card.color-red   .card-value { color: #dc2626; }

/* ===========================================================
 * P1-8: 상품별 손익 화면
 * =========================================================== */

.profit-filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-period {
    display: flex;
    gap: 4px;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 4px;
}

.period-btn {
    background: transparent;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #4b5563;
    transition: all 0.15s;
}

.period-btn:hover { color: #111827; }

.period-btn.active {
    background: white;
    color: #2563eb;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.filter-custom {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-custom input[type="date"] {
    padding: 5px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
}

.btn-apply {
    background: #2563eb;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.filter-sort {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-sort label { font-size: 13px; color: #6b7280; }

.filter-sort select {
    padding: 5px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 900px) { .summary-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .summary-cards { grid-template-columns: 1fr; } }

.profit-table-wrap {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
}

.table-header h3 { margin: 0; font-size: 15px; color: #111827; }

.btn-refresh {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    color: #4b5563;
}

.btn-refresh:hover { background: #f9fafb; }

.profit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.profit-table th,
.profit-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    text-align: left;
}

.profit-table th {
    background: #fafafa;
    color: #4b5563;
    font-weight: 600;
    font-size: 12px;
}

.profit-table .text-right  { text-align: right; }
.profit-table .text-center { text-align: center; }

.profit-table tbody tr:hover { background: #f9fafb; }

.row-product { cursor: pointer; font-weight: 600; }

.row-product .toggle-icon {
    color: #9ca3af;
    display: inline-block;
    transition: transform 0.2s;
}

.row-product.open .toggle-icon { transform: rotate(90deg); }

.row-option { background: #fafafa; font-size: 12px; color: #4b5563; }

.row-option td:first-child { padding-left: 40px; }

.row-option .option-name { color: #6b7280; }

.value-positive { color: #16a34a; font-weight: 600; }
.value-negative { color: #dc2626; font-weight: 600; }
.value-zero     { color: #9ca3af; }

.unmatched-notice {
    margin-top: 20px;
    padding: 14px 16px;
    background: #fff7ed;
    border-left: 4px solid #f97316;
    border-radius: 6px;
}

.unmatched-notice strong { color: #c2410c; display: block; margin-bottom: 4px; }

.unmatched-notice p {
    margin: 0;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.5;
}

.unmatched-notice small { color: #9ca3af; font-size: 11px; }

/* ===========================================================
 * P1-9: 손익 대시보드
 * =========================================================== */

.dashboard-hero {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.hero-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.hero-header h3 { margin: 0; font-size: 16px; color: #0c4a6e; }

.realtime-badge {
    background: white;
    color: #16a34a;
    border: 1px solid #86efac;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 900px) { .hero-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .hero-stats { grid-template-columns: 1fr; } }

.hero-stat {
    background: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.hero-stat .stat-label  { font-size: 12px; color: #6b7280; margin-bottom: 6px; }

.hero-stat .stat-value  {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
    line-height: 1.2;
}

.hero-stat .stat-value.stat-profit { color: #16a34a; }

.hero-stat .stat-compare { font-size: 11px; color: #6b7280; }

.section-title {
    margin: 28px 0 14px 0;
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    height: 240px;
    margin-bottom: 16px;
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 900px) { .quick-links { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .quick-links { grid-template-columns: repeat(2, 1fr); } }

.quick-link {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 12px;
    text-align: center;
    text-decoration: none;
    color: #4b5563;
    transition: all 0.15s;
}

.quick-link:hover {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0369a1;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.quick-link .quick-icon  { font-size: 28px; margin-bottom: 6px; }
.quick-link .quick-label { font-size: 12px; font-weight: 500; }


/* ── 미분류 매핑 (P1.5-1) ──────────────────────────────────── */
.mapping-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.mapping-stats .stat-badge {
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 13px;
    font-weight: 600;
}

.mapping-actions {
    display: flex;
    gap: 10px;
}

.btn-auto-match, .btn-save-all {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}

.btn-auto-match {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.btn-auto-match:hover:not(:disabled) {
    background: #dbeafe;
}

.btn-save-all {
    background: #0d9488;
    color: white;
}

.btn-save-all:hover:not(:disabled) {
    background: #0f766e;
}

.btn-auto-match:disabled, .btn-save-all:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auto-match-result {
    border-radius: 8px;
    padding: 12px 18px;
    margin-bottom: 14px;
    font-size: 13px;
}

.auto-match-result.result-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

.auto-match-result .match-ok   { color: #15803d; font-weight: 700; }
.auto-match-result .match-fail { color: #b91c1c; font-weight: 700; }

.mapping-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: white;
}

.mapping-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.mapping-table thead th {
    background: #f9fafb;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.mapping-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.mapping-table tbody tr:last-child td { border-bottom: none; }

.mapping-table tbody tr:hover { background: #fafafa; }

.col-check  { width: 36px; text-align: center; }
.col-qty    { width: 56px; text-align: right; }
.col-price  { width: 100px; text-align: right; }
.col-select { width: 280px; }
.col-action { width: 68px; text-align: center; }

.cell-order-no { font-family: monospace; font-size: 12px; color: #374151; }
.cell-date     { white-space: nowrap; color: #6b7280; font-size: 12px; }
.cell-qty      { font-weight: 600; }
.cell-price    { font-weight: 600; color: #374151; }

.cell-product .product-name { font-weight: 500; color: #111827; }
.cell-product .option-name  { font-size: 11px; color: #9ca3af; margin-top: 2px; }

.platform-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: #f3f4f6;
    color: #374151;
}

.platform-badge.platform-coupang { background: #fff7ed; color: #c2410c; }
.platform-badge.platform-toss    { background: #eff6ff; color: #1e40af; }

.option-select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    background: white;
    cursor: pointer;
}

.option-select:focus {
    outline: none;
    border-color: #0d9488;
    box-shadow: 0 0 0 2px rgba(13,148,136,0.15);
}

.btn-save-row {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: #0d9488;
    color: white;
    border: none;
    white-space: nowrap;
    transition: all 0.15s;
}

.btn-save-row:hover:not(:disabled) { background: #0f766e; }
.btn-save-row:disabled { opacity: 0.4; cursor: not-allowed; }

.loading-row, .error-row {
    text-align: center;
    padding: 40px !important;
    color: #9ca3af;
    font-size: 14px;
}

.error-row { color: #dc2626; }

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #e5e7eb;
    border-top-color: #0d9488;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.empty-state .empty-icon  { font-size: 48px; margin-bottom: 12px; }
.empty-state .empty-title { font-size: 18px; font-weight: 700; color: #111827; margin-bottom: 6px; }
.empty-state .empty-desc  { font-size: 13px; color: #9ca3af; }

.unmatched-notice {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #92400e;
}

.unmatched-notice strong { display: block; margin-bottom: 4px; }
.unmatched-notice a { color: #0d9488; text-decoration: underline; }


/* ── P1.5-1-ext: 탭 + 매핑 관리 ─────────────────────────────── */
.info-banner {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #1e40af;
}
.info-banner strong { display: block; margin-bottom: 4px; }
.info-banner p      { margin: 0; line-height: 1.6; }

.mapping-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
    border-bottom: 2px solid #e5e7eb;
}

.mapping-tab {
    background: transparent;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.mapping-tab:hover { color: #4b5563; }
.mapping-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    font-weight: 600;
}

.tab-badge {
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
}
.mapping-tab.active .tab-badge {
    background: #dbeafe;
    color: #1e40af;
}

.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.action-left, .action-right { display: flex; gap: 8px; align-items: center; }

.search-input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    min-width: 280px;
}
.search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.badge-matched {
    background: #d1fae5;
    color: #065f46;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}
.badge-unmatched {
    background: #fee2e2;
    color: #991b1b;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.btn-mini {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    border: 1px solid;
    background: white;
    margin: 0 2px;
    white-space: nowrap;
}
.btn-change { color: #2563eb; border-color: #93c5fd; }
.btn-change:hover { background: #eff6ff; }
.btn-unmap  { color: #dc2626; border-color: #fca5a5; }
.btn-unmap:hover { background: #fef2f2; }

.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
}
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: #fafafa;
}

.modal-footer .btn-secondary,
.modal-footer .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    min-width: 80px;
    transition: background .15s, border-color .15s;
    line-height: 1;
}

.modal-footer .btn-secondary {
    background: #ffffff;
    border: 1px solid #d1d5db;
    color: #4b5563;
}
.modal-footer .btn-secondary:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.modal-footer .btn-primary {
    background: var(--brand, #4F46E5);
    border: 1px solid var(--brand, #4F46E5);
    color: #ffffff;
    font-weight: 600;
}
.modal-footer .btn-primary:hover {
    background: var(--brand-hover, #4338CA);
    border-color: var(--brand-hover, #4338CA);
}

/* ── P2-1: 체험단·가구매 관리 ────────────────────────────────── */

.filter-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    background: white;
}

.expense-summary {
    margin: 20px 0;
}

.summary-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.summary-card-total {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 16px 20px;
    min-width: 240px;
    flex: 1;
}

.summary-card-total .card-label {
    font-size: 12px;
    color: #0369a1;
    margin-bottom: 4px;
}

.summary-card-total .card-value {
    font-size: 22px;
    font-weight: 700;
    color: #0c4a6e;
    margin-bottom: 4px;
}

.summary-card-total .card-change {
    font-size: 11px;
    color: #0369a1;
}

.summary-card-mini {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    min-width: 130px;
}

.summary-card-mini .mini-label {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 4px;
}

.summary-card-mini .mini-value {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 2px;
}

.summary-card-mini .mini-count {
    font-size: 10px;
    color: #9ca3af;
}

.type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.modal .form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.modal .form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.modal .form-group label {
    font-size: 12px;
    color: #4b5563;
    font-weight: 500;
    margin-bottom: 4px;
}

.modal .form-group input,
.modal .form-group select,
.modal .form-group textarea {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
}

.modal .form-group small {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 2px;
}

/* ── P2-3: 매출 모니터링 ─────────────────────────────────────── */

.threshold-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

@media (max-width: 900px) { .threshold-cards { grid-template-columns: 1fr; } }

.threshold-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
}

.threshold-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.threshold-title {
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
}

.threshold-amount {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.threshold-progress {
    height: 8px;
    background: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 6px;
}

.threshold-progress .progress-bar {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 999px;
}

.threshold-detail {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 8px;
}

.threshold-desc {
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.4;
}

.status-safe, .status-warning, .status-exceeded {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
}

.status-safe     { background: #d1fae5; color: #065f46; }
.status-warning  { background: #fef3c7; color: #92400e; }
.status-exceeded { background: #fee2e2; color: #991b1b; }

/* 부가세 신고자료 */
.report-period-banner {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.report-period-banner strong {
    font-size: 16px;
    color: #0c4a6e;
}

.vat-result-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.vat-main-result { max-width: 600px; margin: 0 auto; }

.vat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 15px;
    border-bottom: 1px solid #f3f4f6;
}

.vat-row-final {
    border-bottom: none;
    border-top: 2px solid #e5e7eb;
    margin-top: 8px;
    padding-top: 16px;
    font-size: 18px;
    font-weight: 700;
}

.vat-label  { color: #4b5563; }
.vat-value  { color: #111827; font-weight: 600; }
.vat-deduct { color: #dc2626; }
.vat-final  { font-size: 24px; }

.vat-detail-section { margin-bottom: 24px; }

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

@media (max-width: 900px) { .vat-detail-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .vat-detail-grid { grid-template-columns: 1fr; } }

.detail-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px;
}

.detail-label { font-size: 12px; color: #6b7280; margin-bottom: 6px; }
.detail-value { font-size: 18px; font-weight: 700; color: #111827; margin-bottom: 4px; }
.detail-note  { font-size: 11px; color: #9ca3af; }

/* ── 모달 form select 개선 (P2-1-fix-modal) ─────────────────── */
.modal .form-group select {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .modal .form-row {
        flex-direction: column;
        gap: 8px;
    }
}
