/* GrantFlow — global styles */

:root {
  --primary: #2196F3;
  --primary-dark: #1976D2;
  --primary-light: #BBDEFB;
  --success: #4CAF50;
  --ink: #212121;
  --ink-soft: #757575;
  --divider: #BDBDBD;
  --canvas: #F5F7FA;
  --warning: #F59E0B;
  --danger: #EF4444;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .font-display {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* Layout shell */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--primary-dark);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px 28px;
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-mark {
  width: 32px;
  height: 32px;
  background: #fff;
  color: var(--primary-dark);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.sidebar-section {
  padding: 0 12px;
  margin-bottom: 8px;
}

.sidebar-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
  padding: 12px 12px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-link.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.sidebar-link .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.sidebar-footer .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-footer .meta { line-height: 1.3; min-width: 0; }
.sidebar-footer .meta strong { display: block; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer .meta span { color: rgba(255, 255, 255, 0.6); font-size: 12px; }

/* Main column */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid #E5E7EB;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.breadcrumb {
  font-size: 13px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb strong {
  color: var(--ink);
  font-weight: 600;
}

.topbar-search {
  margin-left: auto;
  flex: 1;
  max-width: 420px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 14px;
  background: var(--canvas);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.topbar-search input:focus {
  border-color: var(--primary);
  background: #fff;
}

.topbar-search .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--ink-soft);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  position: relative;
  transition: background 0.15s, color 0.15s;
}

.icon-button:hover {
  background: var(--canvas);
  color: var(--ink);
}

.icon-button .badge-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid #fff;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--canvas);
  border-radius: 999px;
  border: 1px solid #E5E7EB;
  font-size: 13px;
  font-weight: 500;
}

.user-pill .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
}

.content {
  padding: 28px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 28px;
  margin: 0 0 6px;
}

.page-header p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

/* Cards */
.card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.card-pad { padding: 20px; }
.card-pad-lg { padding: 24px; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #F1F2F4;
}

.card-header h3 {
  font-size: 16px;
  margin: 0;
  font-weight: 700;
}

.card-header .muted {
  color: var(--ink-soft);
  font-size: 13px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn .icon { width: 16px; height: 16px; }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: #fff;
  border-color: #E5E7EB;
  color: var(--ink);
}
.btn-secondary:hover { background: var(--canvas); border-color: var(--divider); }

.btn-ghost {
  color: var(--ink-soft);
}
.btn-ghost:hover { background: var(--canvas); color: var(--ink); }

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover { background: #3d8b40; }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }

.btn-icon-only {
  padding: 8px;
  width: 36px;
  height: 36px;
}

/* Stats card */
.stat-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-card .stat-icon {
  width: 32px;
  height: 32px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.stat-card .stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
}

.stat-card .stat-trend {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* Badges & pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--canvas);
  color: var(--ink-soft);
  border: 1px solid #E5E7EB;
  white-space: nowrap;
}

