:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface2: #f0efe9;
  --border: #e2e0d8;
  --border2: #ccc9be;
  --text: #1a1917;
  --text2: #6b6860;
  --text3: #a09e97;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --accent-text: #1d4ed8;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);

  /* status colors */
  --s-discovery-bg: #eff6ff; --s-discovery-text: #1d4ed8; --s-discovery-border: #bfdbfe;
  --s-voting-bg: #fef9c3; --s-voting-text: #854d0e; --s-voting-border: #fef08a;
  --s-strategy-bg: #f3e8ff; --s-strategy-text: #6b21a8; --s-strategy-border: #d8b4fe;
  --s-design-bg: #f0fdf4; --s-design-text: #166534; --s-design-border: #bbf7d0;
  --s-validation-bg: #fff7ed; --s-validation-text: #9a3412; --s-validation-border: #fdba74;
  --s-production-bg: #ecfdf5; --s-production-text: #065f46; --s-production-border: #6ee7b7;
  --s-killed-bg: #fef2f2; --s-killed-text: #991b1b; --s-killed-border: #fecaca;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* SPLASH */
.splash { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.splash-inner { text-align: center; }
.splash-inner p { margin-top: 12px; color: var(--text2); font-size: 13px; }
.spinner {
  width: 28px; height: 28px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .7s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* CONFIG BANNER */
.config-banner {
  background: #fef9c3; border-bottom: 1px solid #fef08a;
  padding: 10px 24px; font-size: 13px; color: #854d0e;
  display: flex; align-items: center; gap: 8px;
}
.config-banner code {
  font-family: 'DM Mono', monospace; font-size: 12px;
  background: rgba(0,0,0,.06); padding: 1px 6px; border-radius: 4px;
}
.config-banner a { color: #854d0e; font-weight: 500; }

/* NAV */
nav {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 24px; display: flex; align-items: stretch; gap: 0;
  position: sticky; top: 0; z-index: 50;
}
.nav-logo {
  font-size: 15px; font-weight: 600; letter-spacing: -.3px;
  padding: 14px 0; margin-right: 32px; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.nav-logo-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.nav-tabs { display: flex; align-items: stretch; gap: 0; }
.nav-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 0 16px; font-size: 13px; font-weight: 500; color: var(--text2);
  cursor: pointer; transition: all .15s; font-family: 'DM Sans', sans-serif;
  display: flex; align-items: center;
}
.nav-tab:hover { color: var(--text); }
.nav-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.save-indicator { font-size: 12px; color: var(--text3); height: 20px; display: flex; align-items: center; gap: 5px; }
.save-dot { width: 6px; height: 6px; border-radius: 50%; background: #16a34a; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* MAIN */
main { padding: 24px; }

/* BUTTONS */
.btn {
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  padding: 7px 14px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--border2); background: var(--surface); color: var(--text);
  transition: all .15s; white-space: nowrap;
}
.btn:hover { background: var(--surface2); border-color: var(--border2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { color: #991b1b; border-color: #fecaca; background: var(--surface); }
.btn-danger:hover { background: #fef2f2; }
.btn-ghost { border-color: transparent; background: none; color: var(--text2); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); border-color: var(--border); }

/* INPUTS */
input, select, textarea {
  font-family: 'DM Sans', sans-serif; font-size: 13px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border2); border-radius: var(--radius-sm);
  padding: 7px 10px; width: 100%; transition: border .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
textarea { resize: vertical; min-height: 72px; }
label { display: block; font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 4px; }

/* SUMMARY CARDS */
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.summary-card-label { font-size: 11px; font-weight: 500; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.summary-card-value { font-size: 28px; font-weight: 600; letter-spacing: -1px; color: var(--text); }
.summary-card.accent { background: var(--accent); border-color: var(--accent); }
.summary-card.accent .summary-card-label { color: rgba(255,255,255,.7); }
.summary-card.accent .summary-card-value { color: #fff; }

/* FILTERS */
.filters { display: flex; gap: 8px; margin-bottom: 20px; align-items: center; flex-wrap: wrap; }
.filters select { width: auto; min-width: 140px; }
.filters-spacer { flex: 1; }

/* KANBAN */
.kanban { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 24px; align-items: flex-start; }
.kanban::-webkit-scrollbar { height: 5px; }
.kanban::-webkit-scrollbar-track { background: var(--bg); }
.kanban::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
.kanban-col { min-width: 232px; width: 232px; flex-shrink: 0; }
.kanban-col-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.status-badge {
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: 20px; letter-spacing: .2px;
}
.kanban-count { font-size: 12px; color: var(--text3); font-variant-numeric: tabular-nums; }
.kanban-zone { min-height: 100px; display: flex; flex-direction: column; gap: 8px; border-radius: var(--radius); transition: background .15s, box-shadow .15s; padding: 4px; }
.kanban-zone.drag-over { background: var(--accent-light); box-shadow: inset 0 0 0 2px var(--accent); }

/* PRODUCT CARD */
.product-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 13px;
  cursor: pointer; transition: all .15s; user-select: none;
}
.product-card:hover { border-color: var(--border2); box-shadow: var(--shadow); transform: translateY(-1px); }
.product-card.dragging { opacity: .4; transform: scale(.97); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; margin-bottom: 4px; }
.card-name { font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--text); flex: 1; }
.priority-badge { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 20px; white-space: nowrap; flex-shrink: 0; }
.priority-High { background: #fef2f2; color: #991b1b; }
.priority-Medium { background: #fff7ed; color: #9a3412; }
.priority-Low { background: var(--surface2); color: var(--text2); }
.card-category { font-size: 11px; color: var(--text3); margin-bottom: 6px; }
.card-next { font-size: 11px; color: var(--text2); background: var(--surface2); border-radius: 5px; padding: 4px 8px; margin-bottom: 7px; line-height: 1.4; }
.card-footer { display: flex; justify-content: space-between; align-items: center; }
.card-owner { font-size: 11px; color: var(--text3); }
.pf-badge { font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 20px; letter-spacing: .3px; }
.pf-pass { background: #ecfdf5; color: #065f46; }
.pf-fail { background: #fef2f2; color: #991b1b; }
.pf-pending { background: #fff7ed; color: #9a3412; }
.pf-no-data { background: var(--surface2); color: var(--text3); }

/* VALIDATION TABLE */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
thead th { text-align: left; padding: 10px 12px; color: var(--text2); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; border-bottom: 1px solid var(--border); background: var(--surface2); }
thead th:first-child { border-radius: var(--radius) 0 0 0; }
thead th:last-child { border-radius: 0 var(--radius) 0 0; }
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }
tbody td { padding: 10px 12px; color: var(--text); white-space: nowrap; }
.td-name { font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.td-pass { color: #065f46; font-weight: 600; }
.td-fail { color: #991b1b; font-weight: 600; }
.td-muted { color: var(--text3); }
.threshold-bar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px;
}
.threshold-bar label { margin: 0; white-space: nowrap; }
.threshold-bar input { width: 68px; }
.threshold-group { display: flex; align-items: center; gap: 8px; }
.threshold-sep { color: var(--border2); font-size: 18px; }

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: flex; align-items: flex-start; justify-content: center;
  z-index: 1000; padding: 48px 16px 80px; overflow-y: auto;
  backdrop-filter: blur(2px);
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: var(--surface); border-radius: 14px;
  border: 1px solid var(--border); width: 100%; max-width: 600px;
  padding: 28px; box-shadow: var(--shadow-md);
  animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-title { font-size: 17px; font-weight: 600; letter-spacing: -.3px; margin-bottom: 4px; }
.modal-sub { font-size: 13px; color: var(--text2); margin-bottom: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-footer { display: flex; gap: 8px; margin-top: 24px; align-items: center; }
.form-footer-spacer { flex: 1; }
.calc-box {
  grid-column: 1/-1; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; margin-top: 2px;
}
.calc-box-title { font-size: 11px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 10px; }
.calc-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.calc-item-label { font-size: 11px; color: var(--text3); margin-bottom: 2px; }
.calc-item-value { font-size: 15px; font-weight: 600; color: var(--text); }

/* SETTINGS */
.settings-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px; max-width: 600px;
}
.settings-title { font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.settings-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.settings-row { display: flex; gap: 8px; align-items: center; }
.settings-row input { flex: 1; }
.settings-add { display: flex; gap: 8px; }
.settings-add input { flex: 1; }
.danger-section {
  background: var(--surface); border: 1px solid #fecaca;
  border-radius: var(--radius); padding: 20px; max-width: 600px;
}
.danger-title { font-size: 14px; font-weight: 600; color: #991b1b; margin-bottom: 6px; }
.danger-desc { font-size: 12px; color: var(--text2); margin-bottom: 14px; }

/* STATUS COLORS */
.status-Discovery  { background: var(--s-discovery-bg); color: var(--s-discovery-text); }
.status-Voting     { background: var(--s-voting-bg); color: var(--s-voting-text); }
.status-Strategy   { background: var(--s-strategy-bg); color: var(--s-strategy-text); }
.status-Design     { background: var(--s-design-bg); color: var(--s-design-text); }
.status-Validation { background: var(--s-validation-bg); color: var(--s-validation-text); }
.status-Production { background: var(--s-production-bg); color: var(--s-production-text); }
.status-Killed     { background: var(--s-killed-bg); color: var(--s-killed-text); }

/* EMPTY STATE */
.empty-col { text-align: center; padding: 20px 10px; color: var(--text3); font-size: 12px; }

/* RESPONSIVE */
@media (max-width: 768px) {
  main { padding: 16px; }
  .summary-grid { grid-template-columns: repeat(2,1fr); }
  nav { padding: 0 16px; }
  .nav-logo { margin-right: 16px; }
}
@media (max-width: 480px) {
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .filters { gap: 6px; }
  .filters select { min-width: 0; flex: 1; }
}
