@font-face {
  font-family: 'Space Grotesk';
  src: url('../assets/fonts/SpaceGrotesk-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/Inter-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/Inter-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../assets/fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* ════════════════════════════════════════════════════════════════════════════
   NXT Partners Pipeline — Design System & Component Styles
   Light theme | Inter + Space Grotesk + JetBrains Mono
   ════════════════════════════════════════════════════════════════════════════ */

/* ─── Custom Properties ─────────────────────────────────────────────────────── */

:root {
  /* Brand */
  --purple:          #7B61FF;
  --purple-light:    rgba(123, 97, 255, 0.10);
  --purple-mid:      rgba(123, 97, 255, 0.18);
  --purple-glow:     rgba(123, 97, 255, 0.22);
  --cyan:            #00B8D4;
  --cyan-light:      rgba(0, 184, 212, 0.10);
  --amber:           #F59E0B;
  --green:           #10B981;
  --red:             #EF4444;

  /* Background */
  --bg:              #FFFFFF;
  --bg-secondary:    #F5F5F7;
  --bg-tertiary:     #EEEEEF;

  /* Text */
  --text-primary:    #111111;
  --text-secondary:  rgba(0, 0, 0, 0.55);
  --text-tertiary:   rgba(0, 0, 0, 0.35);

  /* Borders */
  --border:          rgba(0, 0, 0, 0.06);
  --border-strong:   rgba(0, 0, 0, 0.12);
  --border-focus:    var(--purple);

  /* Radius */
  --radius-card:     12px;
  --radius-btn:      4px;
  --radius-pill:     99px;
  --radius-input:    6px;
  --radius-md:       8px;

  /* Shadows */
  --shadow-card:     0 1px 3px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-hover:    0 4px 16px rgba(0,0,0,0.10), 0 0 0 2px var(--purple-glow);
  --shadow-panel:    -4px 0 32px rgba(0,0,0,0.10);
  --shadow-toast:    0 4px 20px rgba(0,0,0,0.14);

  /* Nav */
  --nav-height:      56px;

  /* Typography */
  --font-body:       'Inter', -apple-system, sans-serif;
  --font-heading:    'Space Grotesk', -apple-system, sans-serif;
  --font-mono:       'JetBrains Mono', 'Fira Code', monospace;

  /* Transitions */
  --transition:      150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset & Base ──────────────────────────────────────────────────────────── */

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

html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-secondary);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

a {
  color: var(--purple);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: var(--font-body);
}

img, svg {
  display: block;
}

/* ─── Layout Shell ──────────────────────────────────────────────────────────── */

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#mainContent {
  flex: 1;
  padding: 24px;
  padding-top: calc(var(--nav-height) + 24px);
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

/* ─── Navigation ────────────────────────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
  z-index: 100;
  backdrop-filter: blur(8px);
}

/* Logo */
.nav__logo {
  display: block;
  line-height: 0;
  flex-shrink: 0;
  text-decoration: none;
}

/* Tabs */
.nav__tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav__tab {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 5px 12px;
  border-radius: var(--radius-btn);
  color: var(--text-secondary);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

.nav__tab:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.nav__tab--active {
  color: var(--purple);
  background: var(--purple-light);
}

/* Sync Status */
.nav__sync {
  margin-left: auto;
  flex-shrink: 0;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.03em;
}

.sync-status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.sync-status--syncing  { color: var(--amber); }
.sync-status--connected{ color: var(--green); }
.sync-status--error    { color: var(--red); }
.sync-status--offline  { color: var(--text-tertiary); }

.sync-status--syncing .sync-status__dot {
  animation: pulse-dot 1.2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.75); }
}

/* ─── Views ─────────────────────────────────────────────────────────────────── */

.view {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.view__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.view__title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-primary);
}

.view__subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ─── Sections ──────────────────────────────────────────────────────────────── */

.section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.section__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.section__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.section__count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
}

/* ─── Stat Cards ─────────────────────────────────────────────────────────────── */

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.stat-card--warn {
  border-color: rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.04);
}

