/* ==========================================================================
   STUDIO TABART - Asset & Account Book Stylesheet
   Glassmorphism Dark/Light Theme & Responsive Financial Workspace
   ========================================================================== */

:root {
  --bg-base: #0a0e1a;
  --bg-surface: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-hover: rgba(30, 41, 59, 0.95);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(99, 102, 241, 0.4);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-cyan: #0ea5e9;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-purple: #a855f7;
  --accent-rose: #f43f5e;
  --accent-blue: #3b82f6;
  --accent-glow: rgba(99, 102, 241, 0.35);

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 25px -3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 40px -5px rgba(0, 0, 0, 0.5);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

[data-theme="light"] {
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: #f1f5f9;
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(99, 102, 241, 0.4);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-primary), #4338ca);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.logo-icon svg { width: 22px; height: 22px; }

.logo-text {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.accent-dot { color: var(--accent-primary); }

.brand-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--accent-primary);
  letter-spacing: 0.5px;
}

/* Center View Switcher Tabs */
.view-switch-group {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.25rem;
  border-radius: 9999px;
  gap: 0.25rem;
}

.view-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.1rem;
  border-radius: 9999px;
  background: transparent;
  border: none;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.view-tab-btn:hover { color: var(--text-primary); }
.view-tab-btn.active {
  background: linear-gradient(135deg, var(--accent-primary), #4338ca);
  color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.view-tab-btn svg { width: 16px; height: 16px; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.networth-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  font-size: 0.82rem;
  font-weight: 700;
}
.networth-pill svg { width: 14px; height: 14px; }
.nw-label { color: var(--text-muted); font-weight: 600; }
.nw-val { color: var(--accent-emerald); }

.btn-icon, .theme-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-icon:hover, .theme-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
}
.btn-icon svg, .theme-btn svg { width: 18px; height: 18px; }

.sun-icon { display: none; }
.moon-icon { display: block; }
[data-theme="light"] .sun-icon { display: block; }
[data-theme="light"] .moon-icon { display: none; }

/* Main Workspace */
.main-container {
  max-width: 1440px;
  width: 100%;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* =========================================================================
   SECURITY LOCK SCREEN STYLES
   ========================================================================= */
.lock-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 65vh;
  padding: 2rem 1rem;
}

.lock-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: lockFadeIn 0.3s ease-out;
}
@keyframes lockFadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.lock-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.lock-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-primary), #4338ca);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px var(--accent-glow);
  margin-bottom: 0.5rem;
}
.lock-icon-box svg { width: 26px; height: 26px; }
.lock-title { font-size: 1.45rem; font-weight: 800; color: var(--text-primary); }
.lock-desc { font-size: 0.84rem; color: var(--text-muted); }

.btn-login {
  width: 100%;
  padding: 0.85rem;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.error-banner {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.lock-footer-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.lock-footer-info svg { width: 14px; height: 14px; color: var(--accent-amber); }

.view-panel {
  display: none;
  flex-direction: column;
  gap: 1.75rem;
  animation: fadeInView 0.25s ease-out;
}
.view-panel.active { display: flex; }
@keyframes fadeInView { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Cards & Containers */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
}

/* =========================================================================
   VIEW 1: OVERVIEW STYLES
   ========================================================================= */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.kpi-card.kpi-networth {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(17, 24, 39, 0.9));
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kpi-icon svg { width: 20px; height: 20px; }

.icon-gem { background: rgba(99, 102, 241, 0.18); color: var(--accent-primary); }
.icon-emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.icon-rose { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }
.icon-cyan { background: rgba(14, 165, 233, 0.15); color: var(--accent-cyan); }
.icon-indigo { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }

.kpi-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  letter-spacing: 0.5px;
}
.kpi-badge.primary { background: rgba(99, 102, 241, 0.18); color: var(--accent-primary); border: 1px solid rgba(99, 102, 241, 0.3); }
.kpi-badge.emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.3); }
.kpi-badge.rose { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); border: 1px solid rgba(244, 63, 94, 0.3); }
.kpi-badge.cyan { background: rgba(14, 165, 233, 0.15); color: var(--accent-cyan); border: 1px solid rgba(14, 165, 233, 0.3); }

