/* ============================================
   RumahTangga — Main Stylesheet
   Mobile-first, clean card UI
   ============================================ */

:root {
  --blue:       #2563EB;
  --blue-light: #EFF6FF;
  --blue-dark:  #1D4ED8;
  --green:      #16A34A;
  --green-light:#F0FDF4;
  --red:        #DC2626;
  --red-light:  #FEF2F2;
  --yellow:     #D97706;
  --yellow-light:#FFFBEB;
  --gray-50:    #F9FAFB;
  --gray-100:   #F3F4F6;
  --gray-200:   #E5E7EB;
  --gray-300:   #D1D5DB;
  --gray-400:   #9CA3AF;
  --gray-500:   #6B7280;
  --gray-600:   #4B5563;
  --gray-700:   #374151;
  --gray-800:   #1F2937;
  --gray-900:   #111827;
  --white:      #FFFFFF;

  --q1-bg:  #FEF2F2; --q1-border: #FCA5A5; --q1-text: #991B1B; --q1-dot: #EF4444;
  --q2-bg:  #EFF6FF; --q2-border: #93C5FD; --q2-text: #1E3A8A; --q2-dot: #3B82F6;
  --q3-bg:  #FFFBEB; --q3-border: #FCD34D; --q3-text: #78350F; --q3-dot: #F59E0B;
  --q4-bg:  #F9FAFB; --q4-border: #D1D5DB; --q4-text: #374151; --q4-dot: #9CA3AF;

  --font-main: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --radius:    12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow:    0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --nav-h:     64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  font-family: var(--font-main);
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-main); }
input, select, textarea { font-family: var(--font-main); }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 99px; }

/* ============================================
   FLASH MESSAGES
   ============================================ */
.flash {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  padding: 14px 20px;
  font-size: 14px; font-weight: 600;
  z-index: 9999;
  animation: slideDown .3s ease, fadeOut .3s ease 3s forwards;
}
.flash--success { background: var(--green); color: #fff; }
.flash--error   { background: var(--red);   color: #fff; }
.flash--info    { background: var(--blue);  color: #fff; }

@keyframes slideDown { from { transform: translateX(-50%) translateY(-100%); } to { transform: translateX(-50%) translateY(0); } }
@keyframes fadeOut   { to { opacity: 0; pointer-events: none; } }

/* ============================================
   TOP APP BAR
   ============================================ */
.app-bar {
  background: var(--white);
  padding: 16px 20px 12px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--gray-100);
  position: sticky; top: 0; z-index: 100;
}
.app-bar__title { font-size: 18px; font-weight: 700; color: var(--gray-900); }
.app-bar__back  { font-size: 20px; padding: 4px 8px 4px 0; color: var(--gray-700); }
.app-bar__action{ font-size: 13px; font-weight: 600; color: var(--blue); }

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--nav-h);
  background: var(--white);
  border-top: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-around;
  z-index: 200;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  flex: 1; padding: 8px 0;
  color: var(--gray-400); font-size: 11px; font-weight: 500;
  transition: color .2s;
}
.nav-item.active { color: var(--blue); }
.nav-icon { font-size: 20px; display: block; }
.nav-label { font-size: 10px; font-weight: 600; }
.nav-fab {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--blue); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 300;
  box-shadow: 0 4px 16px rgba(37,99,235,0.4);
  margin-bottom: 8px;
  transition: transform .2s, box-shadow .2s;
  flex-shrink: 0;
}
.nav-fab:active { transform: scale(0.93); }
.nav-spacer { height: calc(var(--nav-h) + 8px); }

/* ============================================
   PAGE CONTAINER
   ============================================ */
