@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:        #070c1b;
  --bg-2:      #0c1328;
  --surface:   rgba(16, 24, 52, 0.96);
  --surface-2: rgba(22, 33, 66, 0.98);
  --surface-hi: rgba(26, 40, 80, 0.99);

  --border:    rgba(99, 140, 255, 0.22);
  --border-hi: rgba(99, 140, 255, 0.52);

  --text:      #f0f4ff;
  --text-2:    #c8d4f0;
  --muted:     #8fa3cc;
  --faint:     #4a5f8a;

  --blue:   #5b9dff;
  --cyan:   #00f0d4;
  --violet: #a87aff;
  --green:  #2edc82;
  --red:    #ff5577;
  --amber:  #ffbf55;

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;

  --sidebar-w: 360px;
  --nav-h: 64px;

  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 10%  0%,   rgba(91,157,255,.16)  0%, transparent 55%),
    radial-gradient(ellipse 50% 35% at 88%  8%,   rgba(168,122,255,.13) 0%, transparent 50%),
    radial-gradient(ellipse 55% 65% at 55% 100%,  rgba(0,240,212,.10)   0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* ── LAYOUT ─────────────────────────────────── */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── SIDEBAR ─────────────────────────────────── */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 16px 32px;
  border-right: 1px solid var(--border);
  background: rgba(6, 10, 22, 0.98);
  scrollbar-width: thin;
  scrollbar-color: var(--faint) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--faint); border-radius: 99px; }

/* ── BRAND CARD ──────────────────────────────── */

.brand-card {
  padding: 22px 18px 24px;
  margin-bottom: 14px;
  border-radius: var(--r-lg);
  background: linear-gradient(
    135deg,
    rgba(91, 157, 255, 0.24) 0%,
    rgba(168, 122, 255, 0.18) 55%,
    rgba(0, 240, 212, 0.14) 100%
  );
  border: 1px solid rgba(91, 157, 255, 0.42);
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 4px 28px rgba(91,157,255,.20);
}

.brand-card::before {
  content: '';
  position: absolute;
  top: -40px; left: -20px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91,157,255,.25) 0%, transparent 65%);
  pointer-events: none;
}

.brand-card::after {
  content: '';
  position: absolute;
  bottom: -30px; right: -20px;
  width: 130px; height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168,122,255,.20) 0%, transparent 60%);
  pointer-events: none;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: .18em;
  margin-bottom: 8px;
  position: relative;
}

.brand-card h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 8px;
  position: relative;
  text-shadow: 0 2px 12px rgba(91,157,255,.30);
}

.brand-card p {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.65;
  position: relative;
}

/* ── SECTION BLOCKS ──────────────────────────── */

.section-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,.25);
}

.section-block h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-block h2::before {
  content: '';
  display: inline-block;
  width: 3px; height: 14px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--blue), var(--cyan));
  flex-shrink: 0;
}

/* ── FORMS ───────────────────────────────────── */

.form-grid { display: grid; gap: 8px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid.compact label { min-width: 0; }

label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted);
  letter-spacing: .03em;
}

input, select {
  background: rgba(10, 16, 38, 0.90);
  border: 1px solid rgba(99,140,255,.28);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 9px 11px;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(91,157,255,.18);
}

