/* ---------------------------------------------------------------------
   DESIGN TOKENS
   Accent green is a placeholder (#C6FF3D) — swap it for the exact hex
   pulled from the provided logomark once you have that file; every use
   of the accent in this file routes through this one variable.
--------------------------------------------------------------------- */
:root {
  --accent: #C6FF3D;
  --accent-ink: #16330a;

  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;
  --border: #E7E5DF;
  --border-strong: #D6D3CB;

  --text: #1C1C1A;
  --text-muted: #706C64;
  --text-faint: #A7A399;

  --danger: #B14338;
  --danger-bg: #FBEBE9;
  --warning: #A6752B;
  --warning-bg: #FBF0DD;
  --success: #3D7A54;
  --success-bg: #E9F5EC;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 1px 2px rgba(28,28,26,0.06);
  --shadow-modal: 0 12px 40px rgba(28,28,26,0.18);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------------
   BUTTONS
--------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
  transition: background 0.12s ease, transform 0.05s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { filter: brightness(0.96); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--border); }
.btn-danger { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }
.btn-small { min-height: 32px; padding: 6px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------------------------------------------------------------------
   LOGIN
--------------------------------------------------------------------- */
.login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: #0B0B0A;
  padding: 20px;
}
.login-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 36px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-modal);
}
.brand-mark { margin-bottom: 12px; }
.login-card h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.01em; }
.login-sub { color: var(--text-muted); margin: 0 0 24px; font-size: 14px; }
#login-form label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
#login-form input {
  width: 100%; padding: 11px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); font-size: 15px;
}
#login-form input:focus, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
#login-form .btn { margin-top: 22px; }
.form-error { color: var(--danger); font-size: 13px; margin-top: 12px; }

/* ---------------------------------------------------------------------
   APP SHELL
--------------------------------------------------------------------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 0 20px; height: 60px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.topbar-nav { display: flex; gap: 4px; flex: 1; }
.nav-link {
  background: none; border: none; padding: 8px 12px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 14px; font-weight: 600; cursor: pointer;
}
.nav-link.active { color: var(--text); background: var(--border); }
.topbar-actions { display: flex; gap: 8px; }

.bottombar { display: none; }

.main-content {
  flex: 1; padding: 24px; max-width: 1180px; width: 100%; margin: 0 auto;
}

/* ---------------------------------------------------------------------
   HOME / REMINDERS VIEW
--------------------------------------------------------------------- */
.section-heading {
  display: flex; align-items: baseline; gap: 10px; margin: 32px 0 12px;
}
.section-heading:first-child { margin-top: 0; }
.section-heading h2 { font-size: 16px; margin: 0; }
.section-count {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  background: var(--border); padding: 2px 8px; border-radius: 999px;
}
.section-heading.urgent h2 { color: var(--danger); }
.section-heading.urgent .section-count { background: var(--danger-bg); color: var(--danger); }
.section-heading.warn h2 { color: var(--warning); }
.section-heading.warn .section-count { background: var(--warning-bg); color: var(--warning); }

.card-list { display: flex; flex-direction: column; gap: 8px; }

.reminder-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-card);
}
.reminder-card.is-overdue { border-left: 3px solid var(--danger); }
.reminder-card.is-today { border-left: 3px solid var(--warning); }
.reminder-card.is-action { border-left: 3px solid var(--text); }

.reminder-main { flex: 1; min-width: 0; }
.reminder-title { font-weight: 700; font-size: 14.5px; cursor: pointer; }
.reminder-title:hover { text-decoration: underline; }
.reminder-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.reminder-meta { font-size: 12.5px; color: var(--text-faint); white-space: nowrap; }

