/* --- Content Header --- */
.app-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 92%, var(--bg-card));
  --wails-draggable: drag;
}

/* Interactive elements must not be draggable. */
.app-header button,
.app-header input,
.app-header a,
.app-header select,
.app-header [role="button"] {
  --wails-draggable: no-drag;
}
/* Spacer takes the place of the old workspace-group-tabs div so the search
   and action buttons stay right-aligned. */
.app-header__spacer {
  flex: 1 1 0;
  min-width: 0;
}

.app-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  flex-shrink: 0;
}

.app-header__search {
  flex: 1 1 240px;
  max-width: 320px;
}

.app-header__button-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.automation-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.automation-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  max-width: 320px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  z-index: 30;
}

.automation-menu__header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 4px 6px;
}

.automation-active-count {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
}

.header-toggle-strip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.header-toggle-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
  padding: 4px 9px 4px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in oklab, var(--bg-card) 90%, transparent);
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.header-toggle-chip__meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.header-toggle-chip__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.header-toggle-chip__hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid color-mix(in oklab, var(--text-muted) 70%, transparent);
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1;
  font-style: normal;
  cursor: help;
  flex-shrink: 0;
}

.header-toggle-chip__switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 34px;
  height: 20px;
}

.header-toggle-chip__switch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.header-toggle-chip__track {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease;
}

.header-toggle-chip__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition:
    transform 0.16s ease,
    background-color 0.16s ease;
}

.header-toggle-chip__switch input:focus-visible + .header-toggle-chip__track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.header-toggle-chip__switch input:checked + .header-toggle-chip__track {
  background: linear-gradient(
    135deg,
    var(--accent) 0%,
    var(--accent-hover) 100%
  );
  border-color: color-mix(in oklab, var(--accent) 70%, #000 8%);
}

.header-toggle-chip__switch input:checked + .header-toggle-chip__track::after {
  transform: translateX(14px);
  background: #fff7f2;
}

.app-header__next-run {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.watcher-health-section {
  margin-top: 6px;
}

.watcher-health-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 4px 4px;
}

.watcher-health-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.watcher-health-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px 4px 11px;
  border-radius: 7px;
  font-size: 12px;
}

.watcher-health-row--ok {
  color: var(--text-muted);
}

.watcher-health-row--tripped {
  border: 1px solid color-mix(in oklab, #e85d40 30%, var(--border));
  background: color-mix(in oklab, #e85d40 8%, var(--bg-card));
  color: var(--text-secondary);
  cursor: default;
}

.watcher-health-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.watcher-health-dot--ok {
  background: #4caf7d;
}

.watcher-health-dot--tripped {
  background: #e85d40;
}

.watcher-health-name {
  font-weight: 600;
  flex-shrink: 0;
}

.watcher-health-detail {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Board grid: 4 equal columns on desktop */
.board-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-5);
  padding: var(--sp-5);
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.col {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.col-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 6px var(--sp-3);
}
.col-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  flex-shrink: 0;
}
.col-backlog .col-dot {
  background: var(--col-backlog);
}
.col-progress .col-dot {
  background: var(--col-progress);
}
.col-waiting .col-dot {
  background: var(--col-waiting);
}
.col-done .col-dot {
  background: var(--col-done);
}
.col-name {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.col-count {
  font-size: 10px;
  color: var(--ink-4);
  padding: 0 5px;
  border-radius: var(--r-sm);
  background: var(--bg-sunk);
  font-variant-numeric: tabular-nums;
  line-height: 16px;
}
.col-stats {
  min-width: 0;
  overflow: hidden;
  font-size: 10px;
  color: var(--ink-4);
  white-space: nowrap;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.col-btn {
  margin-left: auto;
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--ink-3);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
  line-height: 16px;
}
.col-btn:hover {
  background: var(--bg-hover);
  color: var(--ink);
}
.col-icon-btn {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--ink-3);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.col-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--ink);
}
.col-btn.hidden,
.col-stats.hidden {
  display: none;
}

.column {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  contain: layout paint style;
  /* Reserve equal gutter on both sides so the 6px scrollbar doesn't
     eat into the right padding when content overflows — keeps cards
     visually centred within the column regardless of scroll state. */
  scrollbar-gutter: stable both-edges;
}
/* Each column body reads as a soft tray — subtle enough to not compete
   with cards, distinct enough that an empty column still reads as a
   column rather than empty canvas. */
.col-bg {
  background: var(--bg-sunk);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-3) var(--sp-3);
  gap: var(--sp-2);
}
.col-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-height: 40px;
}