.stat-card--stages {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.stat-card__icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--purple-light);
  color: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card__body {
  flex: 1;
  min-width: 0;
}

.stat-card__value {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1;
  color: var(--text-primary);
}

.stat-card__label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Stage pills inside stat card */
.stage-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ─── Stage Pill ─────────────────────────────────────────────────────────────── */

.stage-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  background: color-mix(in srgb, var(--stage-color, var(--purple)) 14%, transparent);
  color: var(--stage-color, var(--purple));
  border: 1px solid color-mix(in srgb, var(--stage-color, var(--purple)) 25%, transparent);
  white-space: nowrap;
}

.stage-pill--none {
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  border-color: var(--border);
}

/* ─── Table ──────────────────────────────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.table__th {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  text-align: left;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--bg);
  position: sticky;
  top: 0;
}

.table__row {
  transition: background var(--transition);
}

.table__row + .table__row {
  border-top: 1px solid var(--border);
}

.table__row--clickable {
  cursor: pointer;
}

.table__row--clickable:hover {
  background: var(--bg-secondary);
}

.table__cell {
  padding: 12px 20px;
  vertical-align: middle;
  color: var(--text-primary);
}

.table__cell--name {
  font-weight: 500;
}

.table__cell--muted {
  color: var(--text-secondary);
  font-size: 13px;
}

.table__cell--date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.table__cell--action {
  width: 1%;
  white-space: nowrap;
  text-align: right;
  padding-right: 12px;
}

.client-name {
  font-weight: 600;
  color: var(--text-primary);
}

.client-project {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 1px;
  font-style: italic;
}

.client-company,
.contact-email,
.contact-name {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.contact-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 13.5px;
}

.no-value {
  color: var(--text-tertiary);
}

/* Status badges in table */
.status-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge--archived {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.referral-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  background: var(--cyan-light);
  border: 1px solid rgba(0, 184, 212, 0.2);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

/* ─── Kanban Board ───────────────────────────────────────────────────────────── */

.view--kanban {
  height: calc(100vh - var(--nav-height) - 48px);
  overflow: hidden;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 12px;
  height: 100%;
  overflow-x: auto;
  padding-bottom: 8px;
}

/* ─── Kanban Column ─────────────────────────────────────────────────────────── */

.kanban-column {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  min-height: 0;
}

.kanban-column__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 2px solid var(--column-color, var(--border));
  background: var(--bg);
  flex-shrink: 0;
}

.kanban-column__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kanban-column__title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  flex: 1;
}

.kanban-column__count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
}

.kanban-column__cards {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background var(--transition);
}

.kanban-column__cards--drag-over {
  background: var(--purple-light);
}

.kanban-column__empty {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  padding: 20px 10px;
  font-style: italic;
}

/* ─── Kanban Card ───────────────────────────────────────────────────────────── */

.kanban-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-card);
  cursor: grab;
  transition: transform var(--transition), box-shadow var(--transition);
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.kanban-card--dragging {
  opacity: 0.5;
  cursor: grabbing;
  transform: rotate(2deg) scale(1.02);
}

.kanban-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kanban-card__avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--stage-color, var(--purple)) 15%, transparent);
  color: var(--stage-color, var(--purple));
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.kanban-card__info {
  flex: 1;
  min-width: 0;
}

.kanban-card__name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-card__company {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-card__email {
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.kanban-card__date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
}

.kanban-card__open {
  opacity: 0;
  transition: opacity var(--transition);
  flex-shrink: 0;
}

.kanban-card:hover .kanban-card__open {
  opacity: 1;
}

/* ─── Detail Panel ───────────────────────────────────────────────────────────── */

.detail-panel {
  position: fixed;
  top: var(--nav-height);
  right: 0;
  width: 50%;
  height: calc(100vh - var(--nav-height));
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-panel);
  z-index: 90;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  overflow: hidden;
}

.detail-panel--open {
  transform: translateX(0);
}

/* Detail header */
.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg);
}

.detail-header__info {
  flex: 1;
  min-width: 0;
}

