/* ==========================================================================
   Locket Chi Tiêu - Giao diện tinh gọn, tập trung vào Lịch hình ảnh & Món đồ
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@600;700;800&display=swap');

:root {
  --bg-deep: #121318;
  --bg-card: #1c1e27;
  --bg-card-subtle: #161821;
  --bg-hover: #262937;
  
  --primary-blue: #60a5fa;
  --primary-blue-glow: rgba(96, 165, 250, 0.35);

  --expense-red: #ef4444;
  --expense-red-bg: rgba(239, 68, 68, 0.15);
  --expense-red-text: #fca5a5;

  --income-green: #22c55e;
  --income-green-bg: rgba(34, 197, 94, 0.15);
  --income-green-text: #86efac;

  --streak-orange-bg: rgba(245, 158, 11, 0.16);
  --streak-orange-text: #fcd34d;

  --text-main: #ffffff;
  --text-muted: #8e929d;
  --text-dim: #5c606e;

  --border-card: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-main);
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* App Container (Căn giữa đẹp trên máy tính, full màn hình trên điện thoại) */
.app-container {
  position: relative;
  max-width: 440px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-deep);
  padding-bottom: calc(var(--safe-bottom) + 80px);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.9);
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.main-header {
  padding: calc(var(--safe-top) + 16px) 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.user-greeting-box {
  display: flex;
  flex-direction: column;
}

.greeting-text {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.user-name {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.header-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-action-btn:active {
  transform: scale(0.92);
  background: var(--bg-hover);
  color: #fff;
}

.header-action-btn svg {
  width: 20px;
  height: 20px;
}

/* Status Chips */
.status-chips-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}

.chip-spent {
  background: var(--expense-red-bg);
  color: var(--expense-red-text);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.chip-streak {
  background: var(--streak-orange-bg);
  color: var(--streak-orange-text);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Thẻ Thu / Chi */
.summary-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 2px;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.card-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.badge-expense {
  background: var(--expense-red);
  color: #fff;
}

.badge-income {
  background: var(--income-green);
  color: #fff;
}

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

.card-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-amount {
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
  white-space: nowrap;
}

.card-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Nút chuyển xem Lịch / Danh sách */
.view-switch-row {
  display: flex;
  background: #171922;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
  padding: 4px;
  margin-top: 4px;
}

.view-toggle-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
}

.view-toggle-btn.active {
  background: #272a38;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   LỊCH HÌNH ẢNH TRUNG TÂM
   ========================================================================== */
.main-body {
  padding: 4px 18px 24px;
  flex: 1;
}

.calendar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 16px 14px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Thanh tháng */
.month-selector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 14px;
}

.month-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.month-nav-btn:active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.month-nav-btn svg {
  width: 18px;
  height: 18px;
}

.current-month-display {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

/* Thứ trong tuần */
.weekdays-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.weekdays-grid span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
}

/* Lưới ngày */
.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 16px;
  column-gap: 6px;
  padding-top: 16px;
}

.day-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  position: relative;
  cursor: pointer;
}

.day-circle-slot {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.16s ease;
}

.day-cell:active .day-circle-slot {
  transform: scale(0.92);
}

/* Ngày trống có dấu (+) */
.day-circle-slot.empty-slot {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(255, 255, 255, 0.35);
}

.day-circle-slot.empty-slot svg {
  width: 14px;
  height: 14px;
}

/* Ngày tương lai */
.day-circle-slot.future-slot {
  background: rgba(255, 255, 255, 0.03);
  border: none;
}

/* Ngày CÓ ẢNH MÓN ĐỒ */
.day-circle-slot.has-photo {
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.day-photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.day-badge-multi {
  position: absolute;
  bottom: 0;
  right: 0;
  background: #2563eb;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--bg-card);
}

.day-num-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Hôm nay */
.day-cell.is-today .day-num-label {
  color: var(--primary-blue);
  font-weight: 800;
}

.day-cell.is-today::after {
  content: '';
  position: absolute;
  bottom: -4px;
  width: 4px;
  height: 4px;
  background-color: var(--primary-blue);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--primary-blue);
}

.day-cell.empty-pad {
  pointer-events: none;
  visibility: hidden;
}

/* ==========================================================================
   DANH SÁCH CHI TIẾT (KHI BẬT TAB DANH SÁCH)
   ========================================================================== */
.feed-list-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feed-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px;
}

