/* Ztatus Growth CRM - Professional Corporate & Mobile-Responsive Stylesheet */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  
  --navy: #0f172a;
  --navy-light: #1e293b;
  --navy-hover: #334155;
  
  --ink: #0f172a;
  --ink-light: #334155;
  --muted: #64748b;
  --subtle: #94a3b8;
  
  --line: #e2e8f0;
  --line-light: #f1f5f9;
  --paper: #f8fafc;
  --card-bg: #ffffff;
  
  --success: #16a34a;
  --success-bg: #dcfce7;
  --success-border: #bbf7d0;
  
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --warning-border: #fde68a;
  
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --danger-border: #fecaca;
  
  --info: #0284c7;
  --info-bg: #e0f2fe;
  --info-border: #bae6fd;
  
  --whatsapp: #25D366;
  --whatsapp-hover: #1ebd5b;
  --whatsapp-bg: #e8faf0;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  
  --sidebar-w: 250px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* -------------------------------------------------------------
 * Typography & Utilities
 * ------------------------------------------------------------- */
h1, h2, h3, h4, h5 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 8px;
}
h1 { font-size: 24px; letter-spacing: -0.02em; }
h2 { font-size: 18px; letter-spacing: -0.01em; margin-bottom: 14px; }
h3 { font-size: 15px; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  text-decoration: underline;
}

.text-muted { color: var(--muted); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-bold { font-weight: 600; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* -------------------------------------------------------------
 * Desktop Sidebar Navigation
 * ------------------------------------------------------------- */
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--navy);
  color: #e2e8f0;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.12);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  text-decoration: none;
  padding: 4px 8px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
}
.brand:hover {
  text-decoration: none;
}
.brand .logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  object-fit: contain;
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}
.brand b {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand small {
  display: block;
  color: #94a3b8;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}
nav small {
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin: 16px 8px 6px;
}
nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #cbd5e1;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s ease;
}
nav a .icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  opacity: 0.85;
}
nav a:hover {
  background: var(--navy-hover);
  color: #ffffff;
  text-decoration: none;
}
nav a.active {
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
nav a.active .icon {
  opacity: 1;
}

.userfoot {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.userfoot-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: #3b82f6;
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.userfoot-details {
  min-width: 0;
}
.userfoot-details b {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ffffff;
}
.userfoot-details small {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  text-transform: capitalize;
}
.btn-signout {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-signout:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* -------------------------------------------------------------
 * Main Workspace Layout
 * ------------------------------------------------------------- */
main {
  margin-left: var(--sidebar-w);
  padding: 28px clamp(16px, 3vw, 44px) 80px;
  max-width: 1600px;
  min-height: 100vh;
}

header.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
header.page-header .header-meta small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}
header.page-header h1 {
  margin: 4px 0 0;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* -------------------------------------------------------------
 * Mobile Topbar & Bottom Nav (Hidden on Desktop)
 * ------------------------------------------------------------- */
.mobile-topbar {
  display: none;
}
.mobile-bottom-nav {
  display: none;
}
.sidebar-overlay {
  display: none;
}

/* -------------------------------------------------------------
 * Buttons & Form Controls
 * ------------------------------------------------------------- */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink-light);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.4;
  white-space: nowrap;
}
button:hover, .btn:hover {
  background: var(--paper);
  border-color: #cbd5e1;
  text-decoration: none;
}

.primary, .btn-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}
.primary:hover, .btn-primary:hover {
  background: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
  color: #ffffff !important;
}

.danger, .btn-danger {
  background: #ffffff !important;
  border-color: var(--danger-border) !important;
  color: var(--danger) !important;
}
.danger:hover, .btn-danger:hover {
  background: var(--danger-bg) !important;
  border-color: var(--danger) !important;
}

.btn-success {
  background: var(--success) !important;
  border-color: var(--success) !important;
  color: #ffffff !important;
}
.btn-success:hover {
  background: #15803d !important;
}

.btn-whatsapp {
  background: var(--whatsapp) !important;
  border-color: var(--whatsapp) !important;
  color: #ffffff !important;
  font-weight: 600;
}
.btn-whatsapp:hover {
  background: var(--whatsapp-hover) !important;
}

.btn-sm {
  padding: 5px 9px;
  font-size: 12px;
}
.btn-icon {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
}