.page { padding: 16px; padding-bottom: 8px; }
.page--auth { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px; background: var(--white); }

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
}
.card--padded { padding: 16px; }
.card--hero {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 8px 24px rgba(37,99,235,0.3);
}
.card--green { background: var(--green-light); border-color: #BBF7D0; }
.card--red   { background: var(--red-light);   border-color: #FECACA; }

/* ============================================
   DASHBOARD HERO
   ============================================ */
.hero { margin-bottom: 12px; }
.hero__label { font-size: 12px; font-weight: 600; opacity: .8; letter-spacing: .05em; text-transform: uppercase; }
.hero__amount { font-size: 32px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 2px; font-family: var(--font-mono); }
.hero__sub    { font-size: 13px; opacity: .75; }

.stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat-card { border-radius: var(--radius); padding: 14px; }
.stat-card__label { font-size: 11px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.stat-card__icon  { font-size: 16px; float: right; margin-top: -2px; }
.stat-card__value { font-size: 17px; font-weight: 800; font-family: var(--font-mono); }
.stat-card--income { background: var(--green-light); }
.stat-card--income .stat-card__value { color: var(--green); }
.stat-card--expense { background: var(--red-light); }
.stat-card--expense .stat-card__value { color: var(--red); }

/* ============================================
   SECTION HEADER
   ============================================ */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 16px 0 10px;
}
.section-title { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.section-link  { font-size: 13px; font-weight: 600; color: var(--blue); }

/* ============================================
   TRANSACTION LIST ITEMS
   ============================================ */
.tx-list { display: flex; flex-direction: column; gap: 2px; }
.tx-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--gray-100);
  transition: background .15s;
}
.tx-item:active { background: var(--gray-50); }
.tx-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.tx-icon--income  { background: var(--green-light); }
.tx-icon--expense { background: var(--red-light); }
.tx-info { flex: 1; min-width: 0; }
.tx-desc  { font-size: 14px; font-weight: 600; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-meta  { font-size: 12px; color: var(--gray-400); margin-top: 1px; }
.tx-amount { font-size: 15px; font-weight: 700; font-family: var(--font-mono); white-space: nowrap; }
.tx-amount--income  { color: var(--green); }
.tx-amount--expense { color: var(--red); }

/* ============================================
   PRIORITY MATRIX
   ============================================ */
.matrix-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.matrix-cell {
  border-radius: var(--radius);
  padding: 12px;
  min-height: 140px;
}
.matrix-cell--q1 { background: var(--q1-bg); border: 1.5px solid var(--q1-border); }
.matrix-cell--q2 { background: var(--q2-bg); border: 1.5px solid var(--q2-border); }
.matrix-cell--q3 { background: var(--q3-bg); border: 1.5px solid var(--q3-border); }
.matrix-cell--q4 { background: var(--q4-bg); border: 1.5px solid var(--q4-border); }
.matrix-cell__header { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.matrix-cell__dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.matrix-cell--q1 .matrix-cell__dot { background: var(--q1-dot); }
.matrix-cell--q2 .matrix-cell__dot { background: var(--q2-dot); }
.matrix-cell--q3 .matrix-cell__dot { background: var(--q3-dot); }
.matrix-cell--q4 .matrix-cell__dot { background: var(--q4-dot); }
.matrix-cell__title { font-size: 11px; font-weight: 700; }
.matrix-cell--q1 .matrix-cell__title { color: var(--q1-text); }
.matrix-cell--q2 .matrix-cell__title { color: var(--q2-text); }
.matrix-cell--q3 .matrix-cell__title { color: var(--q3-text); }
.matrix-cell--q4 .matrix-cell__title { color: var(--q4-text); }
.matrix-cell__count { font-size: 10px; color: var(--gray-400); margin-left: auto; }

.sticky-note {
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  position: relative;
}
.sticky-note:active { transform: scale(.97); }
.matrix-cell--q1 .sticky-note { background: #fff; border-left: 3px solid var(--q1-dot); color: var(--q1-text); box-shadow: 0 2px 6px rgba(239,68,68,.12); }
.matrix-cell--q2 .sticky-note { background: #fff; border-left: 3px solid var(--q2-dot); color: var(--q2-text); box-shadow: 0 2px 6px rgba(59,130,246,.10); }
.matrix-cell--q3 .sticky-note { background: #fff; border-left: 3px solid var(--q3-dot); color: var(--q3-text); box-shadow: 0 2px 6px rgba(245,158,11,.10); }
.matrix-cell--q4 .sticky-note { background: #fff; border-left: 3px solid var(--q4-dot); color: var(--gray-600);  box-shadow: 0 2px 4px rgba(0,0,0,.05); }
.sticky-note__name  { font-size: 12px; font-weight: 600; line-height: 1.3; }
.sticky-note__score { font-size: 10px; opacity: .6; margin-top: 2px; font-family: var(--font-mono); }

/* ============================================
   MATRIX AXIS LABELS
   ============================================ */
.matrix-wrapper { position: relative; }
.matrix-axis { display: flex; justify-content: space-between; font-size: 10px; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; padding: 0 2px; }
.matrix-axis-side { writing-mode: vertical-rl; font-size: 10px; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: .05em; position: absolute; left: -24px; top: 50%; transform: translateY(-50%) rotate(180deg); }

/* ============================================
   PRIORITY DETAIL
   ============================================ */
.detail-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.detail-icon { width: 64px; height: 64px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 30px; flex-shrink: 0; }
.detail-icon--q1 { background: var(--q1-bg); }
.detail-icon--q2 { background: var(--q2-bg); }
.detail-icon--q3 { background: var(--q3-bg); }
.detail-icon--q4 { background: var(--q4-bg); }
.detail-name { font-size: 20px; font-weight: 800; color: var(--gray-900); }
.detail-tag  { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; margin-top: 4px; }
.tag--q1 { background: var(--q1-bg); color: var(--q1-text); border: 1px solid var(--q1-border); }
.tag--q2 { background: var(--q2-bg); color: var(--q2-text); border: 1px solid var(--q2-border); }
.tag--q3 { background: var(--q3-bg); color: var(--q3-text); border: 1px solid var(--q3-border); }
.tag--q4 { background: var(--q4-bg); color: var(--q4-text); border: 1px solid var(--q4-border); }

.score-bar-wrap { margin-bottom: 10px; }
.score-bar-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.score-bar-label span:last-child { font-family: var(--font-mono); }
.score-bar { height: 8px; background: var(--gray-100); border-radius: 99px; overflow: hidden; }
.score-bar__fill { height: 100%; border-radius: 99px; transition: width .6s cubic-bezier(.22,1,.36,1); }
.score-bar__fill--important { background: linear-gradient(90deg, #F87171, #EF4444); }
.score-bar__fill--urgent    { background: linear-gradient(90deg, #A78BFA, #8B5CF6); }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }

/* ---- Rekomendasi Alokasi ---- */
.alloc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
}
.alloc-item__icon {
  font-size: 22px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
  flex-shrink: 0;
}
.alloc-item--kebutuhan .alloc-item__icon { background: var(--blue-light); }
.alloc-item--keinginan .alloc-item__icon { background: var(--yellow-light); }
.alloc-item--investasi .alloc-item__icon { background: var(--green-light); }
.alloc-item--sedekah   .alloc-item__icon { background: #F5F3FF; }
.alloc-item--goal      .alloc-item__icon { background: var(--gray-50); }
.alloc-item__info { flex: 1; min-width: 0; }
.alloc-item__label { font-size: 13px; font-weight: 700; color: var(--gray-900); }
.alloc-item__desc  { font-size: 11px; color: var(--gray-400); margin-top: 1px; }
.alloc-item__amount { font-size: 14px; font-weight: 800; font-family: var(--font-mono); color: var(--gray-900); white-space: nowrap; }
.alloc-item__pct   { font-size: 11px; color: var(--gray-400); font-weight: 600; margin-top: 2px; }
.info-cell { border-radius: var(--radius); padding: 14px; }
.info-cell--yellow { background: var(--yellow-light); }
.info-cell--green  { background: var(--green-light); }
.info-cell__label  { font-size: 11px; font-weight: 700; color: var(--gray-400); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.info-cell__value  { font-size: 14px; font-weight: 700; color: var(--gray-800); }

.timeline { padding-left: 0; }
.timeline-item { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; position: relative; }
.timeline-item:not(:last-child)::before { content: ''; position: absolute; left: 9px; top: 20px; width: 2px; bottom: -10px; background: var(--gray-100); }
.timeline-dot { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; margin-top: 2px; }
.timeline-dot--done   { background: var(--green-light); color: var(--green); }
.timeline-dot--moved  { background: var(--blue-light); color: var(--blue); }
.timeline-text  { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.timeline-date  { font-size: 11px; color: var(--gray-400); margin-top: 1px; }

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 700; color: var(--gray-700); margin-bottom: 6px; }
.form-label sup { color: var(--red); }
.form-control {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 15px; color: var(--gray-800);
  background: var(--white);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  appearance: none;
}
.form-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.form-control::placeholder { color: var(--gray-300); }
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
textarea.form-control { resize: vertical; min-height: 80px; }

.type-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.type-btn {
  padding: 12px; border-radius: var(--radius);
  border: 2px solid var(--gray-200);
  font-size: 14px; font-weight: 700;
  text-align: center; cursor: pointer;
  transition: all .2s;
  background: var(--white);
}
.type-btn.active--income  { border-color: var(--green); background: var(--green-light); color: var(--green); }
.type-btn.active--expense { border-color: var(--red);   background: var(--red-light);   color: var(--red); }

.range-group { margin-bottom: 16px; }
.range-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.range-label { font-size: 13px; font-weight: 700; color: var(--gray-700); }
.range-value { font-size: 20px; font-weight: 800; font-family: var(--font-mono); color: var(--blue); min-width: 28px; text-align: right; }
input[type=range] {
  width: 100%; height: 6px;
  -webkit-appearance: none; appearance: none;
  border-radius: 99px; outline: none;
  cursor: pointer;
}
input[type=range].range--important { background: linear-gradient(90deg, var(--red) var(--pct, 50%), var(--gray-200) var(--pct, 50%)); }
input[type=range].range--urgent    { background: linear-gradient(90deg, #8B5CF6 var(--pct, 50%), var(--gray-200) var(--pct, 50%)); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--white); border: 3px solid var(--blue);
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  transition: transform .1s;
}
input[type=range]::-webkit-slider-thumb:active { transform: scale(1.2); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px; border-radius: var(--radius);
  font-size: 15px; font-weight: 700;
  transition: all .2s; cursor: pointer;
  border: none; width: 100%;
}
.btn:active { transform: scale(.97); }
.btn--primary  { background: var(--blue);  color: var(--white); box-shadow: 0 4px 12px rgba(37,99,235,.3); }
.btn--primary:hover  { background: var(--blue-dark); }
.btn--green    { background: var(--green); color: var(--white); box-shadow: 0 4px 12px rgba(22,163,74,.25); }
.btn--red      { background: var(--red);   color: var(--white); }
.btn--outline  { background: var(--white); color: var(--blue);  border: 2px solid var(--blue); box-shadow: none; }
.btn--ghost    { background: var(--gray-100); color: var(--gray-700); box-shadow: none; }
.btn--sm       { padding: 8px 14px; font-size: 13px; }
.btn--inline   { width: auto; }

.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-logo   { text-align: center; margin-bottom: 32px; }
.auth-logo__icon { font-size: 48px; }
.auth-logo__name { font-size: 24px; font-weight: 800; color: var(--blue); margin-top: 8px; }
.auth-logo__sub  { font-size: 13px; color: var(--gray-400); margin-top: 4px; }
.auth-heading { font-size: 22px; font-weight: 800; color: var(--gray-900); margin-bottom: 4px; }
.auth-sub     { font-size: 14px; color: var(--gray-400); margin-bottom: 24px; }
.auth-footer  { text-align: center; margin-top: 20px; font-size: 14px; color: var(--gray-500); }
.auth-footer a { color: var(--blue); font-weight: 600; }

/* ============================================
   PROFILE
   ============================================ */
.profile-header { text-align: center; padding: 24px 0 16px; }
.profile-avatar { width: 72px; height: 72px; border-radius: 20px; background: var(--blue-light); display: flex; align-items: center; justify-content: center; font-size: 36px; margin: 0 auto 12px; }
.profile-name   { font-size: 20px; font-weight: 800; color: var(--gray-900); }
.profile-email  { font-size: 13px; color: var(--gray-400); margin-top: 2px; }

.menu-list { display: flex; flex-direction: column; gap: 2px; }
.menu-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--gray-100);
  cursor: pointer;
}
.menu-item__icon { font-size: 20px; width: 36px; }
.menu-item__text { flex: 1; font-size: 14px; font-weight: 600; color: var(--gray-800); }
.menu-item__arrow{ color: var(--gray-300); font-size: 16px; }
.menu-item--red .menu-item__text { color: var(--red); }

/* ============================================
   INSIGHT CARDS
   ============================================ */
.insight-card {
  background: var(--white); border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--gray-100);
  margin-bottom: 8px;
}
.insight-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.insight-icon--red    { background: var(--red-light); }
.insight-icon--blue   { background: var(--blue-light); }
.insight-icon--green  { background: var(--green-light); }
.insight-icon--yellow { background: var(--yellow-light); }
.insight-body { flex: 1; min-width: 0; }
.insight-title { font-size: 14px; font-weight: 700; color: var(--gray-800); }
.insight-desc  { font-size: 12px; color: var(--gray-400); margin-top: 2px; line-height: 1.4; }
.insight-arrow { color: var(--gray-300); font-size: 16px; }

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; -ms-overflow-style: none; scrollbar-width: none; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
  padding: 7px 14px; border-radius: 99px;
  border: 1.5px solid var(--gray-200);
  font-size: 13px; font-weight: 600;
  white-space: nowrap; cursor: pointer;
  background: var(--white); color: var(--gray-600);
  transition: all .2s; flex-shrink: 0;
}
.filter-chip.active        { background: var(--blue);  border-color: var(--blue);  color: var(--white); }
.filter-chip.active--income { background: var(--green); border-color: var(--green); color: var(--white); }
.filter-chip.active--expense{ background: var(--red);   border-color: var(--red);   color: var(--white); }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--gray-400);
}
.empty-state__icon  { font-size: 48px; margin-bottom: 12px; }
.empty-state__title { font-size: 16px; font-weight: 700; color: var(--gray-600); margin-bottom: 6px; }
.empty-state__desc  { font-size: 13px; line-height: 1.5; }

/* ============================================
   BADGE
   ============================================ */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 99px; font-size: 11px; font-weight: 700;
}
.badge--red    { background: var(--red);   color: var(--white); }
.badge--blue   { background: var(--blue);  color: var(--white); }
.badge--green  { background: var(--green); color: var(--white); }
.badge--yellow { background: #F59E0B;      color: var(--white); }
.badge--gray   { background: var(--gray-300); color: var(--white); }

/* ============================================
   DIVIDER
   ============================================ */
.divider { height: 1px; background: var(--gray-100); margin: 16px 0; }
.divider--label { display: flex; align-items: center; gap: 12px; }
.divider--label::before, .divider--label::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }
.divider--label span { font-size: 12px; color: var(--gray-400); font-weight: 600; white-space: nowrap; }

/* ============================================
   MODAL / BOTTOM SHEET
   ============================================ */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 300; opacity: 0;
  pointer-events: none; transition: opacity .3s;
}
.overlay.show { opacity: 1; pointer-events: all; }

.bottom-sheet {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%) translateY(100%);
  width: 100%; max-width: 480px;
  background: var(--white); border-radius: 24px 24px 0 0;
  padding: 16px 20px 32px; z-index: 301;
  transition: transform .35s cubic-bezier(.32,1,.22,1);
  max-height: 85dvh; overflow-y: auto;
}
.bottom-sheet.show { transform: translateX(-50%) translateY(0); }
.sheet-handle { width: 40px; height: 4px; border-radius: 99px; background: var(--gray-200); margin: 0 auto 16px; }
.sheet-title  { font-size: 18px; font-weight: 800; color: var(--gray-900); margin-bottom: 16px; }

/* ============================================
   CATEGORY ITEM
   ============================================ */
.cat-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--gray-100);
  margin-bottom: 6px;
}
.cat-icon { font-size: 22px; width: 36px; text-align: center; }
.cat-name { flex: 1; font-size: 14px; font-weight: 600; color: var(--gray-800); }
.cat-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer; border: none;
  transition: background .2s;
}
.icon-btn--edit   { background: var(--blue-light); color: var(--blue); }
.icon-btn--delete { background: var(--red-light);  color: var(--red); }

/* ============================================
   DONUT CHART (CSS)
   ============================================ */
.donut-wrap { position: relative; width: 120px; height: 120px; margin: 0 auto; }
.donut-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.donut-center__label { font-size: 10px; color: var(--gray-400); font-weight: 600; }
.donut-center__value { font-size: 14px; font-weight: 800; color: var(--gray-900); font-family: var(--font-mono); }
.legend-list { margin-top: 12px; }
.legend-item { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.legend-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-name { flex: 1; color: var(--gray-700); }
.legend-pct  { font-weight: 700; color: var(--gray-800); font-family: var(--font-mono); }

/* ============================================
   UTILITIES
   ============================================ */
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-red    { color: var(--red); }
.text-green  { color: var(--green); }
.text-blue   { color: var(--blue); }
.text-gray   { color: var(--gray-400); }
.text-sm     { font-size: 13px; }
.text-xs     { font-size: 12px; }
.font-bold   { font-weight: 700; }
.font-mono   { font-family: var(--font-mono); }
.d-flex      { display: flex; }
.align-center{ align-items: center; }
.gap-8       { gap: 8px; }
.hidden      { display: none !important; }
