@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&family=Noto+Sans+KR:wght@400;500;600;700;800;900&display=swap');

:root {
  --navy: #10213f;
  --navy-2: #172d54;
  --ink: #1d2b43;
  --muted: #748198;
  --subtle: #a5afbf;
  --line: #e8ecf2;
  --canvas: #f6f8fb;
  --card: #ffffff;
  --blue: #3168e9;
  --blue-soft: #edf3ff;
  --green: #1ca875;
  --green-soft: #eaf9f2;
  --orange: #e58b36;
  --orange-soft: #fff5e9;
  --purple: #7d68e8;
  --purple-soft: #f1efff;
  --red: #e26262;
  --shadow: 0 12px 32px rgba(35, 55, 91, .055);
  --radius: 16px;
  font-family: 'Noto Sans KR', 'Manrope', sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-width: 320px; background: var(--canvas); }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(49, 104, 233, .24); outline-offset: 2px; }

.app-shell { display: flex; min-height: 100vh; }
.auth-root { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 0%, #edf3ff 0, var(--canvas) 48%); }
.auth-card { width: min(440px, 100%); padding: 34px; text-align: center; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 18px 50px rgba(35,55,91,.09); }
.auth-card .brand-mark { margin: 0 auto 20px; }
.auth-card .eyebrow { margin-bottom: 10px; }
.auth-card h1 { font-size: 24px; }
.auth-card p { margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.auth-card small { display: block; margin-top: 15px; color: #9aa5b5; font-size: 9px; line-height: 1.6; }
.google-login-button { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; margin-top: 24px; color: #334155; border: 1px solid #d9e0ea; border-radius: 9px; background: #fff; font-size: 11px; font-weight: 700; box-shadow: 0 4px 10px rgba(35,55,91,.05); }
.google-login-button:hover { border-color: #b8c8e6; background: #fbfcff; }
.google-login-button:disabled { cursor: wait; opacity: .68; }
.google-logo { width: 22px; height: 22px; display: grid; place-items: center; color: #4285f4; border: 1px solid #dbe5fa; border-radius: 50%; background: #fff; font: 800 13px Arial, sans-serif; }
.auth-error { margin-top: 15px; padding: 10px 12px; color: #b45d5d; border: 1px solid #f0d7d7; border-radius: 8px; background: #fff6f6; font-size: 10px; line-height: 1.5; }
.auth-loading { width: 22px; height: 22px; margin: 23px auto 0; border: 3px solid #dfe7f7; border-top-color: var(--blue); border-radius: 50%; animation: auth-spin .8s linear infinite; }
.auth-spinner { width: 14px; height: 14px; display: inline-block; border: 2px solid #c8d5eb; border-top-color: #52637f; border-radius: 50%; animation: auth-spin .8s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
.sidebar { width: 254px; min-height: 100vh; display: flex; flex-direction: column; padding: 27px 16px 18px; color: #dce6f7; background: var(--navy); flex-shrink: 0; }
.brand-lockup { display: flex; align-items: center; gap: 11px; padding: 0 11px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 18px; border-radius: 11px; background: linear-gradient(145deg, #5f91ff, #2c5cdf); box-shadow: 0 5px 14px rgba(36, 86, 213, .32); }
.brand-name { color: #fff; font-size: 16px; font-weight: 800; letter-spacing: -.03em; }
.brand-caption { margin-top: 1px; color: #8395b7; font: 500 9px 'DM Mono', monospace; letter-spacing: .02em; }
.privacy-pill { display: flex; align-items: center; gap: 7px; width: fit-content; margin: 31px 10px 20px; padding: 6px 9px; color: #9fc9b6; font-size: 10px; border: 1px solid rgba(137, 206, 175, .2); border-radius: 999px; background: rgba(65, 172, 120, .09); }
.privacy-pill.warning { color: #efc58d; border-color: rgba(239, 197, 141, .26); background: rgba(229, 139, 54, .1); }
.privacy-pill.warning .status-dot { background: #e5a151; box-shadow: 0 0 0 3px rgba(229, 161, 81, .13); }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #52c18d; box-shadow: 0 0 0 3px rgba(82, 193, 141, .13); }
.nav-list { display: flex; flex-direction: column; gap: 3px; }
.nav-section-label { margin: 0 11px 8px; color: #667b9f; font: 700 9px 'DM Mono', monospace; letter-spacing: .11em; }
.nav-section-spaced { margin-top: 27px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; color: #9db0ce; text-align: left; border-radius: 9px; background: transparent; font-size: 12px; font-weight: 600; transition: .2s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(65, 116, 229, .9), rgba(65, 116, 229, .56)); box-shadow: 0 8px 20px rgba(12, 30, 72, .16); }
.nav-icon { width: 17px; color: currentColor; font-size: 17px; line-height: 1; text-align: center; opacity: .95; }
.nav-count { margin-left: auto; color: #cbd8f3; font: 500 10px 'DM Mono', monospace; }
.nav-badge { margin-left: auto; padding: 3px 5px; color: #96b2e9; font: 700 8px 'DM Mono', monospace; border: 1px solid rgba(150,178,233,.24); border-radius: 4px; }
.nav-badge.beta { color: #a8a0ed; border-color: rgba(168,160,237,.25); }
.sidebar-bottom { margin-top: auto; }
.companion-card { display: flex; align-items: center; gap: 9px; margin: 15px 2px 20px; padding: 12px 10px; border: 1px solid rgba(151, 178, 226, .13); border-radius: 11px; background: rgba(255,255,255,.045); }
.companion-icon { width: 25px; height: 25px; display: grid; place-items: center; color: #9ab8ff; border-radius: 8px; background: rgba(88, 137, 240, .16); font-size: 13px; }
.companion-card strong, .companion-card span { display: block; }
.companion-card strong { color: #d4e0f5; font-size: 10px; }
.companion-card span { margin-top: 3px; color: #7185aa; font-size: 9px; }
.companion-card .text-button { margin-left: auto; padding: 0 3px; color: #7f9ddd; background: transparent; font-size: 16px; }
.profile-row { display: flex; align-items: center; gap: 9px; padding: 15px 9px 0; border-top: 1px solid rgba(151, 178, 226, .11); }
.avatar { width: 29px; height: 29px; display: grid; place-items: center; color: #365b9e; border-radius: 50%; background: #d9e6ff; font-size: 11px; font-weight: 800; }
.profile-text { min-width: 0; flex: 1; }
.profile-text strong, .profile-text span { display: block; }
.profile-text strong { color: #d3def0; font-size: 10px; }
.profile-text span { margin-top: 2px; color: #6e82a6; font-size: 9px; }
.icon-button { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; color: var(--muted); border-radius: 9px; background: transparent; }
.icon-button:hover { color: var(--ink); background: var(--blue-soft); }
.icon-button.ghost { color: #7184a5; width: 24px; font-size: 12px; }

.main-column { min-width: 0; flex: 1; }
.topbar { height: 74px; display: flex; align-items: center; justify-content: space-between; padding: 0 40px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.8); }
.breadcrumb { display: flex; align-items: center; gap: 9px; color: #acb5c4; font-size: 11px; }
.breadcrumb b { color: #cbd2dd; font-weight: 500; }
.breadcrumb strong { color: #53627a; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.global-search { width: 228px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; color: #a3adbd; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.global-search > span { font-size: 17px; line-height: 1; }
.global-search input { min-width: 0; flex: 1; padding: 0; color: var(--ink); border: 0; outline: 0; background: transparent; font-size: 11px; }
.global-search input::placeholder { color: #abb5c4; }
.global-search kbd { padding: 2px 4px; color: #aab3c1; border: 1px solid #e3e7ed; border-radius: 4px; background: #fafbfc; font: 500 8px 'DM Mono', monospace; }
.notification-button { position: relative; color: #738097; font-size: 20px; }
.notification-button i { position: absolute; top: 7px; right: 7px; width: 5px; height: 5px; border: 1px solid #fff; border-radius: 50%; background: #ef6969; }
.top-avatar { border: 0; }
.mobile-menu { display: none; }
.content { max-width: 1380px; margin: 0 auto; padding: 35px 40px 62px; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin-bottom: 8px; color: var(--blue); font: 700 9px 'DM Mono', monospace; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin: 0; }
h1 { color: var(--ink); font-size: 26px; line-height: 1.28; letter-spacing: -.055em; }
h2 { color: var(--ink); font-size: 15px; line-height: 1.4; letter-spacing: -.035em; }
h3 { color: var(--ink); font-size: 13px; line-height: 1.45; letter-spacing: -.025em; }
.page-subtitle { margin-top: 8px; color: var(--muted); font-size: 11px; }
.date-label { color: #98a3b5; font-size: 10px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 15px; border-radius: 8px; font-size: 11px; font-weight: 700; transition: .2s ease; }
.primary-button { color: #fff; background: var(--blue); box-shadow: 0 7px 16px rgba(49,104,233,.19); }
.primary-button:hover { background: #2458d6; transform: translateY(-1px); }
.secondary-button { color: #52637f; border: 1px solid var(--line); background: #fff; }
.secondary-button:hover { color: var(--blue); border-color: #c7d5f4; background: var(--blue-soft); }
.text-button { padding: 0; color: var(--blue); background: transparent; font-size: 10px; font-weight: 700; }
.text-button:hover { text-decoration: underline; }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.stat-card { min-height: 130px; padding: 18px 19px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 600; }
.stat-icon { width: 29px; height: 29px; display: grid; place-items: center; color: var(--blue); border-radius: 9px; background: var(--blue-soft); font-size: 14px; }
.stat-icon.green { color: var(--green); background: var(--green-soft); }
.stat-icon.orange { color: var(--orange); background: var(--orange-soft); }
.stat-icon.purple { color: var(--purple); background: var(--purple-soft); }
.stat-value { margin-top: 12px; color: var(--ink); font: 800 22px 'Manrope', 'Noto Sans KR', sans-serif; letter-spacing: -.06em; }
.stat-value small { margin-left: 2px; color: #8692a4; font: 600 10px 'Noto Sans KR', sans-serif; letter-spacing: 0; }
.stat-foot { display: flex; align-items: center; gap: 7px; margin-top: 9px; color: #9aa5b5; font-size: 9px; }
.trend { font-weight: 700; }
.trend.up { color: var(--red); }
.trend.down { color: var(--green); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); gap: 15px; margin-top: 15px; }
.panel { padding: 21px 21px 18px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-header p { margin-top: 5px; color: var(--muted); font-size: 10px; }
.panel-header .text-button { white-space: nowrap; }
.spend-panel { min-height: 255px; }
.chart-header { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 16px; }
.chart-total { color: var(--ink); font: 800 21px 'Manrope', sans-serif; letter-spacing: -.06em; }
.chart-total span { margin-left: 2px; color: var(--muted); font: 500 10px 'Noto Sans KR', sans-serif; letter-spacing: 0; }
.chart-note { color: #9ba6b6; font-size: 9px; }
.bar-chart { height: 125px; display: flex; align-items: flex-end; gap: 15px; margin: 9px 2px 0; padding-top: 5px; border-bottom: 1px solid #eff1f5; }
.bar-group { min-width: 24px; height: 100%; display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; }
.bar-stack { width: 100%; max-width: 26px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.bar { min-height: 3px; border-radius: 5px 5px 2px 2px; background: #c9d8ff; }
.bar.current { background: var(--blue); }
.bar-label { color: #a1acbb; font: 500 9px 'DM Mono', monospace; }
.category-panel { min-height: 255px; }
.category-list { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.category-row { display: grid; grid-template-columns: 61px 1fr 45px; align-items: center; gap: 10px; color: #617087; font-size: 10px; }
.category-row strong { color: #53627a; font: 700 9px 'Manrope', 'Noto Sans KR', sans-serif; text-align: right; }
.progress-track { height: 6px; overflow: hidden; border-radius: 999px; background: #f0f2f6; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--blue); }
.progress-fill.green { background: #52bf96; }
.progress-fill.orange { background: #f2ad65; }
.progress-fill.purple { background: #a69af0; }
.progress-fill.slate { background: #b5c0d1; }

.section-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); gap: 15px; margin-top: 15px; }
.recent-panel { min-height: 305px; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 14px; table-layout: fixed; }
.data-table th { padding: 0 8px 10px; color: #a0aaba; border-bottom: 1px solid #edf0f4; font: 700 9px 'Noto Sans KR', sans-serif; text-align: left; }
.data-table td { overflow: hidden; padding: 11px 8px; color: #53627a; border-bottom: 1px solid #f0f2f5; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.data-table tbody tr { cursor: pointer; transition: .15s ease; }
.data-table tbody tr:hover { background: #fafbfe; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table th:first-child, .data-table td:first-child { padding-left: 0; }
.data-table th:last-child, .data-table td:last-child { padding-right: 0; text-align: right; }
.purchase-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.merchant-logo { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 27px; color: #3d65b0; border-radius: 8px; background: #eef3ff; font-size: 11px; font-weight: 800; }
.merchant-logo.green { color: #278f6d; background: #eaf8f1; }
.merchant-logo.orange { color: #bd7330; background: #fff2e3; }
.merchant-logo.purple { color: #6f5fc2; background: #f0eeff; }
.purchase-cell strong, .purchase-cell span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.purchase-cell strong { color: var(--ink); font-size: 10px; }
.purchase-cell span { margin-top: 2px; color: #9ba5b4; font-size: 8px; }
.amount { color: var(--ink) !important; font: 700 10px 'Manrope', sans-serif; }
.status-chip, .source-chip { display: inline-flex; align-items: center; width: fit-content; padding: 3px 6px; border-radius: 5px; font-size: 8px; font-weight: 700; }
.status-chip.purchased { color: #278b69; background: #eaf8f1; }
.status-chip.cancelled, .status-chip.refunded { color: #c26363; background: #fff0ef; }
.status-chip.returned { color: #a8732d; background: #fff5e6; }
.source-chip { color: #667ba1; background: #f0f3f8; }
.source-chip.gmail { color: #c0565d; background: #fff0f1; }
.source-chip.notification { color: #4a6dc0; background: #edf3ff; }
.source-chip.receipt { color: #755fc5; background: #f1efff; }
.source-chip.manual { color: #68778d; background: #f1f3f6; }
.insight-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.insight-card { display: flex; gap: 11px; padding: 13px; border: 1px solid #edf0f5; border-radius: 11px; background: #fbfcfe; }
.insight-icon { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 28px; color: var(--orange); border-radius: 8px; background: var(--orange-soft); }
.insight-icon.blue { color: var(--blue); background: var(--blue-soft); }
.insight-icon.green { color: var(--green); background: var(--green-soft); }
.insight-card strong { display: block; color: var(--ink); font-size: 10px; }
.insight-card p { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.6; }
.insight-card b { color: var(--blue); }

.integration-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 15px; }
.integration-mini { display: flex; align-items: center; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.integration-mini > span { width: 25px; height: 25px; display: grid; place-items: center; color: #ca5e68; border-radius: 7px; background: #fff0f1; font-size: 11px; font-weight: 800; }
.integration-mini.android > span { color: #2c9d72; background: #eaf9f2; }
.integration-mini.receipt > span { color: #735fc3; background: #f2efff; }
.integration-mini strong, .integration-mini small { display: block; }
.integration-mini strong { color: #53627a; font-size: 9px; }
.integration-mini small { margin-top: 2px; color: #a4adbb; font-size: 8px; }
.integration-status { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: #cbd2dd; }
.integration-status.connected { background: var(--green); box-shadow: 0 0 0 3px rgba(28,168,117,.1); }

/* list view */
.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 13px; margin-bottom: 13px; }
.filter-search { min-width: 210px; flex: 1; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; color: #9ca8b9; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.filter-search input { width: 100%; color: var(--ink); border: 0; outline: 0; background: transparent; font-size: 10px; }
.select-control { height: 34px; padding: 0 28px 0 10px; color: #60708a; border: 1px solid var(--line); border-radius: 7px; outline: 0; background: #fff; font-size: 10px; }
.toggle-button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; color: #7b8799; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 10px; }
.toggle-button .switch { width: 22px; height: 13px; position: relative; border-radius: 999px; background: #dce1ea; }
.toggle-button .switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 9px; height: 9px; border-radius: 50%; background: #fff; transition: .2s; }
.toggle-button.active { color: var(--blue); border-color: #cbd9f7; background: var(--blue-soft); }
.toggle-button.active .switch { background: var(--blue); }
.toggle-button.active .switch::after { left: 11px; }
.table-card { padding: 4px 20px 15px; }
.list-summary { display: flex; align-items: center; gap: 7px; margin: 10px 0 12px; color: #8490a3; font-size: 10px; }
.list-summary strong { color: var(--ink); font-size: 12px; }
.empty-state { padding: 62px 20px; color: var(--muted); text-align: center; }
.empty-icon { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 12px; color: var(--blue); border-radius: 13px; background: var(--blue-soft); font-size: 21px; }
.empty-state strong { display: block; color: var(--ink); font-size: 13px; }
.empty-state p { margin-top: 5px; font-size: 10px; }

/* recurring */
.recurring-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; color: #fff; border-radius: var(--radius); background: linear-gradient(120deg, #1e3970, #3268dd); box-shadow: 0 13px 24px rgba(38,83,181,.15); }
.recurring-hero h2 { color: #fff; font-size: 17px; }
.recurring-hero p { max-width: 620px; margin-top: 5px; color: #c8d7fb; font-size: 10px; }
.recurring-hero .hero-metric { min-width: 136px; padding-left: 20px; border-left: 1px solid rgba(255,255,255,.18); }
.hero-metric strong { display: block; font: 800 25px 'Manrope', sans-serif; letter-spacing: -.07em; }
.hero-metric span { color: #c8d7fb; font-size: 9px; }
.repeat-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; margin-top: 15px; }
.repeat-card { padding: 17px; }
.repeat-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.repeat-product { display: flex; gap: 10px; min-width: 0; }
.product-emoji { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 35px; border-radius: 10px; background: #f1f4f8; font-size: 18px; }
.repeat-product strong, .repeat-product span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repeat-product strong { max-width: 150px; color: var(--ink); font-size: 11px; }
.repeat-product span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.due-chip { padding: 4px 6px; color: #bd6b26; border-radius: 5px; background: var(--orange-soft); font-size: 8px; font-weight: 700; white-space: nowrap; }
.due-chip.soon { color: #cf5e5e; background: #fff0ef; }
.repeat-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; padding-top: 12px; border-top: 1px solid #eff1f5; }
.repeat-meta span, .repeat-meta strong { display: block; }
.repeat-meta span { color: #a0aabb; font-size: 8px; }
.repeat-meta strong { margin-top: 3px; color: #5b6981; font: 700 10px 'Manrope', 'Noto Sans KR', sans-serif; }
.repeat-table-panel { margin-top: 15px; }

/* analytics */
.analytics-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(280px,.8fr); gap: 15px; }
.analytics-chart-card { min-height: 365px; padding: 21px; }
.big-chart { height: 260px; display: flex; align-items: flex-end; gap: 12px; margin-top: 25px; padding: 0 5px; border-bottom: 1px solid #e9edf3; background-image: linear-gradient(to bottom, transparent 24.8%, #f1f3f6 25%, transparent 25.6%, transparent 49.8%, #f1f3f6 50%, transparent 50.6%, transparent 74.8%, #f1f3f6 75%, transparent 75.6%); }
.big-bar-group { height: 100%; display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; }
.big-bar { width: min(30px, 75%); min-height: 6px; border-radius: 7px 7px 2px 2px; background: #cbd9ff; }
.big-bar.current { background: var(--blue); }
.big-bar-label { color: #99a4b5; font: 500 9px 'DM Mono', monospace; }
.legend { display: flex; gap: 16px; margin-top: 15px; color: #8895a8; font-size: 9px; }
.legend span::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 2px; background: #cbd9ff; }
.legend span.current::before { background: var(--blue); }
.ranking-card { padding: 21px; }
.ranking-list { display: flex; flex-direction: column; gap: 15px; margin-top: 20px; }
.ranking-row { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 9px; }
.ranking-number { color: #b0bac8; font: 500 10px 'DM Mono', monospace; }
.ranking-name { color: #53627a; font-size: 10px; }
.ranking-amount { color: var(--ink); font: 700 10px 'Manrope', sans-serif; }
.ranking-bar { grid-column: 2 / 4; height: 5px; margin-top: -4px; overflow: hidden; border-radius: 999px; background: #f0f2f6; }
.ranking-bar span { display: block; height: 100%; border-radius: inherit; background: #87a5f5; }
.breakdown-card { grid-column: 1 / -1; padding: 21px; }
.breakdown-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.breakdown-item { display: grid; grid-template-columns: 82px 1fr 56px; align-items: center; gap: 12px; color: #64728a; font-size: 10px; }
.breakdown-item strong { color: var(--ink); font: 700 10px 'Manrope', 'Noto Sans KR', sans-serif; text-align: right; }

/* receipts/integrations/settings/AI */
.two-column { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(300px,.8fr); gap: 15px; }
.dropzone { display: flex; min-height: 220px; align-items: center; justify-content: center; padding: 30px; text-align: center; border: 1px dashed #c9d7f3; border-radius: 12px; background: #f8faff; transition: .2s; }
.dropzone.dragging { border-color: var(--blue); background: var(--blue-soft); }
.dropzone-icon { width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto 12px; color: var(--purple); border-radius: 13px; background: var(--purple-soft); font-size: 20px; }
.dropzone strong { display: block; color: var(--ink); font-size: 12px; }
.dropzone p { margin: 7px 0 15px; color: var(--muted); font-size: 10px; }
.file-input { display: none; }
.receipt-list { display: flex; flex-direction: column; gap: 8px; margin-top: 17px; }
.receipt-row { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid #edf0f5; border-radius: 10px; }
.receipt-thumb { width: 33px; height: 33px; display: grid; place-items: center; flex: 0 0 33px; color: #7a64c8; border-radius: 8px; background: #f2efff; }
.receipt-row-main { min-width: 0; flex: 1; }
.receipt-row-main strong, .receipt-row-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt-row-main strong { color: #53627a; font-size: 10px; }
.receipt-row-main span { margin-top: 2px; color: #9aa5b5; font-size: 8px; }
.ocr-status { padding: 4px 6px; color: #a8732d; border-radius: 5px; background: var(--orange-soft); font-size: 8px; font-weight: 700; white-space: nowrap; }
.ocr-status.done { color: #278b69; background: var(--green-soft); }
.steps-card { padding: 21px; }
.step-list { position: relative; display: flex; flex-direction: column; gap: 20px; margin-top: 20px; }
.step-list::before { content: ''; position: absolute; top: 10px; bottom: 10px; left: 10px; width: 1px; background: #e5e9f0; }
.step { position: relative; display: flex; gap: 13px; }
.step-dot { width: 21px; height: 21px; display: grid; place-items: center; z-index: 1; flex: 0 0 21px; color: #a1acbb; border: 1px solid #e2e6ed; border-radius: 50%; background: #fff; font: 700 9px 'Manrope', sans-serif; }
.step.done .step-dot { color: #fff; border-color: var(--green); background: var(--green); }
.step strong { display: block; color: #53627a; font-size: 10px; }
.step p { margin-top: 3px; color: #9ba5b4; font-size: 9px; line-height: 1.55; }
.integration-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.integration-card { padding: 19px; }
.integration-card-header { display: flex; align-items: flex-start; gap: 11px; }
.integration-logo { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 38px; color: #cf5c65; border-radius: 11px; background: #fff0f1; font-size: 16px; font-weight: 900; }
.integration-logo.android { color: #27986b; background: #eaf9f2; }
.integration-logo.npay { color: #2aaf81; background: #e9fbf4; }
.integration-logo.toss { color: #3964bf; background: #edf3ff; }
.integration-card-header strong { display: block; color: var(--ink); font-size: 12px; }
.integration-card-header p { margin-top: 3px; color: var(--muted); font-size: 9px; }
.connection-badge { margin-left: auto; padding: 4px 7px; color: #a0aabb; border-radius: 5px; background: #f1f3f6; font-size: 8px; font-weight: 700; white-space: nowrap; }
.connection-badge.connected { color: #258b68; background: var(--green-soft); }
.integration-card > p { min-height: 33px; margin: 17px 0; color: #7b879a; font-size: 10px; line-height: 1.65; }
.integration-card .secondary-button, .integration-card .primary-button { width: 100%; }
.test-ingest { margin-top: 15px; padding: 21px; }
.test-ingest p { margin-top: 5px; color: var(--muted); font-size: 10px; }
.test-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.test-actions button { font-size: 10px; }
.security-banner { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; padding: 12px 14px; color: #75613f; border: 1px solid #f0dfc7; border-radius: 11px; background: #fffaf1; }
.security-banner.protected { color: #34765f; border-color: #cdebdc; background: #f1fbf5; }
.security-banner.locked { color: #45648f; border-color: #d7e2f7; background: #f5f8ff; }
.security-banner > span:first-child { width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 25px; border-radius: 8px; background: rgba(229,139,54,.12); font-size: 13px; }
.security-banner.protected > span:first-child { background: rgba(28,168,117,.12); }
.security-banner.locked > span:first-child { background: rgba(49,104,233,.11); }
.security-banner strong, .security-banner small { display: block; }
.security-banner strong { font-size: 10px; }
.security-banner small { margin-top: 2px; color: #9a896e; font-size: 9px; line-height: 1.45; }
.security-banner.protected small { color: #719786; }
.security-banner.locked small { color: #7d91b3; }
.security-banner .primary-button { min-height: 32px; margin-left: auto; padding: 0 11px; font-size: 9px; white-space: nowrap; }
.security-checklist { margin-top: 15px; padding: 21px; }
.security-checklist > p { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.check-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 16px; }
.check-grid > div { min-height: 78px; padding: 12px; border: 1px solid #edf0f5; border-radius: 10px; background: #fbfcfe; }
.check-grid strong, .check-grid span { display: block; }
.check-grid strong { color: #53627a; font-size: 10px; }
.check-grid span { margin-top: 5px; color: #a0aabb; font-size: 8px; line-height: 1.45; }
.settings-list { display: flex; flex-direction: column; gap: 9px; }
.settings-section { padding: 21px; }
.settings-section + .settings-section { margin-top: 15px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 0; border-bottom: 1px solid #f0f2f5; }
.settings-row:first-child { padding-top: 0; }
.settings-row:last-child { padding-bottom: 0; border-bottom: 0; }
.settings-row strong, .settings-row span { display: block; }
.settings-row strong { color: #53627a; font-size: 11px; }
.settings-row span { margin-top: 4px; color: #9ca6b5; font-size: 9px; }
.setting-switch { width: 34px; height: 19px; position: relative; flex: 0 0 34px; border-radius: 999px; background: #d9dfe8; }
.setting-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: .2s; }
.setting-switch.on { background: var(--blue); }
.setting-switch.on::after { left: 18px; }
.ai-search-card { max-width: 900px; padding: 26px; }
.ai-intro { display: flex; align-items: flex-start; gap: 13px; }
.ai-orb { width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 39px; color: #fff; border-radius: 12px; background: linear-gradient(140deg, #7a6be6, #477fe9); box-shadow: 0 8px 18px rgba(106,105,225,.2); font-size: 18px; }
.ai-intro p { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.ai-query-box { display: flex; gap: 8px; margin-top: 22px; padding: 7px; border: 1px solid #dce4f5; border-radius: 10px; background: #fbfcff; }
.ai-query-box input { min-width: 0; flex: 1; padding: 0 9px; color: var(--ink); border: 0; outline: 0; background: transparent; font-size: 11px; }
.suggestion-label { margin-top: 22px; color: #a0aaba; font-size: 9px; font-weight: 700; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.suggestion { padding: 8px 10px; color: #687a9b; border: 1px solid #e3e8f2; border-radius: 7px; background: #fff; font-size: 9px; }
.suggestion:hover { color: var(--blue); border-color: #c9d7f5; background: var(--blue-soft); }
.ai-answer { display: none; margin-top: 19px; padding: 15px; color: #5d6d87; border: 1px solid #dfe6fb; border-radius: 10px; background: #f6f8ff; font-size: 11px; line-height: 1.8; }
.ai-answer.visible { display: block; }
.ai-answer strong { color: var(--ink); }
.ai-answer b { color: var(--blue); font: 800 15px 'Manrope', sans-serif; }
.privacy-note { display: flex; gap: 10px; padding: 14px; margin-top: 15px; color: #6e7d92; border-radius: 10px; background: #f8fafc; font-size: 9px; line-height: 1.7; }
.privacy-note span { color: var(--green); font-size: 15px; }

/* modal/toast */
.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(15, 28, 55, .42); backdrop-filter: blur(4px); }
.modal { width: min(610px, 100%); max-height: min(760px, 92vh); overflow: auto; padding: 24px; border: 1px solid rgba(255,255,255,.7); border-radius: 17px; background: #fff; box-shadow: 0 24px 60px rgba(20, 41, 80, .23); }
.modal.small { width: min(470px, 100%); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 21px; }
.modal-header h2 { font-size: 17px; }
.modal-header p { margin-top: 5px; color: var(--muted); font-size: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: #6c7a91; font-size: 9px; font-weight: 700; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 36px; padding: 0 10px; color: var(--ink); border: 1px solid #e1e6ee; border-radius: 7px; outline: 0; background: #fff; font-size: 10px; }
.form-field textarea { height: 64px; padding-top: 9px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: #a9bff0; box-shadow: 0 0 0 3px rgba(49,104,233,.08); }
.modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 23px; padding-top: 17px; border-top: 1px solid #eef1f5; }
.modal-footer-right { display: flex; gap: 8px; margin-left: auto; }
.danger-button { padding: 0; color: #d26363; background: transparent; font-size: 10px; }
.danger-button:hover { text-decoration: underline; }
.detail-summary { display: flex; align-items: center; gap: 11px; padding: 13px; margin-bottom: 16px; border-radius: 10px; background: #f8fafc; }
.detail-summary .merchant-logo { width: 34px; height: 34px; flex-basis: 34px; }
.detail-summary strong { display: block; color: var(--ink); font-size: 12px; }
.detail-summary span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.detail-summary .amount { margin-left: auto; font-size: 14px; }
#toast-root { position: fixed; z-index: 40; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 9px; min-width: 250px; max-width: 360px; padding: 12px 14px; color: #fff; border-radius: 9px; background: #21385e; box-shadow: 0 10px 25px rgba(21, 38, 70, .2); font-size: 10px; animation: toast-in .2s ease-out; }
.toast.success::before { content: '✓'; width: 17px; height: 17px; display: grid; place-items: center; color: #fff; border-radius: 50%; background: var(--green); font-weight: 800; }
.toast.error::before { content: '!'; width: 17px; height: 17px; display: grid; place-items: center; color: #fff; border-radius: 50%; background: var(--red); font-weight: 800; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1080px) {
  .sidebar { width: 220px; }
  .content, .topbar { padding-left: 28px; padding-right: 28px; }
  .bar-chart { gap: 8px; }
  .repeat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; z-index: 15; top: 0; bottom: 0; left: 0; width: 254px; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 12px 0 30px rgba(12,30,72,.16); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: inline-grid; }
  .topbar { gap: 12px; }
  .breadcrumb { flex: 1; }
  .topbar-actions { gap: 7px; }
  .global-search { width: min(220px, 42vw); }
  .notification-button, .top-avatar { display: none; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid, .section-grid, .two-column, .analytics-grid { grid-template-columns: 1fr; }
  .breakdown-card { grid-column: auto; }
  .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .topbar { height: 62px; padding: 0 16px; }
  .content { padding: 25px 16px 46px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 15px; margin-bottom: 21px; }
  .page-heading .primary-button { width: 100%; }
  h1 { font-size: 23px; }
  .global-search { width: 38px; padding: 8px; border: 0; background: transparent; }
  .global-search input, .global-search kbd { display: none; }
  .global-search > span { font-size: 21px; }
  .stats-grid { gap: 9px; }
  .stat-card { min-height: 119px; padding: 14px; }
  .stat-value { font-size: 19px; }
  .panel, .analytics-chart-card, .ranking-card, .breakdown-card, .settings-section, .steps-card, .test-ingest, .ai-search-card { padding: 17px; }
  .integration-strip, .integration-grid, .repeat-grid { grid-template-columns: 1fr; }
  .data-table { display: block; overflow-x: auto; min-width: 620px; }
  .table-card { overflow-x: auto; padding: 4px 16px 15px; }
  .recent-panel .data-table, .repeat-table-panel .data-table { display: table; width: 100%; min-width: 0; table-layout: fixed; }
  .recent-panel .data-table th, .recent-panel .data-table td, .repeat-table-panel .data-table th, .repeat-table-panel .data-table td { padding-left: 4px; padding-right: 4px; }
  .recent-panel .data-table th:first-child, .recent-panel .data-table td:first-child, .repeat-table-panel .data-table th:first-child, .repeat-table-panel .data-table td:first-child { padding-left: 0; }
  .list-toolbar { align-items: stretch; flex-direction: column; }
  .filter-search { min-width: 0; }
  .select-control, .toggle-button { width: 100%; }
  .recurring-hero { align-items: flex-start; flex-direction: column; }
  .recurring-hero .hero-metric { width: 100%; padding: 13px 0 0; border-top: 1px solid rgba(255,255,255,.18); border-left: 0; }
  .breakdown-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .modal { padding: 18px; }
  #toast-root { right: 14px; bottom: 14px; left: 14px; }
  .toast { min-width: 0; }
  .auth-card { padding: 26px 20px; }
  .security-banner { align-items: flex-start; flex-wrap: wrap; }
  .security-banner .primary-button { margin-left: 36px; }
  .check-grid { grid-template-columns: 1fr 1fr; }
}
