/* CostusWorx © 2026 — Lepas-inspired design system */
:root {
  --brand:       #1B4F72;
  --brand-light: #2E86C1;
  --brand-dark:  #154360;
  --accent:      #F39C12;
  --success:     #27AE60;
  --danger:      #E74C3C;
  --bg:          #F4F6F9;
  --surface:     #FFFFFF;
  --border:      #DDE1E7;
  --text:        #1A1A2E;
  --text-muted:  #6C757D;
  --radius:      8px;
  --shadow:      0 2px 8px rgba(0,0,0,.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }

/* ── Navbar ────────────────────────────────── */
.navbar {
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.navbar-brand { display: flex; align-items: center; gap: 12px; }
.nav-title    { font-size: 1.15rem; font-weight: 700; letter-spacing: .5px; }
.nav-plan     { font-size: .7rem; background: rgba(255,255,255,.2); border-radius: 12px; padding: 2px 8px; }
.nav-logo     { height: 36px; }
.navbar-links { list-style: none; display: flex; gap: 8px; }
.navbar-links a { color: rgba(255,255,255,.85); text-decoration: none; padding: 6px 12px; border-radius: var(--radius); font-size: .9rem; }
.navbar-links a:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ── Container ─────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }

/* ── Page header ───────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header h1 { font-size: 1.6rem; color: var(--brand-dark); }

/* ── Cards ─────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }

/* ── Stat cards ────────────────────────────── */
.stats-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card   { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow); }
.stat-value  { display: block; font-size: 2rem; font-weight: 700; color: var(--brand); }
.stat-label  { display: block; font-size: .85rem; color: var(--text-muted); margin-top: 4px; }
.upgrade-link{ display: block; margin-top: 8px; font-size: .8rem; color: var(--accent); font-weight: 600; text-decoration: none; }

/* ── Progress bar ──────────────────────────── */
.progress-bar  { height: 6px; background: var(--border); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--brand-light); border-radius: 3px; transition: width .4s; }

