/* ============================
   Investor Hub - Styles
   ============================ */

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --white: #ffffff;
  --green-50: #f0fdf4;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --amber-50: #fffbeb;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --red-50: #fef2f2;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --blue-50: #eff6ff;
  --blue-500: #3b82f6;
  --purple-50: #faf5ff;
  --purple-500: #a855f7;
  --sidebar-width: 220px;
  --header-height: 64px;
  --radius: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --transition: 150ms ease;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray-800);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}

/* ============================
   Layout
   ============================ */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ============================
   Sidebar
   ============================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--gray-100);
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius);
}

.brand-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-800);
}

.brand-highlight {
  color: var(--primary);
}

.sidebar-nav {
  flex: 1;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: var(--gray-600);
  font-size: 14px;
  font-family: var(--font);
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--transition);
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

.nav-item.active {
  background: var(--primary-50);
  color: var(--primary);
  font-weight: 600;
}

.nav-item svg {
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 8px;
  border-top: 1px solid var(--gray-100);
}

/* ============================
   Main Content
   ============================ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
  min-height: var(--header-height);
}

.header-left h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.01em;
}

.view-subtitle {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ============================
   Buttons
   ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border-color: var(--gray-300);
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.btn-danger {
  background: var(--white);
  color: var(--red-600);
  border-color: var(--gray-300);
}

.btn-danger:hover {
  background: var(--red-50);
  border-color: var(--red-500);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-500);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}

/* ============================
   Views Container
   ============================ */
.views-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

/* ============================
   Stats Grid (Dashboard)
   ============================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.stat-icon-blue { background: var(--blue-50); color: var(--blue-500); }
.stat-icon-green { background: var(--green-50); color: var(--green-600); }
.stat-icon-purple { background: var(--purple-50); color: var(--purple-500); }
.stat-icon-amber { background: var(--amber-50); color: var(--amber-600); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.1;
}

.stat-label {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
  margin-top: 2px;
}

/* ============================
   Dashboard Grid
   ============================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 16px;
}

.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-100);
}

.card-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
}

.card-body {
  padding: 16px 18px;
}

.pipeline-summary-card {
  grid-row: span 2;
}

/* ============================
   Pipeline Overview (Dashboard)
   ============================ */
.pipeline-overview {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pipeline-stage-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.pipeline-stage-label {
  width: 90px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
  flex-shrink: 0;
}

.pipeline-stage-bar {
  flex: 1;
  height: 28px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.pipeline-stage-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 300ms ease;
  min-width: 4px;
}

.pipeline-stage-fill.sourcing { background: var(--blue-500); }
.pipeline-stage-fill.screening { background: var(--primary); }
.pipeline-stage-fill.dd { background: var(--amber-500); }
.pipeline-stage-fill.termsheet { background: var(--purple-500); }
.pipeline-stage-fill.closed { background: var(--green-500); }
.pipeline-stage-fill.passed { background: var(--gray-400); }

.pipeline-stage-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  width: 24px;
  text-align: right;
  flex-shrink: 0;
}

/* ============================
   Dashboard Tasks / Meetings list
   ============================ */
.dashboard-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
}

.dashboard-item:last-child {
  border-bottom: none;
}

.dashboard-item-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.dashboard-item-content {
  flex: 1;
  min-width: 0;
}

.dashboard-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-800);
  line-height: 1.4;
}

.dashboard-item-meta {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 2px;
}

.dashboard-item .priority-high {
  color: var(--red-500);
}

.dashboard-item .priority-medium {
  color: var(--amber-500);
}

.dashboard-item .priority-low {
  color: var(--gray-400);
}

.dashboard-item.completed .dashboard-item-title {
  text-decoration: line-through;
  color: var(--gray-400);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  color: var(--gray-400);
  gap: 8px;
}

.empty-state p {
  font-size: 13px;
}

/* ============================
   Pipeline Board (Kanban)
   ============================ */
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  height: calc(100vh - var(--header-height) - 100px);
  min-height: 500px;
}

.pipeline-column {
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pipeline-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--white);
  border-bottom: 2px solid var(--gray-200);
  flex-shrink: 0;
}

.pipeline-column-header h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.pipeline-column-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 1px 8px;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
}

.pipeline-column-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pipeline-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.pipeline-card:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow);
}

.pipeline-card h5 {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 4px;
}

.pipeline-card-meta {
  font-size: 11px;
  color: var(--gray-500);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pipeline-card-tags {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.pipeline-card-tag {
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--primary-50);
  color: var(--primary);
}

.pipeline-card-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-100);
}

.stage-select {
  font-size: 11px;
  padding: 3px 6px;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  font-family: var(--font);
  color: var(--gray-600);
  background: var(--white);
  cursor: pointer;
  flex: 1;
}

/* ============================
   Toolbar
   ============================ */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  flex: 1;
  max-width: 320px;
}

.search-box svg {
  color: var(--gray-400);
  flex-shrink: 0;
}

.search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  font-family: var(--font);
  color: var(--gray-800);
  width: 100%;
}

.search-box input::placeholder {
  color: var(--gray-400);
}