select option { background: #0c1430; color: var(--text); }

/* ── BUTTONS ─────────────────────────────────── */

button {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  border: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, opacity .2s;
  white-space: nowrap;
}

button:active { transform: scale(.97); }

button.primary {
  background: linear-gradient(135deg, #3a72ff, #7aabff);
  color: #fff;
  box-shadow: 0 4px 18px rgba(91,157,255,.40);
  text-shadow: 0 1px 4px rgba(0,0,0,.3);
}

button.primary:hover {
  box-shadow: 0 6px 28px rgba(91,157,255,.58);
  transform: translateY(-1px);
}

button.secondary {
  background: rgba(91,157,255,.14);
  color: var(--blue);
  border: 1px solid rgba(91,157,255,.30);
}

button.secondary:hover {
  background: rgba(91,157,255,.24);
  border-color: rgba(91,157,255,.50);
}

.action-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* ── FILE UPLOAD ─────────────────────────────── */

.file-box {
  display: block;
  margin-top: 10px;
  border: 1px dashed rgba(91,157,255,.45);
  border-radius: var(--r-md);
  padding: 16px;
  text-align: center;
  background: rgba(91,157,255,.06);
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  transition: border-color .2s, background .2s, color .2s;
}

.file-box:hover {
  border-color: var(--blue);
  background: rgba(91,157,255,.12);
  color: var(--text);
}

.file-box input { display: none; }

/* ── BUDGET LIST ─────────────────────────────── */

.budget-list { display: grid; gap: 8px; }

.budget-item {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 10px;
  align-items: center;
  background: rgba(10, 16, 40, .85);
  border: 1px solid rgba(99,140,255,.20);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-2);
  transition: border-color .2s;
}

.budget-item:hover { border-color: rgba(99,140,255,.38); }

/* ── META LIST ───────────────────────────────── */

.meta-list { margin-top: 12px; display: grid; gap: 6px; }

.meta-item {
  background: rgba(0,240,212,.07);
  border: 1px solid rgba(0,240,212,.22);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.meta-item strong { color: var(--cyan); }

/* ── MAIN PANEL ──────────────────────────────── */

.main-panel {
  padding: 20px 20px 40px;
  overflow-x: hidden;
}

/* ─────────────────────────────────────────────
   HERO SECTION — 자산/수입/지출 한눈에
   ───────────────────────────────────────────── */

.hero-section {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: 28px 32px;
  margin-bottom: 20px;
  background: linear-gradient(
    130deg,
    rgba(26, 40, 88, 0.98) 0%,
    rgba(18, 28, 68, 0.98) 45%,
    rgba(12, 20, 52, 0.98) 100%
  );
  border: 1px solid rgba(91, 157, 255, 0.36);
  box-shadow:
    0 8px 48px rgba(0,0,0,.50),
    inset 0 1px 0 rgba(255,255,255,.07),
    0 0 100px rgba(91,157,255,.08);
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -80px; left: -60px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91,157,255,.14) 0%, transparent 65%);
  pointer-events: none;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -90px; right: -50px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168,122,255,.12) 0%, transparent 62%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: flex-start;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: .18em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: heroPulse 2.2s ease-in-out infinite;
}

@keyframes heroPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .45; transform: scale(.75); }
}

.hero-asset-total {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 42px;
  letter-spacing: -.05em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
  text-shadow: 0 4px 24px rgba(91,157,255,.28);
}

.hero-asset-label {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: .05em;
}

.hero-stats {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  flex-shrink: 0;
  padding-top: 4px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  min-width: 110px;
  padding: 12px 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--r-md);
  backdrop-filter: blur(8px);
}

.hero-stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: .10em;
}

.hero-stat-value {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -.03em;
  line-height: 1.1;
}

.hero-stat-value.income  { color: var(--green);  text-shadow: 0 2px 14px rgba(46,220,130,.32); }
.hero-stat-value.expense { color: var(--amber);  text-shadow: 0 2px 14px rgba(255,191,85,.30); }
.hero-stat-value.saving  { color: var(--cyan);   text-shadow: 0 2px 14px rgba(0,240,212,.32); }

.hero-stat-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--faint);
}

.hero-progress-wrap {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(99,140,255,.16);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-progress-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  min-width: 120px;
}

.hero-progress-bar {
  flex: 1;
  height: 7px;
  min-width: 80px;
  background: rgba(99,140,255,.16);
  border-radius: 99px;
  overflow: hidden;
}

.hero-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  box-shadow: 0 0 14px rgba(91,157,255,.55);
  transition: width .9s cubic-bezier(.34,1.1,.64,1);
  min-width: 4px;
}

.hero-progress-pct {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  color: var(--cyan);
  white-space: nowrap;
}

/* ── KPI CARDS ───────────────────────────────── */

.top-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-card {
  border-radius: var(--r-lg);
  padding: 20px 20px 18px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  border: 1px solid;
}

