/* css/app.css */
:root {
  --buncss-light: initial;
  --buncss-dark: ;
  color-scheme: light;
  --xo-bg: #f4f6f3;
  --xo-surface: #fff;
  --xo-surface-muted: #eef2ef;
  --xo-ink: #14201c;
  --xo-ink-muted: #607068;
  --xo-border: #d9e0dc;
  --xo-rail: #101816;
  --xo-rail-soft: #18231f;
  --xo-accent: #0f8b6f;
  --xo-sky: #277da1;
  --xo-violet: #7251a5;
  --xo-warn: #a16015;
  --xo-error: #b42318;
  --xo-radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
}

* {
  box-sizing: border-box;
}

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

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.ops-console {
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
  min-height: 100vh;
}

.ops-rail {
  display: flex;
  background: var(--xo-rail);
  color: #eef6f2;
  flex-direction: column;
  gap: 24px;
  min-height: 100vh;
  padding: 20px;
}

.ops-brand {
  display: flex;
  align-items:  center;
  gap: 12px;
  min-height: 48px;
}

.ops-brand-mark {
  display: grid;
  color: #c9f3e5;
  background: #22332d;
  border: 1px solid #ffffff2e;
  border-radius: 8px;
  place-items:  center;
  width: 44px;
  height: 44px;
  font-weight: 700;
}

.ops-kicker {
  color: var(--xo-ink-muted);
  text-transform: uppercase;
  margin: 0 0 4px;
  font-size: .75rem;
  font-weight: 700;
}

.ops-rail .ops-kicker {
  color: #8ca099;
}

.ops-brand h1, .ops-header h2, .ops-column h3, .ops-profile h3, .ops-brief h3, .ops-empty h3 {
  letter-spacing: 0;
  margin: 0;
}

.ops-brand h1 {
  color: #f7fffb;
  font-size: 1rem;
}

.ops-backend-list {
  display: grid;
  gap: 8px;
}

.ops-backend {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  border-radius: var(--xo-radius);
  color: inherit;
  text-align: left;
  background: none;
  border: 1px solid #0000;
  align-items:  center;
  gap: 10px;
  width: 100%;
  min-height: 72px;
  padding: 10px;
}

.ops-backend:hover:not(:disabled), .ops-backend.is-selected {
  background: var(--xo-rail-soft);
  outline: none;
  border-color: #fff3;
}

.ops-backend:focus-visible {
  background: var(--xo-rail-soft);
  outline: none;
  border-color: #fff3;
}

.ops-backend.is-disabled {
  opacity: .62;
}

.ops-dot {
  background: var(--xo-accent);
  border-radius: 999px;
  width: 10px;
  height: 10px;
}

.ops-dot.is-sky {
  background: var(--xo-sky);
}

.ops-dot.is-violet {
  background: var(--xo-violet);
}

.ops-backend-main {
  min-width: 0;
}

.ops-backend-name, .ops-backend-description {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-backend-name {
  font-weight: 700;
}

.ops-backend-description {
  color: #9fb1aa;
  margin-top: 4px;
  font-size: .78rem;
}

.ops-status, .ops-priority {
  display: inline-flex;
  background: var(--xo-surface-muted);
  color: var(--xo-ink-muted);
  text-transform: uppercase;
  white-space: nowrap;
  border-radius: 999px;
  align-items:  center;
  min-height: 22px;
  padding: 0 8px;
  font-size: .72rem;
  font-weight: 700;
}

.ops-status.is-ok, .ops-priority.is-complete {
  color: var(--xo-accent);
  background: #0f8b6f24;
}

.ops-status.is-warn, .ops-priority.is-high {
  color: var(--xo-warn);
  background: #a1601529;
}

.ops-status.is-info {
  color: var(--xo-sky);
  background: #277da129;
}

.ops-priority.is-critical {
  color: var(--xo-error);
  background: #b4231824;
}

.ops-workspace {
  min-width: 0;
  padding: 24px;
}

.ops-header {
  display: flex;
  justify-content: space-between;
  align-items:  end;
  gap: 16px;
  margin-bottom: 16px;
}

.ops-header h2 {
  font-size: 1.6rem;
}

.ops-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 8px;
  margin: 0;
}

.ops-stats div {
  border: 1px solid var(--xo-border);
  border-radius: var(--xo-radius);
  background: var(--xo-surface);
  min-height: 64px;
  padding: 10px 12px;
}

.ops-stats dt {
  color: var(--xo-ink-muted);
  text-transform: uppercase;
  font-size: .72rem;
  font-weight: 700;
}

.ops-stats dd {
  margin: 6px 0 0;
  font-size: 1.3rem;
  font-weight: 800;
}

.ops-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.ops-tab {
  display: inline-flex;
  border: 1px solid var(--xo-border);
  border-radius: var(--xo-radius);
  background: var(--xo-surface);
  color: var(--xo-ink-muted);
  align-items:  center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  font-weight: 700;
}