.kpi-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.kpi-label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.kpi-value {
  font-family: 'JetBrains Mono', 'Pretendard', monospace;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.kpi-sub { font-size: 0.74rem; color: var(--text-muted); line-height: 1.4; margin-top: 0.2rem; }

.text-emerald { color: var(--accent-emerald); }
.text-rose { color: var(--accent-rose); }
.text-cyan { color: var(--accent-cyan); }

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 1.25rem;
}

.chart-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card-header-clean {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.title-icon { width: 22px; height: 22px; }
.card-title { font-size: 1.12rem; font-weight: 700; color: var(--text-primary); }
.card-desc { font-size: 0.82rem; color: var(--text-muted); }

.chart-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Accounts Section */
.accounts-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.accounts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.account-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  transition: all 0.2s;
}
.account-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.account-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}
.account-cat-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.account-cat-badge.asset { color: var(--accent-emerald); border-color: rgba(16, 185, 129, 0.3); }
.account-cat-badge.liability { color: var(--accent-rose); border-color: rgba(244, 63, 94, 0.3); }

.account-name { font-size: 0.98rem; font-weight: 700; color: var(--text-primary); margin-top: 0.3rem; }
.account-inst { font-size: 0.78rem; color: var(--text-muted); }

.account-balance {
  font-family: 'JetBrains Mono', 'Pretendard', monospace;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

.account-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}
.primary-tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.primary-tag svg { width: 12px; height: 12px; }

.acc-btn-group { display: flex; gap: 0.35rem; }
.btn-acc-action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 4px;
  transition: all 0.15s;
}
.btn-acc-action:hover { color: var(--text-primary); background: var(--border); }
.btn-acc-action.delete:hover { color: var(--accent-rose); }
.btn-acc-action svg { width: 15px; height: 15px; }

/* =========================================================================
   VIEW 2: MONTHLY SHEET STYLES
   ========================================================================= */

.monthly-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 1.2rem 1.5rem;
}

.period-navigator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-arrow-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}
.nav-arrow-btn:hover { border-color: var(--accent-primary); }
.nav-arrow-btn svg { width: 18px; height: 18px; }

.period-display {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}
.period-display svg { width: 18px; height: 18px; color: var(--accent-primary); }

.cashflow-equation {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.eq-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.eq-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }
.eq-val {
  font-family: 'JetBrains Mono', 'Pretendard', monospace;
  font-size: 1.15rem;
  font-weight: 800;
}
.eq-item.inc .eq-val { color: var(--accent-emerald); }
.eq-item.fix .eq-val { color: var(--accent-primary); }
.eq-item.exp .eq-val { color: var(--accent-rose); }
.eq-item.net .eq-val.highlight {
  color: var(--accent-cyan);
  font-size: 1.3rem;
  background: rgba(14, 165, 233, 0.12);
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(14, 165, 233, 0.3);
}
.eq-sign { font-size: 1.25rem; font-weight: 800; color: var(--text-muted); }

/* 3 Columns Layout */
.monthly-columns-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.column-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 480px;
}

.col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.col-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.col-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.col-icon-box svg { width: 18px; height: 18px; }
.col-title { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.col-sub { font-size: 0.76rem; color: var(--text-muted); }
.col-btn-group { display: flex; gap: 0.4rem; }

.trans-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overflow-y: auto;
  max-height: 520px;
  padding-right: 0.25rem;
}