.detail-header__name {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-header__stage {
  margin-top: 3px;
}

.detail-header__close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}

.detail-header__close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Detail tabs */
.detail-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  gap: 0;
  flex-shrink: 0;
  background: var(--bg);
}

.detail-tabs__tab {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 10px 14px;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
}

.detail-tabs__tab:hover {
  color: var(--text-primary);
}

.detail-tabs__tab--active {
  color: var(--purple);
  border-bottom-color: var(--purple);
}

/* Detail panes */
.detail-pane {
  display: none;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.detail-pane--active {
  display: flex;
  flex-direction: column;
}

/* ─── Overview Pane ──────────────────────────────────────────────────────────── */

.detail-overview {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-section__title {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.detail-fields {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.detail-field {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 14px;
  font-size: 13.5px;
}

.detail-field + .detail-field {
  border-top: 1px solid var(--border);
}

.detail-field__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  width: 88px;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

.detail-field__value {
  color: var(--text-primary);
  font-size: 13.5px;
  flex: 1;
  word-break: break-word;
}

.detail-link {
  color: var(--purple);
  font-size: 13.5px;
}

.detail-empty {
  font-size: 13px;
  color: var(--text-tertiary);
  font-style: italic;
  padding: 4px 0;
}

/* Stage Selector */
.stage-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stage-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 6px 14px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all var(--transition);
  cursor: pointer;
}

.stage-btn__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--stage-color, var(--purple));
  flex-shrink: 0;
  opacity: 0.4;
}

.stage-btn:hover:not(:disabled) {
  border-color: var(--stage-color, var(--purple));
  color: var(--stage-color, var(--purple));
  background: color-mix(in srgb, var(--stage-color, var(--purple)) 8%, transparent);
}

.stage-btn--active {
  border-color: var(--stage-color, var(--purple)) !important;
  color: var(--stage-color, var(--purple)) !important;
  background: color-mix(in srgb, var(--stage-color, var(--purple)) 10%, transparent) !important;
  cursor: default;
}

.stage-btn--active .stage-btn__dot {
  opacity: 1;
}

/* Notes */
.detail-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notes-textarea {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  font-size: 13.5px;
  color: var(--text-primary);
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  line-height: 1.5;
}

.notes-textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-light);
}

/* ─── Docs Panel ─────────────────────────────────────────────────────────────── */

.docs-panel {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.doc-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc-section__header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-section__title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

.doc-section__folder {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  padding: 1px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.doc-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.doc-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform var(--transition), box-shadow var(--transition);
}

.doc-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.doc-card__icon {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.doc-card__body {
  flex: 1;
  min-width: 0;
}

.doc-card__name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}

.doc-card__date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
}

.doc-card__actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.doc-empty-type {
  font-size: 12px;
  color: var(--text-tertiary);
  font-style: italic;
  padding: 6px 0;
}

/* Doc status badge */
.doc-status-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--status-color, #9CA3AF) 14%, transparent);
  color: var(--status-color, #9CA3AF);
  border: 1px solid color-mix(in srgb, var(--status-color, #9CA3AF) 25%, transparent);
}

/* ─── Chat Panel ─────────────────────────────────────────────────────────────── */

.chat-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.chat-bubble {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 88%;
}

.chat-bubble--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-bubble--assistant {
  align-self: flex-start;
}

.chat-bubble__avatar {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--purple-light);
  color: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.chat-bubble__content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-bubble__text {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}

.chat-bubble--user .chat-bubble__text {
  background: var(--purple);
  color: #FFFFFF;
  border-bottom-right-radius: 3px;
}

.chat-bubble--assistant .chat-bubble__text {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 3px;
}

.chat-bubble__time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  padding: 0 2px;
}

.chat-bubble--user .chat-bubble__time {
  text-align: right;
}

/* Typing dots */
.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: typing-bounce 1.2s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50%       { transform: translateY(-4px); opacity: 1; }
}

