/* ==========================================================================
   Zenith Finance Tracker - Enterprise Light Theme (Black & White Minimalist)
   ========================================================================== */

:root {
  /* Core Monochrome Palette */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-input: #f8fafc;
  --bg-hover: #f1f5f9;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --text-inverse: #ffffff;

  --border-light: rgba(226, 232, 240, 0.9);
  --border-focus: #0f172a;

  /* Accent Jewel Tones (Soft & Executive) */
  --accent-black: #0f172a;
  --accent-indigo: #4f46e5;
  --accent-green: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  --accent-blue: #2563eb;

  /* 50:30:20 Rule Shades */
  --need-bg: #eff6ff;
  --need-text: #1d4ed8;
  --need-border: #bfdbfe;

  --want-bg: #fdf2f8;
  --want-text: #be185d;
  --want-border: #fbcfe8;

  --saving-bg: #ecfdf5;
  --saving-text: #047857;
  --saving-border: #a7f3d0;

  /* Geometry & Elevations */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-full: 9999px;

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --shadow-float: 0 12px 30px -4px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: 90px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-app); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Top Status & Live Clock Bar */
.top-status-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.live-clock-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card-subtle);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border-light);
}

.live-clock-badge .pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--accent-black);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  box-shadow: var(--shadow-subtle);
}

.brand-name {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-pill-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 7px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-subtle);
  transition: all 0.2s;
}

.btn-pill-icon:hover {
  background: var(--bg-hover);
  border-color: #cbd5e1;
}

/* App Container */
.app-container {
  max-width: 680px; /* Reference Mobile App optimized width with centered desktop */
  margin: 0 auto;
  padding: 16px;
}

/* Date & Month Header Strip */
.month-selector-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  box-shadow: var(--shadow-subtle);
}