.feed-header-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.feed-header-count {
  font-size: 12px;
  color: var(--text-muted);
}

.feed-day-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feed-day-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.feed-day-date {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
}

.feed-day-sum {
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--expense-red);
}

.feed-items-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.feed-mini-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  cursor: pointer;
}

.feed-mini-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-mini-price {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 2px 4px;
  border-radius: 4px;
  text-align: center;
}

/* ==========================================================================
   NÚT CHỤP XANH BIỂN (+ FAB)
   ========================================================================== */
/* ==========================================================================
   NÚT CHỤP XANH BIỂN (+ FAB)
   ========================================================================== */
.fab-blue-btn {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 72px);
  right: calc(50% - 220px + 18px);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--primary-blue);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 28px var(--primary-blue-glow);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 60;
}

@media (max-width: 440px) {
  .fab-blue-btn {
    right: 18px;
  }
}

.fab-blue-btn:active {
  transform: scale(0.92);
  background: #93c5fd;
}

.fab-blue-btn svg {
  width: 28px;
  height: 28px;
  stroke: #0c1220;
}

/* ==========================================================================
   MODAL & BOTTOM SHEET (GẮN GIÁ & XEM CHI TIẾT)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop.open {
  display: flex;
}

.bottom-sheet {
  width: 100%;
  max-width: 440px;
  max-height: 92vh;
  max-height: 92dvh;
  background: #161822;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
  border-bottom: none;
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 14px 18px calc(var(--safe-bottom) + 120px);
  scroll-padding-bottom: 120px;
  gap: 14px;
  animation: slideUp 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-drag-handle {
  width: 38px;
  height: 4px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.2);
  margin: -4px auto 4px;
}

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

.sheet-title {
  font-size: 16px;
  font-weight: 700;
}

.sheet-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Ảnh chụp kèm Sticker Locket */
/* Ảnh chụp kèm Sticker Locket (Tối ưu gọn gàng trên mobile, không đẩy số tiền) */
.photo-preview-box {
  position: relative;
  width: 100%;
  max-height: 140px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #080a10;
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.locket-price-sticker {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  background: rgba(14, 16, 24, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sticker-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sticker-emoji {
  font-size: 20px;
}

.sticker-info {
  display: flex;
  flex-direction: column;
}

.sticker-amount {
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--expense-red);
}

.sticker-note {
  font-size: 11px;
  color: var(--text-muted);
}

.sticker-date {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}

/* Chọn loại Chi / Thu */
.type-segmented-box {
  display: flex;
  background: #1c1e28;
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
}

.type-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  border-radius: calc(var(--radius-md) - 3px);
  cursor: pointer;
}

.type-btn.active[data-type="expense"] {
  background: var(--expense-red);
  color: #fff;
}

.type-btn.active[data-type="income"] {
  background: var(--income-green);
  color: #fff;
}

/* Form Styles */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group-money {
  margin-top: 2px;
}

.form-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.money-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.money-input {
  width: 100%;
  background: #1b1d27;
  border: 2px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px 42px 12px 16px;
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.money-input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 16px rgba(96, 165, 250, 0.2);
}

.money-unit {
  position: absolute;
  right: 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dim);
}

.quick-amounts-bar, .categories-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.quick-amounts-bar::-webkit-scrollbar, .categories-bar::-webkit-scrollbar {
  display: none;
}