/* 카드별 색상 테마 */
.kpi-card:nth-child(1) {
  background: linear-gradient(150deg, rgba(91,157,255,.18) 0%, rgba(16,24,52,.97) 65%);
  border-color: rgba(91,157,255,.35);
  box-shadow: 0 4px 20px rgba(91,157,255,.12), 0 2px 8px rgba(0,0,0,.3);
}
.kpi-card:nth-child(2) {
  background: linear-gradient(150deg, rgba(168,122,255,.17) 0%, rgba(16,24,52,.97) 65%);
  border-color: rgba(168,122,255,.32);
  box-shadow: 0 4px 20px rgba(168,122,255,.10), 0 2px 8px rgba(0,0,0,.3);
}
.kpi-card:nth-child(3) {
  background: linear-gradient(150deg, rgba(255,191,85,.16) 0%, rgba(16,24,52,.97) 65%);
  border-color: rgba(255,191,85,.30);
  box-shadow: 0 4px 20px rgba(255,191,85,.10), 0 2px 8px rgba(0,0,0,.3);
}
.kpi-card:nth-child(4) {
  background: linear-gradient(150deg, rgba(46,220,130,.16) 0%, rgba(16,24,52,.97) 65%);
  border-color: rgba(46,220,130,.30);
  box-shadow: 0 4px 20px rgba(46,220,130,.10), 0 2px 8px rgba(0,0,0,.3);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
}

.kpi-card:nth-child(1)::before { background: linear-gradient(90deg, var(--blue), var(--violet)); }
.kpi-card:nth-child(2)::before { background: linear-gradient(90deg, var(--violet), var(--cyan)); }
.kpi-card:nth-child(3)::before { background: linear-gradient(90deg, var(--amber), var(--red)); }
.kpi-card:nth-child(4)::before { background: linear-gradient(90deg, var(--green), var(--cyan)); }

.kpi-card::after {
  content: '';
  position: absolute;
  top: -20px; right: -15px;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: .25;
  pointer-events: none;
}
.kpi-card:nth-child(1)::after { background: radial-gradient(circle, var(--blue)   60%, transparent 100%); }
.kpi-card:nth-child(2)::after { background: radial-gradient(circle, var(--violet) 60%, transparent 100%); }
.kpi-card:nth-child(3)::after { background: radial-gradient(circle, var(--amber)  60%, transparent 100%); }
.kpi-card:nth-child(4)::after { background: radial-gradient(circle, var(--green)  60%, transparent 100%); }

.kpi-card:hover {
  transform: translateY(-3px);
}

.kpi-card:nth-child(1):hover { border-color: rgba(91,157,255,.60);  box-shadow: 0 8px 32px rgba(91,157,255,.22), 0 2px 8px rgba(0,0,0,.4); }
.kpi-card:nth-child(2):hover { border-color: rgba(168,122,255,.55); box-shadow: 0 8px 32px rgba(168,122,255,.18), 0 2px 8px rgba(0,0,0,.4); }
.kpi-card:nth-child(3):hover { border-color: rgba(255,191,85,.55);  box-shadow: 0 8px 32px rgba(255,191,85,.16), 0 2px 8px rgba(0,0,0,.4); }
.kpi-card:nth-child(4):hover { border-color: rgba(46,220,130,.55);  box-shadow: 0 8px 32px rgba(46,220,130,.16), 0 2px 8px rgba(0,0,0,.4); }

.kpi-card span {
  display: block;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 12px;
  position: relative;
}

.kpi-card strong {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -.03em;
  display: block;
  position: relative;
}

