@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

/* ─── tokens (mirrors main site) ────────────────────────────────────────────── */
:root {
  --forest:      #0B5E48;
  --teal:        #1D9E75;
  --mint:        #4ECBA5;
  --mist:        #E1F5EE;
  --ink:         #0E1C18;
  --ink-60:      #0E1C1899;
  --ink-20:      #0E1C1833;
  --sand:        #F5F2EC;
  --white:       #FFFFFF;
  --radius:      12px;
  --radius-lg:   20px;
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --sidebar-w:   240px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* AUTH PAGES (login)                                                         */
/* ═══════════════════════════════════════════════════════════════════════════ */

body.auth-body {
  font-family: var(--font-body);
  background: var(--sand);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-wrap {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--ink-20);
  padding: 2.5rem;
  box-shadow: 0 4px 24px rgba(14,28,24,0.07);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2rem;
}

.auth-wordmark {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.auth-wordmark span { color: var(--teal); }

.auth-portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  background: var(--mist);
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid #4ECBA540;
  margin-bottom: 1.25rem;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.auth-sub {
  font-size: 0.875rem;
  color: var(--ink-60);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.auth-field {
  margin-bottom: 1.125rem;
}

.auth-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-60);
  margin-bottom: 0.4rem;
}

.auth-field input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--ink-20);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--mist);
}

.auth-submit {
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: var(--forest);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  margin-top: 0.5rem;
}
.auth-submit:hover { background: var(--teal); transform: translateY(-1px); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.auth-error {
  display: none;
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
  border-radius: 8px;
  padding: 0.625rem 0.875rem;
  font-size: 0.85rem;
  margin-top: 1rem;
}
.auth-error.visible { display: block; }

.auth-forgot {
  text-align: right;
  margin-top: 0.375rem;
}
.auth-forgot a {
  font-size: 0.8rem;
  color: var(--teal);
}
.auth-forgot a:hover { text-decoration: underline; }

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--ink-60);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* DASHBOARD BODY + LAYOUT                                                    */
/* ═══════════════════════════════════════════════════════════════════════════ */

body.db-body {
  font-family: var(--font-body);
  background: #F3F4F6;
  color: var(--ink);
  min-height: 100vh;
  display: flex;
}

/* ─── Loading overlay ─────────────────────────────────────────────────────── */
#auth-loading {
  position: fixed;
  inset: 0;
  background: var(--sand);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
}
#auth-loading .loading-wordmark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
}
#auth-loading .loading-wordmark span { color: var(--teal); }

/* ─── Admin: sidebar + main ───────────────────────────────────────────────── */
.db-sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s;
}

.db-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.db-sidebar-logo {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 8px;
}

.db-wordmark {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
}
.db-wordmark span { color: var(--mint); }

.db-sidebar-section {
  padding: 1rem 0;
  flex: 1;
}

.db-sidebar-label {
  padding: 0.25rem 1.5rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
}

.db-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.7rem 1.5rem;
  color: rgba(255,255,255,0.55);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-right: 3px solid transparent;
}
.db-nav-link:hover { color: var(--white); background: rgba(255,255,255,0.06); }
.db-nav-link.active { color: var(--white); background: rgba(78,203,165,0.12); border-right-color: var(--mint); }
.db-nav-link svg { flex-shrink: 0; opacity: 0.8; }
.db-nav-link.active svg { opacity: 1; }

.db-sidebar-bottom {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.db-user-info {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}
.db-user-info strong { color: rgba(255,255,255,0.8); display: block; font-size: 0.85rem; }

.db-logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 0;
  color: rgba(255,255,255,0.45);
  font-size: 0.8rem;
  cursor: pointer;
  border: none;
  background: none;
  transition: color 0.15s;
}
.db-logout-btn:hover { color: #F87171; }

/* ─── Page header ─────────────────────────────────────────────────────────── */
.db-page-header {
  padding: 1.5rem 2rem 1.25rem;
  background: var(--white);
  border-bottom: 1px solid #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.db-page-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
}

.db-page-sub {
  font-size: 0.8rem;
  color: var(--ink-60);
  margin-top: 2px;
}

/* ─── Daily verse / hadith banner ────────────────────────────────────────── */
.db-verse-banner {
  margin: 1.25rem 2rem 0;
  padding: 1.1rem 1.5rem 1.1rem 1.75rem;
  background: linear-gradient(135deg, rgba(29,158,117,0.07) 0%, rgba(245,158,11,0.06) 100%);
  border: 1px solid rgba(29,158,117,0.18);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  animation: verse-fade-in 0.6s ease both;
}
@keyframes verse-fade-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.db-verse-arabic {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--forest);
  direction: rtl;
  text-align: right;
  font-family: 'Scheherazade New', 'Amiri', 'Traditional Arabic', Georgia, serif;
  letter-spacing: 0.01em;
}
.db-verse-english {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink);
  font-style: italic;
}
.db-verse-source {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  margin-top: 0.15rem;
}