/* Chat input */
.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  resize: none;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  color: var(--text-primary);
  background: var(--bg-secondary);
  line-height: 1.5;
  max-height: 120px;
  overflow-y: auto;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.chat-input:focus {
  outline: none;
  border-color: var(--purple);
  background: var(--bg);
  box-shadow: 0 0 0 3px var(--purple-light);
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Chat empty */
.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-tertiary);
}

.chat-empty__icon {
  opacity: 0.5;
}

.chat-empty__text {
  font-size: 13px;
  max-width: 240px;
}

/* Inline code in chat */
.inline-code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--purple);
}

/* ─── Referrals ──────────────────────────────────────────────────────────────── */

.referral-link {
  color: var(--purple);
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--transition);
}

.referral-link:hover {
  opacity: 0.75;
}

/* Referrer cards */
.referrer-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding: 16px 20px;
}

.referrer-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.referrer-card__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.referrer-card__company {
  font-size: 12px;
  color: var(--text-secondary);
}

.referrer-card__stats {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  margin-top: 4px;
}

.referrer-card__count {
  font-weight: 600;
  color: var(--purple);
}

.referrer-card__active {
  color: var(--green);
}

/* ─── Activity List ─────────────────────────────────────────────────────────── */

.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 20px;
  cursor: pointer;
  transition: background var(--transition);
}

.activity-item + .activity-item {
  border-top: 1px solid var(--border);
}

.activity-item:hover {
  background: var(--bg-secondary);
}

.activity-item__left {
  flex: 1;
  min-width: 0;
}

.activity-item__company {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.activity-item__meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.activity-item__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.activity-item__time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
}

/* ─── Add-Client Form ────────────────────────────────────────────────────────── */

.add-form {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.add-form__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.add-form__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.add-form__close {
  color: var(--text-secondary);
}

.add-form__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.add-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

/* ─── Forms ──────────────────────────────────────────────────────────────────── */

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.required {
  color: var(--red);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-input);
  font-size: 13.5px;
  color: var(--text-primary);
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-tertiary);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}

/* ─── Buttons ────────────────────────────────────────────────────────────────── */

.btn {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 7px 14px;
  border-radius: var(--radius-btn);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary */
.btn--primary {
  background: var(--purple);
  color: #FFFFFF;
  border-color: var(--purple);
}

.btn--primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--purple) 85%, black);
  border-color: color-mix(in srgb, var(--purple) 85%, black);
}

/* Ghost */
.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Secondary */
.btn--secondary {
  background: transparent;
  color: var(--purple);
  border-color: var(--purple);
}

.btn--secondary:hover:not(:disabled) {
  background: rgba(123, 97, 255, 0.08);
}

/* Warning */
.btn--warning {
  color: var(--amber);
}

.btn--warning:hover {
  background: rgba(245, 158, 11, 0.10);
}

/* Icon */
.btn--icon {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  border: none;
  background: transparent;
}

.btn--icon:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn--icon-danger:hover {
  background: rgba(239, 68, 68, 0.08);
  color: var(--red);
}

/* Sizes */
.btn--sm {
  font-size: 11px;
  padding: 5px 11px;
}

.btn--xs {
  font-size: 11px;
  padding: 3px 9px;
}

/* ─── Loading Skeletons ───────────────────────────────────────────────────────── */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 25%,
    var(--bg-tertiary) 50%,
    var(--bg-secondary) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton--icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.skeleton--line {
  height: 13px;
  border-radius: 4px;
}

.skeleton--line-sm  { width: 40%; }
.skeleton--line-md  { width: 60%; }
.skeleton--line-lg  { width: 90%; }

/* ─── Empty State ────────────────────────────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 56px 24px;
  text-align: center;
}

.empty-state__icon {
  opacity: 0.4;
  margin-bottom: 4px;
}

.empty-state__title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
}

.empty-state__subtitle {
  font-size: 13px;
  color: var(--text-tertiary);
  max-width: 280px;
}

/* ─── Toast Notifications ────────────────────────────────────────────────────── */

