/* ============================================================
   VARIABLES & RESET
   ============================================================ */
:root {
  --primary: #7F77DD;
  --primary-dark: #6560c0;
  --primary-light: #ebe9f8;
  --hot: #e24b4a;
  --warm: #ef9f27;
  --cold: #378add;
  --success: #639922;
  --negotiation: #D85A30;
  --neutral: #888780;
  --bg: #f0eff8;
  --card: #ffffff;
  --border: #e0ddf5;
  --text: #2d2d3a;
  --text-light: #6b6b80;
  --shadow: 0 2px 8px rgba(127,119,221,0.10);
  --radius: 10px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
a { text-decoration: none; color: var(--primary); }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ============================================================
   LAYOUT
   ============================================================ */
#app { display: flex; flex-direction: column; min-height: 100vh; }
header {
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 54px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  position: sticky; top: 0; z-index: 100;
}
header .logo { font-weight: 700; font-size: 17px; letter-spacing: 0.5px; margin-right: 32px; white-space: nowrap; }
nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
nav button {
  background: transparent; border: none; color: rgba(255,255,255,0.8);
  padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: 500;
  transition: all 0.15s;
}
nav button:hover { background: rgba(255,255,255,0.15); color: #fff; }
nav button.active { background: rgba(255,255,255,0.25); color: #fff; }
main { flex: 1; padding: 20px; max-width: 1400px; width: 100%; margin: 0 auto; }

/* ============================================================
   CARDS & SHARED
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.section-title {
  font-size: 18px; font-weight: 700; color: var(--text);
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 7px; border: none;
  font-size: 13px; font-weight: 600; transition: all 0.15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--primary-light); color: var(--primary-dark); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: #fdecea; color: var(--hot); border: 1px solid #f5c6c5; }
.btn-danger:hover { background: #fad0ce; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-open { background: #e8f4fd; color: var(--cold); }
.badge-won { background: #edf6e0; color: var(--success); }
.badge-lost { background: #fdecea; color: var(--hot); }
.badge-hold { background: #fef3e2; color: var(--warm); }
.tag {
  display: inline-block; background: var(--primary-light); color: var(--primary-dark);
  border-radius: 4px; padding: 2px 7px; font-size: 11px; font-weight: 600; margin: 2px;
}
.spinner {
  border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; width: 28px; height: 28px;
  animation: spin 0.7s linear infinite; margin: 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state {
  text-align: center; padding: 32px 16px; color: var(--text-light);
}
.empty-state .icon { font-size: 36px; margin-bottom: 8px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 13px; color: var(--text-light); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 7px; outline: none; background: #fff;
  transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
.form-full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 200;
  align-items: flex-start; justify-content: center; padding: 20px;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card); border-radius: var(--radius);
  width: 100%; max-width: 680px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  animation: fadeInDown 0.2s ease;
  margin: auto;
}
@keyframes fadeInDown { from { opacity:0; transform:translateY(-16px); } to { opacity:1; transform:none; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none; border: none; font-size: 20px;
  color: var(--text-light); cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--hot); }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================================
   TOAST
   ============================================================ */
#toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  background: #2d2d3a; color: #fff; padding: 12px 20px;
  border-radius: 8px; font-size: 14px; font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: opacity 0.3s; opacity: 0; pointer-events: none;
}
#toast.show { opacity: 1; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; text-align: center;
  box-shadow: var(--shadow);
}
.stat-card .stat-num { font-size: 32px; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-card .stat-label { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.stat-card .stat-num.hot { color: var(--hot); }
.stat-card .stat-num.warm { color: var(--warm); }
.stat-card .stat-num.green { color: var(--success); }
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (max-width: 700px) { .charts-row { grid-template-columns: 1fr; } }
.chart-block h4 { font-size: 13px; font-weight: 700; color: var(--text-light); margin-bottom: 10px; }
.bar-item { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.bar-item .bar-label { width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.bar-track { flex: 1; background: var(--bg); border-radius: 4px; height: 8px; }
.bar-fill { height: 8px; border-radius: 4px; background: var(--primary); }
.bar-count { width: 28px; text-align: right; font-weight: 600; color: var(--text-light); }

/* ============================================================
   CONTACTS / LEADS LIST
   ============================================================ */
.contacts-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; }
@media (max-width: 900px) { .contacts-layout { grid-template-columns: 1fr; } }
.lead-list { overflow-y: auto; max-height: calc(100vh - 160px); }
.lead-card {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.1s;
}
.lead-card:hover { background: var(--primary-light); }
.lead-card.selected { background: var(--primary-light); border-left: 3px solid var(--primary); }
.lead-card .lead-name { font-weight: 700; font-size: 14px; color: var(--text); }
.lead-card .lead-company { font-size: 12px; color: var(--text-light); }
.lead-card .lead-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.filters-bar {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.filters-bar input, .filters-bar select {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px;
  background: #fff; font-size: 13px;
}
.filters-bar input { flex: 1; min-width: 160px; }

/* ============================================================
   LEAD DETAIL PANEL
   ============================================================ */
.detail-panel { overflow-y: auto; max-height: calc(100vh - 160px); }
.detail-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 14px; gap: 10px;
}
.detail-name { font-size: 20px; font-weight: 800; color: var(--text); }
.detail-company { color: var(--text-light); font-size: 14px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
}
.detail-tab {
  background: none; border: none; padding: 10px 18px;
  font-size: 13px; font-weight: 600; color: var(--text-light);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  cursor: pointer; transition: all 0.15s;
}
.detail-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.detail-tab:hover { color: var(--primary); }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.info-row label { font-size: 11px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.4px; }
.info-row .info-val { font-size: 14px; color: var(--text); margin-top: 1px; }

/* ============================================================
   PHASE 4: ACTIVITY TIMELINE
   ============================================================ */
.activity-timeline { position: relative; }
.activity-entry {
  display: flex; gap: 12px; margin-bottom: 14px;
}
.activity-dot-col { display: flex; flex-direction: column; align-items: center; }
.activity-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0; margin-top: 5px;
}
.activity-line { flex: 1; width: 2px; background: var(--border); margin-top: 4px; }
.activity-card {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 13px; font-size: 13px;
}
.activity-card-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-wrap: wrap; margin-bottom: 5px;
}
.activity-type {
  font-weight: 700; color: var(--primary); font-size: 13px;
}
.activity-date { font-size: 11px; color: var(--text-light); }
.activity-result {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 10px;
  background: var(--primary-light); color: var(--primary-dark);
  margin-bottom: 4px;
}
.activity-result.res-confirmed { background: #edf6e0; color: var(--success); }
.activity-result.res-reject { background: #fdecea; color: var(--hot); }
.activity-result.res-interested { background: #fef3e2; color: var(--warm); }
.activity-summary { color: var(--text); line-height: 1.5; }
.activity-next { font-size: 11px; color: var(--text-light); margin-top: 4px; }
.activity-sp { font-size: 11px; color: var(--text-light); }

/* Activity form inline */
.activity-form-box {
  background: var(--primary-light); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 16px;
}
.activity-form-box h4 { font-size: 13px; font-weight: 700; color: var(--primary-dark); margin-bottom: 10px; }
.activity-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* ============================================================
   PHASE 5: PROGRESS FIELDS
   ============================================================ */
.progress-section { margin-top: 16px; }
.progress-section h4 { font-size: 12px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.outcome-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.outcome-btn {
  padding: 6px 14px; border-radius: 20px; border: 2px solid transparent;
  font-size: 12px; font-weight: 700; cursor: pointer; transition: all 0.15s;
  background: var(--bg);
}
.outcome-btn[data-outcome="Open"] { border-color: var(--cold); color: var(--cold); }
.outcome-btn[data-outcome="Won"] { border-color: var(--success); color: var(--success); }
.outcome-btn[data-outcome="Lost"] { border-color: var(--hot); color: var(--hot); }
.outcome-btn[data-outcome="On Hold"] { border-color: var(--warm); color: var(--warm); }
.outcome-btn.selected[data-outcome="Open"] { background: var(--cold); color: #fff; }
.outcome-btn.selected[data-outcome="Won"] { background: var(--success); color: #fff; }
.outcome-btn.selected[data-outcome="Lost"] { background: var(--hot); color: #fff; }
.outcome-btn.selected[data-outcome="On Hold"] { background: var(--warm); color: #fff; }

/* ============================================================
   PHASE 6: WEEKLY DASHBOARD
   ============================================================ */
.weekly-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}
.period-tabs { display: flex; gap: 6px; }
.period-tab {
  padding: 6px 16px; border-radius: 20px; border: 2px solid var(--border);
  background: #fff; font-size: 13px; font-weight: 600; color: var(--text-light);
  cursor: pointer; transition: all 0.15s;
}
.period-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.weekly-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 20px; }
.weekly-stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; text-align: center;
}
.weekly-stat .w-num { font-size: 28px; font-weight: 800; color: var(--primary); }
.weekly-stat .w-num.hot { color: var(--hot); }
.weekly-stat .w-num.green { color: var(--success); }
.weekly-stat .w-num.warm { color: var(--warm); }
.weekly-stat .w-label { font-size: 11px; color: var(--text-light); margin-top: 3px; }
.weekly-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 700px) { .weekly-tables { grid-template-columns: 1fr; } }
.weekly-table-card h4 { font-size: 12px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 10px; }
table.simple-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.simple-table th { text-align: left; font-size: 11px; color: var(--text-light); font-weight: 700; padding: 6px 8px; border-bottom: 2px solid var(--border); }
table.simple-table td { padding: 8px; border-bottom: 1px solid var(--border); }
table.simple-table tr:last-child td { border-bottom: none; }
table.simple-table .num { text-align: right; font-weight: 600; }
.pipeline-bars { display: flex; gap: 4px; height: 16px; border-radius: 8px; overflow: hidden; margin: 10px 0; }
.pipeline-bar { height: 100%; transition: flex 0.3s; }
.pipeline-bar.open { background: var(--cold); }
.pipeline-bar.won { background: var(--success); }
.pipeline-bar.lost { background: var(--hot); }
.pipeline-bar.hold { background: var(--warm); }
.pipeline-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; margin-top: 6px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

/* ============================================================
   PIPELINE KANBAN
   ============================================================ */
.kanban-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col {
  min-width: 200px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius); flex-shrink: 0;
}
.kanban-col-header {
  padding: 10px 12px; font-weight: 700; font-size: 13px;
  border-bottom: 1px solid var(--border); display: flex;
  align-items: center; justify-content: space-between;
}
.kanban-col-header .col-count {
  background: var(--primary); color: #fff;
  border-radius: 10px; padding: 1px 7px; font-size: 11px;
}
.kanban-cards { padding: 8px; }
.kanban-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 7px; padding: 10px; margin-bottom: 8px;
  cursor: pointer; font-size: 13px; box-shadow: var(--shadow);
}
.kanban-card:hover { border-color: var(--primary); }
.kanban-card .k-name { font-weight: 700; }
.kanban-card .k-company { color: var(--text-light); font-size: 12px; }
.kanban-card .k-event { margin-top: 4px; }

/* ============================================================
   FOLLOWUPS
   ============================================================ */
.followup-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.followup-table th { text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--border); font-size: 12px; color: var(--text-light); font-weight: 700; }
.followup-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.followup-table tr:hover td { background: var(--primary-light); }
.overdue-row td { background: #fff5f5; }

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.settings-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.settings-section h3 { font-size: 14px; font-weight: 700; margin-bottom: 12px; color: var(--primary-dark); }
.settings-item { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); }
.settings-item:last-child { border-bottom: none; }
.settings-add { display: flex; gap: 8px; margin-top: 12px; }
.settings-add input { flex: 1; padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px; }

/* ============================================================
   PHASE 7: LOGIN PAGE
   ============================================================ */
#login-screen {
  display: none; position: fixed; inset: 0;
  background: var(--bg); z-index: 500;
  align-items: center; justify-content: center;
}
#login-screen.show { display: flex; }
.login-box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 40px 36px;
  width: 100%; max-width: 380px;
  box-shadow: 0 8px 32px rgba(127,119,221,0.15);
  text-align: center;
}
.login-box .login-logo { font-size: 36px; margin-bottom: 8px; }
.login-box h2 { font-size: 22px; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.login-box .login-subtitle { font-size: 13px; color: var(--text-light); margin-bottom: 28px; }
.login-box .form-group { text-align: left; margin-bottom: 16px; }
.login-box .form-group label { font-size: 12px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.4px; }
.login-box .form-group input {
  width: 100%; padding: 10px 12px; margin-top: 5px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; outline: none;
}
.login-box .form-group input:focus { border-color: var(--primary); }
.login-btn {
  width: 100%; padding: 11px; background: var(--primary);
  color: #fff; border: none; border-radius: 8px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  margin-top: 8px; transition: background 0.15s;
}
.login-btn:hover { background: var(--primary-dark); }
.login-pw-wrap {
  position: relative; display: flex; align-items: center; margin-top: 5px;
}
.login-pw-wrap input {
  width: 100%; padding: 10px 44px 10px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; outline: none; margin-top: 0 !important;
}
.login-pw-wrap input:focus { border-color: var(--primary); }
.login-pw-toggle {
  position: absolute; right: 10px;
  background: none; border: none; cursor: pointer;
  font-size: 16px; color: var(--text-light); padding: 4px;
  line-height: 1; transition: opacity 0.15s;
  user-select: none;
}
.login-pw-toggle:hover { opacity: 0.7; }
.login-remember-row { display: flex; align-items: center; margin: 8px 0 14px; }
.login-remember-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text-light); cursor: pointer; font-weight: 600;
}
.login-remember-label input[type="checkbox"] {
  width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary);
}
.login-error {
  color: var(--hot); font-size: 13px; margin-top: 12px;
  display: none; background: #fdecea; border-radius: 6px; padding: 8px;
}
.login-error.show { display: block; }