/* ── Data table ────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table thead tr { background: var(--brand); color: #fff; }
.data-table th, .data-table td { padding: 10px 14px; text-align: left; font-size: .9rem; }
.data-table tbody tr:nth-child(even) { background: #F8FAFC; }
.data-table tbody tr:hover { background: #EBF5FB; }

/* ── Forms ─────────────────────────────────── */
.form { max-width: 680px; }
.form-wide { max-width: 960px; }
.form-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
.form-section h2 { font-size: 1rem; color: var(--brand-dark); margin-bottom: 16px; border-bottom: 2px solid var(--brand-light); padding-bottom: 6px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.form-row label, .form label { display: flex; flex-direction: column; gap: 4px; font-size: .875rem; font-weight: 600; color: var(--text); flex: 1 1 160px; }
input, select, textarea { border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font-size: .9rem; font-family: inherit; width: 100%; color: var(--text); background: #fff; }
input:focus, select:focus { outline: none; border-color: var(--brand-light); box-shadow: 0 0 0 3px rgba(46,134,193,.15); }
input[readonly] { background: #f0f4f8; color: var(--text-muted); }

/* ── Buttons ───────────────────────────────── */
.btn-primary   { background: var(--brand); color: #fff; border: none; border-radius: 6px; padding: 10px 20px; font-size: .9rem; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-primary:hover { background: var(--brand-light); }
.btn-outline    { background: transparent; border: 1.5px solid var(--brand); color: var(--brand); border-radius: 6px; padding: 9px 18px; font-size: .875rem; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-outline:hover { background: var(--brand); color: #fff; }
.btn-outline-sm { font-size: .8rem; padding: 4px 10px; border: 1px solid var(--brand); border-radius: 4px; background: transparent; color: var(--brand); cursor: pointer; }
.btn-link       { color: var(--brand-light); text-decoration: none; font-size: .875rem; font-weight: 600; }
.btn-link:hover { text-decoration: underline; }
.btn-full       { width: 100%; text-align: center; }

/* ── Auth page ─────────────────────────────── */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%); }
.auth-card { background: #fff; border-radius: 12px; padding: 40px; width: 100%; max-width: 420px; box-shadow: 0 8px 32px rgba(0,0,0,.18); }
.auth-logo { font-size: 1.4rem; font-weight: 800; color: var(--brand); margin-bottom: 8px; }
.auth-card h2 { font-size: 1rem; color: var(--text-muted); margin-bottom: 24px; font-weight: 400; }
.auth-card .form label { margin-bottom: 12px; }
.auth-footer { margin-top: 20px; text-align: center; font-size: .75rem; color: var(--text-muted); }

/* ── Alerts ────────────────────────────────── */
.alert { border-radius: 6px; padding: 12px 16px; margin-bottom: 16px; font-size: .9rem; }
.alert-error   { background: #FDEDEC; border: 1px solid #E74C3C; color: #922B21; }
.alert-success { background: #EAFAF1; border: 1px solid #27AE60; color: #1E8449; }

/* ── Badges ────────────────────────────────── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: .75rem; font-weight: 700; }
.badge-conservative { background: #EBF5FB; color: #2471A3; }
.badge-moderate     { background: #E9F7EF; color: #1E8449; }
.badge-aggressive   { background: #FEF9E7; color: #D68910; }

/* ── Client/Scenario cards ─────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.scenario-card { display: block; text-decoration: none; color: inherit; transition: box-shadow .2s; }
.scenario-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); transform: translateY(-2px); }
.scenario-card h3 { font-size: 1rem; color: var(--brand-dark); margin-bottom: 8px; }
.scenario-meta { display: flex; gap: 12px; font-size: .8rem; color: var(--text-muted); margin-top: 8px; }
.client-meta { display: flex; gap: 20px; flex-wrap: wrap; font-size: .9rem; color: var(--text-muted); margin-bottom: 24px; }

/* ── Simulation controls ───────────────────── */
.sim-controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin: 24px 0; }
.sim-controls label { font-weight: 600; font-size: .875rem; display: flex; align-items: center; gap: 8px; }
.sim-status { font-size: .85rem; color: var(--text-muted); }

/* ── Results panel ─────────────────────────── */
.results-panel { margin-top: 24px; }
.success-meter { text-align: center; padding: 32px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 24px; box-shadow: var(--shadow); }
.success-ring { font-size: 3.5rem; font-weight: 800; color: var(--brand); }
.success-detail { margin-top: 8px; color: var(--text-muted); }
.charts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 20px; margin-bottom: 20px; }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.chart-card h3 { font-size: .95rem; color: var(--brand-dark); margin-bottom: 12px; }
.export-bar { display: flex; gap: 12px; }

/* ── Asset row ─────────────────────────────── */
.asset-row { margin-bottom: 16px; position: relative; }
.btn-remove-asset { position: absolute; top: 16px; right: 16px; }

/* ── Plans grid ────────────────────────────── */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin-bottom: 32px; }
.plan-card { text-align: center; position: relative; }
.plan-current { border-color: var(--brand); border-width: 2px; }
.plan-badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; font-size: .7rem; padding: 2px 10px; border-radius: 12px; white-space: nowrap; }
.plan-card h2 { font-size: 1.1rem; color: var(--brand-dark); margin-bottom: 12px; }
.plan-price { margin-bottom: 16px; }
.price { font-size: 2rem; font-weight: 800; color: var(--brand); }
.price-period { font-size: .85rem; color: var(--text-muted); }
.plan-features { list-style: none; text-align: left; font-size: .85rem; margin-bottom: 20px; }
.plan-features li { padding: 4px 0; border-bottom: 1px solid var(--border); }
.feat-off { color: var(--text-muted); }
.credits-section { margin-top: 32px; }

/* ── POPI section ──────────────────────────── */
.popi-section { border-left: 4px solid var(--brand-light); }
.checkbox-label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .9rem; cursor: pointer; }
.checkbox-label input { width: auto; margin-top: 3px; }

/* ── Empty state ───────────────────────────── */
.empty-state { background: var(--surface); border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px; text-align: center; color: var(--text-muted); }

/* ── Footer ────────────────────────────────── */
.footer { text-align: center; padding: 20px; font-size: .78rem; color: var(--text-muted); border-top: 1px solid var(--border); margin-top: 40px; }
.footer a { color: var(--brand-light); text-decoration: none; }

/* ── Fund search autocomplete ──────────────── */
.fund-search-wrap  { margin-bottom: 12px; }
.fund-search-label { display: block; margin-bottom: 4px; font-size: .875rem; color: var(--text-muted); }
.fund-search-inner { position: relative; }
.fund-search-row   { display: flex; gap: 8px; }
.fund-search-row .fund-search-input { flex: 1; min-width: 0; }
.fund-search-row .fund-search-btn   { white-space: nowrap; flex-shrink: 0; }
.fund-suggestions  {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
  background: #fff; border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 6px 6px; box-shadow: 0 4px 12px rgba(0,0,0,.1);
  max-height: 260px; overflow-y: auto; display: none;
}
.fund-suggestion-item {
  padding: 10px 14px; cursor: pointer; font-size: .875rem;
  border-bottom: 1px solid var(--border);
}
.fund-suggestion-item:last-child { border-bottom: none; }
.fund-suggestion-item:hover, .fund-suggestion-item.active { background: #EBF5FB; }
.fund-suggestion-name { font-weight: 600; color: var(--brand-dark); }
.fund-suggestion-name strong { color: var(--brand); background: #FEF9E7; border-radius: 2px; padding: 0 1px; font-weight: 700; }
.fund-suggestion-meta { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.fund-suggestion-loading { padding: 10px 14px; font-size: .875rem; color: var(--text-muted); font-style: italic; }
.fund-suggestion-empty   { padding: 10px 14px; font-size: .875rem; color: var(--text-muted); }
.fund-badge {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #EBF5FB; border: 1px solid var(--brand-light);
  border-radius: 6px; padding: 6px 12px; margin-top: 6px; font-size: .8rem;
}
.fund-badge-name { font-weight: 700; color: var(--brand); }
.fund-badge-isin { font-family: monospace; color: var(--text-muted); }
.fund-badge-ter  { color: var(--text-muted); }
.fund-badge-warn { color: #B7472A; font-weight: 600; flex-basis: 100%; font-size: .75rem; }
.fund-badge-unverified { background: #FDF2E9; border-color: #E59866; }
.fund-tag {
  display: inline-block; font-size: .65rem; font-weight: 700; padding: 1px 6px;
  border-radius: 3px; vertical-align: middle; margin-left: 6px; letter-spacing: .03em;
  text-transform: uppercase;
}
.fund-tag-verified   { background: #D5F5E3; color: #196F3D; }
.fund-tag-unverified { background: #FDEBD0; color: #9C640C; }
.fund-suggestion-item.fund-unverified { background: #FFFDF6; }
.optional-tag    { font-size: .75rem; color: var(--text-muted); font-weight: 400; }

/* ── Responsive ────────────────────────────── */
@media (max-width: 640px) {
  .navbar-links { gap: 4px; }
  .charts-grid  { grid-template-columns: 1fr; }
  .form-row     { flex-direction: column; }
}