.kpi-card:nth-child(1) strong { color: #7db8ff; }
.kpi-card:nth-child(2) strong { color: #c4a2ff; }
.kpi-card:nth-child(3) strong { color: #ffd080; }
.kpi-card:nth-child(4) strong { color: #4af09a; }

/* ── GRID LAYOUTS ─────────────────────────────── */

.grid-4, .grid-3, .grid-2 {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.grid-4  { grid-template-columns: repeat(4, 1fr); }
.grid-3  { grid-template-columns: repeat(3, 1fr); }
.grid-2  { grid-template-columns: repeat(2, 1fr); }
.stretch > * { min-height: 0; }

/* ── PANELS ──────────────────────────────────── */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: 0 2px 16px rgba(0,0,0,.28);
}

.panel:hover {
  border-color: rgba(99,140,255,.38);
  box-shadow: 0 4px 28px rgba(0,0,0,.38);
}

.panel h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -.01em;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2 { margin-bottom: 0; }

/* ── ANALYSIS BOX ─────────────────────────────── */

.analysis-box {
  background: rgba(7, 11, 28, .88);
  border: 1px solid rgba(99,140,255,.20);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: 13px;
  font-family: var(--font-body);
  line-height: 1.82;
  color: var(--text-2);
  white-space: pre-wrap;
  min-height: 120px;
}

/* ── INSIGHT CARDS ────────────────────────────── */

.stack { display: grid; gap: 8px; }

.insight-item {
  background: rgba(91,157,255,.08);
  border: 1px solid rgba(91,157,255,.20);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-2);
  transition: border-color .2s, background .2s;
}

.insight-item:hover {
  background: rgba(91,157,255,.13);
  border-color: rgba(91,157,255,.36);
}

.insight-item strong { color: var(--text); font-weight: 600; }

/* ── TABLE ───────────────────────────────────── */

.table-wrap {
  overflow: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.table-wrap.tall { max-height: 480px; }

.table-wrap::-webkit-scrollbar { width: 4px; height: 4px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--faint); border-radius: 99px; }

table { width: 100%; border-collapse: collapse; background: rgba(7,11,28,.88); }

th {
  padding: 10px 12px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(10, 16, 36, .99);
  z-index: 1;
}

td {
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid rgba(99,140,255,.08);
  color: var(--text-2);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(91,157,255,.06); color: var(--text); }

/* ── STATUS COLORS ───────────────────────────── */

.ok     { color: var(--green); font-weight: 600; }
.warn   { color: var(--amber); font-weight: 600; }
.danger { color: var(--red);   font-weight: 600; }

/* ── PILL ────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 99px;
  background: rgba(91,157,255,.16);
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .05em;
  border: 1px solid rgba(91,157,255,.30);
}

/* ── CALENDAR ────────────────────────────────── */

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-2);
}

.calendar-nav button { padding: 5px 10px; font-size: 12px; border-radius: 8px; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.day-header {
  text-align: center;
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.calendar-day {
  min-height: 76px;
  background: rgba(10, 16, 38, .82);
  border: 1px solid rgba(99,140,255,.18);
  border-radius: var(--r-sm);
  padding: 8px 7px;
  cursor: pointer;
  transition: border-color .15s, transform .15s, background .15s, box-shadow .15s;
}

.calendar-day:hover {
  border-color: rgba(91,157,255,.55);
  background: rgba(91,157,255,.09);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}

.calendar-day.empty { opacity: .2; cursor: default; pointer-events: none; }

.calendar-day.selected {
  border-color: var(--cyan);
  background: rgba(0,240,212,.08);
  box-shadow: 0 0 0 1px rgba(0,240,212,.28), 0 4px 18px rgba(0,0,0,.32);
}

.calendar-day .day-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 5px;
}

.calendar-day.selected .day-num { color: var(--cyan); }

.calendar-day .day-amt {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #7db8ff;
  line-height: 1.4;
}

/* ── CHARTS ──────────────────────────────────── */

canvas {
  width: 100% !important;
  max-height: 300px !important;
  border-radius: var(--r-md);
  padding: 8px;
}

/* ── MOBILE NAV BAR ──────────────────────────── */

.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(6, 10, 22, .98);
  border-top: 1px solid var(--border);
  z-index: 1000;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 0 4px;
  box-shadow: 0 -4px 32px rgba(0,0,0,.5);
}

.mobile-nav-inner {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: space-around;
  max-width: 480px;
  margin: 0 auto;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .2s, background .2s;
  flex: 1;
}

.nav-btn svg {
  width: 20px; height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.nav-btn.active {
  color: var(--blue);
  background: rgba(91,157,255,.14);
}

.nav-btn:active { transform: scale(.93); }

/* ── MOBILE SECTIONS ─────────────────────────── */

.mobile-section { display: block; }

/* ── TOAST ───────────────────────────────────── */

.toast-wrap {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(16, 24, 52, .98);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-md);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text);
  font-family: var(--font-body);
  box-shadow: 0 8px 40px rgba(0,0,0,.55);
  animation: toastIn .3s cubic-bezier(.34,1.56,.64,1) forwards;
  pointer-events: auto;
  max-width: 320px;
}

.toast.ok    { border-color: rgba(46,220,130,.45); color: var(--green); }
.toast.error { border-color: rgba(255,85,119,.45); color: var(--red); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(.95); }
  to   { opacity: 1; transform: translateX(0)    scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0)    scale(1); }
  to   { opacity: 0; transform: translateX(20px) scale(.95); }
}

