/* AAF Admin Panel CSS */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');
:root {
  --sidebar-bg: #1e1b2e;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-active: #4b3f6b;
  --primary: #4b3f6b;
  --primary-light: #7e67b6;
  --accent: #a78bfa;
  --bg: #f4f5f7;
  --card-bg: #ffffff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --sidebar-width: 220px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Pretendard', 'Noto Sans KR', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

/* ── LAYOUT ── */
.admin-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;
}

.sidebar-brand {
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 3px;
}

.brand-label {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.875rem;
  border-radius: 8px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: rgba(255,255,255,0.9);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
}

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 1rem;
  margin-bottom: 0.25rem;
}

.lang-btn {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  transition: color 0.15s;
}

.lang-btn:hover {
  color: rgba(255,255,255,0.8);
}

.lang-btn--active {
  color: #fff !important;
  font-weight: 700;
}

.lang-sep {
  color: rgba(255,255,255,0.2);
  font-size: 0.75rem;
}

.nav-item--link {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4) !important;
}

.nav-item--link:hover {
  color: rgba(255,255,255,0.7) !important;
}

/* ── MAIN ── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.top-bar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 40;
}

.top-bar h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  flex: 1;
}

.top-bar-count {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.page-body {
  padding: 1.75rem 2rem;
}

/* ── STAT CARDS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-icon--revenue { background: #ede9fe; }
.stat-icon--orders  { background: #dbeafe; }
.stat-icon--products{ background: #d1fae5; }
.stat-icon--warning { background: #fef3c7; }

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stat-value--revenue { color: var(--primary); }
.stat-value--success { color: var(--success); }
.stat-value--warning { color: var(--warning); }
.stat-value--danger  { color: var(--danger); }

/* ── CARD ── */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.card-body { padding: 1.25rem 1.5rem; }

/* ── TABLE ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 0.625rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f9fafb; }

/* ── TABLE ACTIONS ── */
.table-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* ── STATUS TABS ── */
.status-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

/* ── FILTER BAR ── */
.filter-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.filter-bar .form-control { width: auto; min-width: 140px; }

