/* BalanceBridge 전용 스타일 — dart-validator 디자인 시스템 확장 */

/* 메인 탭 (헤더 내) */
.main-tabs { display:flex; gap:4px; margin-left:24px; }
.main-tab {
  padding:6px 18px; border-radius:6px; border:1px solid rgba(255,255,255,0.3);
  background:transparent; color:rgba(255,255,255,0.75); font-size:13px; font-weight:600;
  font-family:inherit; cursor:pointer; transition:all 0.2s;
}
.main-tab:hover { background:rgba(255,255,255,0.12); color:#fff; }
.main-tab.active { background:rgba(255,255,255,0.22); color:#fff; border-color:rgba(255,255,255,0.5); }

/* 레이아웃 */
.bb-workspace { margin-top:4px; }
.bb-layout { display:grid; grid-template-columns:280px 1fr; gap:16px; min-height:500px; }

/* 업로드 상단 */
.bb-upload-toolbar {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  margin-bottom:12px; padding:12px 14px; background:#fff; border:1px solid #e2e8f0;
  border-radius:10px;
}
.bb-toolbar-group { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.bb-toolbar-label { font-size:13px; font-weight:700; color:#334155; }
.bb-mode-group {
  display:flex; align-items:center; background:#e2e8f0; border-radius:8px; padding:3px; gap:3px;
}
.bb-mode-button {
  border:none; background:transparent; color:#475569; font-size:12px; font-weight:700;
  padding:7px 12px; border-radius:6px; cursor:pointer; transition:all 0.15s;
}
.bb-mode-button:hover { background:#dbe4ef; }
.bb-mode-button.active { background:#2563eb; color:#fff; }
.bb-mode-hint { font-size:12px; color:#64748b; text-align:right; }

/* 사이드바 */
.bb-sidebar {
  background:#fff; border-radius:10px; border:1px solid #e2e8f0;
  display:flex; flex-direction:column; overflow:hidden;
}
.bb-sidebar-header { padding:14px 16px 10px; border-bottom:1px solid #f1f5f9; }
.bb-sidebar-header h3 { font-size:14px; font-weight:700; color:#1e293b; margin-bottom:8px; }
.bb-search-input {
  width:100%; padding:7px 12px; border:1px solid #e2e8f0; border-radius:6px;
  font-size:13px; font-family:inherit; outline:none; transition:border-color 0.2s;
}
.bb-search-input:focus { border-color:#2563eb; }
.bb-account-list { flex:1; overflow-y:auto; padding:6px 0; max-height:calc(100vh - 400px); }
.bb-account-item {
  display:flex; justify-content:space-between; align-items:center;
  padding:8px 16px; cursor:pointer; transition:background 0.15s; border-left:3px solid transparent;
}
.bb-account-item:hover { background:#f8fafc; }
.bb-account-item.active { background:#eff6ff; border-left-color:#2563eb; }
.bb-account-name { font-size:13px; font-weight:500; color:#1e293b; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bb-account-net { font-size:12px; font-weight:600; font-variant-numeric:tabular-nums; margin-left:8px; white-space:nowrap; }
.bb-account-net.pos { color:#dc2626; }
.bb-account-net.neg { color:#2563eb; }
.bb-sidebar-footer { padding:10px 12px; border-top:1px solid #f1f5f9; display:flex; gap:6px; flex-wrap:wrap; }
.bb-prior-status { padding:8px 12px; background:#eff6ff; color:#1e40af; font-size:12px; font-weight:500; border-top:1px solid #e2e8f0; }
.bb-journal-status { background:#f8fafc; color:#334155; }

/* 메인 영역 */
.bb-main { background:#fff; border-radius:10px; border:1px solid #e2e8f0; overflow:hidden; display:flex; flex-direction:column; }
.bb-main-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:0 16px; border-bottom:2px solid #e2e8f0;
}
.bb-main-header .tabs { flex:1; }

/* 툴바 */
.bb-toolbar {
  display:flex; align-items:center; gap:10px; padding:10px 12px;
  background:#f8fafc; border-bottom:1px solid #f1f5f9;
}
.bb-toolbar-info { font-size:13px; font-weight:600; color:#475569; flex:1; }
.btn-sm { padding:5px 14px; font-size:12px; }
.bb-inline-summary { padding:12px; }
.bb-journal-pill {
  display:inline-flex; align-items:center; padding:6px 10px; border-radius:999px;
  background:#dbeafe; color:#1d4ed8; font-size:12px; font-weight:700;
}
.bb-journal-note {
  margin:12px; padding:12px 14px; border-radius:10px; font-size:13px; line-height:1.5;
  border:1px solid #dbeafe; background:#eff6ff; color:#1d4ed8;
}
.bb-journal-note.warn { background:#fff7ed; border-color:#fed7aa; color:#c2410c; }
.bb-journal-note.info { background:#f8fafc; border-color:#cbd5e1; color:#475569; }
.bb-journal-badge {
  display:inline-flex; align-items:center; justify-content:center; min-width:96px;
  padding:5px 10px; border-radius:999px; font-size:12px; font-weight:700;
}
.bb-journal-badge.pass { background:#dcfce7; color:#15803d; }
.bb-journal-badge.warn { background:#fef3c7; color:#b45309; }
.bb-journal-badge.fail { background:#fee2e2; color:#b91c1c; }
.bb-journal-row { cursor:pointer; }
.bb-journal-row:hover td { background:#f8fafc; }
.bb-journal-row.active td { background:#eff6ff; }
.bb-journal-detail-row td {
  padding:0 !important; background:#f8fafc;
}
.bb-journal-detail {
  padding:14px 16px 16px; border-top:1px solid #e2e8f0;
}
.bb-journal-detail-header {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  margin-bottom:10px; color:#334155; font-size:13px;
}
.bb-journal-message {
  margin-bottom:12px; color:#475569; font-size:13px; line-height:1.5;
}
.bb-journal-lines { margin-top:0; }
.bb-journal-empty {
  color:#94a3b8; font-size:13px;
}

/* 차트 (월별추이) */
.bb-chart-area {
  display:flex; align-items:flex-end; gap:8px; padding:20px 16px 8px;
  min-height:160px; border-bottom:1px solid #f1f5f9;
}
.bb-chart-bar-group { display:flex; flex-direction:column; align-items:center; flex:1; }
.bb-chart-bars { display:flex; gap:3px; align-items:flex-end; }
.bb-chart-bar {
  width:18px; border-radius:3px 3px 0 0; min-height:2px; transition:height 0.3s;
}
.bb-chart-bar.debit { background:#2563eb; }
.bb-chart-bar.credit { background:#dc2626; }
.bb-chart-label { font-size:10px; color:#94a3b8; margin-top:4px; }

/* 모달 */
.bb-modal-overlay {
  position:fixed; inset:0; z-index:9998;
  background:rgba(0,0,0,0.45); display:flex; align-items:center; justify-content:center;
}
.bb-modal {
  background:#fff; border-radius:12px; padding:24px; max-width:800px; width:90%;
  box-shadow:0 20px 60px rgba(0,0,0,0.2);
}
.bb-modal h3 { font-size:18px; font-weight:700; margin-bottom:16px; color:#1e293b; }
.bb-modal.large { max-width:1100px; }
.bb-modal-subtitle { font-size:13px; color:#64748b; margin:-8px 0 14px; }
.bb-mapping-layout {
  display:grid; grid-template-columns:300px 1fr; gap:16px; align-items:start;
}
.bb-mapping-panel {
  border:1px solid #e2e8f0; border-radius:10px; background:#f8fafc; padding:14px;
}
.bb-mapping-panel h4 { font-size:14px; font-weight:700; color:#1e293b; margin-bottom:10px; }
.bb-mapping-fields {
  display:grid; grid-template-columns:1fr; gap:10px;
}
.bb-mapping-field label {
  display:block; font-size:12px; font-weight:700; color:#475569; margin-bottom:4px;
}
.bb-mapping-field select {
  width:100%; padding:8px 10px; border:1px solid #cbd5e1; border-radius:6px;
  font-size:13px; font-family:inherit; background:#fff;
}
.bb-mapping-preview {
  border:1px solid #e2e8f0; border-radius:10px; overflow:auto; max-height:460px; background:#fff;
}
.bb-mapping-preview table { width:100%; border-collapse:collapse; }
.bb-mapping-preview th,
.bb-mapping-preview td {
  padding:8px 10px; border-bottom:1px solid #eef2f7; font-size:12px; text-align:left;
}
.bb-mapping-preview thead th {
  position:sticky; top:0; background:#f8fafc; z-index:1; font-weight:700; color:#334155;
}
.bb-mapping-row { cursor:pointer; }
.bb-mapping-row:hover { background:#f8fafc; }
.bb-mapping-row.selected { background:#dbeafe; }
.bb-mapping-note { font-size:12px; color:#64748b; margin-bottom:8px; }
.bb-mapping-error {
  margin-top:10px; color:#dc2626; font-size:12px; font-weight:600;
}

/* 반응형 */
@media (max-width:900px) {
  .bb-layout { grid-template-columns:1fr; }
  .bb-sidebar { max-height:240px; }
  .bb-account-list { max-height:160px; }
  .main-tabs { margin-left:12px; }
  .bb-upload-toolbar { flex-direction:column; align-items:flex-start; }
  .bb-mode-hint { text-align:left; }
  .bb-mapping-layout { grid-template-columns:1fr; }
}
@media (max-width:640px) {
  .main-tabs { display:none; }
  .header-inner { flex-wrap:wrap; }
}
