:root {
  --bg: #0b1220;
  --panel: #0f172a;
  --panel-2: #111827;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.18);
  --row: rgba(15, 23, 42, 0.8);
  --row-alt: rgba(17, 24, 39, 0.9);
  --link: #60a5fa;
  --accent: #38bdf8;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", "Helvetica Neue", sans-serif;
  background: radial-gradient(circle at 10% 10%, #1f2a44, #0b1220 55%, #0a1020 100%);
  color: var(--text);
}
header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 18, 32, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.container {
  max-width: 100%;
  padding: 18px 22px 28px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.title {
  font-weight: 700;
  font-size: 20px;
}
.search-input {
  width: 320px;
}
.table-wrap {
  margin-top: 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: visible;
  max-height: 70vh;
}
.board-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1500px;
}
.board-table th, .board-table td {
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid rgba(148, 163, 184, 0.08);
  vertical-align: middle;
  background: var(--row);
}
.board-table tbody tr:nth-child(even) td {
  background: var(--row-alt);
}
.board-table thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--panel-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  color: var(--muted);
}
.board-table tbody tr:hover td {
  background: rgba(30, 41, 59, 0.85);
}
.board-table tbody tr.selected td {
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.35);
}
.sticky-left {
  position: sticky;
  left: 0;
  z-index: 5;
  background: var(--panel);
}
.sticky-left + .sticky-left {
  left: 44px;
}
.board-table th.sticky-left:first-child,
.board-table td.sticky-left:first-child {
  width: 44px;
  min-width: 44px;
  text-align: center;
}
.sticky-actions {
  position: sticky;
  right: 0;
  z-index: 4;
  background: var(--panel);
}
.link {
  color: var(--link);
  text-decoration: none;
}
.muted { color: var(--muted); }
.cell-text {
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cell-status {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  min-height: 12px;
}
.cell-error {
  color: #fca5a5;
}
.cell-text.editable {
  cursor: pointer;
}
.cell-text.editable:hover {
  color: var(--link);
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  min-width: 90px;
  border: 1px solid transparent;
}
.pill-blue { background: rgba(59, 130, 246, 0.18); color: #93c5fd; border-color: rgba(59, 130, 246, 0.4); }
.pill-gray { background: rgba(148, 163, 184, 0.18); color: #cbd5f5; border-color: rgba(148, 163, 184, 0.4); }
.pill-amber { background: rgba(245, 158, 11, 0.2); color: #fcd34d; border-color: rgba(245, 158, 11, 0.4); }
.pill-indigo { background: rgba(99, 102, 241, 0.18); color: #c7d2fe; border-color: rgba(99, 102, 241, 0.4); }
.pill-green { background: rgba(34, 197, 94, 0.18); color: #86efac; border-color: rgba(34, 197, 94, 0.4); }
.pill-rose { background: rgba(244, 63, 94, 0.2); color: #fda4af; border-color: rgba(244, 63, 94, 0.4); }
.pill-violet { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; border-color: rgba(139, 92, 246, 0.4); }
.pill-orange { background: rgba(249, 115, 22, 0.18); color: #fdba74; border-color: rgba(249, 115, 22, 0.4); }
.pill-emerald { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.4); }
.pill-purple { background: rgba(168, 85, 247, 0.2); color: #e9d5ff; border-color: rgba(168, 85, 247, 0.4); }
.pill-slate { background: rgba(100, 116, 139, 0.18); color: #e2e8f0; border-color: rgba(100, 116, 139, 0.4); }

.pill-cell {
  min-height: 28px;
}

.pill-picker-wrap {
  position: relative;
  min-height: 32px;
}
.pill-picker {
  position: absolute;
  left: 0;
  top: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  min-width: 260px;
  z-index: 20;
}
.pill-option {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.pill-option .pill {
  width: 100%;
  justify-content: center;
}

.cell-input {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.85);
  color: var(--text);
}
.cell-input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.8);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}
.checkbox {
  width: 16px;
  height: 16px;
}
.action-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.16);
  color: #bfdbfe;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
}
.action-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.status-picker {
  position: relative;
}
.status-trigger {
  min-height: 28px;
  min-width: 120px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #0b1220;
}
.status-panel {
  position: fixed;
  opacity: 0;
  pointer-events: none;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
  z-index: 60;
  max-width: 360px;
  max-height: 300px;
  overflow: auto;
  transform: translate3d(var(--x, 0), var(--y, 0), 0) scale(0.98);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.status-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(var(--x, 0), var(--y, 0), 0) scale(1);
}
.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.status-tile {
  border: none;
  border-radius: 8px;
  padding: 10px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #0b1220;
  cursor: pointer;
}
.status-tile:hover {
  outline: 2px solid rgba(255, 255, 255, 0.6);
}
.status-tile.selected {
  outline: 2px solid rgba(255, 255, 255, 0.9);
}
.status-tile:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.6);
}
.icon-btn {
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}
.quick-panel {
  margin-top: 8px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.75);
}
.panel-row {
  margin-bottom: 10px;
}
.panel-row label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}
.panel-tags {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.tag-item {
  display: inline-block;
  margin: 4px 6px 0 0;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 11px;
}
.panel-warning {
  margin-top: 8px;
  color: #fcd34d;
  font-size: 12px;
}
.panel-error {
  margin-top: 8px;
  color: #fca5a5;
  font-size: 12px;
}
.panel-status {
  margin-top: 8px;
  color: #86efac;
  font-size: 12px;
}
.templates-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}
.templates-form {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.75);
}
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.actions {
  display: flex;
  gap: 8px;
}
.file-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.file-icon {
  color: var(--link);
}
.file-upload {
  color: var(--muted);
}
