/* ─── CSS Variables ──────────────────────────────────────────────────────── */
:root {
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;
  --white:     #ffffff;

  --teal-600:  #0d9488;
  --teal-500:  #14b8a6;
  --teal-100:  #ccfbf1;

  --blue-500:  #3b82f6;
  --blue-100:  #dbeafe;
  --purple-500:#a855f7;
  --purple-100:#f3e8ff;
  --amber-500: #f59e0b;
  --amber-100: #fef3c7;
  --gray-400:  #9ca3af;
  --gray-100:  #f3f4f6;

  --red-500:   #ef4444;
  --red-100:   #fee2e2;
  --green-500: #22c55e;

  /* Version colors */
  --v-mvp:     var(--teal-600);
  --v-v1:      var(--blue-500);
  --v-v2:      var(--purple-500);
  --v-v3:      var(--amber-500);
  --v-oos:     var(--gray-400);

  --radius:    8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1),  0 4px 6px rgba(0,0,0,.05);
  --transition: all .15s ease;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--slate-100);
  color: var(--slate-800);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ─── Login Screen ───────────────────────────────────────────────────────── */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--slate-800);
}
.login-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.login-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: .25rem;
}
.login-card p {
  font-size: .875rem;
  color: var(--slate-600);
  margin-bottom: 1.75rem;
}
.login-card input[type="password"] {
  width: 100%;
  padding: .65rem .875rem;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius);
  font-size: .9375rem;
  margin-bottom: 1rem;
  outline: none;
  transition: var(--transition);
}
.login-card input[type="password"]:focus { border-color: var(--teal-600); box-shadow: 0 0 0 3px var(--teal-100); }
.login-card .btn-login {
  width: 100%;
  padding: .7rem;
  background: var(--teal-600);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: .9375rem;
  font-weight: 600;
  transition: var(--transition);
}
.login-card .btn-login:hover { background: var(--teal-500); }
.login-error {
  display: none;
  color: var(--red-500);
  font-size: .8125rem;
  margin-top: .5rem;
}
.login-error.visible { display: block; }

/* ─── App Shell ──────────────────────────────────────────────────────────── */
#app-screen { display: none; flex-direction: column; min-height: 100vh; }
#app-screen.visible { display: flex; }

/* ─── Header ─────────────────────────────────────────────────────────────── */
.app-header {
  background: var(--slate-800);
  color: var(--white);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 58px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.header-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--teal-500);
  white-space: nowrap;
  letter-spacing: -.01em;
}
.header-brand span { color: var(--white); opacity: .6; margin: 0 .35rem; }
.project-selector {
  flex: 1;
  max-width: 280px;
}
.project-selector select {
  width: 100%;
  padding: .4rem .7rem;
  background: var(--slate-700);
  color: var(--white);
  border: 1px solid var(--slate-600);
  border-radius: 6px;
  font-size: .875rem;
  outline: none;
  cursor: pointer;
}
.project-selector select:focus { border-color: var(--teal-500); }
.header-counts {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  font-size: .75rem;
}
.hcount {
  display: flex;
  align-items: center;
  gap: .3rem;
  background: var(--slate-700);
  border-radius: 999px;
  padding: .2rem .6rem;
  white-space: nowrap;
}
.hcount-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.header-actions {
  display: flex;
  gap: .5rem;
  margin-left: auto;
}
.btn-icon {
  background: transparent;
  border: 1px solid var(--slate-600);
  color: var(--slate-200);
  padding: .35rem .7rem;
  border-radius: 6px;
  font-size: .8125rem;
  display: flex;
  align-items: center;
  gap: .35rem;
  transition: var(--transition);
}
.btn-icon:hover { background: var(--slate-700); border-color: var(--teal-500); color: var(--white); }