.trans-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: all 0.15s;
}
.trans-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.trans-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}
.trans-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.trans-cat-pill {
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-secondary);
}
.trans-pm-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
}
.trans-pm-pill[data-pm="지역화폐"] {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.28);
  color: #34d399;
}
.trans-pm-pill[data-pm="신용카드"] {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.28);
  color: #a78bfa;
}
.trans-pm-pill[data-pm="체크카드"] {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.28);
  color: #60a5fa;
}
.trans-pm-pill[data-pm="간편결제"] {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.28);
  color: #fbbf24;
}
.trans-pm-pill[data-pm="현금"] {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.28);
  color: #38bdf8;
}
.trans-title { font-size: 0.92rem; font-weight: 700; color: var(--text-primary); }

.trans-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.trans-amount {
  font-family: 'JetBrains Mono', 'Pretendard', monospace;
  font-size: 1rem;
  font-weight: 800;
}
.col-income .trans-amount { color: var(--accent-emerald); }
.col-fixed .trans-amount { color: var(--accent-primary); }
.col-expense .trans-amount { color: var(--accent-rose); }

.trans-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.btn-trans-edit,
.btn-trans-del {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-trans-edit:hover { color: var(--accent-primary); background: rgba(99, 102, 241, 0.15); }
.btn-trans-del:hover { color: var(--accent-rose); background: rgba(244, 63, 94, 0.15); }
.btn-trans-edit svg,
.btn-trans-del svg { width: 14px; height: 14px; }

.empty-list-msg {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.84rem;
}

/* Bottom Settlement Card */
.settlement-card {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(17, 24, 39, 0.95));
  border: 1px solid rgba(14, 165, 233, 0.35);
  box-shadow: 0 10px 30px rgba(14, 165, 233, 0.12);
}

.settlement-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.settlement-info-pane {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-width: 720px;
}

.settle-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  width: fit-content;
  margin-bottom: 0.2rem;
}
.settle-badge.settled {
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}
.settle-badge svg { width: 14px; height: 14px; }

.settle-title { font-size: 1.35rem; font-weight: 800; color: var(--text-primary); }
.settle-desc { font-size: 0.86rem; color: var(--text-secondary); line-height: 1.5; }

.settlement-action-pane {
  display: flex;
  align-items: flex-end;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.form-group-compact {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.form-label-sm { font-size: 0.76rem; font-weight: 700; color: var(--text-muted); }
.form-select-sm {
  padding: 0.6rem 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.86rem;
  outline: none;
}

.btn-settle {
  padding: 0.75rem 1.4rem;
  font-size: 0.95rem;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

/* =========================================================================
   BUTTONS & FORMS
   ========================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
}
.btn svg { width: 15px; height: 15px; }

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.78rem; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), #4338ca);
  color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}
.modal-overlay.active { display: flex; }

.modal-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: modalFadeIn 0.2s ease-out;
  overflow: hidden;
}
@keyframes modalFadeIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-title-wrap { display: flex; align-items: center; gap: 0.75rem; }
.modal-badge-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-badge-icon svg { width: 20px; height: 20px; }
.modal-title { font-size: 1.15rem; font-weight: 800; color: var(--text-primary); }
.modal-desc { font-size: 0.78rem; color: var(--text-muted); }

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 4px;
}
.modal-close:hover { color: var(--text-primary); background: var(--border); }
.modal-close svg { width: 18px; height: 18px; }

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  overflow-y: auto;
  max-height: 75vh;
}

.form-row { display: flex; gap: 1rem; }
.flex-1 { flex: 1; }

.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}
.form-label svg { width: 14px; height: 14px; color: var(--accent-primary); }

.form-input, .form-select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
}
.form-input:focus, .form-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-checkbox-group {
  margin-top: 0.35rem;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  padding: 1.1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

/* Loading & Toast */
.loading-box {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}
.spin-icon { animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 700;
  z-index: 20000;
  display: none;
  animation: slideToast 0.3s ease;
}
@keyframes slideToast { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Footer */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  margin-top: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Responsive */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .accounts-grid { grid-template-columns: repeat(2, 1fr); }
  .monthly-columns-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-container { flex-direction: column; align-items: stretch; gap: 0.75rem; }
  .view-switch-group { width: 100%; justify-content: center; }
  .kpi-grid { grid-template-columns: 1fr; }
  .accounts-grid { grid-template-columns: 1fr; }
  .settlement-inner { flex-direction: column; align-items: stretch; }
  .settlement-action-pane { flex-direction: column; align-items: stretch; }
  .cashflow-equation { justify-content: space-between; }
  .fixed-columns-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   VIEW 3: FIXED BUDGET MASTER STYLES
   ========================================================================== */
.fixed-guide-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.05));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.fixed-guide-banner .banner-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fixed-guide-banner .banner-text strong {
  display: block;
  font-size: 0.92rem;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}
.fixed-guide-banner .banner-text p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.fixed-columns-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.col-fixed-master {
  display: flex;
  flex-direction: column;
}
.fixed-template-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  max-height: 520px;
  padding-right: 0.25rem;
}

.fixed-item-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  transition: all 0.2s ease;
}
.fixed-item-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.fixed-item-card.inactive-item {
  opacity: 0.55;
  background: rgba(255, 255, 255, 0.015);
}