.filter-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.select-input {
  padding: 7px 28px 7px 10px;
  font-size: 13px;
  font-family: var(--font);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--gray-700);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.select-input:hover {
  border-color: var(--gray-300);
}

/* ============================
   Data Table
   ============================ */
.table-container {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: auto;
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}

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

.data-table tr:hover td {
  background: var(--gray-50);
}

.data-table .company-name {
  font-weight: 600;
  color: var(--gray-800);
}

.stage-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
}

.stage-badge.sourcing { background: var(--blue-50); color: var(--blue-500); }
.stage-badge.screening { background: var(--primary-50); color: var(--primary); }
.stage-badge.dd { background: var(--amber-50); color: var(--amber-600); }
.stage-badge.termsheet { background: var(--purple-50); color: var(--purple-500); }
.stage-badge.closed { background: var(--green-50); color: var(--green-600); }
.stage-badge.passed { background: var(--gray-100); color: var(--gray-500); }

.table-actions {
  display: flex;
  gap: 4px;
}

/* ============================
   Meetings List
   ============================ */
.meetings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.meeting-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.meeting-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.meeting-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
}

.meeting-card-date {
  font-size: 12px;
  color: var(--gray-500);
  white-space: nowrap;
  margin-left: 12px;
}

.meeting-card-company {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  background: var(--primary-50);
  padding: 1px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.meeting-card-notes {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 8px;
  max-height: 80px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.meeting-card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.meeting-tag {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--gray-100);
  color: var(--gray-600);
}

.meeting-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--gray-100);
}

.meeting-card-attendees {
  font-size: 11px;
  color: var(--gray-500);
}

/* ============================
   Tasks List
   ============================ */
.tasks-list {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}

.task-item:last-child {
  border-bottom: none;
}

.task-item:hover {
  background: var(--gray-50);
}

.task-checkbox {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--gray-300);
  border-radius: 4px;
  cursor: pointer;
  appearance: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.task-checkbox:checked {
  background: var(--green-500);
  border-color: var(--green-500);
  position: relative;
}

.task-checkbox:checked::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -1px;
}

.task-content {
  flex: 1;
  min-width: 0;
}

.task-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-800);
  line-height: 1.4;
}

.task-item.completed .task-title {
  text-decoration: line-through;
  color: var(--gray-400);
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.task-priority {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}

.task-priority.high { background: var(--red-50); color: var(--red-600); }
.task-priority.medium { background: var(--amber-50); color: var(--amber-600); }
.task-priority.low { background: var(--gray-100); color: var(--gray-500); }

.task-company-link {
  font-size: 11px;
  color: var(--primary);
  font-weight: 500;
}

.task-due {
  font-size: 11px;
  color: var(--gray-500);
}

.task-due.overdue {
  color: var(--red-500);
  font-weight: 600;
}

.task-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* ============================
   Contacts Grid
   ============================ */
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.contact-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.contact-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-100);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

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

.contact-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
}

.contact-role {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 1px;
}

.contact-org {
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 1px;
}

.contact-detail {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

.contact-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* ============================
   Modal
   ============================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  backdrop-filter: blur(2px);
}

.modal-overlay.active {
  display: block;
}

.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 540px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 101;
  overflow: hidden;
  flex-direction: column;
}

.modal.active {
  display: flex;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--gray-400);
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-600);
}

.modal-body {
  overflow-y: auto;
  padding: 20px;
}

/* ============================
   Forms
   ============================ */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--font);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--gray-800);
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-100);
}

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

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-100);
}

/* ============================
   Toast
   ============================ */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--gray-900);
  color: var(--white);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 300ms ease, toastOut 300ms ease 2.7s forwards;
  min-width: 240px;
}

.toast.success { background: var(--green-600); }
.toast.error { background: var(--red-500); }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ============================
   Scrollbar
   ============================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 1200px) {
  .pipeline-board {
    grid-template-columns: repeat(3, 1fr);
    height: auto;
    min-height: auto;
  }

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

  .pipeline-summary-card {
    grid-row: span 1;
  }
}

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

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

  .pipeline-board {
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar {
    width: 56px;
  }

  .sidebar .brand-text,
  .sidebar .nav-item span {
    display: none;
  }

  .sidebar-brand {
    justify-content: center;
    padding: 14px 8px;
  }

  .nav-item {
    justify-content: center;
    padding: 10px;
  }

  .sidebar-footer .nav-item span {
    display: none;
  }

  .content-header {
    padding: 12px 16px;
  }

  .views-container {
    padding: 16px;
  }

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

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .pipeline-board {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    max-width: none;
  }

  .filter-group {
    flex-wrap: wrap;
  }
}


/* MoM Badge */
.mom-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.mom-badge.positive {
  background: var(--green-50);
  color: var(--green-600);
}
.mom-badge.negative {
  background: var(--red-50);
  color: var(--red-500);
}

/* Pipeline Card Amount */
.pipeline-card-amount {
  font-size: 12px;
  color: var(--gray-700);
  margin-top: 4px;
  padding: 2px 0;
}