/* Header user info */
.header-user {
  display: flex; align-items: center; gap: 10px;
  margin-left: auto; flex-shrink: 0;
}
.header-user .user-name {
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.9);
}
.header-user .user-role {
  font-size: 11px; background: rgba(255,255,255,0.2);
  color: #fff; padding: 2px 8px; border-radius: 10px;
}
.logout-btn {
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3);
  color: #fff; padding: 5px 12px; border-radius: 6px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background 0.15s;
}
.logout-btn:hover { background: rgba(255,255,255,0.28); }

/* Phase 8: Communication buttons */
.comm-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.btn-whatsapp {
  background: #25D366; color: #fff; border: none;
  padding: 8px 16px; border-radius: 7px; font-size: 13px;
  font-weight: 700; display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; transition: background 0.15s;
}
.btn-whatsapp:hover { background: #1ebe5d; }
.btn-email-contact {
  background: #378add; color: #fff; border: none;
  padding: 8px 16px; border-radius: 7px; font-size: 13px;
  font-weight: 700; display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; transition: background 0.15s;
}
.btn-email-contact:hover { background: #2870c0; }

/* Form sections (lead modal) */
.form-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.form-section-title {
  font-size: 11px; font-weight: 700; color: var(--primary);
  letter-spacing: 0.8px; margin-bottom: 12px;
}
.form-row-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px;
}
.form-row-1 {
  display: grid; grid-template-columns: 1fr;
}
@media (max-width: 560px) {
  .form-row-2 { grid-template-columns: 1fr; }
}

/* ============================================================
   PROGRESS TAB — REDESIGNED
   ============================================================ */
.prog-section {
  padding: 14px 0 14px;
  border-bottom: 1px solid var(--border);
}
.prog-section-label {
  font-size: 10px; font-weight: 800; letter-spacing: 1px;
  color: var(--text-light); text-transform: uppercase; margin-bottom: 10px;
}
/* Outcome buttons */
.outcome-group { display: flex; gap: 8px; flex-wrap: wrap; }
.out-btn {
  padding: 7px 18px; border-radius: 20px; border: 2px solid transparent;
  font-size: 13px; font-weight: 700; cursor: pointer;
  background: var(--bg); transition: all 0.15s; display: inline-flex; align-items: center; gap: 5px;
}
.out-open  { border-color: var(--cold);    color: var(--cold); }
.out-won   { border-color: var(--success); color: var(--success); }
.out-lost  { border-color: var(--hot);     color: var(--hot); }
.out-hold  { border-color: var(--warm);    color: var(--warm); }
.out-open.out-active  { background: var(--cold);    color: #fff; }
.out-won.out-active   { background: var(--success); color: #fff; }
.out-lost.out-active  { background: var(--hot);     color: #fff; }
.out-hold.out-active  { background: var(--warm);    color: #fff; }
.prog-lost-reason { margin-top: 8px; font-size: 13px; color: var(--hot); padding: 6px 10px; background: #fdecea; border-radius: 6px; }

/* Pipeline steps */
.pipeline-steps {
  display: flex; flex-wrap: wrap; gap: 0; align-items: center;
}
.pipe-step {
  display: flex; flex-direction: column; align-items: center;
  position: relative; flex: 1; min-width: 70px; text-align: center;
}
.pipe-step:not(:last-child)::after {
  content: ''; position: absolute; top: 10px; left: 60%; width: 80%;
  height: 2px; background: var(--border); z-index: 0;
}
.pipe-step.pipe-done:not(:last-child)::after  { background: var(--success); }
.pipe-step.pipe-active:not(:last-child)::after { background: var(--primary); }
.pipe-dot {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border);
  background: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--text-light);
  position: relative; z-index: 1; transition: all 0.15s;
}
.pipe-step.pipe-done  .pipe-dot { background: var(--success); border-color: var(--success); color: #fff; font-size: 11px; }
.pipe-step.pipe-active .pipe-dot { background: var(--primary); border-color: var(--primary); color: #fff; width: 26px; height: 26px; box-shadow: 0 0 0 3px rgba(127,119,221,0.2); }
.pipe-label {
  font-size: 10px; margin-top: 5px; color: var(--text-light);
  font-weight: 500; line-height: 1.2;
}
.pipe-step.pipe-done   .pipe-label { color: var(--success); font-weight: 600; }
.pipe-step.pipe-active .pipe-label { color: var(--primary); font-weight: 800; font-size: 11px; }

/* Sub-status */
.substatus-display {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 600;
}
.substatus-set   { background: var(--primary-light); color: var(--primary-dark); border: 1px solid var(--border); }
.substatus-empty { background: var(--bg); color: var(--text-light); border: 1px solid var(--border); }
.substatus-icon  { font-size: 16px; }

/* Dates row */
.dates-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.date-box {
  border-radius: 10px; padding: 12px 14px;
  border: 2px solid var(--border); background: var(--bg);
}
.date-last { border-color: var(--border); }
.date-due  { border-color: var(--primary); background: var(--primary-light); }
.date-overdue { border-color: var(--hot); background: #fff5f5; }
.date-box-label {
  font-size: 10px; font-weight: 800; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 5px;
  display: flex; align-items: center; gap: 4px;
}
.date-due  .date-box-label { color: var(--primary-dark); }
.date-overdue .date-box-label { color: var(--hot); }
.date-box-val { font-size: 15px; font-weight: 700; color: var(--text); }
.date-due .date-box-val     { color: var(--primary-dark); }
.date-overdue .date-box-val { color: var(--hot); }
.date-req  { color: var(--hot); font-size: 8px; vertical-align: middle; }
.overdue-tag {
  display: inline-block; background: var(--hot); color: #fff;
  font-size: 10px; font-weight: 700; padding: 1px 7px;
  border-radius: 10px; margin-left: 6px; vertical-align: middle;
}

/* Commercial grid */
.comm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.comm-item { }
.comm-label { font-size: 10px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 2px; }
.comm-val   { font-size: 14px; color: var(--text); font-weight: 500; }
.comm-empty { color: var(--text-light); font-weight: 400; }

@media (max-width: 600px) {
  .dates-row, .comm-grid { grid-template-columns: 1fr; }
  .pipeline-steps { gap: 4px; }
  .pipe-step { min-width: 55px; }
  .pipe-label { font-size: 9px; }
}

@media (max-width: 700px) {
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .contacts-layout { grid-template-columns: 1fr; }
  .activity-form-grid { grid-template-columns: 1fr; }
  main { padding: 12px; }
}

/* ============================================================
   PIPELINE v2 — REDESIGNED KANBAN
   ============================================================ */
.kb2-summary {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px;
}
.kb2-sum-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 11px 16px;
  text-align: center; flex: 1; min-width: 90px; box-shadow: var(--shadow);
}
.kb2-sum-num   { font-size: 24px; font-weight: 800; color: var(--primary); line-height: 1; }
.kb2-sum-label { font-size: 11px; color: var(--text-light); margin-top: 3px; }
.kb2-sum-warn  .kb2-sum-num { color: var(--warm); }
.kb2-sum-nego  .kb2-sum-num { color: var(--negotiation); }
.kb2-sum-green .kb2-sum-num { color: var(--success); }
.kb2-sum-hot   .kb2-sum-num { color: var(--hot); }

.kb2-board-wrap {
  overflow-x: auto; overflow-y: hidden; padding-bottom: 10px;
  scrollbar-width: thin; scrollbar-color: var(--primary) var(--border);
}
.kb2-board-wrap::-webkit-scrollbar { height: 8px; }
.kb2-board-wrap::-webkit-scrollbar-track { background: var(--border); border-radius: 4px; }
.kb2-board-wrap::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

.kb2-board {
  display: flex; gap: 10px; align-items: flex-start;
  min-width: max-content; padding: 2px 2px 6px;
  cursor: default; user-select: none;
}
.kb2-board.kb2-dragging { cursor: grabbing; }

.kb2-col {
  width: 205px; flex-shrink: 0; background: var(--bg);
  border-radius: var(--radius); border: 1px solid var(--border);
  display: flex; flex-direction: column;
  max-height: calc(100vh - 270px);
}
.kb2-col-secondary { opacity: 0.82; filter: saturate(0.65); }

.kb2-col-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 11px; background: var(--card);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 2;
}
.kb2-col-name  { font-size: 12px; font-weight: 700; color: var(--text); }
.kb2-col-count {
  font-size: 11px; font-weight: 700; color: #fff;
  border-radius: 10px; padding: 1px 8px; min-width: 22px; text-align: center;
}

.kb2-cards {
  padding: 7px; overflow-y: auto; flex: 1;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.kb2-cards::-webkit-scrollbar { width: 3px; }
.kb2-cards::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.kb2-empty { text-align: center; color: var(--text-light); font-size: 12px; padding: 14px 0; }

.kb2-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 10px; margin-bottom: 6px;
  cursor: pointer; transition: box-shadow 0.15s, border-color 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.kb2-card:hover { border-color: var(--primary); box-shadow: 0 3px 10px rgba(127,119,221,0.15); }
.kb2-company { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb2-name    { font-size: 11px; color: var(--text-light); margin-bottom: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb2-meta    { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; }
.kb2-tag     { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.kb2-tag-event  { background: var(--primary-light); color: var(--primary-dark); }
.kb2-tag-hot    { background: #fdecea; color: var(--hot); }
.kb2-tag-warm   { background: #fef3e2; color: var(--warm); }
.kb2-tag-cold   { background: #e8f4fd; color: var(--cold); }
.kb2-footer  { border-top: 1px solid var(--border); padding-top: 5px; margin-top: 3px; display: flex; flex-direction: column; gap: 2px; }
.kb2-substatus { font-size: 10px; color: var(--text-light); font-style: italic; }
.kb2-followup  { font-size: 10px; font-weight: 600; color: var(--primary); }
.kb2-overdue   { color: var(--hot); }

.kb2-divider {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 0 4px; gap: 6px; width: 26px; flex-shrink: 0;
}
.kb2-divider-line  { flex: 1; width: 2px; background: var(--border); border-radius: 1px; min-height: 30px; }
.kb2-divider-label {
  writing-mode: vertical-rl; font-size: 9px; font-weight: 700;
  color: var(--text-light); letter-spacing: 1px; text-transform: uppercase;
}

/* ============================================================
   FOLLOW-UPS v2 — ACTION DASHBOARD
   ============================================================ */
.fu-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; flex-wrap: wrap; gap: 10px;
}
.fu-view-toggle { display: flex; gap: 4px; }
.fu-toggle-btn {
  padding: 5px 13px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--card); font-size: 12px; font-weight: 600;
  color: var(--text-light); cursor: pointer; transition: all 0.15s;
}
.fu-toggle-btn.fu-toggle-active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Summary pills */
.fu-summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.fu-sum-pill {
  flex: 1; min-width: 100px; border-radius: var(--radius);
  padding: 12px 16px; display: flex; flex-direction: column; align-items: center;
  cursor: pointer; border: 2px solid transparent; transition: all 0.15s;
  box-shadow: var(--shadow);
}
.fu-sum-pill:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.fu-sum-overdue { background: #fff5f5; border-color: #fad0ce; }
.fu-sum-today   { background: #fff8ee; border-color: #fde8bb; }
.fu-sum-week    { background: #fffbea; border-color: #fef3c7; }
.fu-sum-total   { background: var(--primary-light); border-color: var(--border); }
.fu-sum-num  { font-size: 28px; font-weight: 800; line-height: 1; }
.fu-sum-lbl  { font-size: 11px; font-weight: 600; margin-top: 3px; color: var(--text-light); }
.fu-sum-overdue .fu-sum-num { color: var(--hot); }
.fu-sum-today   .fu-sum-num { color: var(--negotiation); }
.fu-sum-week    .fu-sum-num { color: var(--warm); }
.fu-sum-total   .fu-sum-num { color: var(--primary); }

/* Filters */
.fu-filters {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
  align-items: center;
}
.fu-filter-group { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.fu-filter-btn {
  padding: 6px 14px; border: none; background: var(--card);
  font-size: 12px; font-weight: 600; color: var(--text-light); cursor: pointer; transition: all 0.15s;
}
.fu-filter-btn.active { background: var(--primary); color: #fff; }
.fu-filter-sel {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--card); font-size: 12px; color: var(--text); cursor: pointer;
}

/* Sections */
.fu-section { margin-bottom: 20px; }
.fu-section-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.fu-section-icon  { font-size: 16px; }
.fu-section-title { font-size: 15px; font-weight: 700; color: var(--text); flex: 1; }
.fu-section-count {
  font-size: 12px; font-weight: 700; padding: 2px 10px;
  border-radius: 12px; color: #fff;
}
.fu-count-overdue { background: var(--hot); }
.fu-count-today   { background: var(--negotiation); }
.fu-count-week    { background: var(--warm); }
.fu-empty { text-align: center; padding: 18px; color: var(--text-light); font-size: 13px; background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); }

/* Card grid */
.fu-cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px;
}

/* Card */
.fu-card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 13px 14px;
  box-shadow: var(--shadow); border-left: 4px solid var(--border);
  transition: box-shadow 0.15s;
}
.fu-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.1); }
.fu-card-overdue { border-left-color: var(--hot);        background: #fffbfb; }
.fu-card-today   { border-left-color: var(--negotiation); background: #fffdf8; }
.fu-card-week    { border-left-color: var(--warm);        background: #fffef5; }

.fu-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.fu-card-identity { flex: 1; min-width: 0; }
.fu-company {
  font-size: 14px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.fu-value-badge {
  font-size: 10px; font-weight: 700; background: #edf6e0;
  color: var(--success); padding: 1px 6px; border-radius: 4px; white-space: nowrap;
}
.fu-name { font-size: 12px; color: var(--text-light); margin-top: 2px; }

.fu-card-date { text-align: right; flex-shrink: 0; }
.fu-overdue-tag {
  display: block; font-size: 10px; font-weight: 700;
  color: #fff; background: var(--hot); padding: 1px 7px;
  border-radius: 10px; margin-bottom: 3px; white-space: nowrap;
}
.fu-date-val { font-size: 13px; font-weight: 700; color: var(--text); }
.fu-date-overdue .fu-date-val { color: var(--hot); }
.fu-date-today   .fu-date-val { color: var(--negotiation); }

.fu-card-mid { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.fu-chip {
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 4px; white-space: nowrap;
}
.fu-chip-event { background: var(--primary-light); color: var(--primary-dark); }
.fu-chip-stage { background: #f0f0f0; color: var(--text); }
.fu-chip-sub   { background: #f8f4ff; color: var(--primary-dark); font-style: italic; }
.fu-chip-hot   { background: #fdecea; color: var(--hot); }
.fu-chip-warm  { background: #fef3e2; color: var(--warm); }
.fu-chip-cold  { background: #e8f4fd; color: var(--cold); }

.fu-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 8px; border-top: 1px solid var(--border); gap: 6px;
}
.fu-owner { font-size: 11px; color: var(--text-light); white-space: nowrap; }
.fu-actions { display: flex; gap: 4px; }
.fu-btn {
  width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.12s; padding: 0;
}
.fu-btn:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,0.12); }
.fu-btn-wa    { background: #e8faf0; border-color: #b7e4c7; }
.fu-btn-em    { background: #e8f1fd; border-color: #bdd5f7; }
.fu-btn-view  { background: var(--primary-light); border-color: var(--border); }
.fu-btn-snooze{ background: #fef9e7; border-color: #fde68a; }
.fu-btn-done  { background: #edf6e0; border-color: #c3e6a0; }

/* Table view */
.fu-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.fu-table th { text-align: left; padding: 9px 12px; background: var(--bg); font-size: 11px; font-weight: 700; color: var(--text-light); border-bottom: 2px solid var(--border); }
.fu-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.fu-table tr:last-child td { border-bottom: none; }
.fu-tr-overdue td { background: #fffbfb; }
.fu-tr-today   td { background: #fffdf8; }
.fu-table .fu-actions { justify-content: flex-start; }

/* ============================================================
   DASHBOARD v2
   ============================================================ */
.db-kpi-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr));
  gap: 10px; margin-bottom: 16px;
}
.db-kpi {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 12px; text-align: center;
  box-shadow: var(--shadow);
}
.db-kpi-alert { border-color: var(--hot); background: #fff5f5; }
.db-kpi-num   { font-size: 26px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.db-kpi-lbl   { font-size: 11px; color: var(--text-light); margin-top: 4px; font-weight: 600; }

.db-main-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .db-main-grid { grid-template-columns: 1fr; } }
.db-left, .db-right { display: flex; flex-direction: column; gap: 14px; }
.db-card { padding: 16px; }
.db-card-title { font-size: 13px; font-weight: 800; color: var(--text); margin-bottom: 12px; letter-spacing: 0.2px; }

/* Funnel */
.db-funnel { display: flex; flex-direction: column; gap: 6px; }
.db-funnel-row { display: flex; align-items: center; gap: 8px; }
.db-funnel-label { font-size: 11px; font-weight: 600; color: var(--text-light); width: 110px; flex-shrink: 0; text-align: right; }
.db-funnel-bar-wrap { flex: 1; }
.db-funnel-bar {
  border-radius: 4px; height: 22px; display: flex; align-items: center;
  padding: 0 8px; min-width: 30px; transition: width 0.3s;
}
.db-funnel-count { font-size: 11px; font-weight: 700; color: #fff; }
.db-funnel-conv  { font-size: 10px; font-weight: 700; color: var(--text-light); width: 34px; text-align: right; flex-shrink: 0; }

/* Revenue boxes */
.db-rev-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.db-rev-box { border: 2px solid var(--border); border-radius: 8px; padding: 10px; text-align: center; }
.db-rev-label { font-size: 10px; font-weight: 700; color: var(--text-light); text-transform: uppercase; margin-bottom: 4px; }
.db-rev-val   { font-size: 13px; font-weight: 800; }

/* Today pills */
.db-today-pill {
  font-size: 11px; font-weight: 700; padding: 4px 10px;
  border-radius: 12px;
}
.db-today-overdue { background: #fdecea; color: var(--hot); }
.db-today-due     { background: #fff8ee; color: var(--negotiation); }
.db-today-closing { background: #edf6e0; color: var(--success); }

/* Mini cards */
.db-mini-section-lbl { font-size: 10px; font-weight: 700; color: var(--text-light); text-transform: uppercase; margin: 8px 0 4px; letter-spacing: 0.5px; }
.db-mini-card {
  padding: 7px 10px; border-radius: 6px; margin-bottom: 4px;
  cursor: pointer; border: 1px solid var(--border); background: var(--bg);
  transition: background 0.1s;
}
.db-mini-card:hover { background: var(--primary-light); }
.db-mini-company { font-size: 12px; font-weight: 700; color: var(--text); }
.db-mini-name    { font-size: 11px; color: var(--text-light); }
.db-mini-overdue { border-left: 3px solid var(--hot); }
.db-mini-today   { border-left: 3px solid var(--negotiation); }
.db-mini-closing { border-left: 3px solid var(--success); }
.db-mini-stuck   { border-left: 3px solid var(--warm); }

/* Alerts */
.db-alert-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.db-alert-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; color: #fff; flex-shrink: 0; }
.db-alert-warn  { background: var(--warm); }
.db-alert-info  { background: var(--cold); }

/* Team table */
.db-team-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.db-team-table th { text-align: left; padding: 6px 8px; background: var(--bg); font-size: 10px; font-weight: 700; color: var(--text-light); border-bottom: 2px solid var(--border); text-transform: uppercase; }
.db-team-table td { padding: 8px; border-bottom: 1px solid var(--border); }
.db-team-table tr:last-child td { border-bottom: none; }
.db-team-table tr:hover td { background: var(--primary-light); }

/* ============================================================
   INCENTIVE MODULE — Lead Verification, Meetings, Payments
   ============================================================ */
.inc-page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.inc-page-title { font-size: 18px; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 8px; }
.inc-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.inc-filters select, .inc-filters input { padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px; background: #fff; font-size: 13px; }

/* Summary cards row */
.inc-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 18px; }
.inc-stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 12px; text-align: center; box-shadow: var(--shadow);
}
.inc-stat-num { font-size: 26px; font-weight: 800; line-height: 1.1; }
.inc-stat-lbl { font-size: 11px; color: var(--text-light); margin-top: 4px; font-weight: 600; }
.inc-stat-purple .inc-stat-num { color: var(--primary); }
.inc-stat-green .inc-stat-num { color: var(--success); }
.inc-stat-red .inc-stat-num { color: var(--hot); }
.inc-stat-warn .inc-stat-num { color: var(--warm); }
.inc-stat-blue .inc-stat-num { color: var(--cold); }
.inc-stat-money { border-left: 3px solid var(--success); }
.inc-stat-money .inc-stat-num { color: var(--success); font-size: 18px; }

/* Verification table */
.inc-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.inc-table th { text-align: left; padding: 9px 10px; background: var(--bg); font-size: 11px; font-weight: 700; color: var(--text-light); border-bottom: 2px solid var(--border); text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; }
.inc-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.inc-table tr:last-child td { border-bottom: none; }
.inc-table tr:hover td { background: var(--primary-light); }
.inc-table .inc-actions { display: flex; gap: 4px; flex-wrap: nowrap; }

/* Status badges */
.inc-badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.inc-badge-pending { background: #fef3e2; color: var(--warm); }
.inc-badge-verified { background: #edf6e0; color: var(--success); }
.inc-badge-rejected { background: #fdecea; color: var(--hot); }
.inc-badge-duplicate { background: #f3e8ff; color: #7c3aed; }
.inc-badge-paid { background: #dbeafe; color: #1d4ed8; }
.inc-badge-unpaid { background: #f5f5f5; color: #666; }
.inc-badge-eligible { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.inc-badge-ineligible { background: #fef2f2; color: #dc2626; }

/* Quick action buttons */
.inc-btn { padding: 4px 10px; border-radius: 5px; border: none; font-size: 11px; font-weight: 700; cursor: pointer; transition: all 0.12s; white-space: nowrap; }
.inc-btn-verify { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.inc-btn-verify:hover { background: #d1fae5; }
.inc-btn-reject { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.inc-btn-reject:hover { background: #fee2e2; }
.inc-btn-dup { background: #f3e8ff; color: #7c3aed; border: 1px solid #ddd6fe; }
.inc-btn-dup:hover { background: #ede9fe; }
.inc-btn-pay { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.inc-btn-pay:hover { background: #bfdbfe; }

/* Progress bar */
.inc-progress-wrap { width: 100%; background: var(--bg); border-radius: 6px; height: 10px; overflow: hidden; }
.inc-progress-fill { height: 100%; border-radius: 6px; transition: width 0.4s ease; }
.inc-progress-fill.green { background: var(--success); }
.inc-progress-fill.warn { background: var(--warm); }
.inc-progress-fill.red { background: var(--hot); }

/* Leaderboard */
.inc-leader-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.inc-leader-table th { text-align: left; padding: 8px 10px; background: var(--bg); font-size: 11px; font-weight: 700; color: var(--text-light); border-bottom: 2px solid var(--border); }
.inc-leader-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.inc-leader-table tr:hover td { background: var(--primary-light); }
.inc-target-hit { color: var(--success); font-weight: 700; }
.inc-target-miss { color: var(--hot); font-weight: 700; }

/* Detail drawer */
.inc-drawer-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 250;
  justify-content: flex-end;
}
.inc-drawer-overlay.open { display: flex; }
.inc-drawer {
  background: var(--card); width: 100%; max-width: 520px;
  height: 100%; overflow-y: auto; box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  animation: slideInRight 0.2s ease;
}
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: none; } }
.inc-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card); z-index: 1;
}
.inc-drawer-header h3 { font-size: 16px; font-weight: 700; }
.inc-drawer-body { padding: 20px; }
.inc-drawer-section { margin-bottom: 16px; }
.inc-drawer-section-title { font-size: 10px; font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px; }
.inc-drawer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.inc-drawer-field label { font-size: 10px; font-weight: 700; color: var(--text-light); text-transform: uppercase; }
.inc-drawer-field .inc-val { font-size: 14px; color: var(--text); margin-top: 2px; }
.inc-drawer-img { max-width: 100%; border-radius: 8px; border: 1px solid var(--border); margin-top: 8px; }
.inc-drawer-history { margin-top: 12px; }
.inc-history-item { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.inc-history-item:last-child { border-bottom: none; }
.inc-history-time { color: var(--text-light); white-space: nowrap; flex-shrink: 0; }
.inc-history-text { color: var(--text); }

/* Friday review highlight cards */
.inc-review-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.inc-review-card h4 { font-size: 13px; font-weight: 800; color: var(--text); margin-bottom: 10px; }
.inc-hit-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.inc-hit-row:last-child { border-bottom: none; }
.inc-hit-name { font-weight: 700; font-size: 13px; flex: 1; }
.inc-hit-icon { font-size: 18px; }

/* Payment grouped */
.inc-pay-group { margin-bottom: 20px; }
.inc-pay-group-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--bg); border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid var(--border); border-bottom: none;
}
.inc-pay-group-name { font-weight: 700; font-size: 14px; }
.inc-pay-group-total { font-size: 13px; color: var(--success); font-weight: 700; }

/* Tab nav for sub-pages within module */
.inc-tab-nav { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.inc-tab-btn {
  background: none; border: none; padding: 10px 18px; font-size: 13px; font-weight: 600;
  color: var(--text-light); border-bottom: 2px solid transparent; margin-bottom: -2px;
  cursor: pointer; transition: all 0.15s;
}
.inc-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.inc-tab-btn:hover { color: var(--primary); }

/* Bulk actions bar */
.inc-bulk-bar {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--primary-light); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 14px;
}
.inc-bulk-count { font-size: 13px; font-weight: 700; color: var(--primary-dark); }

@media (max-width: 900px) {
  .inc-drawer { max-width: 100%; }
  .inc-table { font-size: 12px; }
  .inc-table th, .inc-table td { padding: 6px 6px; }
}

/* ============================================================
   FRIDAY REVIEW — Enhanced UI
   ============================================================ */

/* Page header */
.fr-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; flex-wrap: wrap; gap: 10px;
}
.fr-period-label {
  font-size: 13px; font-weight: 700; color: var(--primary-dark);
  background: var(--primary-light); padding: 5px 12px;
  border-radius: 20px; border: 1px solid var(--border);
}

/* Filter bar */
.fr-filter-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  gap: 14px 20px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.fr-filter-group {
  display: flex; flex-direction: column; gap: 5px; min-width: 0;
}
.fr-filter-label {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text-light);
}
.fr-filter-select {
  padding: 7px 10px; border: 1px solid var(--border);
  border-radius: 7px; background: var(--bg); font-size: 13px;
  color: var(--text); min-width: 180px; cursor: pointer;
  transition: border-color 0.15s;
}
.fr-filter-select:focus { border-color: var(--primary); outline: none; }

/* Preset buttons */
.fr-preset-btns { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.fr-preset-btn {
  padding: 7px 14px; border: none; border-right: 1px solid var(--border);
  background: var(--bg); font-size: 12px; font-weight: 600;
  color: var(--text-light); cursor: pointer; transition: all 0.12s; white-space: nowrap;
}
.fr-preset-btn:last-child { border-right: none; }
.fr-preset-btn:hover { background: var(--primary-light); color: var(--primary-dark); }
.fr-preset-btn.fr-preset-active { background: var(--primary); color: #fff; }

/* Custom date row */
.fr-custom-row {
  display: flex; gap: 14px; align-items: flex-end;
  padding-top: 2px; flex-wrap: wrap;
}
.fr-date-input {
  padding: 7px 10px; border: 1px solid var(--border);
  border-radius: 7px; background: var(--bg); font-size: 13px;
  color: var(--text); cursor: pointer; transition: border-color 0.15s;
}
.fr-date-input:focus { border-color: var(--primary); outline: none; }

/* Summary cards override for FR */
.fr-summary { margin-bottom: 18px; }

/* Two-panel layout */
.fr-panels-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-bottom: 18px;
}
@media (max-width: 800px) { .fr-panels-grid { grid-template-columns: 1fr; } }

/* Panel card */
.fr-panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.fr-panel-leads    { border-top: 3px solid var(--success); }
.fr-panel-meetings { border-top: 3px solid var(--primary); }

/* Panel header */
.fr-panel-header {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.fr-panel-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.fr-panel-header-text { display: flex; flex-direction: column; gap: 2px; }
.fr-panel-title { font-size: 13px; font-weight: 800; color: var(--text); }
.fr-panel-sub   { font-size: 11px; color: var(--text-light); }
.fr-sub-all     { font-style: italic; }

/* Scrollable list area */
.fr-panel-list {
  flex: 1; overflow-y: auto; max-height: 340px;
  padding: 10px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.fr-panel-list::-webkit-scrollbar { width: 4px; }
.fr-panel-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Hint / empty states */
.fr-hint {
  text-align: center; padding: 28px 16px;
  color: var(--text-light); font-size: 13px; line-height: 1.6;
}
.fr-empty {
  text-align: center; padding: 20px 10px;
  color: var(--text-light); font-size: 13px; font-style: italic;
}

/* Lead / meeting list table */
.fr-list-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.fr-list-table thead th {
  text-align: left; padding: 6px 8px; background: var(--bg);
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.3px; color: var(--text-light);
  border-bottom: 2px solid var(--border); white-space: nowrap;
}
.fr-list-table tbody td {
  padding: 7px 8px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.fr-list-table tbody tr:last-child td { border-bottom: none; }
.fr-list-table tbody tr:hover td { background: var(--primary-light); }
.fr-num { color: var(--text-light); font-size: 11px; width: 26px; text-align: right; }

/* Panel footer */
.fr-panel-footer {
  padding: 12px 14px; background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 5px;
}
.fr-footer-row {
  display: flex; align-items: center;
  justify-content: space-between; gap: 10px;
}
.fr-footer-lbl { font-size: 12px; color: var(--text-light); font-weight: 500; }
.fr-footer-val { font-size: 14px; font-weight: 700; color: var(--text); }
.fr-val-green  { color: var(--success); }
.fr-val-red    { color: var(--hot); }
.fr-val-money  { color: var(--success); font-size: 15px; }
.fr-footer-divider {
  height: 1px; background: var(--border); margin: 3px 0;
}
.fr-footer-incentive .fr-footer-lbl { font-size: 13px; font-weight: 700; color: var(--text); }
.fr-footer-incentive .fr-footer-val { font-size: 16px; }

/* Full breakdown section */
.fr-breakdown-card { padding: 16px; margin-bottom: 16px; }
.fr-breakdown-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; gap: 10px; flex-wrap: wrap;
}
.fr-breakdown-title { font-size: 13px; font-weight: 800; color: var(--text); }
.fr-breakdown-period {
  font-size: 12px; font-weight: 600; color: var(--text-light);
  background: var(--bg); padding: 3px 10px;
  border-radius: 10px; border: 1px solid var(--border);
}

/* Highlighted row for selected agent */
.fr-row-highlight td { background: var(--primary-light) !important; }
.fr-row-highlight td:first-child {
  border-left: 3px solid var(--primary);
}

@media (max-width: 700px) {
  .fr-filter-bar    { padding: 12px; }
  .fr-preset-btns   { flex-wrap: wrap; }
  .fr-preset-btn    { flex: 1; min-width: 70px; text-align: center; }
  .fr-filter-select { min-width: 140px; }
  .fr-panel-list    { max-height: 260px; }
}

/* ============================================================
   CONTACT PAGE — Search bar with button
   ============================================================ */
.cs-search-wrap {
  display: flex; flex: 1; min-width: 200px; gap: 0;
}
/* Override the generic .filters-bar input rule for the search input */
.filters-bar .cs-search-wrap input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 7px 0 0 7px !important;
  background: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  min-width: 0;
}
.filters-bar .cs-search-wrap input:focus {
  border-color: var(--primary);
}
.cs-search-btn {
  border-radius: 0 7px 7px 0 !important;
  padding: 7px 14px !important;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ============================================================
   FILE UPLOAD FIELDS — Task 1 addition (do not remove)
   ============================================================ */
.upload-field-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.upload-field-wrap input[type="file"] {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  width: auto;
}
.upload-btn {
  white-space: nowrap;
  flex-shrink: 0;
}
.upload-preview {
  font-size: 12px;
  white-space: nowrap;
}
.upload-view-link {
  font-weight: 600;
  color: var(--success);
}