.q-btn, .cat-btn {
  flex-shrink: 0;
  background: #1c1e28;
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.q-btn:active, .cat-btn.active {
  background: var(--primary-blue);
  color: #0c1220;
  border-color: var(--primary-blue);
  font-weight: 700;
}

.text-input, .date-input {
  background: #1b1d27;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
}

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.btn-retake {
  flex: 1;
  background: #202330;
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-save-item {
  flex: 2;
  background: var(--primary-blue);
  border: none;
  color: #0c1220;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--primary-blue-glow);
}

/* Day Detail Modal */
.day-title-box {
  display: flex;
  flex-direction: column;
}

.day-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.day-total-spent-card {
  background: #1b1d27;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.day-total-val {
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--expense-red);
}

.day-items-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.day-item-card {
  background: #1c1e28;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.day-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.day-item-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.day-item-info {
  display: flex;
  flex-direction: column;
}

.day-item-note {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.day-item-cat {
  font-size: 11px;
  color: var(--text-muted);
}

.day-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-item-price {
  font-size: 13.5px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--expense-red);
}

.btn-del-item {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
}

.btn-del-item:hover {
  color: var(--expense-red);
}

.btn-add-for-this-day {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #202330;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: var(--primary-blue);
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
}

/* Settings Modal */
.settings-action-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.btn-setting-item {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-card);
  background: #1b1d27;
  color: #fff;
  text-align: center;
}

.btn-primary-act {
  background: var(--primary-blue);
  color: #0c1220;
  font-weight: 800;
  border: none;
}

.btn-danger-act {
  background: rgba(239, 68, 68, 0.12);
  color: var(--expense-red);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 30px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  pointer-events: none;
}

.toast {
  background: rgba(24, 26, 35, 0.95);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-card);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  animation: toastIn 0.2s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   PHOTO VIEWER LIGHTBOX (PHÓNG TO XEM RÕ)
   ========================================================================== */
.viewer-backdrop {
  align-items: center !important;
  justify-content: center !important;
  padding: 20px;
}

.photo-viewer-box {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: zoomIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.viewer-close-btn {
  align-self: flex-end;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.viewer-close-btn:active {
  transform: scale(0.9);
}

.viewer-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.05;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(96, 165, 250, 0.25);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
}

.viewer-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.viewer-sticker {
  bottom: 16px;
  left: 16px;
  right: 16px;
  padding: 12px 16px;
}

.day-item-left {
  cursor: pointer;
  transition: transform 0.15s ease;
}

.day-item-left:active {
  transform: scale(0.96);
}

/* ==========================================================================
   MONTHLY RECAP & FINANCIAL ADVISOR STYLES
   ========================================================================== */
/* Recap Auto Banner in Header */
.recap-banner-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(96, 165, 250, 0.12) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  animation: fadeIn 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.recap-banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.recap-banner-icon {
  font-size: 20px;
}

.recap-banner-texts {
  display: flex;
  flex-direction: column;
}

.recap-banner-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
}

.recap-banner-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.recap-banner-btn {
  background: var(--streak-orange-bg);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd34d;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
}

.recap-banner-btn:active {
  transform: scale(0.95);
}

/* Nút Báo Cáo Tháng trong Month Bar */
.btn-open-recap {
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.3);
  color: var(--primary-blue);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-open-recap:active {
  transform: scale(0.94);
  background: rgba(96, 165, 250, 0.25);
}

/* Recap Sheet */
.recap-sheet {
  max-height: 94vh;
  max-height: 94dvh;
}

.recap-title-box {
  display: flex;
  flex-direction: column;
}

.recap-sub-badge {
  font-size: 10px;
  font-weight: 800;
  color: #fcd34d;
  letter-spacing: 0.5px;
}

.recap-content-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 8px;
}

/* 2 Thẻ Thống kê Tổng quan */
.recap-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.recap-stat-card {
  background: #1b1d28;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recap-stat-card.card-chi {
  border-color: rgba(239, 68, 68, 0.25);
}