.ops-tab:hover, .ops-tab.is-selected {
  border-color: color-mix(in srgb, var(--xo-accent) 45%, var(--xo-border));
  color: var(--xo-ink);
  outline: none;
}

.ops-tab:focus-visible {
  border-color: color-mix(in srgb, var(--xo-accent) 45%, var(--xo-border));
  color: var(--xo-ink);
  outline: none;
}

.ops-tab-icon {
  width: 18px;
  height: 18px;
}

.ops-surface {
  min-width: 0;
}

.ops-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  overflow-x: auto;
  align-items:  start;
  gap: 12px;
}

.ops-column, .ops-profile, .ops-brief, .ops-empty, .ops-table {
  border: 1px solid var(--xo-border);
  border-radius: var(--xo-radius);
  background: var(--xo-surface);
}

.ops-column {
  min-height: 440px;
  padding: 10px;
}

.ops-column-header {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  height: 34px;
  margin-bottom: 10px;
}

.ops-column-header h3 {
  font-size: .9rem;
}

.ops-column-header span {
  color: var(--xo-ink-muted);
  font-size: .8rem;
  font-weight: 800;
}

.ops-task-list {
  display: grid;
  gap: 8px;
}

.ops-task {
  border: 1px solid var(--xo-border);
  background: #fbfcfa;
  border-radius: 6px;
  min-height: 120px;
  padding: 10px;
}

.ops-task-top, .ops-task footer, .ops-meta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items:  center;
  gap: 8px;
}

.ops-task-id {
  color: var(--xo-ink-muted);
  font-size: .78rem;
  font-weight: 800;
}

.ops-task h4 {
  margin: 10px 0 8px;
  font-size: .92rem;
  line-height: 1.28;
}

.ops-task p, .ops-brief p, .ops-profile p, .ops-empty p {
  color: var(--xo-ink-muted);
  margin: 0;
  line-height: 1.45;
}

.ops-task footer {
  color: var(--xo-ink-muted);
  margin-top: 12px;
  font-size: .78rem;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
}

.ops-profile {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  min-height: 160px;
  padding: 14px;
}

.ops-profile-icon, .ops-brief-icon {
  display: grid;
  color: var(--xo-accent);
  background: #0f8b6f1f;
  border-radius: 8px;
  place-items:  center;
  width: 40px;
  height: 40px;
}

.ops-profile h3 {
  font-size: 1rem;
}

.ops-profile p {
  margin-top: 6px;
}

.ops-meta-row {
  color: var(--xo-ink-muted);
  justify-content: flex-start;
  margin-top: 12px;
  font-size: .78rem;
  font-weight: 700;
}

.ops-table {
  overflow: hidden;
}

.ops-table-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(120px, .7fr) minmax(220px, 1fr) minmax(96px, .5fr);
  border-top: 1px solid var(--xo-border);
  align-items:  center;
  gap: 12px;
  min-height: 68px;
  padding: 10px 14px;
}

.ops-table-row:first-child {
  border-top: 0;
}

.ops-table-head {
  background: var(--xo-surface-muted);
  color: var(--xo-ink-muted);
  text-transform: uppercase;
  min-height: 42px;
  font-size: .75rem;
  font-weight: 800;
}

.ops-table strong, .ops-table small, .ops-table code {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.ops-table small {
  color: var(--xo-ink-muted);
  margin-top: 4px;
}

.ops-table code {
  font-family: SFMono-Regular, Consolas, monospace;
  font-size: .8rem;
}

.ops-brief {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  max-width: 760px;
  padding: 18px;
}

.ops-brief h3 {
  margin-bottom: 8px;
}

.ops-brief ul {
  display: grid;
  list-style: none;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
}

.ops-brief li {
  border: 1px solid var(--xo-border);
  border-radius: 6px;
  padding: 10px;
}

.ops-brief li span {
  display: block;
  margin-bottom: 4px;
  font-weight: 800;
}

.ops-empty {
  display: grid;
  text-align: center;
  place-items:  center;
  min-height: 300px;
  padding: 24px;
}

.ops-empty > span {
  color: var(--xo-ink-muted);
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
}

.ops-empty.is-error > span {
  color: var(--xo-error);
}

@media (max-width: 980px) {
  .ops-console {
    grid-template-columns: 1fr;
  }

  .ops-rail {
    min-height: 0;
  }

  .ops-backend-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ops-header {
    flex-direction: column;
    align-items:  start;
  }

  .ops-board {
    grid-template-columns: repeat(4, minmax(220px, 78vw));
  }

  .ops-grid {
    grid-template-columns: 1fr;
  }

  .ops-table-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .ops-table-head {
    display: none;
  }
}

@media (max-width: 640px) {
  .ops-rail, .ops-workspace {
    padding: 16px;
  }

  .ops-backend-list, .ops-stats {
    grid-template-columns: 1fr;
  }

  .ops-tab {
    flex: 140px;
    justify-content: center;
  }
}