/* ── RESPONSIVE ──────────────────────────────── */

@media (max-width: 1200px) {
  .top-kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-3   { grid-template-columns: repeat(2, 1fr); }
  .hero-asset-total { font-size: 36px; }
  .hero-stats { gap: 16px; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 300px; }
  .top-kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-4   { grid-template-columns: repeat(2, 1fr); }
  .kpi-card strong { font-size: 20px; }
  .hero-asset-total { font-size: 30px; }
  .hero-stat-value  { font-size: 17px; }
}

/* ── MOBILE BREAKPOINT ───────────────────────── */

@media (max-width: 720px) {
  .app-shell { display: block; padding-bottom: var(--nav-h); }

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px;
  }

  .main-panel { padding: 12px 12px 20px; }

  .mobile-section { display: none; }
  .mobile-section.active { display: block; }

  .mobile-nav { display: flex; }

  .top-kpis  { grid-template-columns: 1fr 1fr; }
  .grid-4    { grid-template-columns: 1fr 1fr; }
  .grid-3    { grid-template-columns: 1fr; }
  .grid-2    { grid-template-columns: 1fr; }

  .form-grid.two { grid-template-columns: 1fr; }

  .brand-card h1 { font-size: 15px; }

  .kpi-card { padding: 14px 16px; }
  .kpi-card strong { font-size: 18px; }

  .calendar-day { min-height: 60px; }
  .calendar-day .day-num { font-size: 11px; }
  .calendar-day .day-amt { font-size: 9px; }

  canvas { max-height: 220px !important; }

  .hero-section  { padding: 18px 16px; border-radius: var(--r-lg); }
  .hero-inner    { grid-template-columns: 1fr; gap: 16px; }
  .hero-asset-total { font-size: 30px; }
  .hero-stats    { gap: 10px; justify-content: flex-start; flex-wrap: wrap; }
  .hero-stat     { align-items: flex-start; min-width: 100px; flex: 1; }
  .hero-stat-value { font-size: 17px; }
}

@media (max-width: 400px) {
  .top-kpis { grid-template-columns: 1fr; }
  .grid-4   { grid-template-columns: 1fr; }
  .hero-asset-total { font-size: 24px; }
}

/* ═══════════════════════════════════════════
   AUTH STRIP
   ═══════════════════════════════════════════ */

.auth-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: var(--r-md);
  background: rgba(91, 157, 255, 0.07);
  border: 1px solid rgba(91, 157, 255, 0.20);
  transition: background .2s, border-color .2s;
}

.auth-strip.logged-in {
  background: rgba(46, 220, 130, 0.08);
  border-color: rgba(46, 220, 130, 0.28);
}

.auth-strip-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.auth-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  color: var(--muted);
}

.auth-strip.logged-in .auth-icon { color: var(--green); }

#authStatus {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.auth-strip.logged-in #authStatus { color: var(--green); }

.auth-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(91, 157, 255, 0.30);
  background: rgba(91, 157, 255, 0.12);
  color: var(--blue);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .2s, border-color .2s;
}

.auth-btn:hover:not(:disabled) {
  background: rgba(91, 157, 255, 0.22);
  border-color: rgba(91, 157, 255, 0.50);
}

.auth-strip.logged-in .auth-btn {
  background: rgba(255, 85, 119, 0.10);
  border-color: rgba(255, 85, 119, 0.25);
  color: var(--red);
}

.auth-strip.logged-in .auth-btn:hover {
  background: rgba(255, 85, 119, 0.20);
  border-color: rgba(255, 85, 119, 0.45);
}

.auth-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}


/* ═══════════════════════════════════════════
   PIN GATE
   ═══════════════════════════════════════════ */

.pin-gate {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(4, 7, 18, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pin-gate.fade-out {
  animation: pinFadeOut .4s ease forwards;
}

@keyframes pinFadeOut {
  to { opacity: 0; transform: scale(1.04); }
}

.pin-card {
  background: rgba(16, 24, 52, 0.98);
  border: 1px solid rgba(91, 157, 255, 0.35);
  border-radius: var(--r-xl);
  padding: 40px 36px 36px;
  width: 340px;
  max-width: 92vw;
  text-align: center;
  box-shadow:
    0 24px 80px rgba(0,0,0,.65),
    0 0 0 1px rgba(255,255,255,.04),
    inset 0 1px 0 rgba(255,255,255,.07);
  position: relative;
  overflow: hidden;
}

.pin-card::before {
  content: '';
  position: absolute;
  top: -60px; left: 50%;
  transform: translateX(-50%);
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91,157,255,.14) 0%, transparent 65%);
  pointer-events: none;
}