.fixed-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.fixed-item-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.fixed-day-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}
.fixed-status-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
}
.fixed-status-badge.badge-active {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
}
.fixed-status-badge.badge-inactive {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
}

.fixed-item-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.btn-icon-xs {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.btn-icon-xs:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}
.btn-icon-xs svg { width: 15px; height: 15px; }

.fixed-item-mid {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}
.fixed-item-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
}
.fixed-item-amount {
  font-family: 'JetBrains Mono', 'Pretendard', monospace;
  font-size: 1.15rem;
  font-weight: 800;
}

.fixed-item-bot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border);
  padding-top: 0.45rem;
}
.fixed-pay-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.trans-acc-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
}
.fixed-memo {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-style: italic;
}

/* ==========================================================================
   FEATURE 2: AI CARD / RECEIPT MODAL & STYLES
   ========================================================================== */
.modal-card.modal-lg {
  max-width: 900px;
  width: 95%;
}

.ai-drop-zone {
  border: 2px dashed rgba(99, 102, 241, 0.45);
  border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: rgba(99, 102, 241, 0.03);
  cursor: pointer;
  transition: all 0.2s ease;
}
.ai-drop-zone:hover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
  transform: translateY(-2px);
}
.drop-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
  color: #a5b4fc;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}
.drop-icon-box svg { width: 26px; height: 26px; }
.drop-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}
.drop-title strong {
  color: #818cf8;
  background: rgba(99, 102, 241, 0.15);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}
.drop-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.preview-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--accent-emerald);
  font-weight: 600;
}
.preview-thumb-box {
  max-height: 180px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #000;
  display: flex;
  justify-content: center;
}
.preview-thumb-box img {
  max-height: 180px;
  width: auto;
  object-fit: contain;
}

.ai-loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  text-align: center;
}
.spinner-ring {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(99, 102, 241, 0.15);
  border-top-color: #818cf8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}
.ai-loading-box h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}
.ai-loading-box p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ai-stats-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.stat-pill {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stat-pill .lbl { font-size: 0.75rem; color: var(--text-muted); }
.stat-pill strong { font-size: 0.95rem; font-family: 'JetBrains Mono', monospace; }
.stat-pill.new { border-color: rgba(16, 185, 129, 0.35); background: rgba(16, 185, 129, 0.08); }
.stat-pill.new strong { color: var(--accent-emerald); }
.stat-pill.dup { border-color: rgba(244, 63, 94, 0.35); background: rgba(244, 63, 94, 0.08); }
.stat-pill.dup strong { color: var(--accent-rose); }

.ai-table-container {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.ai-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.ai-items-table th {
  background: var(--bg-surface);
  padding: 0.6rem 0.7rem;
  text-align: left;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}
.ai-items-table td {
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.ai-row-dup {
  background: rgba(244, 63, 94, 0.06);
  opacity: 0.65;
}
.ai-row-new {
  background: transparent;
}
.ai-row-new:hover {
  background: rgba(255, 255, 255, 0.025);
}

.badge-new {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}
.badge-new svg { width: 11px; height: 11px; }

.badge-dup {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
}
.badge-dup svg { width: 11px; height: 11px; }

.type-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}
.type-tag.inc { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.type-tag.exp { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }

.pm-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-ai-receipt-trigger {
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.35);
  transition: all 0.2s ease;
}
.btn-ai-receipt-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
}

/* ==========================================================================
   AI WEALTH MANAGER (자산관리 매니저) STYLES
   ========================================================================== */
.wealth-manager-card {
  margin-bottom: 1.5rem;
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 25px -10px rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.wealth-manager-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), var(--accent-cyan), transparent);
}