.priority-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.priority-Critical { background: var(--danger); }
.priority-High { background: var(--warning); }
.priority-Medium { background: #8B8F5C; }
.priority-Low { background: var(--border-strong); }

.empty-state {
  text-align: center; padding: 40px 20px; color: var(--text-muted);
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
}
.empty-state strong { display: block; color: var(--text); margin-bottom: 4px; }

/* ---------------------------------------------------------------------
   PROSPECT TABLE (desktop) / CARDS (mobile)
--------------------------------------------------------------------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.prospect-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.prospect-table th {
  text-align: left; font-size: 11.5px; text-transform: none; color: var(--text-muted);
  font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.prospect-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.prospect-table tr:last-child td { border-bottom: none; }
table.prospect-table tr:hover { background: #FCFCFA; }
.cell-name { font-weight: 600; cursor: pointer; }
.cell-name:hover { text-decoration: underline; }
.fu-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 3px; }
.fu-dot.sent { background: var(--success); }
.fu-dot.overdue { background: var(--danger); }
.fu-dot.soon { background: var(--warning); }
.fu-dot.later { background: var(--border-strong); }
.fu-dot.none { background: transparent; border: 1px dashed var(--border-strong); }

.status-pill {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--border); color: var(--text);
}
.status-pill.outcome-Replied { background: var(--success-bg); color: var(--success); }
.status-pill.outcome-Action { background: var(--warning-bg); color: var(--warning); }
.status-pill.outcome-Hired { background: #E4EEFA; color: #2E5F8A; }
.status-pill.outcome-Not { background: var(--border); color: var(--text-faint); }

/* mobile card table replacement */
.prospect-cards { display: none; flex-direction: column; gap: 10px; }
.prospect-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px;
}
.prospect-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.prospect-card-title { font-weight: 700; font-size: 15px; }
.prospect-card-sub { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.prospect-card-row { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; }
.prospect-card-row span:first-child { color: var(--text-muted); }

/* ---------------------------------------------------------------------
   CONTROLS BAR (search/sort/filter)
--------------------------------------------------------------------- */
.controls-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.controls-bar input, .controls-bar select {
  padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  font-size: 14px; background: var(--surface);
}
.controls-bar input[type="search"] { flex: 1; min-width: 180px; }

/* ---------------------------------------------------------------------
   MODAL / DRAWER
--------------------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20,20,18,0.4);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto; z-index: 50;
}
.modal {
  background: var(--surface); border-radius: 14px; width: 100%; max-width: 560px;
  box-shadow: var(--shadow-modal); padding: 24px;
}
.modal.modal-wide { max-width: 720px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-header h2 { margin: 0; font-size: 18px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); line-height: 1; padding: 4px; }

.field-row { margin-bottom: 14px; }
.field-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field-row input, .field-row select, .field-row textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); font-size: 14px;
}
.field-row textarea { min-height: 70px; resize: vertical; font-family: inherit; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.field-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.disclosure-toggle {
  background: none; border: none; color: var(--text-muted); font-weight: 600; font-size: 13.5px;
  cursor: pointer; padding: 6px 0; text-decoration: underline;
}
.disclosure-body { margin-top: 10px; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab-btn { background: none; border: none; padding: 8px 4px; margin-right: 16px; font-size: 14px; font-weight: 600;
  color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.followup-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border);
}
.followup-row:last-child { border-bottom: none; }
.followup-step-label { width: 90px; font-weight: 600; font-size: 13.5px; }
.followup-date-input { flex: 1; }
.followup-status { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.followup-status.sent { background: var(--success-bg); color: var(--success); }
.followup-status.overdue { background: var(--danger-bg); color: var(--danger); }
.followup-status.soon { background: var(--warning-bg); color: var(--warning); }
.followup-status.later, .followup-status.none { background: var(--border); color: var(--text-muted); }

.note-entry { padding: 10px 0; border-bottom: 1px solid var(--border); }
.note-entry:last-child { border-bottom: none; }
.note-time { font-size: 11.5px; color: var(--text-faint); }
.note-text { font-size: 14px; margin-top: 3px; white-space: pre-wrap; }

.history-entry { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; align-items: flex-start; }
.history-entry:last-child { border-bottom: none; }
.history-time { color: var(--text-faint); font-size: 11.5px; white-space: nowrap; width: 130px; flex-shrink: 0; }
.history-desc { flex: 1; }
.history-source-tag { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-faint); }

.msg-step { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; }
.msg-step-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.msg-preview { font-size: 13px; color: var(--text-muted); white-space: pre-wrap; }

/* ---------------------------------------------------------------------
   TOAST
--------------------------------------------------------------------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1C1C1A; color: #fff; padding: 12px 18px; border-radius: 999px;
  display: flex; align-items: center; gap: 14px; font-size: 14px; z-index: 100;
  box-shadow: var(--shadow-modal);
}
.toast-undo { background: none; border: none; color: var(--accent); font-weight: 700; cursor: pointer; font-size: 14px; }

/* ---------------------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------------------- */
@media (max-width: 860px) {
  .topbar-nav { display: none; }
  .topbar { gap: 12px; }
  .topbar-actions .btn:not(#btn-logout) { display: none; }
  .bottombar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 64px;
    background: var(--surface); border-top: 1px solid var(--border);
    z-index: 20; padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-link {
    flex: 1; background: none; border: none; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 2px; font-size: 11px; color: var(--text-muted); font-weight: 600;
  }
  .bottom-link.active { color: var(--text); }
  .bottom-icon { font-size: 16px; }
  .bottom-link-add .bottom-icon {
    width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
    display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 2px;
  }
  .main-content { padding: 16px; padding-bottom: 88px; }
  .table-wrap { display: none; }
  .prospect-cards { display: flex; }
  .field-grid { grid-template-columns: 1fr; }
  .modal { padding: 18px; border-radius: 14px 14px 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-overlay .modal { max-height: 92vh; overflow-y: auto; }
}