.pin-card.shake {
  animation: pinShake .45s ease;
}

@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  15%       { transform: translateX(-8px); }
  30%       { transform: translateX(8px); }
  45%       { transform: translateX(-6px); }
  60%       { transform: translateX(6px); }
  75%       { transform: translateX(-3px); }
  90%       { transform: translateX(3px); }
}

.pin-logo {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(91,157,255,.14);
  border: 1px solid rgba(91,157,255,.30);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  color: var(--blue);
}

.pin-card h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -.02em;
}

.pin-card p {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-bottom: 24px;
}

.pin-dots {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 8px;
}

.pin-dots span {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(91,157,255,.35);
  background: transparent;
  transition: background .15s, border-color .15s, box-shadow .15s;
}

.pin-dots span.filled {
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 0 10px rgba(91,157,255,.55);
}

.pin-error {
  height: 18px;
  font-size: 11px;
  color: var(--red);
  font-family: var(--font-mono);
  margin-bottom: 20px;
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.pin-key {
  background: rgba(91,157,255,.09);
  border: 1px solid rgba(91,157,255,.20);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  padding: 16px 0;
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .1s;
  line-height: 1;
}

.pin-key:hover {
  background: rgba(91,157,255,.18);
  border-color: rgba(91,157,255,.42);
}

.pin-key:active { transform: scale(.93); background: rgba(91,157,255,.28); }

.pin-clear { color: var(--amber); border-color: rgba(255,191,85,.22); background: rgba(255,191,85,.07); }
.pin-del   { color: var(--muted); font-size: 16px; }

/* ═══════════════════════════════════════════
   KPI CARD — 숫자 깨짐 방지
   ═══════════════════════════════════════════ */

.kpi-card strong {
  font-size: clamp(13px, 1.8vw, 20px) !important;
  word-break: break-all;
  overflow: hidden;
  line-height: 1.15;
  display: block;
  position: relative;
}

/* ═══════════════════════════════════════════
   BUDGET ITEM — 편집 모드
   ═══════════════════════════════════════════ */

.budget-item.editable {
  grid-template-columns: 1fr 110px 28px;
  gap: 8px;
}

.budget-name-input {
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid rgba(91,157,255,.25) !important;
  border-radius: 0 !important;
  padding: 4px 6px !important;
  font-size: 13px !important;
  color: var(--text-2) !important;
  font-family: var(--font-body) !important;
  box-shadow: none !important;
}

.budget-name-input:focus {
  border-bottom-color: var(--blue) !important;
  box-shadow: none !important;
  outline: none !important;
}

.budget-del-btn {
  background: transparent !important;
  border: none !important;
  color: var(--faint) !important;
  font-size: 13px !important;
  padding: 0 !important;
  cursor: pointer !important;
  border-radius: 6px !important;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s !important;
  box-shadow: none !important;
}

.budget-del-btn:hover {
  color: var(--red) !important;
  background: rgba(255,85,119,.12) !important;
}

/* ═══════════════════════════════════════════
   KEYWORD EDITOR
   ═══════════════════════════════════════════ */

.keyword-list { display: grid; gap: 8px; }

.keyword-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
  align-items: center;
}

.keyword-cat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.keyword-input {
  font-size: 12px !important;
  padding: 7px 10px !important;
  color: var(--text-2) !important;
}


/* ═══════════════════════════════════════════
   파일 가이드 버튼
   ═══════════════════════════════════════════ */

.guide-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 99px;
  background: rgba(0, 240, 212, 0.10);
  border: 1px solid rgba(0, 240, 212, 0.28);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .05em;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  white-space: nowrap;
}

.guide-pill-btn:hover {
  background: rgba(0, 240, 212, 0.18);
  border-color: rgba(0, 240, 212, 0.50);
}

