/* InsightFlow Activity Tracker - Custom Styles */

:root {
  --if-navy: #0f1f3d;
  --if-blue: #1a56db;
  --if-teal: #0694a2;
  --if-accent: #7c3aed;
  --if-success: #057a55;
  --if-warning: #c27803;
  --if-danger: #c81e1e;
}

* { box-sizing: border-box; }

body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }

/* ============================================================
   SIDEBAR NAVIGATION
   ============================================================ */
#sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--if-navy);
  position: fixed;
  left: 0; top: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width 0.2s ease;
  overflow-x: hidden;
}

#sidebar .logo-area {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

#sidebar .logo-area .logo-mark {
  background: linear-gradient(135deg, #1a56db, #0694a2);
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: white; font-weight: 800;
  flex-shrink: 0;
}

#sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: rgba(255,255,255,0.65);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 6px;
  margin: 1px 8px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

#sidebar nav a:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.95);
}

#sidebar nav a.active {
  background: rgba(26,86,219,0.35);
  color: white;
  font-weight: 600;
}

#sidebar nav a .nav-icon {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}

#sidebar .nav-section-label {
  padding: 12px 24px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
#main-content {
  margin-left: 240px;
  min-height: 100vh;
}

.page-header {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}

.page-body {
  padding: 28px 32px;
}

/* ============================================================
   CARDS & BOARDS
   ============================================================ */
.card {
  background: white;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card-hover {
  transition: box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
}
.card-hover:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.09);
  border-color: #c7d2fe;
}

/* ============================================================
   PIPELINE STAGES
   ============================================================ */
.stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.stage-prospecting    { background: #f3f4f6; color: #6b7280; }
.stage-qualification  { background: #eff6ff; color: #1d4ed8; }
.stage-discovery      { background: #f0fdf4; color: #166534; }
.stage-proposal       { background: #fefce8; color: #854d0e; }
.stage-negotiation    { background: #fdf4ff; color: #7e22ce; }
.stage-closed_won     { background: #dcfce7; color: #14532d; }
.stage-closed_lost    { background: #fef2f2; color: #7f1d1d; }

/* Engagement status */
.status-planned      { background: #eff6ff; color: #1d4ed8; }
.status-completed    { background: #dcfce7; color: #14532d; }
.status-cancelled    { background: #fef2f2; color: #7f1d1d; }
.status-rescheduled  { background: #fefce8; color: #854d0e; }

/* Health */
.health-green  { background: #dcfce7; color: #14532d; }
.health-yellow { background: #fefce8; color: #854d0e; }
.health-red    { background: #fef2f2; color: #7f1d1d; }

/* Priority */
.priority-low    { background: #f3f4f6; color: #6b7280; }
.priority-medium { background: #eff6ff; color: #1d4ed8; }
.priority-high   { background: #fef3c7; color: #92400e; }
.priority-urgent { background: #fef2f2; color: #7f1d1d; }

/* Prep status */
.prep-not_started { background: #f3f4f6; color: #6b7280; }
.prep-in_progress { background: #eff6ff; color: #1d4ed8; }
.prep-ready       { background: #ecfdf5; color: #065f46; }
.prep-completed   { background: #dcfce7; color: #14532d; }

/* Account status */
.acct-prospect { background: #eff6ff; color: #1d4ed8; }
.acct-active   { background: #dcfce7; color: #14532d; }
.acct-churned  { background: #fef2f2; color: #7f1d1d; }
.acct-on_hold  { background: #fefce8; color: #854d0e; }

/* ============================================================
   TABLE
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: #f9fafb;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13.5px;
  color: #374151;
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover td {
  background: #f9fafb;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 13.5px;
  color: #1f2937;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

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

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--if-blue);
  color: white;
}
.btn-primary:hover { background: #1748c0; }

.btn-secondary {
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
}
.btn-secondary:hover { background: #f9fafb; border-color: #9ca3af; }

.btn-danger  { background: #fee2e2; color: #991b1b; }
.btn-danger:hover  { background: #fecaca; }

.btn-success { background: #d1fae5; color: #065f46; }
.btn-success:hover { background: #a7f3d0; }

.btn-ghost { background: transparent; color: #6b7280; }
.btn-ghost:hover { background: #f3f4f6; color: #374151; }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  justify-content: center;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

.modal-box {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease;
}

.modal-box.modal-lg { max-width: 800px; }
.modal-box.modal-xl { max-width: 1000px; }

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0;
  background: white;
  z-index: 1;
}

.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ============================================================
   QUICK ADD BAR
   ============================================================ */
.quick-add-bar {
  background: linear-gradient(135deg, #0f1f3d, #1a3560);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  background: white;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 18px 20px;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #111827;
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.stat-card .stat-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

/* ============================================================
   KANBAN COLUMNS
   ============================================================ */
.kanban-col {
  min-width: 260px;
  max-width: 260px;
  background: #f9fafb;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.kanban-col-header {
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 8px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.kanban-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-color: #a5b4fc;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar-bg {
  background: #e5e7eb;
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #1a56db, #0694a2);
  transition: width 0.4s ease;
}

/* ============================================================
   NOTIFICATION / TOAST
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: white;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  animation: slideInRight 0.25s ease;
  max-width: 320px;
}

.toast-success { background: #057a55; }
.toast-error   { background: #c81e1e; }
.toast-info    { background: #1a56db; }

/* ============================================================
   INTAKE TABS
   ============================================================ */
.tab-bar {
  display: flex;
  gap: 2px;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 3px;
}

.tab-btn {
  flex: 1;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #6b7280;
  transition: all 0.15s ease;
  text-align: center;
}

.tab-btn.active {
  background: white;
  color: #1a56db;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ============================================================
   CLIENT CARD
   ============================================================ */
.client-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.client-card:hover {
  border-color: #a5b4fc;
  box-shadow: 0 4px 16px rgba(0,0,0,0.09);
}

.client-avatar {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1a56db, #0694a2);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}

/* ============================================================
   CHART CONTAINERS
   ============================================================ */
.chart-container {
  position: relative;
  background: white;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 20px;
}

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-bar {
  position: relative;
}

.search-bar input {
  padding-left: 36px;
}

.search-bar .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 13px;
  pointer-events: none;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #9ca3af;
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
  opacity: 0.4;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  #sidebar { width: 64px; }
  #sidebar .logo-text, #sidebar nav a span, #sidebar .nav-section-label { display: none; }
  #main-content { margin-left: 64px; }
  .page-body { padding: 16px; }
  .page-header { padding: 14px 16px; }
  .kanban-col { min-width: 220px; }
}
