:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  /* SOLAAX brand palette (from solaax.com) */
  --accent: #00b050;        /* emerald — primary action */
  --accent-dark: #00963f;   /* emerald hover */
  --brand-dark: #00201c;    /* deep teal-green — nav / dark surfaces */
  --brand-teal: #02493c;    /* teal-green — secondary surface */
  --brand-black: #010101;
  --green: #00a04a;
  --danger: #dc2626;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }

/* ---- top nav ---- */
.topnav { background: var(--brand-dark); color: #fff; box-shadow: var(--shadow); }
.topnav-inner { display: flex; align-items: center; gap: 1.5rem; height: 56px; }
.brand { color: #fff; font-weight: 700; font-size: 1.05rem; letter-spacing: .14em; display: flex; align-items: center; gap: .5rem; }
.brand img { height: 22px; width: auto; display: block; }
.brand span { color: var(--accent); }
.brand:hover { text-decoration: none; }
.navlinks { display: flex; align-items: center; gap: 1.1rem; flex: 1; }
.navlinks a { color: #cbd5e1; font-weight: 500; }
.navlinks a:hover { color: #fff; text-decoration: none; }
.navlinks a.active { color: #fff; }
.navuser { display: flex; align-items: center; gap: .75rem; }
.navuser .muted { color: #94a3b8; }
.linkbtn { background: none; border: none; color: #cbd5e1; cursor: pointer; font: inherit; padding: 0; }
.linkbtn:hover { color: #fff; text-decoration: underline; }
.linkbtn-danger { color: var(--danger); }

/* ---- layout primitives ---- */
main.container { padding-top: 1.5rem; padding-bottom: 3rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; }
.page-head h1 { margin: .2rem 0 0; font-size: 1.5rem; }
.head-actions { display: flex; gap: .5rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.right { text-align: right; }
.strong, .strong:hover { font-weight: 600; }
.backlink { font-size: .85rem; }
.inline { display: inline; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.card.no-pad { padding: 0; overflow: hidden; }
.card h2 { margin-top: 0; font-size: 1.1rem; }

/* ---- buttons ---- */
.btn {
  display: inline-block; background: var(--accent); color: #fff; border: none;
  padding: .5rem .9rem; border-radius: 8px; font-weight: 600; font-size: .875rem;
  cursor: pointer; text-align: center;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn-sm { padding: .3rem .6rem; font-size: .8rem; }
.btn-block { width: 100%; }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: #f8fafc; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }

/* ---- badges / chips ---- */
.badge { display: inline-block; color: #fff; padding: .15rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.badge-lg { font-size: .8rem; padding: .25rem .7rem; vertical-align: middle; margin-left: .5rem; }
.badge-count { background: #e2e8f0; color: #475569; }
.chip { display: inline-block; background: #f1f5f9; color: #475569; padding: .1rem .45rem; border-radius: 6px; font-size: .72rem; }
.chip-money { background: #ecfdf5; color: #047857; }
.chip-type { text-transform: capitalize; color: #fff; }
.chip-call { background: #2563eb; }
.chip-email { background: #7c3aed; }
.chip-meeting { background: #d97706; }
.chip-note { background: #64748b; }

/* ---- tables ---- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .65rem .9rem; border-bottom: 1px solid var(--border); }
.table th { background: #f8fafc; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tbody tr:hover { background: #fafbfc; }
.table .right { text-align: right; }
.row-overdue td { background: #fef2f2; }

/* ---- filters ---- */
.filters { display: flex; align-items: flex-end; gap: 1rem; padding: 1rem 1.25rem; }
.filters label { font-size: .8rem; color: var(--muted); display: flex; flex-direction: column; gap: .25rem; }
.filters select { min-width: 160px; }

/* ---- forms ---- */
label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: .9rem; font-weight: 500; }
input, select, textarea {
  width: 100%; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 8px;
  font: inherit; color: var(--text); background: #fff; margin-top: .2rem;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
textarea { resize: vertical; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: .6rem; margin-top: .5rem; }

/* ---- auth ---- */
.authbox { max-width: 380px; margin: 4rem auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; }
.authbrand { display: flex; align-items: center; justify-content: center; gap: .45rem; margin: 0 0 .25rem; font-size: 1.3rem; letter-spacing: .14em; }
.authbrand img { height: 24px; width: auto; }
.authbrand span { color: var(--accent); }
.authbox h2 { text-align: center; margin: 0 0 1.25rem; font-size: 1.05rem; color: var(--muted); font-weight: 500; }
.alert { padding: .6rem .8rem; border-radius: 8px; margin-bottom: 1rem; font-size: .85rem; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.role-form select { min-width: 110px; padding: .25rem .4rem; margin-top: 0; }

/* ---- dashboard ---- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat { text-align: center; padding: 1.25rem .75rem; margin-bottom: 0; }
.stat-num { font-size: 1.75rem; font-weight: 700; }
.stat-label { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.accent-green { color: var(--green); }

.stage-bars { display: flex; flex-direction: column; gap: .5rem; }
.stage-bar-row { display: flex; align-items: center; gap: .75rem; color: var(--text); }
.stage-bar-row:hover { text-decoration: none; }
.stage-bar-row:hover .stage-bar-label { color: var(--accent-dark); }
.stage-bar-label { width: 110px; font-size: .82rem; flex-shrink: 0; }
.stage-bar-track { flex: 1; height: 22px; background: #f1f5f9; border-radius: 6px; overflow: hidden; }
.stage-bar-fill { display: block; height: 100%; min-width: 2px; border-radius: 6px; transition: width .3s; }
.stage-bar-count { width: 28px; text-align: right; font-weight: 600; font-size: .85rem; }

/* ---- detail ---- */
.detail-cols { display: grid; grid-template-columns: 1fr 1.2fr; gap: 1.25rem; align-items: start; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: .4rem .75rem; margin: 0; }
.kv dt { color: var(--muted); font-size: .82rem; }
.kv dd { margin: 0; }
.notes { white-space: pre-wrap; background: #f8fafc; padding: .75rem; border-radius: 8px; }

/* ---- activity log ---- */
.activity-form { background: #f8fafc; padding: 1rem; border-radius: 8px; margin-bottom: 1.25rem; }
.activity-form-row { display: flex; gap: .75rem; }
.activity-form-row .grow { flex: 1; }
.activity-form label { margin-bottom: .5rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.timeline-item:last-child { border-bottom: none; }
.timeline-head { display: flex; align-items: center; gap: .6rem; }
.timeline-date { font-size: .8rem; color: var(--muted); }
.timeline-outcome { font-weight: 600; font-size: .85rem; }
.timeline-del { margin-left: auto; }
.timeline-notes { margin: .35rem 0 .15rem; white-space: pre-wrap; }
.timeline-by { font-size: .75rem; }

/* ---- board ---- */
.board { display: flex; gap: .9rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; }
.board-col { background: #eef1f5; border-radius: 10px; width: 230px; flex-shrink: 0; }
.board-col-head { display: flex; align-items: center; justify-content: space-between; padding: .6rem .75rem; font-weight: 600; font-size: .85rem; }
.board-col-body { min-height: 60px; padding: 0 .55rem .55rem; display: flex; flex-direction: column; gap: .5rem; }
.board-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: .6rem .7rem; box-shadow: var(--shadow); cursor: grab; }
.board-card:active { cursor: grabbing; }
.board-card-title { font-weight: 600; color: var(--text); display: block; }
.board-card-title:hover { color: var(--accent-dark); text-decoration: none; }
.board-card-sub { font-size: .8rem; color: var(--muted); }
.board-card-meta { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
.board-card-date { font-size: .72rem; color: var(--muted); margin-top: .35rem; }
.card-ghost { opacity: .4; }
.card-saved { outline: 2px solid var(--green); }

@media (max-width: 880px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-cols { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
}

/* ===== Investor portal ===================================================== */
.portal-body { background: linear-gradient(160deg, var(--brand-dark) 0%, var(--brand-teal) 100%); min-height: 100vh; }
.portal-main { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }

.portal-card {
  max-width: 420px; margin: 6vh auto 0; background: var(--card);
  border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.35); padding: 2.25rem 2rem;
}
.portal-card-wide { max-width: 560px; }
.portal-brand { display: flex; align-items: center; gap: .55rem; font-size: 1.15rem; letter-spacing: .16em; color: var(--brand-dark); margin-bottom: 1.25rem; }
.portal-brand img { height: 26px; width: auto; display: block; }
.portal-brand strong { color: var(--brand-dark); font-weight: 700; }
.portal-card h1 { margin: 0 0 .35rem; font-size: 1.5rem; }
.portal-form { margin-top: 1.25rem; }
.portal-form label { margin-bottom: .25rem; }
.portal-form .btn { margin-top: 1rem; }
.portal-resend { margin-top: 1rem; text-align: center; }
.linkbtn-muted { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
.linkbtn-muted:hover { color: var(--text); }
.otp-input { text-align: center; font-size: 1.6rem; letter-spacing: .5rem; font-weight: 700; }

/* NDA modal */
.nda-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.7); display: flex; align-items: center; justify-content: center; padding: 1.25rem; z-index: 50; }
.nda-modal { background: #fff; border-radius: 14px; max-width: 640px; width: 100%; max-height: 90vh; overflow: auto; padding: 2rem; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.nda-text { white-space: pre-wrap; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 1rem; font-size: .85rem; line-height: 1.6; max-height: 38vh; overflow: auto; margin: 1rem 0; }
.nda-check { display: flex; align-items: flex-start; gap: .6rem; margin: 0 0 1rem; font-size: .9rem; color: var(--text); }
.nda-check input { width: auto; margin-top: .15rem; flex-shrink: 0; }
.nda-fineprint { font-size: .75rem; text-align: center; margin: .75rem 0 0; }
#nda-submit:disabled { opacity: .5; cursor: not-allowed; }

/* Deck presentation */
.deck { position: fixed; inset: 0; background: var(--brand-black); display: flex; flex-direction: column; }
.deck-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 1.5rem 1.5rem 0; overflow: hidden; }
.deck-slide { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.deck-preload { display: none; }
.deck-bar { display: flex; align-items: center; gap: 1.25rem; padding: 1rem 1.5rem; background: var(--brand-dark); }
.deck-progress { flex: 1; display: flex; align-items: center; gap: .75rem; color: #cbd5e1; font-size: .85rem; }
.deck-track { flex: 1; height: 6px; background: rgba(255,255,255,.12); border-radius: 999px; overflow: hidden; }
.deck-fill { display: block; height: 100%; background: var(--accent); width: 0; transition: width .25s; }
.deck-bar .btn-ghost { background: transparent; color: #cbd5e1; border-color: rgba(255,255,255,.22); }
.deck-bar .btn-ghost:hover { background: rgba(255,255,255,.08); }
.deck-bar .btn:disabled { opacity: .4; cursor: not-allowed; }

/* Portal admin */
.subnav { display: flex; gap: .25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.subnav a { padding: .5rem .9rem; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--text); text-decoration: none; }
.subnav a.active { color: var(--accent-dark); border-bottom-color: var(--accent); }
.row-form { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row-form input { width: auto; flex: 1; min-width: 160px; margin-top: 0; }
.qblock { border-left: 3px solid var(--accent); margin: .5rem 0 0; padding: .6rem 1rem; background: #f8fafc; border-radius: 6px; white-space: pre-wrap; }
.qitem { padding: .9rem 0; border-bottom: 1px solid var(--border); }
.qitem:last-child { border-bottom: none; }
.qitem-head { font-size: .85rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