.badge.primary { background: var(--primary-light); color: var(--primary-dark); border-color: transparent; }
.badge.success { background: #DCFCE7; color: #166534; border-color: transparent; }
.badge.warning { background: #FEF3C7; color: #92400E; border-color: transparent; }
.badge.danger { background: #FEE2E2; color: #991B1B; border-color: transparent; }
.badge.muted { background: #F3F4F6; color: #4B5563; border-color: transparent; }
.badge.outline { background: transparent; }

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* Status pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-new { background: #E0F2FE; color: #075985; }
.status-reviewing { background: #FEF3C7; color: #92400E; }
.status-preparing { background: #DBEAFE; color: #1E40AF; }
.status-submitted { background: var(--primary-light); color: var(--primary-dark); }
.status-won { background: #DCFCE7; color: #166534; }
.status-lost { background: #F3F4F6; color: #4B5563; }
.status-archived { background: #E5E7EB; color: #6B7280; }

/* Priority dots */
.priority-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.priority-high { background: var(--danger); }
.priority-medium { background: var(--warning); }
.priority-low { background: #94A3B8; }

/* Fit score circle */
.fit-circle {
  --pct: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background:
    conic-gradient(var(--success) calc(var(--pct) * 1%), #E5E7EB 0);
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
}
.fit-circle::before {
  content: '';
  position: absolute;
  inset: 5px;
  background: #fff;
  border-radius: 50%;
}
.fit-circle .label {
  position: relative;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}

.fit-circle.medium { background: conic-gradient(var(--warning) calc(var(--pct) * 1%), #E5E7EB 0); }
.fit-circle.low { background: conic-gradient(var(--danger) calc(var(--pct) * 1%), #E5E7EB 0); }

.fit-circle.lg {
  width: 96px;
  height: 96px;
}
.fit-circle.lg::before { inset: 8px; }
.fit-circle.lg .label { font-size: 22px; }

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  padding: 12px 16px;
  background: var(--canvas);
  border-bottom: 1px solid #E5E7EB;
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #F1F2F4;
  vertical-align: middle;
}

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

.data-table .funder-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.funder-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

/* Opportunity card */
.opp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.opp-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}

.opp-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 6px 18px rgba(33, 150, 243, 0.08);
}

.opp-card-head {
  display: flex;
  gap: 12px;
}

.opp-card-head .body {
  flex: 1;
  min-width: 0;
}

.opp-title {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.opp-funder {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
}

.opp-overview {
  font-size: 13px;
  color: #4B5563;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.opp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.opp-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  padding-top: 12px;
  border-top: 1px solid #F1F2F4;
  font-size: 13px;
}

.opp-meta .label { color: var(--ink-soft); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; margin-bottom: 2px; }
.opp-meta .value { font-weight: 600; }

.opp-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #F1F2F4;
}

/* Filter sidebar */
.filters {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 88px;
}

.filter-group .label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin-bottom: 8px;
  display: block;
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.checklist label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}
.checklist label:hover { background: var(--canvas); }
.checklist input[type=checkbox] { accent-color: var(--primary); }

.tag-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-toggle button {
  border: 1px solid #E5E7EB;
  background: #fff;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 500;
}
.tag-toggle button:hover { border-color: var(--primary); color: var(--primary-dark); }
.tag-toggle button.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }

/* Range presets */
.range-presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.range-presets button {
  border: 1px solid #E5E7EB;
  background: #fff;
  border-radius: 8px;
  padding: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
}
.range-presets button.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }

/* Toggle group */
.toggle-group {
  display: inline-flex;
  background: var(--canvas);
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.toggle-group button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  border: none;
  background: transparent;
}
.toggle-group button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

/* Kanban */
.kanban-scroll {
  overflow-x: auto;
  padding-bottom: 12px;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(260px, 1fr));
  gap: 12px;
  min-width: 1860px;
}

.kanban-col {
  background: var(--canvas);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 400px;
}

.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  padding: 4px 6px 6px;
}

.kanban-col-head .count {
  background: #fff;
  color: var(--ink-soft);
  font-size: 11px;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid #E5E7EB;
}

.kanban-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 12px;
  cursor: grab;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}

.kanban-card:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  border-color: var(--primary-light);
}

.kanban-card:active { cursor: grabbing; transform: scale(0.99); }

.kanban-card .title {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.35;
  margin-bottom: 4px;
  font-family: 'Outfit', sans-serif;
}

.kanban-card .funder {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.kanban-card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.kanban-card .next-step {
  font-size: 12px;
  color: var(--ink-soft);
  border-top: 1px solid #F1F2F4;
  padding-top: 8px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kanban-col-head.col-new { color: #075985; }
.kanban-col-head.col-reviewing { color: #92400E; }
.kanban-col-head.col-preparing { color: #1E40AF; }
.kanban-col-head.col-submitted { color: var(--primary-dark); }
.kanban-col-head.col-won { color: #166534; }
.kanban-col-head.col-lost { color: #4B5563; }
.kanban-col-head.col-archived { color: #6B7280; }

.kanban-col-head .col-marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.col-new .col-marker { background: #0EA5E9; }
.col-reviewing .col-marker { background: var(--warning); }
.col-preparing .col-marker { background: #3B82F6; }
.col-submitted .col-marker { background: var(--primary-dark); }
.col-won .col-marker { background: var(--success); }
.col-lost .col-marker { background: #94A3B8; }
.col-archived .col-marker { background: #6B7280; }

/* Avatars */
.avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 11px;
  color: #fff;
  flex-shrink: 0;
}
.avatar-circle.sm { width: 22px; height: 22px; font-size: 10px; }
.avatar-circle.md { width: 32px; height: 32px; font-size: 12px; }
.avatar-circle.lg { width: 40px; height: 40px; font-size: 14px; }

.avatar-andrei { background: #2563EB; }
.avatar-maria { background: #DB2777; }
.avatar-elena { background: #7C3AED; }
.avatar-radu { background: #059669; }

.avatar-stack {
  display: flex;
}
.avatar-stack .avatar-circle:not(:first-child) {
  margin-left: -8px;
  border: 2px solid #fff;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid #E5E7EB;
  margin-bottom: 24px;
}

.tab {
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tab:hover { color: var(--ink); }
.tab.active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

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

/* Slide-over */
.slide-over-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 60;
}
.slide-over-backdrop.open { opacity: 1; pointer-events: auto; }

.slide-over {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 480px;
  max-width: 100vw;
  background: #fff;
  z-index: 61;
  transform: translateX(100%);
  transition: transform 0.25s ease-out;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 24px rgba(15, 23, 42, 0.12);
}
.slide-over.open { transform: translateX(0); }
.slide-over-head {
  padding: 20px 24px;
  border-bottom: 1px solid #E5E7EB;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.slide-over-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.slide-over-foot {
  padding: 16px 24px;
  border-top: 1px solid #E5E7EB;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 70;
  padding: 24px;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }

.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(8px);
  transition: transform 0.2s;
}
.modal.lg { max-width: 880px; }
.modal-backdrop.open .modal { transform: translateY(0); }

.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid #E5E7EB;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 80;
  pointer-events: none;
}
.toast {
  background: #1E293B;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
  animation: toast-in 0.2s ease-out;
  max-width: 360px;
  pointer-events: auto;
}
.toast.success { background: var(--success); }
.toast .icon { width: 18px; height: 18px; flex-shrink: 0; }
@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Forms */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.form-row .hint {
  font-size: 12px;
  color: var(--ink-soft);
}

.input, .select, .textarea {
  width: 100%;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15);
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.5; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Empty state */
.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-soft);
}
.empty .icon-wrap {
  width: 56px;
  height: 56px;
  background: var(--canvas);
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  color: var(--ink-soft);
}
.empty h4 { color: var(--ink); margin: 0 0 6px; font-size: 16px; }
.empty p { margin: 0; font-size: 14px; }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, #F1F2F4 25%, #E5E7EB 50%, #F1F2F4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: 6px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Mobile */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease-out;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.16);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-toggle { display: inline-flex !important; }
  .topbar-search { display: none; }
  .content { padding: 20px 16px; }
  .opp-grid { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
}

.mobile-toggle { display: none; }

.mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.mobile-backdrop.open { opacity: 1; pointer-events: auto; }

/* Activity feed */
.activity-list { display: flex; flex-direction: column; gap: 16px; }
.activity-item { display: flex; gap: 12px; align-items: flex-start; }
.activity-item .body { flex: 1; min-width: 0; font-size: 13px; }
.activity-item .body strong { font-weight: 600; }
.activity-item .body .meta { color: var(--ink-soft); font-size: 12px; margin-top: 2px; display: block; }

/* Comments */
.comment {
  display: flex;
  gap: 12px;
}
.comment .body {
  flex: 1;
  background: var(--canvas);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
}
.comment .body header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.comment .body header strong { font-weight: 600; }
.comment .body header span { color: var(--ink-soft); font-size: 12px; }

/* Checklist */
.task-checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.task-checklist .item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--canvas);
}
.task-checklist .item.checked { opacity: 0.62; }
.task-checklist .item.checked .text { text-decoration: line-through; }
.task-checklist .item input[type=checkbox] { accent-color: var(--primary); width: 16px; height: 16px; }
.task-checklist .item .text { font-size: 14px; flex: 1; }

/* Files */
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #F1F2F4;
}
.file-row:hover { background: var(--canvas); }
.file-row .icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: grid;
  place-items: center;
}
.file-row .body { flex: 1; min-width: 0; }
.file-row .body strong { display: block; font-weight: 600; font-size: 14px; }
.file-row .body span { font-size: 12px; color: var(--ink-soft); }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #E5E7EB;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Generic helpers */
.divider-line { height: 1px; background: #E5E7EB; margin: 16px 0; }
.text-ink { color: var(--ink); }
.text-soft { color: var(--ink-soft); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary-dark); }
.muted { color: var(--ink-soft); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 20px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.text-xs { font-size: 12px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.text-2xl { font-size: 22px; }
.text-3xl { font-size: 28px; }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr; }
}

.layout-2col {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: flex-start;
}
@media (max-width: 1024px) {
  .layout-2col { grid-template-columns: 1fr; }
  .filters { position: static; }
}

.layout-detail {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: flex-start;
}
@media (max-width: 1024px) {
  .layout-detail { grid-template-columns: 1fr; }
}

.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px;
}

.list-bullets {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  line-height: 1.55;
}

.kv-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kv-list .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  gap: 12px;
}
.kv-list .row .label {
  color: var(--ink-soft);
  font-weight: 500;
}
.kv-list .row .value {
  font-weight: 600;
  text-align: right;
}

/* Responsive table wrapper */
.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  background: #fff;
}

/* Welcome banner */
.welcome-banner {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  padding: 28px 32px;
  border-radius: 14px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.welcome-banner::after {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.welcome-banner h1 {
  color: #fff;
  font-size: 26px;
  margin: 0 0 4px;
}
.welcome-banner p {
  color: rgba(255,255,255,0.85);
  margin: 0 0 18px;
  font-size: 14px;
}
.welcome-banner .quick-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  position: relative;
  z-index: 1;
}
.welcome-banner .quick-stats div { font-size: 13px; }
.welcome-banner .quick-stats strong {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

/* Days-left badge */
.days-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.days-badge.danger { background: #FEE2E2; color: #991B1B; }
.days-badge.warning { background: #FEF3C7; color: #92400E; }
.days-badge.success { background: #DCFCE7; color: #166534; }

/* Misc utilities */
.divider-v { width: 1px; background: #E5E7EB; align-self: stretch; }
.hover-row { transition: background 0.15s; }
.hover-row:hover { background: var(--canvas); }

.dot-sep::before { content: '•'; margin: 0 6px; color: var(--divider); }

.notif-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  z-index: 50;
  display: none;
}
.notif-popover.open { display: block; }
.notif-popover header {
  padding: 14px 16px;
  border-bottom: 1px solid #F1F2F4;
  font-weight: 600;
}
.notif-popover ul { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.notif-popover li {
  padding: 12px 16px;
  display: flex;
  gap: 10px;
  border-bottom: 1px solid #F1F2F4;
  font-size: 13px;
}
.notif-popover li:last-child { border-bottom: none; }
.notif-popover li .meta { color: var(--ink-soft); font-size: 12px; margin-top: 2px; display: block; }

.relative { position: relative; }