/* ─── Content area ────────────────────────────────────────────────────────── */
.db-content {
  padding: 2rem;
  flex: 1;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* METRIC CARDS                                                               */
/* ═══════════════════════════════════════════════════════════════════════════ */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  border: 1px solid #E5E7EB;
}

.metric-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--mist);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.875rem;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--ink-60);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 0.3rem;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* TABLE COMPONENTS                                                           */
/* ═══════════════════════════════════════════════════════════════════════════ */

.db-table-wrap {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid #E5E7EB;
  overflow: hidden;
  overflow-x: auto;
}

.db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.db-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-60);
  background: #F9FAFB;
  border-bottom: 1px solid #E5E7EB;
  white-space: nowrap;
}

.db-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #F3F4F6;
  vertical-align: middle;
}

.db-table tr:last-child td { border-bottom: none; }
.db-table tbody tr:hover td { background: #FAFAFA; }

.db-table .actions-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* STATUS BADGES                                                              */
/* ═══════════════════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.badge-new        { background: #EFF6FF; color: #1D4ED8; }
.badge-contacted  { background: #FFFBEB; color: #B45309; }
/* Full financing pipeline statuses */
.badge-credit-check         { background: #DBEAFE; color: #1D4ED8; }
.badge-pre-approved         { background: #CCFBF1; color: #0D9488; }
.badge-dealership-scheduled { background: #FEF9C3; color: #A16207; }
.badge-vehicle-selected     { background: #FEF3C7; color: #B45309; }
.badge-murabaha-pending     { background: #EDE9FE; color: #6D28D9; }
.badge-halal-review         { background: #F5F3FF; color: #7C3AED; }
.badge-contract-signing     { background: #CCFBF1; color: #0F766E; }
.badge-delivered            { background: #DCFCE7; color: #15803D; }
.badge-completed-full       { background: #D1FAE5; color: #065F46; }
.badge-visited    { background: #F0FDF4; color: #15803D; }
.badge-contracted { background: #E1F5EE; color: #0B5E48; }
.badge-closed     { background: #D1FAE5; color: #065F46; }
.badge-lost       { background: #FEF2F2; color: #DC2626; }
.badge-active     { background: #E1F5EE; color: #1D9E75; }
.badge-revoked    { background: #FEF2F2; color: #DC2626; }
.badge-pending    { background: #FFFBEB; color: #B45309; }
.badge-approved   { background: #E1F5EE; color: #1D9E75; }
.badge-rejected   { background: #FEF2F2; color: #DC2626; }
.badge-paid       { background: #E1F5EE; color: #1D9E75; }
.badge-invoiced   { background: #EFF6FF; color: #1D4ED8; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* BUTTONS                                                                    */
/* ═══════════════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 1rem;
  border-radius: 99px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: var(--forest); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--teal); }

.btn-teal { background: var(--teal); color: var(--white); }
.btn-teal:hover:not(:disabled) { background: var(--forest); }

.btn-outline { background: transparent; color: var(--teal); border-color: var(--teal); }
.btn-outline:hover:not(:disabled) { background: var(--mist); }

.btn-ghost { background: transparent; color: var(--ink-60); border-color: #D1D5DB; }
.btn-ghost:hover:not(:disabled) { background: #F3F4F6; color: var(--ink); }

.btn-danger { background: transparent; color: #DC2626; border-color: #FCA5A5; }
.btn-danger:hover:not(:disabled) { background: #FEF2F2; }

.btn-danger-solid { background: #DC2626; color: white; }
.btn-danger-solid:hover:not(:disabled) { background: #B91C1C; }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.75rem; }
.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-family: var(--font-display);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* SECTION HEADERS + FILTER BARS                                              */
/* ═══════════════════════════════════════════════════════════════════════════ */

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input[type="text"],
.filter-bar input[type="date"] {
  padding: 0.45rem 0.75rem;
  border: 1.5px solid #D1D5DB;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--ink);
  background: var(--white);
  cursor: pointer;
}
.filter-bar select:focus,
.filter-bar input:focus {
  outline: none;
  border-color: var(--teal);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* MODALS                                                                     */
/* ═══════════════════════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14,28,24,0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(8px);
  transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  padding: 1.5rem 1.5rem 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #F3F4F6;
  color: var(--ink-60);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.modal-close:hover { background: #E5E7EB; color: var(--ink); }

.modal-body { padding: 1.25rem 1.5rem; }

.modal-footer {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  border-top: 1px solid #F3F4F6;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* SLIDE PANEL (lead detail)                                                  */
/* ═══════════════════════════════════════════════════════════════════════════ */

.slide-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14,28,24,0.35);
  z-index: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.slide-overlay.open { opacity: 1; pointer-events: all; }

.slide-panel {
  position: fixed;
  top: 0;
  right: -600px;
  width: 560px;
  max-width: 100%;
  height: 100vh;
  background: var(--white);
  z-index: 801;
  overflow-y: auto;
  transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -8px 0 32px rgba(14,28,24,0.12);
}
.slide-panel.open { right: 0; }

.slide-panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}

.slide-panel-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.slide-panel-body { padding: 1.5rem; }

.panel-section {
  margin-bottom: 1.75rem;
}

.panel-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal);
  margin-bottom: 0.75rem;
}

.panel-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}
.panel-row-label { color: var(--ink-60); flex-shrink: 0; width: 130px; }
.panel-row-val { color: var(--ink); font-weight: 500; }

/* ─── Status history timeline ─────────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }

.timeline-item {
  display: flex;
  gap: 1rem;
  padding-bottom: 1rem;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 24px;
  bottom: 0;
  width: 1px;
  background: #E5E7EB;
}
.timeline-item:last-child::before { display: none; }

.timeline-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--mist);
  border: 2px solid var(--teal);
  flex-shrink: 0;
  margin-top: 2px;
}

.timeline-content { flex: 1; }
.timeline-meta { font-size: 0.75rem; color: var(--ink-60); margin-bottom: 0.25rem; }
.timeline-note { font-size: 0.85rem; color: var(--ink); line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* FORM ELEMENTS (inside modals/panels)                                       */
/* ═══════════════════════════════════════════════════════════════════════════ */

.form-group { margin-bottom: 1.125rem; }

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-60);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.875rem;
  border: 1.5px solid #D1D5DB;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--mist);
}

.form-group textarea { min-height: 90px; resize: vertical; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.875rem; }

.form-note-text {
  font-size: 0.78rem;
  color: var(--ink-60);
  margin-top: 0.375rem;
  line-height: 1.5;
}

.form-error {
  display: none;
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
  border-radius: 8px;
  padding: 0.625rem 0.875rem;
  font-size: 0.83rem;
  margin-top: 0.75rem;
}
.form-error.visible { display: block; }

/* File upload */
.file-upload-area {
  border: 2px dashed #D1D5DB;
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.file-upload-area:hover { border-color: var(--teal); background: var(--mist); }
.file-upload-area.has-file { border-color: var(--teal); background: var(--mist); }
.file-upload-area p { font-size: 0.83rem; color: var(--ink-60); margin-top: 0.5rem; }
.file-upload-area input[type="file"] { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ACTIVITY FEED                                                              */
/* ═══════════════════════════════════════════════════════════════════════════ */

.activity-feed {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid #E5E7EB;
  overflow: hidden;
}

.activity-feed-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #E5E7EB;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid #F3F4F6;
  font-size: 0.83rem;
}
.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
  margin-top: 5px;
}

.activity-content { flex: 1; line-height: 1.5; color: var(--ink); }
.activity-time { font-size: 0.75rem; color: var(--ink-60); flex-shrink: 0; white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* DEALER DASHBOARD — top nav layout                                          */
/* ═══════════════════════════════════════════════════════════════════════════ */

body.dealer-body {
  font-family: var(--font-body);
  background: #F3F4F6;
  color: var(--ink);
  min-height: 100vh;
}

.dealer-topnav {
  height: 64px;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.dealer-nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dealer-nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dealer-nav-name {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
}
.dealer-nav-name strong { color: rgba(255,255,255,0.9); font-weight: 500; }

.dealer-nav-btn {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.15);
  background: none;
  cursor: pointer;
  transition: all 0.15s;
}
.dealer-nav-btn:hover { color: var(--white); border-color: rgba(255,255,255,0.35); }

.dealer-content { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ─── Lead card (dealer view) ─────────────────────────────────────────────── */
.lead-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid #E5E7EB;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: box-shadow 0.15s;
}
.lead-card:hover { box-shadow: 0 4px 16px rgba(14,28,24,0.07); }

.lead-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.lead-card-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.lead-card-meta {
  font-size: 0.8rem;
  color: var(--ink-60);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.lead-card-detail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: #F9FAFB;
  border-radius: 8px;
}

.lead-card-detail-item {
  font-size: 0.8rem;
}
.lead-card-detail-item .dl { color: var(--ink-60); margin-bottom: 2px; }
.lead-card-detail-item .dv { font-weight: 500; color: var(--ink); }

/* ─── Status progress bar ─────────────────────────────────────────────────── */
.status-progress { margin: 1rem 0 1.25rem; }

.status-progress-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-60);
  margin-bottom: 0.75rem;
}

.progress-steps {
  display: flex;
  align-items: center;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.progress-step-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #E5E7EB;
  border: 2px solid #E5E7EB;
  z-index: 1;
  transition: all 0.2s;
}

.progress-step.done .progress-step-dot { background: var(--teal); border-color: var(--teal); }
.progress-step.current .progress-step-dot { background: var(--forest); border-color: var(--forest); box-shadow: 0 0 0 4px var(--mist); }
.progress-step.lost .progress-step-dot { background: #DC2626; border-color: #DC2626; }

.progress-step-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-60);
  margin-top: 5px;
  white-space: nowrap;
}
.progress-step.done .progress-step-label { color: var(--teal); }
.progress-step.current .progress-step-label { color: var(--forest); font-weight: 700; }

.progress-connector {
  height: 2px;
  flex: 1;
  background: #E5E7EB;
  margin: 0 -1px;
  position: relative;
  top: -10px;
}
.progress-connector.done { background: var(--teal); }

/* ─── Suspension message ───────────────────────────────────────────────────── */
.suspended-wrap {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.suspended-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid #FECACA;
  padding: 2.5rem;
  max-width: 460px;
  text-align: center;
}

.suspended-icon {
  width: 56px;
  height: 56px;
  background: #FEF2F2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* UTILITY                                                                    */
/* ═══════════════════════════════════════════════════════════════════════════ */

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--mist);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 3rem auto;
}
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ─── New pipeline badge variants ──────────────────────────────────────────── */
.badge-reviewed  { background: #F3F4F6; color: #374151; }
.badge-signing   { background: #FFF7ED; color: #C2410C; }  /* assigned — gold-ish */
.badge-lost      { background: #F3F4F6; color: #6B7280; }  /* declined */

.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
  margin: 0;
  display: inline-block;
}

.empty-state {
  text-align: center;
  padding: 3.5rem 2rem;
  color: var(--ink-60);
}
.empty-state p { font-size: 0.875rem; margin-top: 0.5rem; }

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--ink);
  color: var(--white);
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.875rem;
  z-index: 2000;
  transform: translateY(8px);
  opacity: 0;
  transition: all 0.25s;
  max-width: 360px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid var(--mint); }
.toast.error { border-left: 3px solid #F87171; }

.info-box {
  background: var(--mist);
  border: 1px solid #4ECBA540;
  border-radius: 8px;
  padding: 0.875rem 1rem;
  font-size: 0.83rem;
  color: var(--forest);
  line-height: 1.6;
}

.divider {
  border: none;
  border-top: 1px solid #F3F4F6;
  margin: 1.25rem 0;
}

/* ─── Leads tab bar ──────────────────────────────────────────────────────────── */
.leads-tab-btn {
  padding: 0.35rem 0.875rem;
  border: 1.5px solid #E5E7EB;
  border-radius: 99px;
  background: white;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-60);
  cursor: pointer;
  transition: all 0.15s;
}
.leads-tab-btn:hover { border-color: var(--teal); color: var(--teal); }
.leads-tab-btn.active { background: var(--teal); border-color: var(--teal); color: white; font-weight: 600; }

/* ─── Assign dealer card ──────────────────────────────────────────────────────── */
.assign-dealer-card {
  padding: 0.75rem 1rem;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.15s;
}
.assign-dealer-card:hover { border-color: var(--teal); background: #F0FDF9; }
.assign-dealer-card.selected { border-color: var(--teal); background: var(--mist); }

/* ─── ink-40 shorthand ───────────────────────────────────────────────────────── */
.ink-40 { color: #0E1C1866; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* MOBILE RESPONSIVE                                                          */
/* ═══════════════════════════════════════════════════════════════════════════ */

.db-mobile-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: white;
}

@media (max-width: 860px) {
  .db-sidebar {
    transform: translateX(-100%);
  }
  .db-sidebar.open {
    transform: translateX(0);
  }
  .db-main {
    margin-left: 0;
  }
  .slide-panel {
    width: 100%;
    right: -100%;
  }
  .db-mobile-toggle { display: flex; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* COHORT MANAGEMENT                                                          */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Cohort stats row ───────────────────────────────────────────────────── */
.cohort-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.875rem;
  margin-bottom: 1.75rem;
}

/* ─── Cohort card ────────────────────────────────────────────────────────── */
.cohort-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1.5px solid var(--ink-20);
  margin-bottom: 0.875rem;
  overflow: hidden;
  transition: border-color 0.2s;
}
.cohort-card.expanded { border-color: var(--teal); }

.cohort-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
}
.cohort-card-header:hover { background: #F9FAFB; }

.cohort-card-left { flex: 1; min-width: 0; }

.cohort-card-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 3px;
}

.cohort-card-meta {
  font-size: 0.78rem;
  color: var(--ink-60);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cohort-card-right {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

.cohort-expand-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-20);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-60);
  font-size: 0.7rem;
  transition: transform 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.cohort-card.expanded .cohort-expand-icon {
  transform: rotate(90deg);
  border-color: var(--teal);
  color: var(--teal);
}

/* Capacity bar */
.cohort-capacity-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-60);
}
.cohort-capacity-track {
  width: 80px;
  height: 6px;
  background: var(--ink-20);
  border-radius: 99px;
  overflow: hidden;
}
.cohort-capacity-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 99px;
  transition: width 0.4s;
}
.cohort-capacity-fill.full { background: #F59E0B; }

/* ─── Cohort card body (client list) ─────────────────────────────────────── */
.cohort-card-body {
  border-top: 1px solid var(--ink-20);
  background: #F9FAFB;
}

.cohort-client-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--ink-20);
  flex-wrap: wrap;
}
.cohort-client-card:last-child { border-bottom: none; }

.cohort-client-info { flex: 1; min-width: 0; }

.cohort-client-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  margin-bottom: 2px;
}

.cohort-client-meta {
  font-size: 0.75rem;
  color: var(--ink-60);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.cohort-client-stage-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cohort-stage-select {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--ink-20);
  border-radius: 99px;
  padding: 4px 10px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: border-color 0.2s;
}
.cohort-stage-select:focus { border-color: var(--teal); }

.cohort-client-actions {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
}

/* Satisfaction stars */
.star-rating {
  display: flex;
  gap: 2px;
}
.star-rating button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #D1D5DB;
  padding: 0;
  transition: color 0.15s;
}
.star-rating button.filled,
.star-rating button:hover { color: #F59E0B; }

/* ─── Waitlist ───────────────────────────────────────────────────────────── */
.waitlist-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1.25rem;
  background: var(--white);
  border: 1.5px solid var(--ink-20);
  border-radius: var(--radius);
  margin-bottom: 0.625rem;
  flex-wrap: wrap;
}
.waitlist-position {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--mist);
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.waitlist-info { flex: 1; min-width: 0; }
.waitlist-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  margin-bottom: 2px;
}
.waitlist-meta { font-size: 0.75rem; color: var(--ink-60); }

/* ─── Cohort status badge variants ──────────────────────────────────────── */
.badge-intake   { background: #EFF6FF; color: #1D4ED8; }
.badge-active   { background: #DCFCE7; color: #166534; }
.badge-signing  { background: #FFF7ED; color: #C2410C; }
.badge-complete { background: #F3F4F6; color: #374151; }

/* ─── Timeline ───────────────────────────────────────────────────────────── */
.cohort-timeline {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  position: relative;
}
.cohort-timeline::before {
  content: '';
  position: absolute;
  top: 26px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ink-20);
  z-index: 0;
}

.timeline-cohort {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 140px;
  padding: 0 12px;
  position: relative;
  cursor: pointer;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--white);
  z-index: 1;
  flex-shrink: 0;
  margin-bottom: 10px;
  box-shadow: 0 0 0 2px var(--ink-20);
}
.timeline-dot.dot-complete { background: var(--teal); box-shadow: 0 0 0 2px var(--teal); }
.timeline-dot.dot-active   { background: #3B82F6; box-shadow: 0 0 0 2px #3B82F6; }
.timeline-dot.dot-signing  { background: #F59E0B; box-shadow: 0 0 0 2px #F59E0B; }
.timeline-dot.dot-intake   { background: #9CA3AF; box-shadow: 0 0 0 2px #9CA3AF; }

.timeline-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timeline-date {
  font-size: 0.67rem;
  color: var(--ink-60);
  text-align: center;
  margin-top: 2px;
}

/* ─── Cohort "add from waitlist" footer ──────────────────────────────────── */
.cohort-add-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px dashed var(--ink-20);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #F9FAFB;
}

/* ─── Cohort stats per-card ──────────────────────────────────────────────── */
.cohort-mini-stats {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--ink-20);
  background: var(--white);
  font-size: 0.75rem;
  color: var(--ink-60);
}
.cohort-mini-stat strong { color: var(--ink); font-size: 1rem; }

@media (max-width: 860px) {
  .cohort-stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .db-content { padding: 1rem; }
  .db-page-header { padding: 1rem 1rem; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .dealer-content { padding: 1rem; }
  .dealer-topnav { padding: 0 1rem; }
  .lead-card { padding: 1rem; }
  .modal { border-radius: var(--radius); }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* KANBAN BOARD — Financing Pipeline                                          */
/* ═══════════════════════════════════════════════════════════════════════════ */

.fp-summary-bar {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1.125rem;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--ink-60);
  line-height: 1.6;
}
.fp-summary-bar strong { color: var(--ink); }

.kanban-wrap {
  margin: 0 -2rem;
  padding: 0 2rem 2rem;
  overflow-x: auto;
}

.kanban-board {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  min-width: max-content;
  padding-bottom: 0.5rem;
}

.kanban-col { width: 284px; flex-shrink: 0; }

.kanban-col-header {
  padding: 0.75rem 1rem;
  background: var(--white);
  border: 1px solid #E5E7EB;
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.kanban-col-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
}

.kanban-col-count {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  background: #F3F4F6;
  color: var(--ink-60);
}

.kanban-col-accent { height: 3px; }

.kanban-cards {
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 0.625rem;
  min-height: 100px;
}

.kcard {
  background: var(--white);
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 0.875rem;
  margin-bottom: 0.5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.kcard:last-child { margin-bottom: 0; }
.kcard:hover { border-color: #A7F3D0; box-shadow: 0 2px 8px rgba(14,28,24,0.07); }

.kcard-name {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  margin-bottom: 0.25rem;
}
.kcard-name:hover { color: var(--teal); text-decoration: underline; }

.kcard-meta {
  font-size: 0.75rem;
  color: var(--ink-60);
  margin-bottom: 0.2rem;
  line-height: 1.5;
}

.kcard-checklist {
  margin: 0.625rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.kcard-checklist-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--ink);
  cursor: pointer;
  line-height: 1.4;
}
.kcard-checklist-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--teal);
  cursor: pointer;
  flex-shrink: 0;
}

.kcard-action {
  margin-top: 0.625rem;
  padding-top: 0.5rem;
  border-top: 1px solid #F3F4F6;
}

.kcard-days-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: #FEF3C7;
  color: #B45309;
  margin-top: 0.25rem;
}

.kcard-alert {
  margin-top: 0.5rem;
  padding: 6px 8px;
  background: #FEF9C3;
  border: 1px solid #FDE68A;
  border-radius: 6px;
  font-size: 0.72rem;
  color: #92400E;
  line-height: 1.4;
}

.fp-empty {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
  font-size: 0.78rem;
  color: var(--ink-60);
}

/* ── Financing pipeline modal tabs ────────────────────────────────────────── */
.fp-tab-btns {
  display: flex;
  border-bottom: 2px solid #E5E7EB;
  margin-bottom: 1.25rem;
}

.fp-tab-btn {
  padding: 0.5rem 1.125rem;
  font-family: var(--font-body);
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--ink-60);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.15s;
}
.fp-tab-btn:hover { color: var(--ink); }
.fp-tab-btn.active { color: var(--teal); border-bottom-color: var(--teal); }

/* ── Delivery follow-up star ratings ──────────────────────────────────────── */
.del-star { font-size: 1.75rem; cursor: pointer; color: #D1D5DB; transition: color 0.1s; }
.del-star.active { color: #D97706; }
.del-star:hover { color: #FBBF24; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* NOTIFICATION HISTORY (client panel)                                         */
/* ═══════════════════════════════════════════════════════════════════════════ */

.notif-history-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
  margin: -2px 0;
  padding: 2px 0;
}
.notif-history-toggle:hover { color: var(--teal); }

.notif-history-caret {
  font-size: 0.6rem;
  color: var(--ink-60);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.notif-history-caret.open { transform: rotate(90deg); }

.notif-stat-line {
  font-size: 0.75rem;
  color: var(--ink-60);
  margin-bottom: 0.625rem;
  line-height: 1.5;
}

.notif-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.79rem;
}
.notif-log-table th {
  text-align: left;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-60);
  padding: 0 0 0.45rem;
  border-bottom: 1px solid var(--ink-20);
  white-space: nowrap;
}
.notif-log-table td {
  padding: 0.55rem 0.5rem 0.55rem 0;
  border-bottom: 1px solid #F3F4F6;
  vertical-align: middle;
  color: var(--ink);
}
.notif-log-table tr:last-child td { border-bottom: none; }
.notif-log-table td:last-child { white-space: nowrap; }

/* View notification modal body text */
#nv-body-text {
  background: #F9FAFB;
  border-radius: 8px;
  padding: 1rem 1.125rem;
  font-size: 0.83rem;
  line-height: 1.75;
  white-space: pre-wrap;
  color: var(--ink);
  max-height: 340px;
  overflow-y: auto;
  word-break: break-word;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* STAGE NOTIFICATION SYSTEM                                                   */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Mail hint icon next to stage select */
.stage-mail-hint {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.85;
  cursor: default;
  transition: opacity 0.15s;
}
.stage-mail-hint.visible { display: inline-flex; }
.stage-mail-hint:hover { opacity: 1; }

/* Notify modal — wider than default for email preview */
#notify-modal .modal { max-width: 600px; }
#notif-view-modal .modal { max-width: 580px; }

/* Duplicate/warning banner inside modal */
.notify-warn-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: #92400E;
  line-height: 1.5;
  margin: 0 1.5rem 0;
}

/* Missing-data warning below body textarea */
.notify-missing-warn {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: #FFF7ED;
  border: 1px solid #FED7AA;
  border-radius: 6px;
  padding: 0.55rem 0.8rem;
  font-size: 0.78rem;
  color: #9A3412;
  line-height: 1.5;
  margin-top: 0.375rem;
}

/* Form fields inside notify modal */
.notify-field { margin-bottom: 0.875rem; }
.notify-field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-60);
  margin-bottom: 0.35rem;
}
.notify-field input[type="text"],
.notify-field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  resize: vertical;
  transition: border-color 0.15s;
  line-height: 1.55;
}
.notify-field input[type="text"]:focus,
.notify-field textarea:focus { outline: none; border-color: var(--teal); }
.notify-field input[readonly] { background: #F9FAFB; color: var(--ink-60); cursor: default; }
.notify-field textarea { min-height: 230px; font-size: 0.82rem; }

/* Loading state inside notify modal */
.notify-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 0;
  color: var(--ink-60);
  font-size: 0.875rem;
}

/* Notify modal footer layout */
#notify-modal .modal-footer {
  flex-wrap: wrap;
  gap: 0.5rem;
}
#notify-modal .modal-footer .cancel-link {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 0.82rem;
  color: var(--ink-60);
  cursor: pointer;
  padding: 0 0.25rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}
#notify-modal .modal-footer .cancel-link:hover { color: var(--ink); }

/* ── Notifications Tab ─────────────────────────────────────────────── */
.notif-subtabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.25rem;
}
.notif-subtab {
  background: none;
  border: none;
  padding: 0.55rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-60);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.notif-subtab:hover { color: var(--ink); }
.notif-subtab.active { color: var(--emerald); border-bottom-color: var(--emerald); }

.notif-subtab-panel { display: none; }
.notif-subtab-panel.active { display: block; }

.notif-filter-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
}
.notif-filter-input { flex: 1; min-width: 180px; max-width: 260px; }
.notif-filter-select { min-width: 150px; }

.badge-success { background: #DCFCE7; color: #15803D; }
.badge-danger  { background: #FEE2E2; color: #B91C1C; }