.wm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.wm-title-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.wm-icon-badge {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.25);
}
.wm-icon-badge svg { width: 24px; height: 24px; }

.wm-header-flex {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.2rem;
}

.wm-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.wm-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
}
.wm-tag svg { width: 12px; height: 12px; }

.wm-subtitle {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.wm-actions {
  display: flex;
  gap: 0.6rem;
}

/* 3-Column Grid */
.wm-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 1080px) {
  .wm-grid {
    grid-template-columns: 1fr;
  }
}

.wm-col {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(8px);
}

.wm-metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.wm-metric-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.wm-metric-label svg { width: 15px; height: 15px; color: var(--accent-primary); }

.wm-badge-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.18);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.wm-badge-pill.pill-emerald { background: rgba(16, 185, 129, 0.18); color: var(--accent-emerald); border-color: rgba(16, 185, 129, 0.3); }
.wm-badge-pill.pill-cyan { background: rgba(6, 182, 212, 0.18); color: var(--accent-cyan); border-color: rgba(6, 182, 212, 0.3); }
.wm-badge-pill.pill-rose { background: rgba(244, 63, 94, 0.18); color: var(--accent-rose); border-color: rgba(244, 63, 94, 0.3); }
.wm-badge-pill.pill-indigo { background: rgba(129, 140, 248, 0.18); color: #a5b4fc; border-color: rgba(129, 140, 248, 0.3); }

/* Score Box */
.wm-score-display {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
.wm-score-val {
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
}
.wm-score-max {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.wm-meter-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1.1rem;
}
.wm-meter-bar {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-emerald));
  transition: width 0.6s ease;
}

.wm-sub-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.wm-sub-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}
.wm-sub-item .sub-label { color: var(--text-muted); }
.wm-sub-item .sub-val { font-weight: 600; color: var(--text-primary); }

/* Debt Box & Simulator */
.wm-target-debt-info {
  margin-bottom: 1rem;
}
.wm-target-debt-info .target-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.wm-target-debt-info .target-amount {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.wm-target-debt-info .target-desc {
  margin: 0.35rem 0 0 0;
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.wm-sim-wrap {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
}
.sim-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.sim-val-text {
  color: var(--accent-cyan);
  font-weight: 700;
}
.wm-slider {
  width: 100%;
  height: 6px;
  accent-color: var(--accent-cyan);
  margin-bottom: 0.85rem;
  cursor: pointer;
}
.sim-result-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.sim-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.sim-chip .chip-k { font-size: 0.68rem; color: var(--text-muted); }
.sim-chip .chip-v { font-size: 0.82rem; font-weight: 700; }

/* Actions Box */
.wm-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.wm-check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  transition: all 0.2s ease;
}
.wm-check-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.3);
}
.wm-check-item .check-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.wm-check-item .check-icon svg { width: 12px; height: 12px; }
.wm-check-item .check-text { flex: 1; }
.wm-check-item .check-num {
  font-size: 0.65rem;
  font-weight: 800;
  color: #818cf8;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.15rem;
}
.wm-check-item p {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-primary);
  line-height: 1.35;
}

