/* ============================================
   Whole Soul Financial — Client Portal
   ============================================ */
:root {
  --color-bg: #FAF7F2;
  --color-card: #FFFFFF;
  --color-teal: #2E9DB8;
  --color-teal-light: #8FD0DE;
  --color-teal-dim: #E4F2F5;
  --color-navy: #3E4A56;
  --color-charcoal: #2B2F33;
  --color-muted: #6B7280;
  --color-gold: #B6892F;
  --color-gold-dim: #F9F1E2;
  --color-line: #E6E0D4;
  --color-green: #2A7E5A;
  --color-green-dim: #E2F4EC;
  --color-red: #B3432C;
  --color-red-dim: #FCEEE9;

  --font-display: 'Lora', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 10px;
  --shadow-soft: 0 2px 14px rgba(62, 74, 86, 0.07);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: var(--font-body); background: var(--color-bg); color: var(--color-charcoal); -webkit-font-smoothing: antialiased; line-height: 1.55; }
img { max-width: 100%; display: block; }
button { font-family: var(--font-body); cursor: pointer; }

/* ---------- Login screen ---------- */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--color-bg);
}

.login-card {
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-card .logo { height: 36px; margin: 0 auto 28px; }

.login-card h1 {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--color-navy);
  margin: 0 0 6px;
}

.login-card .sub { color: var(--color-muted); font-size: 14px; margin: 0 0 28px; }

.login-card .field { text-align: left; margin-bottom: 14px; }
.login-card label { display: block; font-size: 13.5px; font-weight: 600; color: var(--color-navy); margin-bottom: 6px; }
.login-card input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-charcoal);
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.login-card input:focus { outline: none; border-color: var(--color-teal); box-shadow: 0 0 0 3px var(--color-teal-dim); }

.login-error { color: var(--color-red); font-size: 13px; margin: 8px 0 0; display: none; }

.forgot-link { display: block; margin-top: 10px; font-size: 13px; color: var(--color-teal); text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }

/* ---------- Shared buttons ---------- */

.btn-primary {
  background: var(--color-teal);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 15px;
  padding: 13px 24px;
  border-radius: var(--radius);
  width: 100%;
  transition: background 0.15s;
  margin-top: 4px;
}
.btn-primary:hover { background: #277E94; }
.btn-primary:disabled { background: var(--color-muted); cursor: not-allowed; }

.btn-secondary {
  background: none;
  border: 1.5px solid var(--color-line);
  color: var(--color-navy);
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px 16px;
  border-radius: 8px;
  transition: border-color 0.15s, background 0.15s;
}
.btn-secondary:hover { border-color: var(--color-teal); background: var(--color-teal-dim); }

.btn-teal {
  background: var(--color-teal);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 18px;
  border-radius: 8px;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-teal:hover { background: #277E94; }
.btn-teal:disabled { background: var(--color-muted); cursor: not-allowed; }

.btn-navy {
  background: var(--color-navy);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 18px;
  border-radius: 8px;
  transition: background 0.15s;
}
.btn-navy:hover { background: #2f3a45; }

.btn-ghost {
  background: none;
  border: none;
  color: var(--color-muted);
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.12s, color 0.12s;
}
.btn-ghost:hover { background: var(--color-bg); color: var(--color-navy); }

/* ---------- App shell ---------- */

.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

.app-header {
  background: #fff;
  border-bottom: 1px solid var(--color-line);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 58px;
  flex-shrink: 0;
}

.header-logo { height: 26px; }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-navy);
}

/* ---------- Tab bar ---------- */

.tab-bar {
  display: flex;
  background: #fff;
  border-bottom: 1px solid var(--color-line);
  padding: 0 24px;
  gap: 0;
  overflow-x: auto;
  flex-shrink: 0;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  color: var(--color-muted);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--color-navy); }
.tab-btn.active { color: var(--color-teal); border-bottom-color: var(--color-teal); }

/* ---------- Tab content ---------- */

.tab-content { display: none; flex: 1; overflow-y: auto; }
.tab-content.active { display: block; }

.content-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ---------- Overview tab ---------- */

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.status-card {
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
}

.status-card .sc-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-muted); font-weight: 600; margin-bottom: 8px; }
.status-card .sc-value { font-family: var(--font-display); font-size: 18px; color: var(--color-navy); font-weight: 600; }
.status-card .sc-sub { font-size: 12.5px; color: var(--color-muted); margin-top: 4px; }
.status-card.done { border-color: var(--color-teal-light); background: var(--color-teal-dim); }
.status-card.done .sc-value { color: var(--color-teal); }