.month-btn {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.month-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.month-text-group {
  text-align: center;
}

.month-heading {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.month-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Top Overview Cards (Income vs Expenses) - Reference Design */
.hero-overview-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.hero-pill-card {
  border-radius: var(--radius-xl);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-subtle);
  transition: transform 0.2s;
}

.hero-pill-card:hover {
  transform: translateY(-2px);
}

.card-expense {
  background: #fef2f2;
  border: 1px solid #fee2e2;
}

.card-income {
  background: #f0fdf4;
  border: 1px solid #dcfce7;
}

.pill-card-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.pill-card-amount {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-expense .pill-card-amount { color: #dc2626; }
.card-income .pill-card-amount { color: #16a34a; }

.pill-card-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Quick Action / Feature Pills Grid - Reference Design */
.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.action-pill-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: var(--shadow-subtle);
  transition: all 0.2s;
}

.action-pill-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: #cbd5e1;
}

.action-icon-circle {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.icon-ledger { background: #fef3c7; }
.icon-recurring { background: #e0e7ff; }
.icon-category { background: #fce7f3; }
.icon-analytics { background: #dcfce7; }

.action-pill-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-main);
}

/* 50:30:20 Rule Progress Strip */
.rule-gauge-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 16px 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-subtle);
}

.rule-gauge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.rule-title {
  font-size: 0.95rem;
  font-weight: 800;
}

.rule-badge {
  background: var(--bg-card-subtle);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

.multi-progress-bar {
  display: flex;
  height: 10px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: #f1f5f9;
  margin-bottom: 12px;
}

.prog-segment {
  height: 100%;
  transition: width 0.4s ease;
}

.prog-need { background: var(--accent-blue); }
.prog-want { background: var(--accent-rose); }
.prog-saving { background: var(--accent-green); }

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

.rule-col {
  padding: 8px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
}

.rule-col.col-need { background: var(--need-bg); border: 1px solid var(--need-border); color: var(--need-text); }
.rule-col.col-want { background: var(--want-bg); border: 1px solid var(--want-border); color: var(--want-text); }
.rule-col.col-saving { background: var(--saving-bg); border: 1px solid var(--saving-border); color: var(--saving-text); }

.rule-col-title {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.rule-col-amt {
  font-size: 1rem;
  font-weight: 800;
  margin: 2px 0;
}

.rule-col-sub {
  font-size: 0.65rem;
  opacity: 0.8;
}

/* Transactions Feed - Reference Clean Pastel Item Cards */
.tx-feed-section {
  margin-bottom: 24px;
}

.section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 4px;
}

.section-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.tx-feed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tx-row-card {
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-subtle);
  transition: all 0.2s;
  cursor: pointer;
}

.tx-row-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

/* Reference Soft Pastel Row Backgrounds */
.tx-bg-food { background: #fffbeb; border: 1px solid #fef3c7; }
.tx-bg-lifestyle { background: #fdf2f8; border: 1px solid #fce7f3; }
.tx-bg-growth { background: #f0fdf4; border: 1px solid #dcfce7; }
.tx-bg-infra { background: #f0f9ff; border: 1px solid #e0f2fe; }
.tx-bg-saving { background: #ecfdf5; border: 1px solid #a7f3d0; }
.tx-bg-default { background: #ffffff; border: 1px solid var(--border-light); }

.tx-left-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.tx-item-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
}

.tx-item-info {
  min-width: 0;
}

.tx-item-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-item-category {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}

.tx-right-block {
  text-align: right;
  flex-shrink: 0;
  margin-left: 12px;
}

.tx-item-price {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: #b91c1c; /* Reference negative red format */
}

.tx-item-price.price-saving {
  color: #15803d;
}

.tx-item-date {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Modals (Auth, Quick Add, Profile, Forgot Password) */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 640px) {
  .modal-backdrop {
    align-items: center;
  }
}

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

.modal-panel {
  background: #ffffff;
  border: 1px solid var(--border-light);
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px 20px 36px 20px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-float);
  animation: modalSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .modal-panel {
    border-radius: var(--radius-xl);
    padding: 26px;
  }
}

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

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.btn-close-modal {
  background: var(--bg-card-subtle);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
}

/* Form Styling */
.form-field {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}

.form-control:focus {
  border-color: var(--accent-black);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.input-huge {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-black);
}

.btn-primary-dark {
  width: 100%;
  background: var(--accent-black);
  color: #ffffff;
  border: none;
  padding: 14px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.15);
  transition: all 0.2s;
  margin-top: 8px;
}

.btn-primary-dark:hover {
  background: #1e293b;
  transform: translateY(-1px);
}

/* Bottom Navigation Bar with Elevated Center FAB */
.bottom-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 45;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
}

.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  gap: 3px;
  cursor: pointer;
  flex: 1;
}

.dock-item.active {
  color: var(--accent-black);
}

.dock-item .dock-icon {
  font-size: 1.35rem;
}

/* Elevated Reference Center Button */
.center-fab-wrap {
  position: relative;
  top: -18px;
}

.center-fab-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706); /* Warm golden tone like reference */
  color: #ffffff;
  border: 3px solid #ffffff;
  font-size: 26px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.center-fab-btn:hover {
  transform: scale(1.08) translateY(-2px);
}

/* View Sections */
.app-view {
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.app-view.active {
  display: block;
}

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

/* Toast Message */
.toast-bar {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--accent-black);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  z-index: 200;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-bar.visible {
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Filter Panel & Search
   ========================================================================== */
.filter-control-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-box-wrap {
  position: relative;
}

.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px 10px 36px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s;
}

.search-input:focus {
  border-color: var(--accent-black);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.06);
}

.search-icon-inside {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-dim);
  pointer-events: none;
}

.filter-chip-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-chip-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.filter-chip-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.filter-chip-btn.active {
  background: var(--accent-black);
  color: #ffffff;
  border-color: var(--accent-black);
}

.filter-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.filter-select {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 0.78rem;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

.filter-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 600;
  padding-top: 2px;
}

/* Quick Suggestion Chips in Modal */
.quick-tag-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  max-height: 85px;
  overflow-y: auto;
  padding: 2px;
}

.quick-tag-chip {
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.quick-tag-chip:hover {
  background: var(--accent-black);
  color: #ffffff;
  border-color: var(--accent-black);
  transform: translateY(-1px);
}

/* Minimal Data Table */
.data-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-subtle);
  overflow-x: auto;
}

.excel-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-top: 8px;
}

.excel-data-table th, .excel-data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.excel-data-table th {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #fafafa;
}

.badge-status-ok {
  background: #ecfdf5;
  color: #047857;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 700;
}

.badge-status-over {
  background: #fef2f2;
  color: #b91c1c;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 700;
}

/* Discipline Score Card */
.score-hero-box {
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-subtle);
}

.score-badge-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-black);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 800;
}