.wm-action-footer {
  text-align: right;
  padding-top: 0.5rem;
}
.btn-read-more {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s;
}
.btn-read-more:hover {
  color: #fff;
  background: rgba(6, 182, 212, 0.15);
}
.btn-read-more svg { width: 14px; height: 14px; }

/* Markdown Report Modal Styles */
.markdown-report-body {
  max-height: 70vh;
  overflow-y: auto;
  padding: 1.5rem;
  color: #cbd5e1;
  font-size: 0.92rem;
  line-height: 1.7;
}

.md-rendered-wrap h2.md-h2 {
  font-size: 1.35rem;
  color: #fff;
  margin: 1.5rem 0 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.5rem;
}
.md-rendered-wrap h3.md-h3 {
  font-size: 1.15rem;
  color: #e2e8f0;
  margin: 1.25rem 0 0.5rem 0;
}
.md-rendered-wrap h4.md-h4 {
  font-size: 1.02rem;
  color: var(--accent-cyan);
  margin: 1.1rem 0 0.4rem 0;
}
.md-rendered-wrap strong {
  color: #fff;
  font-weight: 700;
}
.md-rendered-wrap li.md-li {
  margin-bottom: 0.4rem;
  padding-left: 0.2rem;
}
.md-rendered-wrap blockquote.md-quote {
  margin: 1rem 0;
  padding: 0.85rem 1.1rem;
  background: rgba(99, 102, 241, 0.1);
  border-left: 4px solid var(--accent-primary);
  border-radius: 0 8px 8px 0;
  color: #e2e8f0;
}
.md-rendered-wrap table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.85rem;
}
.md-rendered-wrap table th,
.md-rendered-wrap table td {
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.md-rendered-wrap table th {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 700;
}

/* =========================================================================
   MONTHLY EXPENSE ANALYTICS & OVERSPENDING DIAGNOSIS
   ========================================================================= */
.monthly-analytics-card {
  margin-bottom: 1.5rem;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
}

.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.4rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.analytics-target-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.target-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.target-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.target-tab-btn.active {
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.analytics-body-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 980px) {
  .analytics-body-grid {
    grid-template-columns: 1fr;
  }
}

.analytics-chart-box {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.chart-box-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.analytics-canvas-wrap {
  width: 200px;
  height: 200px;
  position: relative;
  margin: 0.25rem 0;
}

.analytics-total-badge {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-sm);
  width: 100%;
}

.analytics-total-badge .label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.analytics-total-badge .val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
}

.analytics-details-box {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.ranking-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  flex-wrap: wrap;
  gap: 0.6rem;
}

.ranking-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ranking-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--accent-indigo);
  font-weight: 800;
}

.ranking-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-tool-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-tool-sm:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-tool-sm.btn-tool-ai {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}

.btn-tool-sm.btn-tool-ai:hover {
  background: rgba(99, 102, 241, 0.28);
  color: #fff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.35);
}

.subitems-summary-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
}

.subitems-summary-badge.safe {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.subitems-summary-badge.warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.subitems-summary-badge.over {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fb7185;
}

.badge-subitem-status {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}

.badge-subitem-status.safe {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-subitem-status.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-subitem-status.over {
  background: rgba(244, 63, 94, 0.18);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

/* Category Cards Grid (비목별 미니 카드 그리드 - 스크롤 없이 한눈에 보기) */
.category-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 0.65rem;
  width: 100%;
}

.cat-grid-card {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.cat-grid-card:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: var(--cat-color, rgba(99, 102, 241, 0.4));
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.cat-grid-card.is-over {
  border-color: rgba(244, 63, 94, 0.45);
  background: rgba(244, 63, 94, 0.06);
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.15);
}

.cat-grid-card.is-warning {
  border-color: rgba(245, 158, 11, 0.35);
}

.cat-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}

.cat-card-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.cat-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
}
.cat-icon-wrap svg { width: 12px; height: 12px; }

.cat-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-card-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  margin: 0.15rem 0;
}

.cat-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.72rem;
}

.cat-metric-row .metric-label {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
}