/* ─── Toolbar ─────────────────────────────────────────────────────────────── */
.toolbar {
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  padding: .625rem 1.5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.view-toggle {
  display: flex;
  background: var(--slate-100);
  border-radius: 7px;
  padding: 3px;
  gap: 2px;
}
.view-btn {
  padding: .3rem .75rem;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--slate-600);
  font-size: .8125rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .3rem;
  transition: var(--transition);
}
.view-btn.active {
  background: var(--white);
  color: var(--teal-600);
  box-shadow: var(--shadow-sm);
}
.filter-group { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.filter-label { font-size: .75rem; color: var(--slate-500); margin-right: .15rem; }
.filter-btn {
  padding: .25rem .65rem;
  border-radius: 999px;
  border: 1.5px solid var(--slate-200);
  background: var(--white);
  font-size: .75rem;
  color: var(--slate-600);
  font-weight: 500;
  transition: var(--transition);
}
.filter-btn:hover { border-color: var(--teal-500); color: var(--teal-600); }
.filter-btn.active {
  background: var(--teal-600);
  border-color: var(--teal-600);
  color: var(--white);
}
.search-box {
  margin-left: auto;
  position: relative;
}
.search-box input {
  padding: .35rem .75rem .35rem 2rem;
  border: 1.5px solid var(--slate-200);
  border-radius: 6px;
  font-size: .875rem;
  width: 210px;
  outline: none;
  transition: var(--transition);
  background: var(--slate-50);
}
.search-box input:focus { border-color: var(--teal-500); background: var(--white); width: 260px; }
.search-icon {
  position: absolute;
  left: .55rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
  pointer-events: none;
  font-size: .85rem;
}
.toolbar-right { display: flex; gap: .5rem; align-items: center; }
.btn-add {
  padding: .35rem .85rem;
  background: var(--teal-600);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-size: .8125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .3rem;
  transition: var(--transition);
}
.btn-add:hover { background: var(--teal-500); }
.btn-export {
  padding: .35rem .85rem;
  background: transparent;
  color: var(--slate-700);
  border: 1.5px solid var(--slate-200);
  border-radius: 6px;
  font-size: .8125rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .3rem;
  transition: var(--transition);
}
.btn-export:hover { border-color: var(--teal-500); color: var(--teal-600); }
.btn-import {
  padding: .35rem .85rem;
  background: transparent;
  color: var(--slate-700);
  border: 1.5px solid var(--slate-200);
  border-radius: 6px;
  font-size: .8125rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .3rem;
  transition: var(--transition);
}
.btn-import:hover { border-color: var(--teal-500); color: var(--teal-600); }

/* ─── Main Content ──────────────────────────────────────────────────────── */
.app-main {
  flex: 1;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
}
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--slate-400);
}
.empty-state h3 { font-size: 1rem; margin-bottom: .5rem; }
.empty-state p  { font-size: .875rem; }

/* ─── Board View ────────────────────────────────────────────────────────── */
.category-section { margin-bottom: 1.5rem; }
.category-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  cursor: pointer;
  user-select: none;
  margin-bottom: .75rem;
}
.category-title {
  font-size: .8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--slate-600);
}
.category-badge {
  background: var(--slate-200);
  color: var(--slate-600);
  border-radius: 999px;
  padding: .1rem .5rem;
  font-size: .7rem;
  font-weight: 600;
}
.category-toggle {
  margin-left: auto;
  color: var(--slate-400);
  font-size: .75rem;
  transition: transform .2s;
}
.category-toggle.collapsed { transform: rotate(-90deg); }
.category-divider {
  flex: 1;
  height: 1px;
  background: var(--slate-200);
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: .875rem;
}
.cards-grid.collapsed { display: none; }