.recap-stat-card.card-thu {
  border-color: rgba(34, 197, 94, 0.25);
}

.recap-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.recap-stat-val {
  font-size: 17px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
  letter-spacing: -0.3px;
}

.card-chi .recap-stat-val {
  color: var(--expense-red);
}

.card-thu .recap-stat-val {
  color: var(--income-green);
}

.recap-stat-sub {
  font-size: 10.5px;
  color: var(--text-dim);
  font-weight: 500;
  margin-top: 2px;
}

/* Champion Item Card (Món đắt nhất tháng) */
.recap-champion-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(20, 22, 32, 0.9) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.champion-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.champion-crown {
  font-size: 16px;
}

.champion-tag {
  font-size: 10.5px;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 0.5px;
}

.champion-body {
  display: flex;
  align-items: center;
  gap: 12px;
}

.champion-img {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.champion-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.champion-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.champion-price {
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--expense-red);
}

.champion-date {
  font-size: 11px;
  color: var(--text-dim);
}

/* Category Progress Bars */
.recap-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recap-sec-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2px;
}

.category-bars-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #1a1c27;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.cat-bar-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cat-bar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.cat-bar-name {
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cat-bar-meta {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-muted);
}

.cat-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.cat-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #60a5fa 0%, #3b82f6 100%);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Smart Financial Advice Cards */
.recap-advice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.advice-card {
  background: #1b1d28;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.advice-card.highlight {
  border-color: rgba(96, 165, 250, 0.35);
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.08) 0%, #1b1d28 100%);
}

.advice-card.warning {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, #1b1d28 100%);
}