/* ═══════════════════════════════════════════
   모달 공통
   ═══════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(4, 7, 18, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: rgba(16, 24, 52, 0.99);
  border: 1px solid rgba(91, 157, 255, 0.32);
  border-radius: var(--r-xl);
  padding: 28px 28px 24px;
  width: 480px;
  max-width: 96vw;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow:
    0 24px 80px rgba(0,0,0,.65),
    inset 0 1px 0 rgba(255,255,255,.06);
  scrollbar-width: thin;
  scrollbar-color: var(--faint) transparent;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.modal-head h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -.02em;
}

.modal-close {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s;
  padding: 0;
}

.modal-close:hover { background: rgba(255,85,119,.15); color: var(--red); }

/* ═══════════════════════════════════════════
   가이드 모달 내용
   ═══════════════════════════════════════════ */

.guide-block { margin-bottom: 4px; }

.guide-bank-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .05em;
  margin-bottom: 14px;
}

.guide-bank-badge.kb      { background: rgba(255,191,85,.12); border: 1px solid rgba(255,191,85,.30); color: var(--amber); }
.guide-bank-badge.samsung { background: rgba(91,157,255,.12); border: 1px solid rgba(91,157,255,.30); color: var(--blue); }

.guide-steps {
  list-style: none;
  display: grid;
  gap: 10px;
  padding: 0;
}

.guide-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(91,157,255,.18);
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 1px;
}

.guide-steps li strong { color: var(--text); font-weight: 600; }

.guide-note {
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(0,240,212,.06);
  border: 1px solid rgba(0,240,212,.18);
  border-radius: var(--r-sm);
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  line-height: 1.6;
}

.guide-divider {
  height: 1px;
  background: rgba(99,140,255,.14);
  margin: 20px 0;
}

/* KB 분류 매핑표 */
.guide-kb-map { }

.guide-map-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
}

.guide-map-grid { display: grid; gap: 6px; }

.map-row {
  display: grid;
  grid-template-columns: 1fr 24px 1fr;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(91,157,255,.06);
  border: 1px solid rgba(91,157,255,.14);
  border-radius: var(--r-sm);
  font-size: 12px;
}

.map-src  { color: var(--text-2); font-family: var(--font-mono); }
.map-arrow{ color: var(--faint); text-align: center; font-size: 10px; }
.map-cat  { color: var(--cyan);  font-family: var(--font-mono); font-weight: 500; }

/* ═══════════════════════════════════════════
   거래내역 source 배지
   ═══════════════════════════════════════════ */

.src-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 4px;
  letter-spacing: .04em;
}

.src-badge.kb { background: rgba(255,191,85,.15); color: var(--amber); border: 1px solid rgba(255,191,85,.25); }

/* ═══════════════════════════════════════════
   카드값 예산 행 하이라이트
   ═══════════════════════════════════════════ */

.card-budget-row td {
  background: rgba(91, 157, 255, 0.05);
  font-weight: 500;
}

.card-budget-row td:first-child {
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 12px;
}

.card-budget-row.danger td {
  background: rgba(255, 85, 119, 0.06);
}

.card-budget-row.ok td {
  background: rgba(46, 220, 130, 0.05);
}

.flat-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding-top: 4px;
}

/* 넓은 화면에서 3열 */
@media (min-width: 1400px) {
  .flat-panel-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 패널이 flat grid 안에서 항상 맞게 */
.flat-panel-grid > .panel {
  height: fit-content;
  margin: 0 !important;
}

/* 드래그 핸들 */
.drag-handle {
  display: none;    /* 편집 모드 아닐 땐 숨김 */
  cursor: grab;
  font-size: 16px;
  color: var(--faint);
  padding: 0 6px 0 0;
  line-height: 1;
  user-select: none;
  transition: color .15s;
  flex-shrink: 0;
}

.drag-handle:hover { color: var(--blue); }
.drag-handle:active { cursor: grabbing; }

/* panel-drag-head — panel-head 없는 패널용 */
.panel-drag-head {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 14px;
}

.panel-drag-head h2 { margin-bottom: 0; flex: 1; }

/* 편집 모드 */
.flat-panel-grid.edit-mode .drag-handle,
.sortable-grid.edit-mode .drag-handle {
  display: inline-flex;
  align-items: center;
}

.flat-panel-grid.edit-mode .panel,
.sortable-grid.edit-mode .panel {
  border-style: dashed;
  border-color: rgba(91,157,255,.35);
  cursor: default;
  position: relative;
}

.flat-panel-grid.edit-mode .panel::after,
.sortable-grid.edit-mode .panel::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(91,157,255,.03);
  pointer-events: none;
}