#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--text-primary);
  color: #FFFFFF;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-toast);
  min-width: 220px;
  max-width: 360px;
  pointer-events: auto;

  /* Start hidden + shifted down */
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.toast--visible {
  opacity: 1;
  transform: translateY(0);
}

.toast__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.toast__msg {
  flex: 1;
  line-height: 1.4;
}

.toast--success { background: #111111; }
.toast--error   { background: #DC2626; }
.toast--warning { background: #D97706; }
.toast--info    { background: #2563EB; }

/* ─── Detail Field Inputs (inline editable) ─────────────────────────────────── */

.detail-field--full {
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
}

.detail-field--full .detail-field__label {
  width: auto;
}

.detail-field__input,
.detail-field__select,
.detail-field__textarea {
  flex: 1;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-input);
  padding: 3px 6px;
  font-size: 13.5px;
  color: var(--text-primary);
  font-family: var(--font-body);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.detail-field__input:hover,
.detail-field__select:hover,
.detail-field__textarea:hover {
  border-color: var(--border-strong);
  background: var(--bg-secondary);
}

.detail-field__input:focus,
.detail-field__select:focus,
.detail-field__textarea:focus {
  outline: none;
  border-color: var(--purple);
  background: var(--bg);
  box-shadow: 0 0 0 3px var(--purple-light);
}

.detail-field__select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}

.detail-field__textarea {
  resize: vertical;
  min-height: 60px;
  line-height: 1.5;
}

/* Saved indicator */
.detail-saved-indicator {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green);
  letter-spacing: 0.04em;
  transition: opacity 400ms ease;
  position: absolute;
  top: 12px;
  right: 20px;
}

.detail-overview {
  position: relative;
}

/* Project brief */
.detail-brief {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.detail-brief__textarea {
  width: 100%;
  font-size: 13px;
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 80px;
}

.detail-brief__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

.detail-brief--empty .detail-brief__placeholder {
  font-size: 13px;
  color: var(--text-tertiary);
  font-style: italic;
}

/* Brief status indicator */
.brief-status { font-size: 0.8125rem; color: var(--text-secondary); }
.brief-status--ready { color: var(--text-primary); font-weight: 400; }
.brief-status--missing { color: var(--text-tertiary); }

/* Brief content — rendered markdown */
.brief-content {
  max-height: 400px;
  overflow-y: auto;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  white-space: normal;
  word-break: break-word;
}

.brief-content .brief-heading {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-top: 10px;
  margin-bottom: 2px;
}

.brief-content .brief-heading:first-child {
  margin-top: 0;
}

.brief-content .brief-heading--h1 {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Drive link */
.detail-drive-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--purple);
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-input);
  border: 1px solid var(--purple-mid);
  background: var(--purple-light);
  transition: all var(--transition);
}

.detail-drive-link:hover {
  background: var(--purple-mid);
  text-decoration: none;
}

/* ─── Docs Panel Extras ──────────────────────────────────────────────────────── */

.docs-panel__toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 4px;
}

.docs-panel__note {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 12px 2px 4px;
}

.doc-card__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.doc-section__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.doc-card__feedback {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.doc-feedback-textarea {
  font-size: 12.5px;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 7px 10px;
  resize: none;
  min-height: 56px;
  line-height: 1.5;
  transition: border-color var(--transition), background var(--transition);
}

.doc-feedback-textarea:focus {
  outline: none;
  border-color: var(--purple);
  background: var(--bg);
  box-shadow: 0 0 0 3px var(--purple-light);
}

/* Status-specific action rows */
.doc-card__flagged-row,
.doc-card__generating-row,
.doc-card__done-row,
.doc-card__error-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.doc-card__flagged-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--amber);
}

.doc-card__generating-row {
  color: var(--text-secondary);
  font-size: 13px;
}

.doc-card__error-msg {
  font-size: 12.5px;
  color: var(--red);
  flex: 1;
}

.doc-card__hint {
  font-size: 12px;
  color: var(--text-tertiary);
  font-style: italic;
}

/* Spinner */
.doc-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--purple-mid);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Drive preview iframe */
.doc-card__preview {
  margin-top: 10px;
}