.advice-icon-box {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.advice-text-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.advice-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.advice-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Framework 50/30/20 Box */
.recap-framework-box {
  background: #171923;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.framework-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.fw-desc {
  font-size: 11.5px;
  color: var(--text-muted);
}

.fw-bars {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.fw-pill {
  flex: 1;
  font-size: 10px;
  text-align: center;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  color: #fff;
  white-space: nowrap;
}

.fw-50 {
  flex: 5;
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

.fw-30 {
  flex: 3;
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd34d;
}

.fw-20 {
  flex: 2;
  background: rgba(34, 197, 94, 0.25);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
}

/* ==========================================================================
   VIEW SWITCHER (.app-view)
   ========================================================================== */
.app-view {
  display: none;
}

.app-view.active {
  display: block;
  animation: fadeInView 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInView {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   BOTTOM DOCK NAVIGATION (CHUẨN GIAO DIỆN IOS DARK)
   ========================================================================== */
.bottom-dock-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 440px;
  margin: 0 auto;
  background: rgba(18, 19, 26, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 12px calc(var(--safe-bottom) + 8px);
  z-index: 55;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6);
}

.dock-nav-item {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: var(--radius-full);
}

.dock-icon-wrap {
  width: 48px;
  height: 36px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6a6f80;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dock-nav-item.active .dock-icon-wrap {
  background: #2b3042;
  color: #60a5fa;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.dock-nav-item svg {
  width: 22px;
  height: 22px;
}

/* ==========================================================================
   VIEW 2: BIỂU ĐỒ & DANH MỤC CHI TIÊU (ANALYTICS - ẢNH 1)
   ========================================================================== */
.analytics-header {
  padding: calc(var(--safe-top) + 16px) 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.analytics-month-title {
  font-size: 16.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.source-filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  background: #1c1e28;
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.source-pill.active {
  background: #60a5fa;
  color: #0c1220;
  border-color: #60a5fa;
  font-weight: 700;
}

.analytics-summary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 18px 10px;
}

.analytics-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.analytics-card.active-glow {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.16);
}

.ana-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-inc {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.icon-exp {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.ana-card-icon svg {
  width: 18px;
  height: 18px;
}

.ana-card-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ana-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.ana-val {
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ffffff;
  white-space: nowrap;
}

.ana-val.exp-color {
  color: #ef4444;
}

.ana-balance-card {
  margin: 0 18px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ana-bal-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.ana-bal-val {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ef4444;
  letter-spacing: -0.5px;
}

.ana-compare-card {
  margin: 0 18px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.ana-compare-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.ana-compare-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.ana-segment-row {
  display: flex;
  margin: 0 18px 14px;
  background: #171922;
  border-radius: var(--radius-full);
  padding: 4px;
  border: 1px solid var(--border-card);
}

.ana-seg-btn {
  flex: 1;
  padding: 8px 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.ana-seg-btn.active {
  background: #60a5fa;
  color: #0c1220;
  font-weight: 700;
}

.donut-chart-card {
  margin: 0 18px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.donut-chart-top {
  display: flex;
  justify-content: flex-end;
}

.chart-photo-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #232635;
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.donut-svg-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 220px;
}

.donut-center-info {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.donut-center-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.donut-center-total {
  font-size: 19px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ef4444;
  letter-spacing: -0.5px;
}

.donut-center-cats {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}

.ana-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 6px;
}

.ana-breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ana-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ana-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ana-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.ana-item-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
}

.ana-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ana-item-amt {
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ffffff;
}

.ana-item-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 2px;
}

.ana-progress-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.ana-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   VIEW 3: TÀI KHOẢN, SỔ TIẾT KIỆM & CHUYẾN ĐI (ACCOUNTS - ẢNH 2)
   ========================================================================== */
.accounts-header-segments {
  padding: calc(var(--safe-top) + 16px) 18px 8px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.accounts-header-segments::-webkit-scrollbar {
  display: none;
}

.acc-top-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: #1c1e28;
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.acc-top-pill.active {
  background: #60a5fa;
  color: #0c1220;
  border-color: #60a5fa;
  font-weight: 700;
}

.acc-time-filters {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 6px 18px 10px;
}

.acc-time-chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.acc-time-chip.active {
  background: #252836;
  color: #fff;
}

.acc-month-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.acc-month-nav {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.acc-month-nav svg {
  width: 16px;
  height: 16px;
}

.acc-month-label {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.acc-total-balance-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0 18px 20px;
}

.acc-bal-title-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.acc-bal-big-val {
  font-size: 28px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ef4444;
  letter-spacing: -0.5px;
}

.acc-bal-sub-row {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.acc-inc-dot {
  color: #86efac;
}

.acc-inc-dot b {
  color: #fff;
}

.acc-exp-dot {
  color: #fca5a5;
}

.acc-exp-dot b {
  color: #fff;
}

.acc-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 18px 18px;
}

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

.acc-sec-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.acc-sec-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.acc-count-badge {
  background: #252836;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.acc-sec-actions {
  display: flex;
  gap: 6px;
}

.acc-act-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1c1e28;
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
}

.acc-act-add {
  background: #60a5fa;
  color: #0c1220;
  border-color: #60a5fa;
  font-weight: 800;
  font-size: 16px;
}

.acc-cards-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0 6px;
}

.acc-cards-scroll::-webkit-scrollbar {
  display: none;
}

.acc-card {
  width: 148px;
  height: 110px;
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  cursor: pointer;
}

.card-wallet {
  background: linear-gradient(145deg, #17281e 0%, #111e16 100%);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.card-bank {
  background: linear-gradient(145deg, #16263b 0%, #111d2e 100%);
  border: 1px solid rgba(96, 165, 250, 0.25);
}

.acc-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.acc-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-wallet {
  background: #22c55e;
  color: #0c1220;
}

.icon-bank {
  background: #3b82f6;
  color: #fff;
}

.acc-star-badge {
  color: #fbbf24;
  font-size: 14px;
}

.acc-card-bot {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.acc-card-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.acc-card-val {
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ef4444;
}

.card-bank .acc-card-val {
  color: #fff;
}

.acc-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 2px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #323646;
}

.dot.active {
  background: #ffffff;
  width: 14px;
  border-radius: 4px;
}

.acc-pill-btn {
  background: #1c1e28;
  border: 1px solid var(--border-card);
  color: #60a5fa;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.acc-feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.acc-feature-card:active {
  background: var(--bg-hover);
}

.feature-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #232635;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #60a5fa;
}

.feature-card-icon svg {
  width: 20px;
  height: 20px;
}

.feature-card-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.feature-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
}

.feature-card-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.feature-chevron {
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ==========================================================================
   VIEW 4: QUẢN LÝ NGÂN SÁCH (BUDGET - ẢNH 3)
   ========================================================================== */
.budget-top-header {
  padding: calc(var(--safe-top) + 16px) 18px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.budget-title-box {
  display: flex;
  flex-direction: column;
}

.budget-page-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.4px;
}

.budget-page-sub {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.budget-header-actions {
  display: flex;
  gap: 8px;
}

.budget-act-round {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1c1e28;
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.budget-act-round svg {
  width: 18px;
  height: 18px;
}

.round-blue {
  background: #60a5fa;
  color: #0c1220;
  border-color: #60a5fa;
  box-shadow: 0 4px 14px var(--primary-blue-glow);
}

.budget-empty-card {
  margin: 0 18px 24px;
  background: #181a24;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.budget-empty-card:active {
  background: #1d202d;
}

.card-123-icon {
  width: 58px;
  height: 44px;
  color: #4b5166;
}

.card-123-icon svg {
  width: 100%;
  height: 100%;
}

.budget-empty-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.budget-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: #d1d5db;
}

.budget-empty-desc {
  font-size: 13px;
  color: var(--text-dim);
}

.budget-templates-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 18px 40px;
}

.budget-sec-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.2px;
}

.budget-template-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.budget-template-card:active {
  background: var(--bg-hover);
  transform: scale(0.98);
}

.template-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-card-blue {
  background: #1c3252;
  color: #60a5fa;
}

.icon-cart-orange {
  background: #402812;
  color: #f59e0b;
}

.template-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.template-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.template-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.template-action-tag {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 2px;
  font-weight: 500;
}

/* ==========================================================================
   STREAMLINED STYLES FOR REFINED VIEWS
   ========================================================================== */
.donut-card-title {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.2px;
}

.ana-breakdown-item {
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.ana-breakdown-item:active {
  background: rgba(255, 255, 255, 0.06);
  transform: scale(0.98);
}

.acc-cashflow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.acc-cashflow-grid .acc-card {
  width: 100%;
  box-sizing: border-box;
  height: 116px;
}

/* ==========================================================================
   SUPABASE CLOUD SYNC UI
   ========================================================================== */
.user-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cloud-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-full);
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  color: #4ade80;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.cloud-status-badge:hover {
  background: rgba(34, 197, 94, 0.2);
}

.cloud-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

.cloud-status-badge.syncing {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.cloud-status-badge.syncing .cloud-dot {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  animation: pulse-dot 0.9s infinite alternate;
}

.cloud-status-badge.offline {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.25);
  color: #94a3b8;
}

.cloud-status-badge.offline .cloud-dot {
  background: #64748b;
  box-shadow: none;
}

.cloud-status-badge.error {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.cloud-status-badge.error .cloud-dot {
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
}

@keyframes pulse-dot {
  from { opacity: 0.35; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1.2); }
}

/* Cloud Card inside Settings Modal */
.cloud-card-box {
  background: #151722;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.cloud-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cloud-meta-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

.cloud-meta-row {
  display: flex;
  justify-content: space-between;
}

.btn-cloud-sync {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-cloud-sync:active {
  transform: scale(0.98);
  opacity: 0.9;
}


