/* ==========================================================================
   UPLITH MOBILE PWA - MODULE COMPONENTS STYLING
   Luminous Fintech Design System (Daylight & Obsidian Support)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. BUDGET 50/30/20 & PACE COMPONENTS
   -------------------------------------------------------------------------- */
.donut-container {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 16px;
  padding: 10px 0;
}

.donut-chart-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

.donut-center-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-center-title {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.donut-center-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

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

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-dot.blue { background: var(--accent-blue); box-shadow: 0 0 8px var(--accent-blue); }
.legend-dot.pink { background: var(--accent-pink); box-shadow: 0 0 8px var(--accent-pink); }
.legend-dot.green { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); }

.legend-name {
  color: var(--text-muted);
  font-weight: 500;
}

.legend-right {
  text-align: right;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: var(--text-main);
}

.legend-sub {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 400;
}

/* Category Spending List */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.cat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
}

.cat-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--text-main);
}

.cat-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--bg-surface-active);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.cat-spending-val {
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  color: var(--text-main);
}

.progress-track {
  width: 100%;
  height: 7px;
  background: var(--border-subtle);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill.blue { background: linear-gradient(90deg, #2563EB, #3B82F6); }
.progress-fill.pink { background: linear-gradient(90deg, #DB2777, #EC4899); }
.progress-fill.green { background: linear-gradient(90deg, #059669, #10B981); }
.progress-fill.orange { background: linear-gradient(90deg, #EA580C, #F97316); }

/* Spending Pace Indicator */
.pace-banner {
  background: var(--accent-blue-bg);
  border: 1px solid var(--border-glow-blue);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

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

.pace-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-blue);
  font-weight: 700;
}

.pace-desc {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   2. TAX SHIELD (LHDN YA 2026 - FORM BE) COMPONENTS
   -------------------------------------------------------------------------- */
.tax-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

.tax-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--accent-green-bg);
  color: var(--accent-green);
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.relief-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.relief-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  position: relative;
  transition: all var(--transition-fast);
}

.relief-card.maxed {
  border-color: rgba(5, 150, 105, 0.25);
}

.relief-card.has-room {
  border-color: rgba(234, 88, 12, 0.25);
}

.relief-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.relief-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.relief-cap-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

.relief-amounts {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  white-space: nowrap !important;
  gap: 6px;
}

.relief-amounts span {
  white-space: nowrap !important;
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}

.relief-claimed-val {
  font-weight: 700;
  color: var(--text-main);
  font-family: 'Inter', -apple-system, sans-serif;
  white-space: nowrap !important;
}

.relief-action-row {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  font-size: 11.5px;
}

.relief-tip {
  color: var(--accent-orange);
  font-size: 11px;
  line-height: 1.35;
  width: 100%;
}

.relief-tip.optimal {
  color: var(--accent-green);
}

/* --------------------------------------------------------------------------
   3. LIABILITIES & DSR HEALTH GAUGE COMPONENTS
   -------------------------------------------------------------------------- */
.dsr-gauge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0 8px 0;
}

.gauge-svg-wrap {
  position: relative;
  width: 220px;
  height: 110px;
  display: flex;
  justify-content: center;
}

.gauge-svg-wrap canvas {
  width: 100%;
  height: 100%;
}

.gauge-center-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 6px;
  text-align: center;
}

.gauge-percent {
  font-size: 24px;
  font-weight: 800;
  font-family: 'Poppins', sans-serif;
  color: var(--text-main);
  line-height: 1;
}

.gauge-status-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-top: 4px;
  display: inline-block;
}

.gauge-status-label.safe {
  background: var(--accent-green-bg);
  color: var(--accent-green);
  border: 1px solid rgba(5, 150, 105, 0.3);
}

.gauge-status-label.caution {
  background: var(--accent-orange-bg);
  color: var(--accent-orange);
  border: 1px solid rgba(234, 88, 12, 0.3);
}

.gauge-benchmarks {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px 0 12px;
  font-size: 10.5px;
  color: var(--text-dim);
}

.liability-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.liability-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

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

.liability-val-col {
  text-align: right;
}

.liability-monthly {
  font-size: 13.5px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  color: var(--text-main);
}

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

/* --------------------------------------------------------------------------
   4. BUSINESS P&L (FORM B) & TAX ADJUSTMENTS ACCORDION
   -------------------------------------------------------------------------- */
.accordion-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.accordion-item.open {
  border-color: var(--border-glow-blue);
}

.accordion-header {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.accordion-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.accordion-chevron {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-fast);
  stroke: var(--text-muted);
}

.accordion-item.open .accordion-chevron {
  transform: rotate(180deg);
  stroke: var(--accent-blue);
}

.accordion-body {
  display: none;
  padding: 0 14px 14px 14px;
  border-top: 1px solid var(--border-subtle);
}

.accordion-item.open .accordion-body {
  display: block;
}

.sub-item-table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
}

.sub-item-table td {
  padding: 6px 0;
  font-size: 12px;
  color: var(--text-main);
}

.sub-item-table td.val-col {
  text-align: right;
  font-weight: 600;
  color: var(--text-main);
  font-family: 'Poppins', sans-serif;
}

/* --------------------------------------------------------------------------
   5. eZHASIL MIRROR UI (1-CLICK E-FILING)
   -------------------------------------------------------------------------- */
.ezhasil-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid var(--border-glow-blue);
}

.lhdn-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
  overflow: hidden;
}

.lhdn-section-header {
  background: var(--bg-surface-active);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
}

.lhdn-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  gap: 6px;
}

.lhdn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}

.lhdn-row:last-child {
  border-bottom: none;
}

.lhdn-row:hover {
  background: var(--bg-surface-subtle);
}

.lhdn-item-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding-right: 12px;
}

.lhdn-code-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: 0.02em;
}

.lhdn-item-name {
  font-size: 12px;
  color: var(--text-main);
  margin-top: 1px;
  line-height: 1.3;
}

.lhdn-item-limit {
  font-size: 10px;
  color: var(--text-dim);
}

.lhdn-action-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lhdn-val-display {
  font-size: 13.5px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  color: var(--text-main);
  min-width: 75px;
  text-align: right;
}

/* --------------------------------------------------------------------------
   6. SMART "ADD TO HOME SCREEN" MODAL & BOTTOM SHEET
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 28px 28px 0 0;
  padding: 20px 20px calc(var(--sab) + 24px) 20px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.2);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .bottom-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 38px;
  height: 4px;
  background: var(--text-dim);
  border-radius: 4px;
  align-self: center;
  margin-bottom: 16px;
}

.sheet-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.sheet-app-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.sheet-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.step-guide-card {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.guide-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.guide-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==========================================================================
   GLOBAL SINGLE-LINE CURRENCY & FINANCIAL METRICS (NO WRAPPING)
   ========================================================================== */
.metric-val,
.hero-num,
.legend-right,
.legend-val,
.cat-spending-val,
.relief-claimed-val,
.relief-amounts,
.liability-monthly,
.liability-balance,
.sub-item-table td.val-col,
.lhdn-val-display,
.gauge-percent,
#pl-adjusted-statutory,
#tax-estimated-refund,
#tax-total-claimed,
#tax-total-headroom,
#budget-hero-income,
#budget-hero-spent,
#budget-hero-remaining {
  white-space: nowrap !important;
  word-break: keep-all !important;
}