select, input:not([type=checkbox]):not([type=radio]), textarea {
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 9px 12px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}
select:focus, input:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
textarea {
  min-height: 90px;
  resize: vertical;
}

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-light);
  margin-bottom: 6px;
}
.form-group {
  margin-bottom: 14px;
}
.form-group label {
  margin-bottom: 4px;
}
.form-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  display: block;
}

/* -------------------------------------------------------------
 * Hero Banner & KPI Stats Cards
 * ------------------------------------------------------------- */
.hero {
  background: linear-gradient(130deg, #0f172a 0%, #1e3a8a 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.hero::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}
.hero small {
  color: #38bdf8;
  letter-spacing: 1.5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.hero h2 {
  color: #ffffff;
  font-size: 24px;
  margin: 6px 0 4px;
}
.hero p {
  margin: 0;
  color: #cbd5e1;
  font-size: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.stat-card-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-card-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 16px;
}
.stat-card strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.stat-card-foot {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--muted);
}

/* -------------------------------------------------------------
 * Panels & Card Containers
 * ------------------------------------------------------------- */
.panel {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.panel-header h2 {
  margin: 0;
}

/* -------------------------------------------------------------
 * Badges & Pills (Stage, Temperature, Due)
 * ------------------------------------------------------------- */
.pill, .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.4;
}

/* Stage Badges */
.badge-stage-new { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.badge-stage-contacted { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.badge-stage-qualified { background: #e0e7ff; color: #4338ca; border: 1px solid #c7d2fe; }
.badge-stage-proposal { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.badge-stage-negotiation { background: #fae8ff; color: #86198f; border: 1px solid #f5d0fe; }
.badge-stage-won { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.badge-stage-lost { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* Temperature Badges */
.badge-temp-hot { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-temp-warm { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.badge-temp-cold { background: #ecfeff; color: #0891b2; border: 1px solid #a5f3fc; }

/* Due Badges */
.badge-due-overdue { background: #fee2e2; color: #b91c1c; font-weight: 700; border: 1px solid #fca5a5; }
.badge-due-today { background: #fef3c7; color: #b45309; font-weight: 700; border: 1px solid #fde68a; }
.badge-due-upcoming { background: #f1f5f9; color: #475569; }

/* Score Badge */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 12px;
  color: #ffffff;
}
.score-high { background: #16a34a; }
.score-mid { background: #d97706; }
.score-low { background: #dc2626; }

/* -------------------------------------------------------------
 * Table & Data Views
 * ------------------------------------------------------------- */
.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 760px;
  background: #ffffff;
  font-size: 13.5px;
}
th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 14px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-light);
  color: var(--ink-light);
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: none;
}
tr:hover td {
  background: #fbfcfe;
}
td a.lead-link {
  color: var(--ink);
  text-decoration: none;
}
td a.lead-link b {
  display: block;
  font-size: 14px;
  color: var(--ink);
}
td a.lead-link small {
  display: block;
  font-weight: 400;
  color: var(--muted);
}
td a.lead-link:hover b {
  color: var(--primary);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* -------------------------------------------------------------
 * Filters & Search Bar
 * ------------------------------------------------------------- */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.filter-tab {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.filter-tab:hover {
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
}
.filter-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.search-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.search-form input[type=search], .search-form input[name=q] {
  max-width: 280px;
  min-width: 200px;
}
.search-form select {
  width: auto;
  min-width: 130px;
}

/* -------------------------------------------------------------
 * Pipeline Kanban Board & Stage Navigation
 * ------------------------------------------------------------- */
.pipeline-stage-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}
.pipeline-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.pipeline-tab:hover {
  background: #ffffff;
  color: var(--ink);
  border-color: #cbd5e1;
}
.pipeline-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}
.pipeline-tab .tab-badge {
  background: rgba(0, 0, 0, 0.08);
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-size: 11px;
}
.pipeline-tab.active .tab-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Kanban Board: Viewport-Pinned Container */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: stretch;
  padding-bottom: 8px;
}

/* Custom Scrollbars for Kanban Board */
.kanban-board::-webkit-scrollbar {
  height: 10px;
}
.kanban-board::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 6px;
}
.kanban-board::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 6px;
}
.kanban-board::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.kanban-col {
  width: 295px;
  min-width: 295px;
  max-width: 295px;
  background: #f1f5f9;
  border-radius: var(--radius-md);
  padding: 12px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  max-height: 100%;
}

.kanban-col-head {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: #e2e8f0;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.kanban-col-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.kanban-col-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}
.kanban-col-meta {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  background: #ffffff;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
}
.kanban-col-total {
  font-size: 11.5px;
  color: var(--muted);
  padding: 0 4px;
  font-weight: 600;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.kanban-cards-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.kanban-cards-scroll::-webkit-scrollbar {
  width: 6px;
}
.kanban-cards-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.kanban-cards-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.kanban-cards-scroll::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.kanban-empty {
  text-align: center;
  color: var(--muted);
  padding: 30px 10px;
  font-size: 12px;
}

.kanban-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  box-sizing: border-box;
}
.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}
.kanban-card a.card-title {
  color: var(--ink);
  text-decoration: none;
}
.kanban-card a.card-title b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}
.kanban-card a.card-title small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.kanban-card .card-value {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}
.kanban-card .card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line-light);
}
.kanban-stage-form select {
  font-size: 11px;
  padding: 4px 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
}

/* Desktop Viewport-Lock Rules specifically for Pipeline */
@media (min-width: 769px) {
  body.page-pipeline {
    height: 100vh;
    overflow: hidden;
  }
  body.page-pipeline main {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 22px 28px 12px 28px;
    box-sizing: border-box;
    overflow: hidden;
    max-width: 100%;
  }
  body.page-pipeline .page-header {
    flex-shrink: 0;
    margin-bottom: 12px;
  }
  body.page-pipeline .pipeline-stage-tabs {
    flex-shrink: 0;
  }
  body.page-pipeline .kanban-board {
    flex: 1 1 auto;
    min-height: 0;
  }
}

/* -------------------------------------------------------------
 * Lead Profile View (2-Column SaaS Layout)
 * ------------------------------------------------------------- */
.lead-header-banner {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}
.lead-header-main h1 {
  margin: 0 0 4px;
  font-size: 22px;
}
.lead-header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.quick-contact-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.columns {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  align-items: start;
}
.fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}
.fields-grid .full-width {
  grid-column: 1 / -1;
}

/* Activity Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.timeline-item {
  position: relative;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}
.timeline-item.completed {
  opacity: 0.75;
  background: #f8fafc;
}
.timeline-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.timeline-item-head b {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.timeline-item-head small {
  color: var(--muted);
  font-size: 11.5px;
}
.timeline-item p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-light);
  white-space: pre-line;
}
.timeline-item-due {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

/* -------------------------------------------------------------
 * Reports & Visual Charts
 * ------------------------------------------------------------- */
.chart-bar-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}
.chart-bar-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chart-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
}
.chart-bar-bg {
  width: 100%;
  height: 10px;
  background: var(--line-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.chart-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* -------------------------------------------------------------
 * Alerts & Flash Messages
 * ------------------------------------------------------------- */
.alert {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: #0369a1;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.alert-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: #15803d;
}
.alert-error {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: #b91c1c;
}

/* -------------------------------------------------------------
 * Login Page
 * ------------------------------------------------------------- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 10% 20%, #1e293b 0%, #0f172a 90%);
  padding: 20px;
}
.loginbox {
  width: min(420px, 100%);
  padding: 36px 32px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
}
.loginbox .logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  display: block;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  object-fit: contain;
}
.loginbox small {
  display: block;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 1.2px;
}
.loginbox h1 {
  font-size: 24px;
  margin: 6px 0 20px;
}
.loginbox .primary {
  width: 100%;
  padding: 11px;
  margin-top: 14px;
}
.loginbox .foot-note {
  margin-top: 20px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
}

/* -------------------------------------------------------------
 * Mobile-First Responsive Breakpoints
 * ------------------------------------------------------------- */

/* Tablet (Max 1024px) */
@media (max-width: 1024px) {
  :root {
    --sidebar-w: 220px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .columns {
    grid-template-columns: 1fr;
  }
}

/* Mobile Devices (Max 768px) */
@media (max-width: 768px) {
  /* Mobile Header Topbar */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--navy);
    color: #ffffff;
    padding: 0 16px;
    z-index: 150;
    box-shadow: var(--shadow-md);
  }
  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
  }
  .mobile-brand:hover {
    text-decoration: none;
  }
  .mobile-brand .logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
    display: block;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
  }
  .btn-hamburger {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 22px;
    padding: 6px;
    cursor: pointer;
  }
  .mobile-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* Offcanvas Drawer Sidebar */
  aside {
    transform: translateX(-100%);
    width: 280px;
    z-index: 200;
  }
  aside.drawer-open {
    transform: translateX(0);
  }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .sidebar-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
  .drawer-close {
    display: block;
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
  }

  /* Main View adjustments */
  main {
    margin-left: 0;
    padding: 16px 14px 90px; /* space for bottom nav */
  }

  /* Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #ffffff;
    border-top: 1px solid var(--line);
    z-index: 150;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  }
  .mobile-bottom-nav a, .mobile-bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    background: transparent;
    border: none;
    padding: 0;
  }
  .mobile-bottom-nav a .nav-icon, .mobile-bottom-nav button .nav-icon {
    font-size: 18px;
  }
  .mobile-bottom-nav a.active {
    color: var(--primary);
  }
  .mobile-bottom-nav .nav-add-btn {
    background: var(--primary);
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    margin: -14px auto 0;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4);
    display: grid;
    place-items: center;
    font-size: 22px;
  }

  /* Responsive Cards for Tables on Mobile */
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-card {
    padding: 14px 16px;
  }
  .stat-card strong {
    font-size: 22px;
  }

  .fields-grid {
    grid-template-columns: 1fr;
  }

  .lead-header-banner {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
  }
  .quick-contact-actions {
    width: 100%;
  }
  .quick-contact-actions a, .quick-contact-actions button {
    flex: 1;
  }

  /* Responsive Mobile Lead Cards in Table */
  .tablewrap.desktop-table {
    display: none !important;
  }
  .mobile-card-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
  }
  .mobile-lead-card {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: var(--shadow-sm);
  }
  .mobile-lead-card-head {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    margin-bottom: 8px !important;
  }
  .mobile-lead-card-head b {
    font-size: 15px !important;
    color: var(--ink);
    display: block !important;
  }
  .mobile-lead-card-head small {
    display: block !important;
    color: var(--muted);
    font-size: 12px !important;
  }
  .mobile-lead-card-actions {
    display: flex !important;
    gap: 8px !important;
    margin-top: 12px !important;
    padding-top: 10px !important;
    border-top: 1px solid var(--line-light);
  }
  .mobile-lead-card-actions a, .mobile-lead-card-actions button {
    flex: 1 1 0 !important;
    text-align: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    padding: 7px 10px !important;
  }

  /* Mobile Pipeline Kanban & Stage Tabs */
  body.page-pipeline {
    height: auto !important;
    overflow-y: auto !important;
  }
  body.page-pipeline main {
    height: auto !important;
    display: block !important;
    overflow-y: visible !important;
  }
  .pipeline-stage-tabs {
    position: sticky;
    top: 56px;
    background: var(--paper);
    z-index: 100;
    padding: 8px 0;
    margin-bottom: 12px;
  }
  .kanban-board {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    padding-bottom: 20px !important;
  }
  .kanban-col {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    max-height: none !important;
    padding: 12px !important;
    background: #f1f5f9 !important;
    border-radius: var(--radius-md) !important;
    box-sizing: border-box !important;
  }
  .kanban-col-head {
    position: sticky;
    top: 104px;
    z-index: 90;
    background: #e2e8f0 !important;
    padding: 8px 10px !important;
    border-radius: var(--radius-sm) !important;
    margin-bottom: 8px !important;
  }
  .kanban-cards-scroll {
    overflow-y: visible !important;
    height: auto !important;
    max-height: none !important;
  }
  .kanban-card {
    background: #ffffff !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--radius-sm) !important;
    padding: 12px !important;
    margin-bottom: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .forecast-ribbon {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    padding: 10px 12px !important;
  }
  .forecast-item b {
    font-size: 16px !important;
  }

  .tasks-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .task-card-footer {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .quick-peek-drawer {
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1200 !important;
  }
  .quick-peek-body {
    padding-bottom: calc(95px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .bulk-actions-bar {
    position: fixed !important;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    left: 10px !important;
    right: 10px !important;
    transform: none !important;
    width: auto !important;
    max-width: calc(100vw - 20px) !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
    padding: 10px 12px !important;
    z-index: 1000 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
  }
  .bulk-actions-inner {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    white-space: normal !important;
  }
  .bulk-info-group {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
  }
  .bulk-divider.desktop-only {
    display: none !important;
  }
  .bulk-form {
    width: 100% !important;
    display: block !important;
  }
  .bulk-controls {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .bulk-select {
    flex: 1 1 160px !important;
    height: 36px !important;
    font-size: 13px !important;
  }
  .bulk-sub-select.visible {
    display: block !important;
    flex: 1 1 100% !important;
    width: 100% !important;
  }
  .bulk-btn-apply {
    height: 36px !important;
    flex: 0 0 auto !important;
  }
  .bulk-btn-cancel.desktop-only {
    display: none !important;
  }
  .bulk-cancel-mobile {
    display: inline-flex !important;
    background: none !important;
    border: none !important;
    color: #94a3b8 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    padding: 2px 6px !important;
  }

  /* Prevent iOS zoom on input focus */
  input, select, textarea {
    font-size: 16px !important;
  }

  main {
    padding: 14px 12px calc(90px + env(safe-area-inset-bottom, 0px)) 12px !important;
  }

  .mobile-bottom-nav {
    height: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }
}

/* Tablet (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  :root {
    --sidebar-w: 210px;
  }
  aside {
    width: 210px !important;
    padding: 20px 12px !important;
  }
  main {
    margin-left: 210px !important;
    padding: 20px 16px 40px !important;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .forecast-ribbon {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .tasks-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }
  .columns {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .fields-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .quick-peek-drawer {
    width: 440px !important;
  }
}

/* Small Mobile Devices (<= 640px) */
@media (max-width: 640px) {
  .template-modal {
    width: 100% !important;
    max-width: 100% !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    transform: translateY(100%) !important;
    border-radius: 16px 16px 0 0 !important;
    max-height: 85vh !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    border-bottom: none !important;
  }
  .template-modal.open {
    transform: translateY(0) !important;
  }
  .command-palette {
    top: 10px !important;
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    max-height: 82vh !important;
  }
  .command-results {
    max-height: 52vh !important;
  }
  .quick-contact-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .quick-contact-actions a, .quick-contact-actions button {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
    padding: 9px 8px !important;
    font-size: 12.5px !important;
  }
}

/* -------------------------------------------------------------
 * Enterprise Deal Health, Rotten Alerts & Badges
 * ------------------------------------------------------------- */
.badge-health {
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.badge-health-success {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #bbf7d0 !important;
}
.badge-health-warning {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}
.badge-health-danger {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1px solid #fecaca !important;
}
.badge-rotten {
  background: #fff1f2 !important;
  color: #e11d48 !important;
  border: 1px dashed #fda4af !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 2px 7px !important;
  border-radius: 999px !important;
}

/* -------------------------------------------------------------
 * Drag & Drop Kanban Polish
 * ------------------------------------------------------------- */
.kanban-card[draggable=true] {
  cursor: grab;
}
.kanban-card[draggable=true]:active {
  cursor: grabbing;
}
.kanban-card.is-dragging {
  opacity: 0.35 !important;
  transform: scale(0.97) !important;
  border: 2px dashed #6366f1 !important;
}
.kanban-col.drag-hover {
  background: #e0e7ff !important;
  outline: 2px dashed #4f46e5 !important;
}

/* -------------------------------------------------------------
 * Floating Bulk Actions Toolbar (Salesforce / Zoho style)
 * ------------------------------------------------------------- */
.bulk-actions-bar {
  position: fixed;
  bottom: 24px;
  left: calc(50% + 125px);
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  padding: 9px 16px;
  border-radius: 12px;
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.12);
  z-index: 1000;
  display: none;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  animation: slideUpFade 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUpFade {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.bulk-actions-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.bulk-info-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.bulk-check-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #2563eb;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
}
.bulk-count {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
}
.bulk-divider {
  width: 1px;
  height: 22px;
  background: #334155;
  flex-shrink: 0;
}
.bulk-form {
  margin: 0;
  display: inline-flex;
  align-items: center;
}
.bulk-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.bulk-select {
  background: #1e293b;
  color: #ffffff;
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  height: 32px;
  box-sizing: border-box;
}
.bulk-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}
.bulk-sub-select {
  display: none;
}
.bulk-sub-select.visible {
  display: inline-block;
}
.bulk-btn-apply {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  padding: 5px 14px !important;
  border-radius: 6px !important;
  height: 32px !important;
  font-size: 12.5px !important;
  white-space: nowrap !important;
}
.bulk-btn-apply:hover { background: #1d4ed8 !important; }
.bulk-btn-cancel {
  background: transparent !important;
  border-color: #475569 !important;
  color: #94a3b8 !important;
  font-weight: 600 !important;
  padding: 5px 10px !important;
  border-radius: 6px !important;
  height: 32px !important;
  font-size: 12.5px !important;
  white-space: nowrap !important;
}
.bulk-btn-cancel:hover { background: #1e293b !important; color: #ffffff !important; }
.bulk-cancel-mobile { display: none; }

/* -------------------------------------------------------------
 * Slide-Over Quick Peek Drawer (HubSpot / Salesforce style)
 * ------------------------------------------------------------- */
.quick-peek-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto !important;
  width: 480px;
  max-width: 90vw;
  background: #ffffff;
  box-shadow: -6px 0 28px rgba(0, 0, 0, 0.18);
  z-index: 1100;
  display: none;
  flex-direction: column;
  border-left: 1px solid #e2e8f0;
}
.quick-peek-drawer.open {
  display: flex !important;
}
.quick-peek-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  z-index: 1050;
  display: none;
}
.quick-peek-backdrop.active {
  display: block;
}
.quick-peek-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}
.quick-peek-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}
.quick-peek-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.quick-peek-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}
.quick-peek-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
}

/* -------------------------------------------------------------
 * WhatsApp Corporate Template Modal
 * ------------------------------------------------------------- */
.template-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: 540px;
  max-width: 92vw;
  max-height: 85vh;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
  z-index: 1200;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.template-modal.open {
  display: flex;
  transform: translate(-50%, -50%) scale(1);
}
.template-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 1150;
  display: none;
}
.template-backdrop.active {
  display: block;
}
.template-header {
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.template-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.template-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.15s ease;
}
.template-item:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}
.template-item b {
  display: block;
  font-size: 13.5px;
  color: #1e293b;
  margin-bottom: 4px;
}
.template-item p {
  margin: 0;
  font-size: 12.5px;
  color: #475569;
  line-height: 1.4;
}

/* -------------------------------------------------------------
 * Command Palette (Ctrl + K)
 * ------------------------------------------------------------- */
.command-palette {
  position: fixed;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 560px;
  max-width: 92vw;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35);
  z-index: 1300;
  display: none;
  overflow: hidden;
  border: 1px solid #cbd5e1;
}
.command-palette.open {
  display: block;
  animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalScaleIn {
  from { opacity: 0; transform: translate(-50%, -10px) scale(0.97); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
.command-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
  z-index: 1250;
  display: none;
}
.command-backdrop.active {
  display: block;
}
.command-input {
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
  border: none;
  border-bottom: 1px solid #e2e8f0;
  outline: none;
  background: #f8fafc;
  box-sizing: border-box;
  color: #0f172a;
}
.command-results {
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
}
.command-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 6px;
  text-decoration: none !important;
  color: #0f172a;
  transition: background 0.15s ease;
  cursor: pointer;
}
.command-item:hover, .command-item.selected {
  background: #eff6ff;
  color: #2563eb;
}
.command-item-title {
  font-weight: 600;
  font-size: 13.5px;
}
.command-item-badge {
  font-size: 11px;
  background: #e2e8f0;
  padding: 2px 7px;
  border-radius: 4px;
  color: #475569;
}

/* -------------------------------------------------------------
 * Pipeline Weighted Forecast Ribbon
 * ------------------------------------------------------------- */
.forecast-ribbon {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 14px;
  box-sizing: border-box;
}
.forecast-item small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 2px;
}
.forecast-item b {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}
.forecast-item.highlight b {
  color: #2563eb;
}

/* -------------------------------------------------------------
 * "My Day" Tasks Agenda Workspace (?page=tasks)
 * ------------------------------------------------------------- */
.tasks-agenda-container {
  width: 100%;
}
.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.task-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.task-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}
.task-card-overdue {
  border-left: 5px solid #ef4444;
}
.task-card-today {
  border-left: 5px solid #f59e0b;
}
.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.task-lead-link {
  text-decoration: none !important;
  color: #0f172a;
}
.task-lead-link b {
  display: block;
  font-size: 14.5px;
  color: #0f172a;
}
.task-lead-link small {
  display: block;
  color: #64748b;
  font-size: 12px;
}
.task-card-body {
  flex: 1;
}
.task-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.task-kind-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}
.task-note-text {
  margin: 0;
  font-size: 13px;
  color: #334155;
  line-height: 1.45;
}
.task-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}
.tasks-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  grid-column: 1 / -1;
}
.tasks-empty-icon {
  font-size: 44px;
  margin-bottom: 12px;
}
.tasks-empty-state h3 {
  font-size: 18px;
  margin: 0 0 6px;
  color: #0f172a;
}
.tasks-empty-state p {
  color: #64748b;
  margin: 0;
  font-size: 13.5px;
}

