/* Minimal clean allocation group styles */
.alloc-group-list {
  display: flex;
  gap: 16px;
  margin: 10px 0 0 0;
  flex-wrap: wrap;
}
.alloc-group {
  background: #fff;
  border: 1px solid #e3e6e8;
  border-radius: 7px;
  padding: 12px 18px 10px 18px;
  min-width: 120px;
  flex: 1 1 120px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.alloc-group-title {
  font-weight: 600;
  font-size: 1.05em;
  margin-bottom: 4px;
}
.alloc-group-amt {
  font-size: 1.1em;
  margin-bottom: 2px;
}
.alloc-group-pct {
  color: #666;
  font-size: 0.97em;
}
/* Ensure allocation and portfolio sections in left column are compact */
#planner-allocation-section,
#planner-portfolio-section {
  margin-bottom: 0.12rem;
  padding: 0.4rem 0.7rem 0.3rem 0.7rem;
  background: #fafbfc;
  border: 1px solid #e3e6e8;
  border-radius: 6px;
  font-size: 0.97rem;
  width: 100%;
  box-sizing: border-box;
}
#planner-allocation-section h3,
#planner-portfolio-section h3 {
  font-size: 0.97rem;
  margin-bottom: 4px;
}
:root{
  --bg: #ffffff;
  --text: #000000;
  --border: #e5e5e5;
  --muted: #666666;
  --primary: #000000;
  --primary-bg: #000000;
  --primary-text: #ffffff;
  --radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-family);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1000px; margin: 0 auto; padding: 0 8px; }

.header {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
}

.hero {
  padding: 60px 0;
  text-align: center;
}
.hero h2 {
  margin: 0 0 12px;
  font-size: 2.2rem;
  line-height: 1.2;
}
.hero p {
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 1.1rem;
}

.ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s;
}
.btn.primary {
  background: var(--primary-bg);
  color: var(--primary-text);
  border-color: var(--primary);
}
.btn.primary:hover {
  opacity: 0.8;
}
.btn.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--primary);
}
.btn.secondary:hover {
  background: #f5f5f5;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Planner page */
.planner {
  padding: 18px 0 8px 0;
}
.planner h1 {
  margin: 0 0 8px;
  font-size: 1.8rem;
}
.planner > .container > p {
  margin: 0 0 30px;
  color: var(--muted);
}

.planner-form {
  background: #f9f9f9;
  padding: 22px 24px 16px 24px;
  border-radius: 10px;
  border: 1px solid #e3e6e8;
  margin: 32px auto 18px auto;
  max-width: 480px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* Two column planner grid for single-page layout */
.planner .container {
  max-width: 1100px;
  display: block;
}
/* Unified dashboard grid for planner */
/* Single-column layout for planner results */
.planner-form, .results, #planner-overview-section, #planner-emergency-section, #planner-allocation-section, #planner-portfolio-section, #planner-breakdown-section, #planner-projection-section, #planner-suggestions-section {
  width: 100%;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
/* Compact result sections for all planner results */
#planner-overview-section,
#planner-emergency-section,
#planner-allocation-section,
#planner-portfolio-section,
#planner-breakdown-section,
#planner-projection-section,
#planner-suggestions-section {
  margin-bottom: 0.12rem;
  padding: 0.4rem 0.7rem 0.3rem 0.7rem;
  background: #fafbfc;
  border: 1px solid #e3e6e8;
  border-radius: 6px;
  font-size: 0.97rem;
  width: 100%;
  box-sizing: border-box;
}
.result-section.compact h3 {font-size: 0.97rem; margin-bottom: 4px;}


.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0;
}
.form-group label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 6px;
  font-weight: 500;
}
.form-group input, .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row {
  display: flex;
  gap: 18px;
  margin-bottom: 10px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  justify-content: flex-start;
}

.results {
  margin-top: 30px;
}
.result-section {
  background: #f9f9f9;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.result-section h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}
.result-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.result-row:last-child {
  border-bottom: none;
}
.result-label {
  color: var(--muted);
}
.result-value {
  font-weight: 600;
}


  color: var(--muted);
  margin-bottom: 4px;
}

.alert {
  background: #fff0f0;
  border-left: 4px solid #ff0000;
  padding: 12px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  color: #cc0000;
}

/* Graph page */
.graph-section {
  padding: 40px 0;
}
.graph-section h1 {
  margin: 0 0 8px;
  font-size: 1.8rem;
}

.graph-container {
  background: #f9f9f9;
  padding: 30px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 30px;
}

.chart-box {
  background: white;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.chart-box h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.graph-form {
  background: #f9f9f9;
  padding: 30px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 30px;
}

.entry-row {
  background: white;
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 12px;
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}
.summary-table th,
.summary-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.summary-table th {
  background: white;
  font-weight: 600;
}

/* SIP Calculator */
.sip-section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.sip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 20px;
  background: #f9f9f9;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.sip-header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.toggle-icon {
  font-size: 1.5rem;
  font-weight: 700;
  transition: transform 0.3s;
}

.sip-header:hover {
  background: #f5f5f5;
}

.sip-content {
  padding: 30px 0;
  margin-top: 20px;
  transition: all 0.3s ease;
}

.sip-content.hidden {
  display: none;
}

/* generic hidden utility */
.hidden { display: none; }

.info-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 50%;
  background: #e0e0e0;
  color: #111;
  font-size: 12px;
  margin-left: 6px;
  cursor: default;
}

.sip-form {
  background: #f9f9f9;
  padding: 30px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 30px;
}

.radio-group {
  display: flex;
  gap: 20px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.95rem;
}