.filter-count {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge--confirm  { background: #ede9fe; color: #6d28d9; }
.badge--paid     { background: #dbeafe; color: #1d4ed8; }
.badge--shipping { background: #fef3c7; color: #d97706; }
.badge--done     { background: #d1fae5; color: #059669; }
.badge--cancel   { background: #fee2e2; color: #dc2626; }
.badge--low      { background: #fef3c7; color: #d97706; }
.badge--out      { background: #fee2e2; color: #dc2626; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}

.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-light); }
.btn--success { background: var(--success); color: #fff; }
.btn--success:hover { background: #059669; }
.btn--warning { background: var(--warning); color: #fff; }
.btn--danger  { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #dc2626; }
.btn--outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn--outline:hover { background: var(--bg); }
.btn--sm { padding: 0.35rem 0.75rem; font-size: 0.75rem; }

/* ── FORMS ── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.375rem; }
.form-label .req { color: #ef4444; margin-left: 2px; }
.form-hint { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 0.25rem; }
.form-control {
  width: 100%;
  padding: 0.55rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(75,63,107,0.1); }
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}
select.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(75,63,107,0.1); }
textarea.form-control { min-height: 80px; resize: vertical; }

/* ── GRID ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

/* ── PRODUCT FORM SECTIONS ── */
.product-form { max-width: 800px; }

.form-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.form-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.form-section--meta {
  background: #f9fafb;
  padding: 1rem 1.5rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-bottom: 2rem;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.3rem 0;
  font-size: 0.8rem;
}

.meta-label {
  color: var(--text-muted);
  min-width: 80px;
  font-weight: 600;
}

.meta-value { color: var(--text); }

/* ── PRODUCT DETAIL ── */
.detail-layout { max-width: 900px; }

.detail-top {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.detail-img-wrap {
  width: 220px;
  height: 220px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
}

.detail-basic { display: flex; flex-direction: column; gap: 0.5rem; }
.detail-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.detail-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-top: 0.25rem;
}

.detail-brand {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.detail-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.detail-meta-item { display: flex; flex-direction: column; gap: 0.1rem; }

.dm-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dm-value { font-size: 0.82rem; color: var(--text); font-weight: 500; }

.detail-sections { display: flex; flex-direction: column; gap: 1rem; }

.detail-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}

.detail-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.detail-desc { font-size: 0.875rem; color: var(--text); line-height: 1.6; }

.detail-info-grid { display: flex; flex-direction: column; }

.di-row {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f3f4f6;
  gap: 1rem;
  font-size: 0.875rem;
}

.di-row:last-child { border-bottom: none; }

.di-label {
  color: var(--text-muted);
  min-width: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

.di-value { color: var(--text); display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }

.option-chip {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text);
}
.color-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  vertical-align: middle;
}
.color-swatch-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.12);
}
.color-swatch-dot--light { border-color: #d1d5db; }
.color-swatch-dot--none {
  background: repeating-linear-gradient(
    45deg, #e5e7eb, #e5e7eb 2px, #fff 2px, #fff 6px
  );
}

/* ── PRODUCT IMAGE ── */
.product-img {
  width: 48px; height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg);
}

/* ── ALERTS ── */
.alert {
  padding: 0.875rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.alert--success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert--danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}

.modal {
  background: #fff;
  border-radius: 16px;
  width: 520px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: #fff; z-index: 1;
}

.modal-title { font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 1.2rem; color: var(--text-muted); }
.modal-body { padding: 1.25rem 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 0.75rem;
  position: sticky; bottom: 0; background: #fff;
}

/* ── CHART ── */
.chart-container { position: relative; height: 240px; }

/* ── PROGRESS BAR ── */
.progress-bar {
  height: 6px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.375rem;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.4s;
}

/* ── TOP BAR ACTIONS ── */
.top-bar-actions { display: flex; gap: 0.5rem; align-items: center; flex-shrink: 0; }

/* ── SIDEBAR OVERLAY ── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 49;
}
.sidebar-overlay.open { display: block; }

/* ── HAMBURGER ── */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
}
.hamburger-btn:hover { background: var(--bg); }
.hamburger-btn span {
  display: block;
  width: 20px; height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ══════════════════════════════════════════════
   TABLET (≤1024px)
══════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .detail-top { grid-template-columns: 180px 1fr; }
  .detail-img-wrap { width: 180px; height: 180px; }
}

/* ══════════════════════════════════════════════
   MOBILE (≤768px)
══════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Sidebar & layout ── */
  .hamburger-btn { display: flex; }
  .sidebar { transform: translateX(-100%); transition: transform 0.28s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }

  /* ── Top bar ── */
  .top-bar { padding: 0.75rem 1rem; gap: 0.5rem; }
  .top-bar h1 { font-size: 1rem; }
  .top-bar-actions { gap: 0.4rem; }
  .top-bar-actions .btn--sm { font-size: 0.7rem; padding: 0.3rem 0.55rem; }

  /* ── Page body ── */
  .page-body { padding: 0.875rem 1rem; }

  /* ── Stats grid ── */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem; }
  .stat-card { padding: 0.875rem 1rem; gap: 0.75rem; }
  .stat-icon { width: 40px; height: 40px; font-size: 1.1rem; border-radius: 8px; }
  .stat-value { font-size: 1.2rem; }
  .stat-label { font-size: 0.7rem; }

  /* ── Grids → single column ── */
  .grid-2, .grid-3 { grid-template-columns: 1fr; }

  /* ── Filter bar ── */
  .filter-bar { flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .filter-bar .form-control { width: 100%; min-width: unset; }
  .filter-bar .btn { width: 100%; justify-content: center; }
  .filter-count { margin-left: 0; text-align: right; padding-top: 0.25rem; }

  /* ── Status tabs ── */
  .status-tabs .btn { font-size: 0.72rem; padding: 0.3rem 0.6rem; }

  /* ── Mobile card-style tables ── */
  .card { border-radius: 8px; overflow: visible; }
  .data-table { min-width: 0; width: 100%; border-collapse: separate; border-spacing: 0; }
  .data-table thead { display: none; }

  .data-table tbody tr {
    display: block;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    overflow: hidden;
  }

  .data-table tbody tr:hover td { background: transparent; }

  .data-table td {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.875rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.82rem;
  }

  .data-table td:last-child { border-bottom: none; }

  .data-table td[data-label]:not([data-label=""])::before {
    content: attr(data-label);
    font-size: 0.67rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 58px;
    flex-shrink: 0;
  }

  .data-table td[data-label=""] {
    padding: 0.75rem 0.875rem;
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
  }

  /* 모바일 숨김 열 */
  .col-mobile-hide { display: none !important; }

  /* table-actions */
  .table-actions { flex-wrap: wrap; gap: 0.35rem; }

  /* ── Form sections ── */
  .form-section { padding: 1rem; }
  .form-section-title { margin-bottom: 1rem; }
  .product-form { max-width: 100%; }

  /* ── Product detail ── */
  .detail-top { grid-template-columns: 1fr; gap: 1rem; }
  .detail-img-wrap { width: 100%; height: 200px; }
  .detail-layout { max-width: 100%; }
  .detail-name { font-size: 1.2rem; }
  .detail-price { font-size: 1.3rem; }

  /* ── Modal → bottom sheet ── */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { width: 100%; border-radius: 20px 20px 0 0; max-height: 92vh; }

  /* ── Form actions ── */
  .form-actions { flex-wrap: wrap; }
}

/* ══════════════════════════════════════════════
   SMALL MOBILE (≤480px)
══════════════════════════════════════════════ */
@media (max-width: 480px) {
  .stats-grid { gap: 0.5rem; }
  .stat-card { padding: 0.75rem; gap: 0.5rem; }
  .stat-icon { width: 36px; height: 36px; font-size: 1rem; }
  .stat-value { font-size: 1.1rem; }

  .page-body { padding: 0.625rem 0.75rem; }
  .top-bar { padding: 0.625rem 0.75rem; }
  .top-bar h1 { font-size: 0.9rem; }

  .btn--sm { padding: 0.28rem 0.55rem; font-size: 0.7rem; }

  .detail-meta-grid { grid-template-columns: 1fr; }

  .form-actions {
    flex-direction: column-reverse;
  }
  .form-actions .btn { width: 100%; justify-content: center; }
}

/* ══════════════════════════════════════════════
   ATTR PICKER — 한국어 · 중국어 커스텀 셀렉트
══════════════════════════════════════════════ */
.attr-picker { position: relative; }

.attr-picker-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 38px;
}

.attr-picker-btn:hover { border-color: #a78bfa; }
.attr-picker.open .attr-picker-btn { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(75,63,107,0.1); }

.attr-picker-ko {
  color: var(--text);
  font-weight: 400;
  font-size: 0.875rem;
}

.attr-picker-ko--empty {
  color: #9ca3af;
  font-style: normal;
}

.attr-picker-zh {
  display: inline-flex;
  align-items: center;
  color: #0369a1;
  font-size: 0.75rem;
  font-weight: 500;
  background: #f0f9ff;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  border: 1px solid #bae6fd;
  white-space: nowrap;
}

.attr-picker-caret {
  margin-left: auto;
  flex-shrink: 0;
  color: #6b7280;
  transition: transform 0.2s;
}

.attr-picker.open .attr-picker-caret { transform: rotate(180deg); }

.attr-picker-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid var(--primary);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.13);
  z-index: 50;
  max-height: 260px;
  overflow-y: auto;
  padding: 0.25rem;
}

.attr-picker.open .attr-picker-dropdown { display: block; }

.attr-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
  line-height: 1.3;
}

.attr-option:hover { background: #f5f3ff; }
.attr-option.selected { background: #ede9fe; }
.attr-option.selected .attr-opt-ko { color: var(--primary); font-weight: 600; }

.attr-opt-ko {
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 400;
}

.attr-opt-zh {
  color: #64748b;
  font-size: 0.78rem;
  margin-left: auto;
  white-space: nowrap;
}

/* 그룹 헤더 */
.attr-group-header {
  padding: 0.45rem 0.75rem 0.2rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  border-top: 1px solid var(--border);
  margin-top: 0.2rem;
}
.attr-picker-dropdown > div:first-child > .attr-group-header {
  border-top: none;
  margin-top: 0;
}

/* 색상 체크박스 그룹 */
.color-group-section {
  margin-bottom: 0.75rem;
}

.color-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0.2rem 0.25rem;
  margin-bottom: 0.4rem;
  border-left: 3px solid var(--primary);
  padding-left: 0.5rem;
  background: #f5f3ff;
  border-radius: 0 4px 4px 0;
}

/* ══════════════════════════════════════════════
   EXCHANGE RATE / MARGIN MANAGEMENT
══════════════════════════════════════════════ */

/* 환율 섹션 2열 그리드 */
.er-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 768px) {
  .er-grid { grid-template-columns: 1fr; }
}

/* 현재 환율 카드 */
.er-rate-card { text-align: center; }

.er-rate-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.er-currency-badge {
  background: #4b3f6b;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  letter-spacing: 0.05em;
}
.er-arrow { color: #9ca3af; font-size: 1.1rem; }

.er-rate-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.er-rate-value {
  font-size: 2.4rem;
  font-weight: 800;
  color: #4b3f6b;
  letter-spacing: -0.02em;
}
.er-rate-unit {
  font-size: 0.85rem;
  color: #9ca3af;
}

.er-rate-breakdown {
  background: #f5f3ff;
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  margin: 0.5rem 0;
  font-size: 0.8rem;
}
.er-rate-row {
  display: flex;
  justify-content: space-between;
  color: #6b7280;
  padding: 0.15rem 0;
}
.er-rate-row--add { color: #7c3aed; }
.er-rate-row--total {
  color: #4b3f6b;
  font-weight: 700;
  border-top: 1px solid #ddd6fe;
  margin-top: 0.25rem;
  padding-top: 0.35rem;
}

.er-rate-meta {
  font-size: 0.78rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

/* 마진율 배지 */
.er-margin-badge {
  display: inline-block;
  background: #ede9fe;
  color: #5b21b6;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}

/* 계산기 그리드 */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 768px) {
  .calc-grid { grid-template-columns: 1fr; }
}

.calc-result {
  background: #f8f7ff;
  border: 1px solid #e9d8fd;
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.calc-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.calc-result-label {
  font-size: 0.8rem;
  color: #6b7280;
  white-space: nowrap;
}
.calc-result-value {
  font-size: 1rem;
  font-weight: 700;
  color: #374151;
}
.calc-result-item--main .calc-result-value {
  font-size: 1.25rem;
  color: #4b3f6b;
}

/* ══════════════════════════════════════════════
   DASHBOARD – EXCHANGE RATE BANNER
══════════════════════════════════════════════ */
.rate-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  border-radius: 10px;
  padding: 0.875rem 1.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.rate-banner-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.rate-banner-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rate-banner-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #374151;
}

.rate-banner-value--main { color: #4b3f6b; font-size: 1.2rem; }
.rate-banner-value--muted { font-size: 0.875rem; color: #6b7280; font-weight: 500; }

.rate-banner-sep {
  color: #a78bfa;
  font-size: 1.1rem;
  font-weight: 700;
}

@media (max-width: 768px) {
  .rate-banner { gap: 1rem; padding: 0.75rem 1rem; }
  .rate-banner-sep:not(.d-mobile-hide) { display: none; }
  .d-mobile-hide { display: none !important; }
  /* settlement year selector wrap */
  .top-bar-actions form { gap: 0.35rem; }
  .top-bar-actions form select { font-size: 0.75rem; }
}
