:root {
  color-scheme: light;
  --bg: #f3f6f4;
  --panel: #ffffff;
  --panel-2: #f8faf8;
  --card: #fbfcfb;
  --card-hover: #f4f8f2;
  --text: #1b1f1d;
  --muted: #65706c;
  --line: #d8dfdb;
  --accent: #91c11e;
  --accent-dark: #567a0a;
  --accent-soft: #edf6dc;
  --danger: #b4233a;
  --warn: #a56b00;
  --ok: #289d4f;
  --shadow: 0 12px 28px rgb(31 41 36 / 10%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button, input, textarea, select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  color: inherit;
  background: #e9eee9;
  border-radius: 4px;
  min-height: 34px;
  padding: 7px 11px;
  font-weight: 850;
}

button:hover { background: #dde6dc; }
button:disabled { cursor: not-allowed; opacity: .55; }

input, textarea, select {
  width: 100%;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 8px 10px;
}

textarea {
  resize: vertical;
  min-height: 92px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(440px, 100%);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.auth-card p {
  margin: 0 0 24px;
  color: var(--muted);
}

.auth-brand {
  display: grid;
  gap: 10px;
}

.auth-brand img {
  width: min(210px, 72%);
  height: auto;
  margin-bottom: 10px;
}

.stack { display: grid; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.hidden { display: none !important; }

.primary {
  background: var(--accent);
  color: #11150f;
}
.primary:hover { background: #a4dc25; }
.danger {
  background: #f9a8d4;
  color: #351124;
}
.danger:hover { background: #f472b6; }
.ghost { background: transparent; border: 1px solid var(--line); }
.icon-btn { width: 36px; padding: 0; display: grid; place-items: center; }

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

.app.tv-mode {
  background: #eef2ef;
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 50px;
  padding: 0 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  z-index: 15;
  box-shadow: 0 8px 24px rgb(31 41 36 / 8%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand img {
  width: 126px;
  height: auto;
  flex: 0 0 auto;
}

.brand-divider {
  width: 1px;
  height: 28px;
  background: var(--line);
}

.brand-product {
  color: #232927;
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand span, .muted {
  color: var(--muted);
  font-size: 12px;
}

.main-nav,
.tabs {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tab {
  background: transparent;
  border: 1px solid transparent;
  color: #252b28;
  min-height: 30px;
  padding: 5px 9px;
}

.tab.active {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: #d4e8aa;
}

.user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  color: #252b28;
  font-size: 12px;
  font-weight: 850;
}

.board-strip {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(4, 88px) 96px;
  gap: 6px;
  padding: 8px 8px 0;
  align-items: start;
  flex: 0 0 auto;
}

.board-title,
.stat,
.dense-create {
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.board-title {
  min-width: 0;
  padding: 7px 9px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.board-title h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1;
}

.board-title span {
  display: block;
  color: var(--muted);
  margin-top: 3px;
  font-size: 11px;
}

.stat {
  display: grid;
  align-content: center;
  min-height: 58px;
  padding: 6px 8px;
}

.stat span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.stat strong {
  color: #101411;
  font-size: 22px;
  line-height: 1;
  margin-top: 2px;
}

.dense-create {
  min-width: 0;
  min-height: 58px;
  height: auto;
  border-radius: 0;
  padding: 0 8px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(5, minmax(94px, 136px));
  gap: 6px;
  padding: 6px 8px 8px;
  align-items: center;
  flex: 0 0 auto;
}

.filters input,
.filters select {
  height: 34px;
  min-height: 34px;
  padding: 5px 8px;
  font-size: 13px;
}

.search-filter {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: stretch;
  min-width: 0;
}

.search-filter-button {
  display: grid;
  place-items: center;
  min-height: 34px;
  width: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 3px 0 0 3px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
}

.search-filter-button:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.search-filter input {
  border-radius: 0 3px 3px 0;
}

.tv-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 18px 9px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 8px 24px rgb(31 41 36 / 8%);
}

.tv-header h1 {
  margin: 0;
  font-size: 22px;
  color: #202622;
  line-height: 1.1;
}

.tv-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tv-header img {
  width: 172px;
  height: auto;
}

.tv-header span {
  color: var(--muted);
  font-size: 13px;
}

.tv-stats {
  text-align: right;
}

.tv-stats strong {
  display: block;
  color: var(--accent-dark);
  font-size: 32px;
  line-height: 1;
}

.today-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 10px;
}

.today-header h2 {
  margin: 0;
  font-size: 26px;
}

.today-header span {
  color: var(--muted);
  font-size: 14px;
}

.today-list {
  display: grid;
  gap: 8px;
  width: min(980px, calc(100% - 40px));
  margin: 0 auto 28px;
}

.today-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
  align-items: stretch;
}

.today-bucket {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px;
  color: #303733;
  font-weight: 800;
}

.empty-state {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.board {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 8px 8px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
}

.bucket {
  flex: 1 0 260px;
  min-width: 240px;
  max-height: none;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto 1fr;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.bucket.bucket-dragging {
  opacity: .62;
}

.tv-mode .board {
  height: auto;
  gap: 7px;
  padding: 10px 12px 12px;
  background: #eef2ef;
}

.tv-mode .bucket {
  flex-basis: 292px;
  max-height: 100%;
  background: #ffffff;
  border-color: #cfd7d2;
  box-shadow: 0 6px 18px rgb(31 41 36 / 8%);
}

.tv-mode .task-card {
  cursor: default;
}

.tv-mode .bucket-header {
  min-height: 32px;
  background: #f7faf8;
  border-bottom-color: #cfd7d2;
}

.tv-mode .bucket-title strong {
  color: #252b28;
  font-size: 10px;
  letter-spacing: .04em;
}

.tv-mode .cards {
  background: #ffffff;
}

.tv-mode .cards > .muted {
  padding: 8px 2px;
  color: #6f7a75;
  font-size: 12px;
}

.tv-mode .task-card {
  background: #fbfcfb;
  border-color: #d9e1dc;
}

.tv-mode .task-card.in-progress {
  background: #eef7ff;
}

.bucket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 34px;
  padding: 0 8px;
  border-top: 4px solid var(--accent);
  border-bottom: 1px solid var(--line);
}

.bucket-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.bucket-title.bucket-draggable {
  cursor: grab;
}

.bucket-title.bucket-draggable:active {
  cursor: grabbing;
}

.swatch {
  width: 6px;
  height: 22px;
  border-radius: 0;
  flex: 0 0 auto;
}

.bucket-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #303733;
  font-size: 11px;
  text-transform: uppercase;
}

.add-task {
  margin: 5px 6px;
  text-align: left;
  background: #f3f7f0;
  border: 1px dashed #cfe4a4;
  color: var(--accent-dark);
  min-height: 28px;
  padding: 4px 8px;
  font-size: 13px;
}

.cards {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 0 6px 6px;
  overflow-y: auto;
  min-height: 0;
}

.task-card {
  background: var(--card);
  border: 1px solid #e0e6e2;
  border-left: 4px solid var(--accent);
  border-radius: 0;
  padding: 6px 7px;
  box-shadow: none;
  cursor: pointer;
}

.task-card:hover { background: var(--card-hover); }
.task-card.in-progress {
  background: #eef7ff;
  border-left-color: #38bdf8;
}
.task-card.in-progress:hover { background: #e3f1ff; }
.task-card.completed {
  opacity: .68;
  border-left-color: var(--ok);
}
.task-card.closed {
  opacity: .62;
  border-left-color: #94a3b8;
}
.task-card.dragging { outline: 2px solid var(--accent); }
.task-card.is-warn { border-left-color: #d2a43b; }
.task-card.is-hot { border-left-color: #c96868; }

.context-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: transparent;
}

.task-context-menu {
  position: fixed;
  z-index: 90;
  width: 190px;
  display: grid;
  gap: 2px;
  padding: 5px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.task-context-menu button {
  width: 100%;
  min-height: 30px;
  padding: 6px 8px;
  text-align: left;
  background: transparent;
  border-radius: 3px;
  font-size: 13px;
}

.task-context-menu button:hover {
  background: var(--accent-soft);
}

.quick-comment-popover {
  position: fixed;
  z-index: 90;
  width: min(330px, calc(100vw - 16px));
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.quick-comment-popover strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.quick-comment-popover textarea {
  min-height: 82px;
}

.quick-comment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.task-title {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  line-height: 1.22;
  word-break: break-word;
}

.task-title strong {
  font-size: 11px;
}

.task-card.completed .task-title strong {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  color: var(--muted);
}

.complete-dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  margin-top: 0;
}

.completed .complete-dot {
  background: var(--ok);
  border-color: var(--ok);
}

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

.task-actions .primary {
  flex: 1 1 180px;
}

.labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.chip {
  color: #07111f;
  border-radius: 0;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.label-picker {
  width: 100%;
}

.label-dropdown {
  position: relative;
  width: 100%;
}

.label-dropdown-trigger {
  min-height: 34px;
  border: 1px solid var(--border-strong);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  cursor: pointer;
  list-style: none;
}

.label-dropdown-trigger::-webkit-details-marker {
  display: none;
}

.label-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.label-dropdown-caret {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 950;
}

.label-dropdown-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  background: #fff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  padding: 4px;
}

.label-option {
  display: grid;
  grid-template-columns: 18px 18px 1fr;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}

.label-option:hover {
  background: var(--surface);
}

.label-swatch {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border);
  display: inline-block;
}

.selected-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  margin-top: 4px;
}

.overdue { color: var(--danger); font-weight: 800; }
.soon { color: #fbbf24; font-weight: 800; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgb(0 0 0 / 48%);
  z-index: 50;
}

.drawer {
  width: min(680px, 100%);
  height: 100%;
  overflow-y: auto;
  background: #ffffff;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 18px;
}

.task-modal {
  width: min(760px, calc(100% - 28px));
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  align-self: center;
  margin: 18px auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.drawer h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

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

.section {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.section h3 {
  margin: 0 0 12px;
  font-size: 14px;
  color: #303733;
}

.check-item, .comment, .admin-item {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px;
}

.check-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.comment p {
  margin: 6px 0 0;
  white-space: pre-wrap;
}

.admin {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.admin-menu {
  align-self: start;
  position: sticky;
  top: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px;
  display: grid;
  gap: 2px;
}

.admin-menu button {
  text-align: left;
  min-height: 31px;
  padding: 6px 9px;
  background: transparent;
  border-radius: 3px;
  color: #303733;
  font-size: 13px;
  font-weight: 750;
}

.admin-menu button.active {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.admin-main {
  min-height: 0;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 16px;
}

.admin-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-panel-header h2,
.admin-main > h2 {
  margin: 0 0 4px;
  color: #202622;
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: 0;
}

.admin-main > h2 {
  margin-bottom: 12px;
}

.admin .section {
  padding: 10px 0;
}

.admin .grid-2 {
  gap: 8px 10px;
}

.admin label {
  gap: 4px;
  color: #626d68;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
}

.admin input,
.admin textarea,
.admin select {
  min-height: 30px;
  padding: 5px 8px;
  border-color: #cfd7d2;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 650;
}

.admin textarea {
  min-height: 72px;
}

.admin button {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 800;
}

.admin .primary {
  background: #7fb10f;
  color: #11150f;
}

.admin .primary:hover {
  background: #6f9f09;
}

.admin .danger {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.admin .danger:hover {
  background: #fecaca;
}

.admin form.section {
  align-items: end;
}

.admin form.section > button {
  justify-self: start;
  min-width: 132px;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(104px, 1fr));
  gap: 8px;
}

.dashboard-kpi,
.dashboard-secondary div,
.dashboard-panel {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.dashboard-kpi {
  display: grid;
  align-content: center;
  min-height: 86px;
  padding: 10px;
  border-top: 4px solid var(--accent);
}

.dashboard-kpi span,
.dashboard-secondary span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.dashboard-kpi strong {
  color: #101411;
  font-size: 30px;
  line-height: 1;
  margin-top: 4px;
}

.dashboard-secondary {
  display: grid;
  grid-template-columns: repeat(6, minmax(92px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.dashboard-secondary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
}

.dashboard-secondary strong {
  font-size: 18px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, .85fr);
  gap: 10px;
  margin-top: 10px;
}

.dashboard-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.dashboard-panel h3 {
  margin: 0;
  color: #303733;
  font-size: 14px;
}

.dashboard-table {
  display: grid;
  gap: 4px;
  overflow-x: auto;
}

.dashboard-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(5, minmax(82px, .34fr));
  gap: 8px;
  align-items: center;
  min-width: 680px;
  min-height: 34px;
  padding: 6px 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 12px;
}

.dashboard-head {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.dashboard-bucket-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 850;
}

.dashboard-bucket-name .swatch {
  height: 18px;
}

.status-bars {
  display: grid;
  gap: 10px;
}

.status-bar-row {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.status-bar-row strong {
  color: var(--text);
}

.status-bar-track {
  height: 8px;
  overflow: hidden;
  background: #e6ece7;
  border-radius: 999px;
}

.status-bar-track span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.stale-job {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.stale-job strong {
  display: block;
  overflow-wrap: anywhere;
}

.admin-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.admin-item {
  display: grid;
  gap: 7px;
  background: #fbfcfb;
  border-color: #cfd7d2;
  border-radius: 3px;
  padding: 9px 10px;
}

.admin-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lookup-id {
  color: var(--muted);
  font-size: 12px;
}

.lookup-id code {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 5px;
}

.status-panel {
  display: grid;
  gap: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px;
}

.halo-workflow-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
}

.halo-workflow-head h3 {
  margin: 0 0 2px;
}

.halo-polling {
  display: grid;
  gap: 12px;
}

.halo-polling h3,
.global-exclusions h3 {
  margin: 0 0 4px;
}

.global-exclusions {
  display: grid;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px;
}

.lookup-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.lookup-counts span {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
  padding: 3px 6px;
}

.halo-rule {
  border-top: 1px solid var(--line);
  padding: 8px 10px;
  gap: 8px;
}

.halo-rule .row.between {
  min-height: 28px;
}

.halo-rule .row.between strong {
  font-size: 13px;
}

.halo-rule .grid-2 {
  gap: 8px 10px;
}

.halo-rule label,
.halo-polling label,
.global-exclusions label {
  gap: 4px;
  font-size: 11px;
}

.halo-rule input,
.halo-rule select,
.halo-polling input,
.halo-polling select,
.global-exclusions select {
  min-height: 30px;
  padding: 5px 8px;
}

.halo-rule button {
  min-height: 30px;
  padding: 5px 10px;
}

.condition-builder {
  display: grid;
  gap: 6px;
}

.condition-controls {
  display: grid;
  grid-template-columns: minmax(72px, .4fr) minmax(120px, .65fr) minmax(108px, .55fr) minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.condition-list {
  display: grid;
  gap: 5px;
}

.workflow-condition-row {
  display: grid;
  grid-template-columns: 58px 94px 62px 1fr auto;
  gap: 6px;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 7px;
  min-height: 34px;
}

.workflow-condition-row code {
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 4px;
}

.workflow-condition-row .danger {
  min-height: 28px;
  padding: 4px 8px;
}

.condition-join {
  color: var(--accent-dark);
  font-weight: 950;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 12px 14px;
  max-width: 420px;
  z-index: 80;
}

@media (max-width: 900px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .filters, .board-strip { grid-template-columns: 1fr 1fr; }
  .dashboard-kpis, .dashboard-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .condition-controls, .workflow-condition-row { grid-template-columns: 1fr 1fr; }
  .halo-workflow-head { flex-direction: column; }
  .admin { grid-template-columns: 1fr; }
  .admin-menu { position: static; }
  .today-item { grid-template-columns: 1fr; }
  .user-actions, .main-nav { flex-wrap: wrap; }
  .stale-job { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .filters, .board-strip, .grid-2, .dashboard-kpis, .dashboard-secondary, .condition-controls, .workflow-condition-row { grid-template-columns: 1fr; }
  .admin-panel-header { flex-direction: column; }
  .bucket { flex-basis: 86vw; }
  .tabs { overflow-x: auto; }
  .brand { flex-wrap: wrap; }
  .brand-divider { display: none; }
}