.section-heading {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--color-navy);
  margin: 28px 0 14px;
}

/* ---------- Intake tab ---------- */

.intake-section {
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 18px;
  overflow: hidden;
}

.intake-section-head {
  padding: 14px 20px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-line);
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--color-navy);
  font-weight: 600;
}

.intake-section-body { padding: 16px 20px; }

.intake-field { margin-bottom: 14px; }
.intake-field:last-child { margin-bottom: 0; }
.intake-field dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-muted); font-weight: 700; margin-bottom: 3px; }
.intake-field dd { margin: 0; font-size: 14.5px; color: var(--color-charcoal); }

.intake-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; }

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag-pill { background: var(--color-teal-dim); color: var(--color-teal); font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 20px; }

.intake-longtext { font-size: 14.5px; color: var(--color-charcoal); background: var(--color-bg); border: 1px solid var(--color-line); border-radius: 8px; padding: 12px 14px; margin: 4px 0 0; white-space: pre-wrap; }

.intake-empty { text-align: center; padding: 60px 24px; color: var(--color-muted); font-size: 15px; }
.intake-empty a { color: var(--color-teal); font-weight: 600; }

/* ---------- Budget tab ---------- */

.budget-frame-wrap {
  height: calc(100vh - 120px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-line);
  box-shadow: var(--shadow-soft);
}

.budget-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ---------- Snapshots tab ---------- */

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.snapshot-card {
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.snapshot-card .snap-icon { font-size: 28px; }
.snapshot-card .snap-label { font-family: var(--font-display); font-size: 16px; color: var(--color-navy); font-weight: 600; }
.snapshot-card .snap-date { font-size: 12.5px; color: var(--color-muted); }
.snapshot-card a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-teal);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 16px;
  border-radius: 8px;
  text-decoration: none;
  width: fit-content;
  transition: background 0.15s;
}
.snapshot-card a:hover { background: #277E94; }

.snapshots-empty { text-align: center; padding: 60px 24px; color: var(--color-muted); font-size: 15px; }

/* ---------- Admin shell ---------- */

.admin-shell { display: none; min-height: 100vh; flex-direction: column; }
.admin-shell.visible { display: flex; }

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--color-navy);
  color: #fff;
  flex-shrink: 0;
}

.admin-topbar .brand { font-family: var(--font-display); font-size: 17px; }
.admin-topbar .brand span { opacity: 0.7; font-size: 13px; font-family: var(--font-body); margin-left: 10px; }

.admin-logout {
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  cursor: pointer;
}
.admin-logout:hover { background: rgba(255,255,255,0.22); }

.admin-body { display: flex; flex: 1; min-height: 0; overflow: hidden; }

/* ---------- Admin client list ---------- */

.admin-sidebar {
  width: 320px;
  flex-shrink: 0;
  border-right: 1px solid var(--color-line);
  background: var(--color-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--color-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.sidebar-head h2 { font-size: 14px; font-weight: 700; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 0; }

.client-list { flex: 1; overflow-y: auto; }

.client-row {
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-line);
  cursor: pointer;
  transition: background 0.1s;
}
.client-row:hover { background: var(--color-teal-dim); }
.client-row.active { background: var(--color-teal-dim); border-left: 3px solid var(--color-teal); }
.client-row .cr-name { font-weight: 600; font-size: 14.5px; color: var(--color-navy); }
.client-row .cr-email { font-size: 12.5px; color: var(--color-muted); margin-top: 2px; }
.client-row .cr-pills { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }

.status-pill {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
}
.status-pill.done { background: var(--color-teal-dim); color: var(--color-teal); }
.status-pill.pending { background: var(--color-gold-dim); color: var(--color-gold); }
.status-pill.none { background: var(--color-bg); color: var(--color-muted); border: 1px solid var(--color-line); }

/* ---------- Admin detail panel ---------- */

.admin-detail {
  flex: 1;
  overflow-y: auto;
  background: var(--color-bg);
}

.admin-detail-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 32px 80px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.detail-header h2 { font-family: var(--font-display); font-size: 24px; color: var(--color-navy); margin: 0; }
.detail-header .dh-email { font-size: 13.5px; color: var(--color-muted); margin-top: 4px; }
.detail-btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.empty-detail { display: flex; align-items: center; justify-content: center; height: 300px; color: var(--color-muted); font-size: 15px; }

/* ---------- Admin cards ---------- */

.admin-card {
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 18px;
  overflow: hidden;
}

.admin-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-line);
}