.doc-card__iframe {
  width: 100%;
  height: 360px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.doc-card__preview-toggle {
  margin-left: auto;
}

/* ─── Kanban Column Header Right ────────────────────────────────────────────── */

.kanban-column__header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.kanban-add-btn {
  border-radius: var(--radius-pill) !important;
  padding: 2px 8px !important;
  font-size: 14px !important;
  line-height: 1;
}

/* Kanban card contact line */
.kanban-card__contact {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Kanban card project name subtitle */
.kanban-card__project {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
}

/* Kanban card action buttons row */
.kanban-card__actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition);
}

.kanban-card:hover .kanban-card__actions {
  opacity: 1;
}

/* Individual buttons inside actions are always full-opacity within the group */
.kanban-card__actions .kanban-card__open {
  opacity: 1;
}

/* Duplicate button */
.kanban-card__duplicate {
  color: var(--text-tertiary);
}

.kanban-card__duplicate:hover {
  background: var(--purple-light);
  color: var(--purple);
}

/* Kanban doc status badge */
.kanban-doc-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.kanban-doc-badge--generating {
  background: var(--purple-light);
  color: var(--purple);
  border: 1px solid var(--purple-mid);
}

.kanban-doc-badge--flagged {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.kanban-doc-badge--error {
  background: rgba(239, 68, 68, 0.10);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.20);
}

.kanban-doc-badge--done {
  background: rgba(16, 185, 129, 0.10);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.22);
}

/* ─── Kanban Add Client Overlay ──────────────────────────────────────────────── */

.kanban-add-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.40);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.kanban-add-modal {
  width: 100%;
  max-width: 520px;
  animation: modal-pop 180ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-pop {
  from { transform: scale(0.94); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* ─── Kanban Card Archive Button ────────────────────────────────────────────── */

.kanban-card__archive {
  opacity: 0;
  transition: opacity var(--transition);
  flex-shrink: 0;
}

.kanban-card:hover .kanban-card__archive {
  opacity: 1;
}

/* ─── Kanban Archived Section ────────────────────────────────────────────────── */

.kanban-archived {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.kanban-archived__toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border-strong);
  background: transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 14px;
}

.kanban-archived__toggle:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.kanban-archived__chevron {
  transition: transform var(--transition);
  flex-shrink: 0;
}

.kanban-archived__chevron--open {
  transform: rotate(180deg);
}

.kanban-archived__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 8px;
}

.kanban-archived__grid .kanban-card--archived {
  width: 220px;
  flex-shrink: 0;
}

/* ─── Kanban Card — Archived State ──────────────────────────────────────────── */

.kanban-card--archived {
  opacity: 0.65;
  filter: grayscale(0.4);
  cursor: pointer;
  border-style: dashed;
}

.kanban-card--archived:hover {
  opacity: 0.9;
  filter: grayscale(0);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* ─── Toast / Snackbar ───────────────────────────────────────────────────────── */

#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  min-width: 260px;
  max-width: 380px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.14), 0 1px 4px rgba(0,0,0,0.08);
  pointer-events: auto;
  cursor: default;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast--visible {
  opacity: 1;
  transform: translateY(0);
}

.toast--success { background: #16a34a; }
.toast--error   { background: #dc2626; }
.toast--warning { background: #d97706; }
.toast--info    { background: #2563eb; }

.toast__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  opacity: 0.9;
}

.toast__msg {
  flex: 1;
  letter-spacing: 0.01em;
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .detail-panel {
    width: 60%;
  }
}

@media (max-width: 768px) {
  #mainContent {
    padding: 16px;
    padding-top: calc(var(--nav-height) + 16px);
  }

  .nav {
    padding: 0 16px;
    gap: 12px;
  }

  .detail-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .kanban-board {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

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

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

@media (max-width: 480px) {
  .kanban-board {
    grid-template-columns: minmax(240px, 1fr);
  }

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

  #toastContainer {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast {
    min-width: unset;
    max-width: unset;
  }
}