.radio-label input[type="radio"] {
  cursor: pointer;
}

.fund-search-wrapper {
  position: relative;
}

.fund-search-wrapper input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
}

.fund-dropdown {
  position: absolute;
  width: 100%;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 300px;
  overflow-y: auto;
  z-index: 10;
}

.fund-dropdown.hidden {
  display: none;
}

.fund-option {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.fund-option:hover {
  background: #f5f5f5;
}

.fund-option:last-child {
  border-bottom: none;
}

.sip-results {
  margin-top: 30px;
}

.result-box {
  background: #f9f9f9;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.result-box h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.fund-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.fund-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.fund-rank {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.fund-name {
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.fund-detail {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.fund-detail:last-child {
  border-bottom: none;
}

.fund-detail .label {
  color: var(--muted);
}

.fund-detail .value {
  font-weight: 600;
}

/* Funds comparison table */
.funds-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.funds-table th,
.funds-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.funds-table th {
  background: #f5f5f5;
  font-weight: 700;
  text-align: center;
}

.funds-table td {
  text-align: center;
}

.funds-table tbody tr:hover {
  background: #fafafa;
}

.funds-table tbody tr:last-child td {
  border-bottom: none;
}

.funds-table tbody tr td:first-child {
  text-align: left;
}

.funds-table tbody tr td:nth-child(2) {
  text-align: left;
}

.input-summary {
  background: white;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.summary-item {
  display: flex;
  flex-direction: column;
}

.summary-item .label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.summary-item .value {
  font-weight: 700;
  font-size: 1.1rem;
}

@media (max-width: 900px) {
  
/* Dashboard grid for planner page */
.planner-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
.dashboard-left {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 320px;
  max-width: 480px;
  flex: 1 1 0;
}
.dashboard-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 320px;
  max-width: 540px;
  flex: 1 1 0;
}
@media (max-width: 900px) {
  .planner-form, .results, #planner-overview-section, #planner-emergency-section, #planner-allocation-section, #planner-portfolio-section, #planner-breakdown-section, #planner-projection-section, #planner-suggestions-section {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}
}

/* Health page styles */
.health-section { padding: 40px 0; }
.health-form { background: #f9f9f9; padding: 24px; border-radius: var(--radius); border: 1px solid var(--border); }
.banks-wrapper { margin: 18px 0; }
.bank-row { display: grid; grid-template-columns: 1fr 90px 140px 40px; gap: 8px; margin-bottom: 8px; align-items:center; }
.bank-row input { padding: 8px 10px; border:1px solid var(--border); border-radius:6px }
.currency-row { display:flex; gap:8px; align-items:center }
.currency-select { padding:8px 8px; border:1px solid var(--border); border-radius:6px; background:white }

.liabilities-wrapper { margin: 18px 0; }
.lumpsum-wrapper { margin: 18px 0; }
.loan-row { display: grid; grid-template-columns: 1fr 120px 100px 100px 80px 40px; gap: 8px; margin-bottom: 8px; align-items:center; }
.loan-row input { padding: 8px 10px; border:1px solid var(--border); border-radius:6px; font-size:0.9rem }
.loan-row select { padding:8px 6px; border:1px solid var(--border); border-radius:6px; background:white; font-size:0.9rem }
.loan-remove { background: transparent; border: none; color: #b00; cursor: pointer; font-size:1.2rem }

/* Analysis status and badges */
.analysis-status { padding:12px; margin-top:12px; border-radius:6px; display:flex; align-items:center; gap:12px; border:1px solid var(--border); background:#fffef8 }
.analysis-status.hidden { display:none }
.spinner { width:18px; height:18px; border-radius:50%; border:3px solid rgba(0,0,0,0.1); border-top-color:var(--primary-bg); animation:spin 1s linear infinite }
@keyframes spin { to { transform:rotate(360deg) } }

.status-badge { display:inline-block; padding:6px 10px; border-radius:999px; color:white; font-weight:700; font-size:0.85rem }
.status-green { background: #2e7d32 }
.status-amber { background: #ff8f00 }
.status-red { background: #c62828 }
.bank-remove { background: transparent; border: none; color: #b00; cursor: pointer }
.health-results { margin-top: 18px }
.health-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 12px; margin-bottom: 12px }
.health-card { background: white; padding:12px; border-radius:6px; border:1px solid var(--border) }
.health-card h4 { margin:0 0 8px }
.advice-list { margin:0; padding-left:18px }
.comparison-table { width:100%; border-collapse:collapse; margin-top:12px }
.comparison-table th, .comparison-table td { padding:10px; text-align:left; border-bottom:1px solid var(--border) }
.comparison-table th { background:#f5f5f5; font-weight:600 }
.comparison-table tr:last-child td { border-bottom:none }

/* Bonus vs Loan Styles */
.bonus-cta { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 36px 0; color: white; margin: 24px 0 }
.bonus-cta h2 { color: white; margin-bottom: 8px }
.bonus-cta .muted { color: rgba(255,255,255,0.8) }
.bonus-section { padding: 24px 0 }
.bonus-form { background: white; padding: 20px; border-radius: 8px; border: 1px solid var(--border) }
.tenure-row { display: flex; gap: 8px; align-items: center }
.tenure-row input { flex: 1 }
.tenure-row select { flex: 0 1 100px }
.bonus-results { margin-top: 24px }
.suggestion-box { background: #f0f7ff; border-left: 4px solid #2196F3 }
.suggestion-box h3 { color: #1976D2 }
.suggestion-box p { margin: 0; color: #0d47a1 }
.tax-detail { display: block; font-size: 0.85rem; color: #666; margin-top: 4px; font-style: italic }