/* 드래그 중 ghost */
.panel-ghost {
  opacity: .35;
  background: rgba(91,157,255,.12) !important;
  border-color: rgba(91,157,255,.5) !important;
  border-style: dashed !important;
}

/* 드래그 중인 실제 패널 */
.panel-dragging {
  box-shadow: 0 16px 48px rgba(0,0,0,.6), 0 0 0 2px var(--blue) !important;
  transform: rotate(1.5deg) scale(1.02);
  opacity: .95;
  z-index: 999;
}

/* chosen (클릭된) 패널 */
.panel-chosen {
  box-shadow: 0 8px 32px rgba(0,0,0,.4), 0 0 0 1px rgba(91,157,255,.5) !important;
}

/* ── 레이아웃 편집 바 ─────────────── */

.layout-edit-bar {
  display: none;  /* JS에서 데스크톱일 때만 show */
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 8px 4px;
}

.layout-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  background: rgba(91,157,255,.10);
  border: 1px solid rgba(91,157,255,.25);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}

.layout-toggle-btn:hover {
  background: rgba(91,157,255,.18);
  color: var(--blue);
  border-color: rgba(91,157,255,.45);
}

.layout-toggle-btn.active {
  background: rgba(91,157,255,.20);
  color: var(--blue);
  border-color: rgba(91,157,255,.55);
  box-shadow: 0 0 14px rgba(91,157,255,.20);
}

.layout-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--faint);
  letter-spacing: .04em;
  animation: fadeIn .3s ease;
}

@keyframes fadeIn { from { opacity:0; transform: translateY(-4px); } to { opacity:1; transform:none; } }

.layout-reset-btn {
  padding: 7px 12px;
  border-radius: var(--r-sm);
  background: rgba(255,191,85,.08);
  border: 1px solid rgba(255,191,85,.22);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
  transition: background .2s;
}

.layout-reset-btn:hover { background: rgba(255,191,85,.16); }

/* 모바일에서 레이아웃 편집 바 숨김 */
@media (max-width: 720px) {
  .layout-edit-bar { display: none !important; }
  .flat-panel-grid { display: none !important; }
  .drag-handle     { display: none !important; }
}

/* ═══════════════════════════════════════════
   DUAL UPLOAD UI
   ═══════════════════════════════════════════ */

.upload-row {
  display: grid;
  grid-template-columns: 80px 1fr 52px;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.upload-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .03em;
  text-align: center;
  white-space: nowrap;
  line-height: 1.4;
}

.upload-badge.samsung {
  background: rgba(91,157,255,.12);
  border: 1px solid rgba(91,157,255,.28);
  color: var(--blue);
}

.upload-badge.kb {
  background: rgba(255,191,85,.10);
  border: 1px solid rgba(255,191,85,.26);
  color: var(--amber);
}

.upload-file-box {
  margin: 0 !important;
  padding: 10px 12px !important;
  font-size: 11px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-go-btn {
  padding: 10px 0 !important;
  font-size: 12px !important;
  text-align: center;
  min-width: 0;
}

/* 업로드 상태 바 */
.upload-status-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
}

.status-chip.ok {
  background: rgba(46,220,130,.10);
  border: 1px solid rgba(46,220,130,.28);
  color: var(--green);
}

.status-chip.empty {
  background: rgba(99,140,255,.07);
  border: 1px solid rgba(99,140,255,.18);
  color: var(--faint);
}

@media (max-width: 720px) {
  .upload-row {
    grid-template-columns: 70px 1fr 44px;
    gap: 6px;
  }
}

/* ═══════════════════════════════════════════
   DAY DETAIL BOX 내부 스타일
   ═══════════════════════════════════════════ */

.day-detail-total {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(99,140,255,.14);
}

.day-detail-total strong {
  color: var(--text);
  font-size: 16px;
  font-family: var(--font-mono);
  font-weight: 600;
}

.day-detail-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(99,140,255,.06);
  font-size: 12px;
}

.day-detail-item:last-child { border-bottom: none; }

.di-desc {
  color: var(--text-2);
  font-family: var(--font-body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.di-amt {
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.di-cat {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
  text-align: right;
}