.admin-card-head h3 { font-family: var(--font-display); font-size: 17px; color: var(--color-navy); margin: 0; }
.admin-card-body { padding: 16px 20px; }

/* ---------- Snapshot upload area ---------- */

.upload-area {
  border: 2px dashed var(--color-teal-light);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 14px;
}
.upload-area:hover { background: var(--color-teal-dim); }
.upload-area p { color: var(--color-muted); font-size: 14px; margin: 8px 0 0; }
.upload-area input[type="file"] { display: none; }

.upload-label-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-charcoal);
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.upload-label-input:focus { outline: none; border-color: var(--color-teal); }

.upload-progress { color: var(--color-muted); font-size: 13.5px; font-style: italic; display: none; }

/* Snapshot list in admin */
.snap-list { display: flex; flex-direction: column; gap: 10px; }
.snap-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: 8px;
}
.snap-row .sr-label { flex: 1; font-weight: 600; font-size: 14px; color: var(--color-navy); }
.snap-row .sr-date { font-size: 12.5px; color: var(--color-muted); white-space: nowrap; }
.snap-delete {
  background: none;
  border: none;
  color: var(--color-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}
.snap-delete:hover { color: var(--color-red); background: var(--color-red-dim); }

/* ---------- Add client modal ---------- */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.visible { display: flex; }

.modal-card {
  background: var(--color-card);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  padding: 32px 28px;
  width: 100%;
  max-width: 420px;
}

.modal-card h2 { font-family: var(--font-display); font-size: 21px; color: var(--color-navy); margin: 0 0 20px; }
.modal-card .field { margin-bottom: 14px; }
.modal-card label { display: block; font-size: 13.5px; font-weight: 600; color: var(--color-navy); margin-bottom: 6px; }
.modal-card input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--color-charcoal);
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: 8px;
  padding: 11px 13px;
}
.modal-card input:focus { outline: none; border-color: var(--color-teal); box-shadow: 0 0 0 3px var(--color-teal-dim); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal-error { color: var(--color-red); font-size: 13px; margin: 8px 0 0; display: none; }

/* ---------- Coach notes ---------- */

.coach-notes-area {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-charcoal);
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: 8px;
  padding: 12px 14px;
  resize: vertical;
  min-height: 90px;
  transition: border-color 0.15s;
}
.coach-notes-area:focus { outline: none; border-color: var(--color-teal); }

/* ---------- Loading / empty ---------- */

.loading-text { color: var(--color-muted); font-size: 14px; padding: 40px 24px; text-align: center; }
.empty-text { color: var(--color-muted); font-size: 14px; padding: 40px 24px; text-align: center; }

/* ---------- Mobile ---------- */

@media (max-width: 520px) {
  .login-card { padding: 36px 20px; }
  .app-header { padding: 0 14px; height: 52px; }
  .header-logo { height: 22px; }
  .header-name { display: none; }
  .tab-btn { padding: 10px 14px; font-size: 13px; }
  .content-inner { padding: 20px 14px 60px; }
  .status-grid { grid-template-columns: 1fr 1fr; }
  .intake-grid { grid-template-columns: 1fr; }
  .budget-frame-wrap { height: calc(100vh - 110px); border-radius: 8px; }
  .snapshot-grid { grid-template-columns: 1fr; }
  .admin-body { flex-direction: column; }
  .admin-sidebar { width: 100%; max-height: 240px; border-right: none; border-bottom: 1px solid var(--color-line); }
  .admin-detail-inner { padding: 18px 14px 60px; }
  .detail-header { flex-direction: column; }
}