.cat-metric-row .metric-target {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--text-secondary);
}

.cat-metric-row.main .metric-spent {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 800;
}

.cat-metric-row.sub .metric-rem {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.74rem;
}

.cat-card-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.15rem;
}

.cat-card-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.cat-card-fill.fill-emerald {
  background: linear-gradient(90deg, #10b981, #059669);
}

.cat-card-fill.fill-amber {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.cat-card-fill.fill-rose {
  background: linear-gradient(90deg, #f43f5e, #e11d48);
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.5);
}

.cat-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
}

.budget-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

@media (max-width: 600px) {
  .budget-edit-grid {
    grid-template-columns: 1fr;
  }
}

.overspending-advice-box {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 1.1rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  color: #fef3c7;
  font-size: 0.84rem;
  line-height: 1.5;
}

.advice-icon {
  color: #fbbf24;
  margin-top: 2px;
}

.advice-content strong {
  color: #fff;
  font-weight: 700;
}

/* Target Badges in Transaction Items */
.trans-target-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.trans-target-pill.dad {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.trans-target-pill.family {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.trans-target-pill.spouse {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.25);
}

.trans-target-pill.child1,
.trans-target-pill.child2 {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* =============================================================================
   MORTGAGE LOAN REPAYMENT TRACKER & SCHEDULE MODAL
   ============================================================================= */
.loan-tracker-card {
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(59, 130, 246, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.loan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.loan-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.loan-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(16, 185, 129, 0.2));
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loan-icon-badge svg { width: 22px; height: 22px; }

.loan-header-flex {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.loan-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.loan-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.loan-tag svg { width: 13px; height: 13px; }

.loan-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.loan-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* 4-Stat Metric Strip */
.loan-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

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

@media (max-width: 640px) {
  .loan-stats-grid { grid-template-columns: 1fr; }
}

.loan-stat-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: all 0.2s;
}

.loan-stat-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-hover);
}

.l-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.l-value-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.l-val-main {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.l-badge-accent {
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

.loan-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.2rem 0;
}

.lp-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #3b82f6);
  border-radius: 999px;
  transition: width 0.5s ease;
}

.l-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.l-breakdown-chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.l-chip {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
}

.chip-principal {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.chip-interest {
  background: rgba(244, 63, 94, 0.12);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.25);
}

/* Modal XL & Amortization Schedule */
.modal-card-xl {
  max-width: 980px !important;
  width: 95vw !important;
}

.modal-schedule-body {
  max-height: 78vh;
  overflow-y: auto;
  padding: 1.25rem 1.5rem !important;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.schedule-summary-banner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

@media (max-width: 768px) {
  .schedule-summary-banner { grid-template-columns: repeat(2, 1fr); }
}

.ss-box {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ss-lbl {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.ss-val {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
}

.schedule-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.sc-info {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.sc-info svg { width: 15px; height: 15px; color: #38bdf8; }

.schedule-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  max-height: 480px;
  overflow-y: auto;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.schedule-table th {
  position: sticky;
  top: 0;
  background: #1e293b;
  z-index: 2;
  padding: 0.75rem 0.85rem;
  color: var(--text-secondary);
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}

.schedule-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.schedule-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.schedule-row-current td {
  background: rgba(56, 189, 248, 0.12) !important;
  border-top: 1px solid rgba(56, 189, 248, 0.3);
  border-bottom: 1px solid rgba(56, 189, 248, 0.3);
  font-weight: 700;
}

.badge-paid {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-current {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.12rem 0.5rem;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.badge-upcoming {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* =========================================================================
   TOP QUICK EXPENSE REGISTER CARD (모바일 최상단 전진 배치)
   ========================================================================= */
.quick-expense-card {
  margin-bottom: 1.25rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 16px rgba(99, 102, 241, 0.1);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.quick-expense-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
}

.quick-exp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.quick-exp-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.quick-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.25));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.quick-icon-badge svg { width: 18px; height: 18px; }

.quick-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-mobile-top {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.quick-desc {
  margin: 0.2rem 0 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.quick-form-grid {
  display: grid;
  grid-template-columns: 140px 150px 160px 1fr 140px 110px;
  gap: 0.75rem;
  align-items: flex-end;
}

.form-label-xs {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.form-label-xs svg { width: 13px; height: 13px; color: var(--accent-primary); }

.form-input-sm, .form-select-sm {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #fff;
  transition: all 0.2s ease;
}

.form-input-sm:focus, .form-select-sm:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  outline: none;
}

.btn-quick-submit {
  width: 100%;
  padding: 0.55rem 0.85rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.quick-options-row {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quick-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.quick-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #f59e0b;
}

.chk-text {
  font-size: 0.82rem;
  color: #fbbf24;
}

.chk-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

@media (max-width: 960px) {
  .quick-form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .quick-field.field-title {
    grid-column: span 2;
  }
  .quick-field.field-btn {
    grid-column: span 2;
  }
}

/* =========================================================================
   REALTIME FINANCIAL DIAGNOSTICS & ACTION COACHING
   ========================================================================= */
.diagnostics-banner-card {
  margin-bottom: 1.25rem;
  padding: 1.25rem 1.5rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
}

.diag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.diag-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.diag-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
}

.diag-icon-badge svg { width: 20px; height: 20px; }

.diag-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.diag-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.diag-badge-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.6rem;
  border-radius: 12px;
}

.diag-badge-pill.pill-danger {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.diag-badge-pill.pill-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.diag-badge-pill.pill-success {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.diag-desc {
  margin: 0.2rem 0 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-rebalance-trigger {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  font-weight: 700;
  padding: 0.5rem 0.85rem;
}

.diag-alerts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.diag-alert-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.diag-alert-item.alert-warning {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.25);
}

.diag-alert-item.alert-success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

.diag-alert-item.alert-normal {
  background: rgba(6, 182, 212, 0.08);
  border-color: rgba(6, 182, 212, 0.25);
}

.alert-icon-box svg { width: 18px; height: 18px; margin-top: 2px; }

.alert-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.alert-warning .alert-label { color: #fb7185; }
.alert-success .alert-label { color: #34d399; }
.alert-normal .alert-label { color: #38bdf8; }

.alert-msg {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.diag-action-strip {
  padding: 0.65rem 1rem;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #e0e7ff;
}

.action-strip-icon { width: 16px; height: 16px; color: #a855f7; flex-shrink: 0; }

/* =========================================================================
   MONTHLY CLOSURE AI REVIEW CARD
   ========================================================================= */
.monthly-review-card {
  margin-bottom: 1.25rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.9));
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-md);
}

.rev-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.rev-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.rev-grade-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 1.35rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.rev-grade-badge.grade-B { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.rev-grade-badge.grade-C { background: linear-gradient(135deg, #f59e0b, #d97706); }
.rev-grade-badge.grade-D { background: linear-gradient(135deg, #ef4444, #dc2626); }

.rev-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
}

.rev-subtitle {
  margin: 0.15rem 0 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.rev-text-box {
  margin: 0;
  padding: 1rem 1.2rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.86rem;
  line-height: 1.65;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-all;
}

/* =========================================================================
   IRREGULAR EXPENSE BADGES & HIGHLIGHTS
   ========================================================================= */
.trans-irregular-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.trans-item.is-irregular-item {
  border-left: 3px solid #f59e0b;
}

/* =========================================================================
   MOBILE FLOATING ACTION BUTTON (FAB)
   ========================================================================= */
.mobile-fab-btn {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0.8rem 1.3rem;
  font-weight: 800;
  font-size: 0.92rem;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5), 0 0 12px rgba(139, 92, 246, 0.4);
  cursor: pointer;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

.mobile-fab-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.6);
}

.mobile-fab-btn svg { width: 18px; height: 18px; }

@media (max-width: 768px) {
  .mobile-fab-btn {
    display: inline-flex;
  }
}