/* ─── Feature Card ──────────────────────────────────────────────────────── */
.feature-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid transparent;
  padding: .875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  transition: box-shadow .2s, transform .15s;
  position: relative;
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card-top { display: flex; align-items: flex-start; gap: .5rem; justify-content: space-between; }
.card-name {
  font-size: .9rem;
  font-weight: 600;
  color: var(--slate-800);
  flex: 1;
  line-height: 1.35;
}
.card-actions { display: flex; gap: .2rem; opacity: 0; transition: opacity .15s; }
.feature-card:hover .card-actions { opacity: 1; }
.card-action-btn {
  background: transparent;
  border: none;
  color: var(--slate-400);
  padding: .2rem .3rem;
  border-radius: 4px;
  font-size: .8rem;
  transition: var(--transition);
}
.card-action-btn:hover { background: var(--slate-100); color: var(--slate-700); }
.card-action-btn.delete:hover { background: var(--red-100); color: var(--red-500); }
.card-description {
  font-size: .8rem;
  color: var(--slate-500);
  line-height: 1.5;
}
.card-footer { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.tag {
  font-size: .7rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 999px;
}
.tag-complexity-low    { background: var(--teal-100);   color: var(--teal-600); }
.tag-complexity-medium { background: var(--blue-100);   color: var(--blue-500); }
.tag-complexity-high   { background: var(--amber-100);  color: #b45309; }
.tag-complexity-veryhigh { background: var(--red-100);  color: var(--red-500); }
.tag-priority-low      { background: var(--gray-100);   color: var(--slate-500); }
.tag-priority-medium   { background: var(--blue-100);   color: var(--blue-500); }
.tag-priority-high     { background: var(--amber-100);  color: #b45309; }
.tag-priority-critical { background: var(--red-100);    color: var(--red-500); }
.version-badge {
  margin-left: auto;
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 999px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}
.version-badge:hover { filter: brightness(1.1); transform: scale(1.05); }
.version-badge.v-MVP      { background: var(--teal-600);   color: #fff; }
.version-badge.v-V1       { background: var(--blue-500);   color: #fff; }
.version-badge.v-V2       { background: var(--purple-500); color: #fff; }
.version-badge.v-V3\\+    { background: var(--amber-500);  color: #fff; }
.version-badge.v-Out-of-Scope { background: var(--gray-400); color: #fff; }

/* border-left per version */
.feature-card.v-MVP       { border-left-color: var(--teal-600);   }
.feature-card.v-V1        { border-left-color: var(--blue-500);   }
.feature-card.v-V2        { border-left-color: var(--purple-500); }
.feature-card.v-V3\\+     { border-left-color: var(--amber-500);  }
.feature-card.v-Out-of-Scope { border-left-color: var(--gray-400); }

/* ─── Table View ─────────────────────────────────────────────────────────── */
.features-table-wrap {
  overflow-x: auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.features-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.features-table thead { background: var(--slate-50); border-bottom: 2px solid var(--slate-200); }
.features-table th {
  padding: .65rem 1rem;
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--slate-500);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.features-table th:hover { color: var(--teal-600); }
.features-table th .sort-arrow { margin-left: .25rem; opacity: .4; font-size: .7rem; }
.features-table th.sorted .sort-arrow { opacity: 1; color: var(--teal-600); }
.features-table td {
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--slate-100);
  vertical-align: middle;
}
.features-table tbody tr:last-child td { border-bottom: none; }
.features-table tbody tr:hover { background: var(--slate-50); }
.table-name { font-weight: 600; color: var(--slate-800); }
.table-desc { color: var(--slate-500); font-size: .8125rem; max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-vborder { width: 4px; padding: 0; }
.table-vborder-dot { width: 4px; height: 100%; border-radius: 2px; min-height: 36px; display: block; }
.inline-select {
  padding: .2rem .4rem;
  border: 1.5px solid var(--slate-200);
  border-radius: 5px;
  font-size: .75rem;
  background: var(--white);
  cursor: pointer;
  outline: none;
}
.inline-select:focus { border-color: var(--teal-500); }
.table-actions { display: flex; gap: .2rem; justify-content: flex-end; }

/* ─── Summary Bar ────────────────────────────────────────────────────────── */
.summary-bar {
  background: var(--slate-800);
  padding: .65rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.summary-label {
  font-size: .75rem;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}
.summary-counts { display: flex; gap: .75rem; flex-wrap: wrap; }
.scount {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8125rem;
  color: var(--slate-200);
}
.scount-bar {
  height: 6px;
  border-radius: 3px;
  min-width: 4px;
  transition: width .3s ease;
}
.scount-num { font-weight: 700; }
.summary-total { margin-left: auto; font-size: .8125rem; color: var(--slate-400); }

/* ─── Version Reassign Popup ─────────────────────────────────────────────── */
.popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.popup-overlay.visible { display: flex; }
.popup-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  width: 100%;
  max-width: 320px;
}
.popup-title {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: .25rem;
}
.popup-sub {
  font-size: .8rem;
  color: var(--slate-500);
  margin-bottom: 1rem;
}
.version-options {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.version-option {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem .75rem;
  border-radius: 6px;
  border: 2px solid var(--slate-200);
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
  font-size: .875rem;
  font-weight: 500;
  color: var(--slate-700);
  text-align: left;
}
.version-option:hover { border-color: var(--teal-500); background: var(--slate-50); }
.version-option.selected { border-color: var(--teal-600); background: var(--teal-100); color: var(--slate-900); }
.vorb { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.popup-cancel {
  margin-top: .75rem;
  width: 100%;
  padding: .45rem;
  background: transparent;
  border: 1.5px solid var(--slate-200);
  border-radius: 6px;
  font-size: .8125rem;
  color: var(--slate-500);
  transition: var(--transition);
}
.popup-cancel:hover { border-color: var(--slate-400); color: var(--slate-700); }

/* ─── Feature / Project Modal ────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.visible { display: flex; }
.modal-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1.75rem;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.modal-title { font-size: 1.0625rem; font-weight: 700; color: var(--slate-800); }
.modal-close {
  background: transparent;
  border: none;
  color: var(--slate-400);
  font-size: 1.25rem;
  line-height: 1;
  padding: .2rem .4rem;
  border-radius: 4px;
  transition: var(--transition);
}
.modal-close:hover { background: var(--slate-100); color: var(--slate-700); }
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: .35rem;
}
.form-control {
  width: 100%;
  padding: .55rem .75rem;
  border: 1.5px solid var(--slate-200);
  border-radius: 6px;
  font-size: .875rem;
  outline: none;
  transition: var(--transition);
  background: var(--white);
  color: var(--slate-800);
}
.form-control:focus { border-color: var(--teal-500); box-shadow: 0 0 0 3px var(--teal-100); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: 1.5rem;
}
.btn-primary {
  padding: .5rem 1.25rem;
  background: var(--teal-600);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 600;
  transition: var(--transition);
}
.btn-primary:hover { background: var(--teal-500); }
.btn-secondary {
  padding: .5rem 1rem;
  background: transparent;
  color: var(--slate-600);
  border: 1.5px solid var(--slate-200);
  border-radius: 6px;
  font-size: .875rem;
  transition: var(--transition);
}
.btn-secondary:hover { border-color: var(--slate-400); color: var(--slate-800); }
.btn-danger {
  padding: .5rem 1rem;
  background: var(--red-100);
  color: var(--red-500);
  border: none;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 600;
  transition: var(--transition);
  margin-right: auto;
}
.btn-danger:hover { background: var(--red-500); color: var(--white); }

/* ─── Confirm Dialog ─────────────────────────────────────────────────────── */
.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 400;
  align-items: center;
  justify-content: center;
}
.confirm-overlay.visible { display: flex; }
.confirm-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  max-width: 380px;
  width: 100%;
}
.confirm-card h3 { font-size: 1rem; margin-bottom: .5rem; }
.confirm-card p  { font-size: .875rem; color: var(--slate-500); margin-bottom: 1.25rem; }
.confirm-actions { display: flex; gap: .5rem; justify-content: flex-end; }

/* ─── No Project Selected ────────────────────────────────────────────────── */
.no-project {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem;
  color: var(--slate-400);
  text-align: center;
  gap: .75rem;
}
.no-project-icon { font-size: 2.5rem; }
.no-project h3 { font-size: 1rem; color: var(--slate-500); }
.no-project p  { font-size: .875rem; }

/* ─── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--slate-300, #cbd5e1); border-radius: 3px; }

/* ─── Import Modal ───────────────────────────────────────────────────────── */
.import-modal-card { max-width: 860px; position: relative; }
.import-state { min-height: 0; }
.import-instructions { font-size: .875rem; color: var(--slate-600); margin-bottom: 1rem; }
.import-templates { display: flex; gap: .5rem; margin-bottom: 1.25rem; }
.btn-sm { padding: .3rem .7rem; font-size: .75rem; }
.import-dropzone {
  border: 2px dashed var(--slate-200);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.import-dropzone:hover, .import-dropzone.dragover {
  border-color: var(--teal-500);
  background: var(--teal-100);
}
.import-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.dropzone-icon { font-size: 2rem; margin-bottom: .5rem; }
.dropzone-text { font-size: .875rem; font-weight: 500; color: var(--slate-700); }
.dropzone-hint { font-size: .75rem; color: var(--slate-400); margin-top: .25rem; }
.import-file-error { color: var(--red-500); font-size: .8125rem; margin-top: .75rem; min-height: 1.2em; }

/* Review summary */
.import-summary {
  display: flex; gap: .75rem; flex-wrap: wrap;
  margin-bottom: 1rem; font-size: .8125rem; font-weight: 500;
}
.import-summary .is-new { color: var(--green-500); }
.import-summary .is-dup { color: var(--amber-500); }
.import-summary .is-err { color: var(--red-500); }

/* Review & results table */
.import-table-wrap { max-height: 400px; overflow-y: auto; overflow-x: auto; border: 1px solid var(--slate-200); border-radius: var(--radius); margin-bottom: 1rem; }
.import-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.import-table thead { position: sticky; top: 0; background: var(--slate-100); z-index: 1; }
.import-table th { padding: .5rem .6rem; text-align: left; font-weight: 600; color: var(--slate-600); border-bottom: 1px solid var(--slate-200); white-space: nowrap; }
.import-th-status { width: 28px; }
.import-table td { padding: .45rem .6rem; border-bottom: 1px solid var(--slate-100); vertical-align: middle; }
.import-table tr:last-child td { border-bottom: none; }
.import-table tr.import-row-new { background: #f0fdf4; }
.import-table tr.import-row-dup { background: #fffbeb; }
.import-table tr.import-row-err { background: #fef2f2; }
.import-table tr.import-row-skip { background: var(--slate-50); opacity: .6; }
.import-table tr.import-row-created { background: #f0fdf4; }
.import-table tr.import-row-updated { background: #eff6ff; }
.import-table tr.import-row-error { background: #fef2f2; }
.import-status-icon { font-size: .9rem; }

/* Inline edit in error rows */
.import-table .inline-edit {
  border: 1px solid var(--red-500);
  border-radius: 4px;
  padding: .15rem .35rem;
  font-size: .8125rem;
  font-family: inherit;
  width: 100%;
  min-width: 80px;
  box-sizing: border-box;
  background: var(--white);
}
.import-table .inline-edit:focus { outline: 2px solid var(--teal-500); border-color: var(--teal-500); }
.import-table .inline-edit-ok { border-color: var(--slate-200); }
.import-table select.inline-edit { min-width: 90px; padding: .15rem .2rem; }
.import-err-msg { font-size: .7rem; color: var(--red-500); display: block; margin-top: .15rem; }

/* Action column */
.import-action-select {
  font-size: .75rem;
  padding: .2rem .3rem;
  border: 1px solid var(--slate-200);
  border-radius: 4px;
  background: var(--white);
}

/* Results summary */
.import-results-summary {
  display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center;
  padding: 1.5rem 0; font-size: .9375rem; font-weight: 600;
}
.import-results-summary .badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .4rem .85rem; border-radius: 20px; font-size: .8125rem;
}
.badge-created { background: #dcfce7; color: #166534; }
.badge-updated { background: #dbeafe; color: #1e40af; }
.badge-skipped { background: var(--gray-100); color: var(--slate-600); }
.badge-errors  { background: #fee2e2; color: #991b1b; }

/* Spinner */
.import-spinner-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,.85);
  border-radius: var(--radius);
  z-index: 10;
}
.import-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--slate-200);
  border-top-color: var(--teal-600);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.import-spinner-text { margin-top: .75rem; font-size: .875rem; color: var(--slate-600); font-weight: 500; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .app-header { padding: 0 1rem; gap: .5rem; }
  .header-brand span { display: none; }
  .header-counts { display: none; }
  .project-selector { max-width: none; flex: 1; }
  .app-main { padding: 1rem; }
  .toolbar { padding: .5rem 1rem; }
  .search-box input { width: 140px; }
  .search-box input:focus { width: 180px; }
  .form-row { grid-template-columns: 1fr; }
}
