/* ============================================================
   WMSmac Mission Control — styles.css
   Dark "Abyss" theme — Phase 1 rewrite
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --bg:          #0d1117;
  --sidebar-bg:  #13191f;
  --topbar-bg:   #161b22;
  --card:        #1c2333;
  --card-hover:  #222d3b;
  --text:        #e6edf3;
  --muted:       #7d8590;
  --accent:      #58a6ff;
  --accent-dim:  #1f3a5f;
  --border:      #30363d;
  --success:     #3fb950;
  --warning:     #d29922;
  --danger:      #f85149;
  --tag-bg:      #21262d;

  --sidebar-w:   220px;
  --topbar-h:    52px;
  --radius:      8px;
  --radius-sm:   5px;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout Shell ---------- */
.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  height: var(--topbar-h);
  flex-shrink: 0;
}

.sidebar-brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
}

.sidebar-brand .brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
}

.sidebar-brand .brand-sub {
  font-size: 10px;
  color: var(--muted);
  display: block;
  line-height: 1;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.nav-group { margin-bottom: 4px; }

.nav-group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  padding: 10px 16px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px;
  color: var(--muted);
  cursor: pointer;
  border-radius: 0;
  font-size: 13.5px;
  font-weight: 400;
  transition: background 0.12s, color 0.12s;
  user-select: none;
  border-left: 2px solid transparent;
  position: relative;
}

.nav-item:hover {
  background: rgba(88, 166, 255, 0.07);
  color: var(--text);
}

.nav-item.active {
  background: rgba(88, 166, 255, 0.12);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}

.nav-item .nav-icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  font-size: 9px;
  background: var(--tag-bg);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
}

/* ---------- Main Wrapper ---------- */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
}

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  flex-shrink: 0;
  z-index: 10;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

/* ---------- Content Area ---------- */
.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ---------- Pages ---------- */
.page { display: none; }
.page.active { display: block; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.card-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-title .card-title-icon { font-size: 13px; }

/* ---------- Dashboard Page ---------- */
#page-dashboard .highlights-card {
  margin-bottom: 18px;
}

.highlights-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(88, 166, 255, 0.06);
  border: 1px solid rgba(88, 166, 255, 0.15);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}

.highlight-item::before {
  content: "✦";
  color: var(--accent);
  font-size: 10px;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Dashboard 2x2 grid */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.dash-grid .card {
  min-height: 160px;
}

/* Agent roles in dashboard */
.role-pill-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.role-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  background: var(--tag-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  gap: 8px;
}

.role-pill .role-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}

.model-pill {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(88, 166, 255, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Projects list in dashboard */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.project-row:last-child { border-bottom: none; }

.status-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 500;
  background: var(--tag-bg);
  color: var(--muted);
  border: 1px solid var(--border);
}

.status-badge.active { background: rgba(63, 185, 80, 0.15); color: var(--success); border-color: rgba(63, 185, 80, 0.3); }
.status-badge.done   { background: rgba(88, 166, 255, 0.15); color: var(--accent); border-color: rgba(88, 166, 255, 0.3); }
.status-badge.paused { background: rgba(210, 153, 34, 0.15); color: var(--warning); border-color: rgba(210, 153, 34, 0.3); }

/* System status */
.system-kv {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.kv-row:last-child { border-bottom: none; }

.kv-key {
  color: var(--muted);
  font-size: 12px;
}

.kv-val {
  font-weight: 500;
  color: var(--text);
}

.kv-val.ok   { color: var(--success); }
.kv-val.warn { color: var(--warning); }
.kv-val.err  { color: var(--danger); }

/* Alerts list */
.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.alert-item {
  padding: 7px 10px;
  background: rgba(248, 81, 73, 0.07);
  border: 1px solid rgba(248, 81, 73, 0.2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}

/* ---------- Page Header Row ---------- */
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.page-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

/* ---------- Select / Dropdown ---------- */
select, .select {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237d8590'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

select:hover, .select:hover { border-color: var(--accent); }
select:focus, .select:focus { border-color: var(--accent); }

/* ---------- Completion Bar ---------- */
.completion-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.completion-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.completion-bar-track {
  flex: 1;
  height: 8px;
  background: var(--tag-bg);
  border-radius: 4px;
  overflow: hidden;
  min-width: 80px;
}

.completion-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.completion-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  min-width: 36px;
  text-align: right;
}

/* ---------- Projects Page ---------- */
.projects-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 16px;
  flex-wrap: wrap;
}

.projects-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.projects-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Chat + Links row */
.project-row-1 {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.chat-placeholder {
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

.links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--tag-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--accent);
  transition: background 0.12s;
}

.link-item:hover {
  background: var(--card-hover);
  text-decoration: none;
}

.link-item .link-icon { font-size: 13px; }

/* Project Kanban row */
.project-row-2 {
  margin-bottom: 16px;
}

/* Project Docs row */
.project-row-3 {}

/* ---------- Kanban Board ---------- */
.kanban-wrapper {
  overflow-x: auto;
  width: 100%;
}

#page-kanban {
  overflow-x: auto;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
  overflow-x: auto;
  min-width: max-content;
}

.kanban-col {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.kanban-col-header {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-count {
  background: var(--tag-bg);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 20px;
  font-size: 10px;
  padding: 1px 7px;
}

.kanban-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
}

.kanban-card {
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  transition: border-color 0.12s;
}

.kanban-card:hover {
  border-color: var(--accent);
}

/* Column color accents */
.kanban-col.col-todo    .kanban-col-header { color: var(--muted); }
.kanban-col.col-inprog  .kanban-col-header { color: var(--warning); }
.kanban-col.col-done    .kanban-col-header { color: var(--success); }
.kanban-col.col-todo    { border-top: 2px solid var(--border); }
.kanban-col.col-inprog  { border-top: 2px solid var(--warning); }
.kanban-col.col-done    { border-top: 2px solid var(--success); }

/* ---------- Docs Library Page ---------- */
.docs-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.docs-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  height: calc(100vh - var(--topbar-h) - 200px);
  min-height: 400px;
}

.docs-list-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.docs-list-panel::-webkit-scrollbar { width: 4px; }
.docs-list-panel::-webkit-scrollbar-thumb { background: var(--border); }

.doc-list-item {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}

.doc-list-item:last-child { border-bottom: none; }
.doc-list-item:hover { background: var(--card-hover); }
.doc-list-item.active { background: var(--accent-dim); border-left: 2px solid var(--accent); }

.doc-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-item-meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 8px;
}

.doc-item-snippet {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.docs-viewer-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.docs-viewer-panel::-webkit-scrollbar { width: 6px; }
.docs-viewer-panel::-webkit-scrollbar-thumb { background: var(--border); }

.docs-viewer-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
  text-align: center;
}

/* Markdown rendering */
.markdown-body { color: var(--text); line-height: 1.65; }
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
  color: var(--text);
  margin: 1.2em 0 0.5em;
  line-height: 1.3;
}
.markdown-body h1 { font-size: 1.6em; border-bottom: 1px solid var(--border); padding-bottom: 0.3em; }
.markdown-body h2 { font-size: 1.3em; border-bottom: 1px solid var(--border); padding-bottom: 0.3em; }
.markdown-body h3 { font-size: 1.1em; }
.markdown-body p  { margin: 0.7em 0; }
.markdown-body ul, .markdown-body ol { margin: 0.6em 0 0.6em 1.5em; }
.markdown-body li { margin: 0.2em 0; }
.markdown-body code {
  background: var(--tag-bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.88em;
  font-family: "SFMono-Regular", Consolas, monospace;
  color: #f97583;
}
.markdown-body pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0.8em 0;
}
.markdown-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: 0.85em;
}
.markdown-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  color: var(--muted);
  margin: 0.7em 0;
}
.markdown-body a { color: var(--accent); }
.markdown-body table { width: 100%; border-collapse: collapse; margin: 0.8em 0; }
.markdown-body th, .markdown-body td {
  padding: 7px 12px;
  border: 1px solid var(--border);
  text-align: left;
}
.markdown-body th { background: var(--tag-bg); font-weight: 600; color: var(--muted); font-size: 12px; }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 1em 0; }

/* Memory checkbox */
.memory-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.memory-filter input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---------- Agents Page ---------- */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.agent-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.15s, background 0.15s;
}

.agent-card:hover {
  border-color: var(--accent);
  background: var(--card-hover);
}

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

.agent-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.agent-card-purpose {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- Logs Page ---------- */
.logs-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-family: "SFMono-Regular", Consolas, monospace;
}

.logs-table thead th {
  background: var(--card);
  color: var(--muted);
  padding: 9px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.logs-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.logs-table tbody tr:last-child { border-bottom: none; }
.logs-table tbody tr:hover { background: var(--card); }

.logs-table td {
  padding: 8px 14px;
  vertical-align: top;
  line-height: 1.4;
}

.log-time {
  color: var(--muted);
  white-space: nowrap;
  font-size: 11px;
}

.log-level {
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
}

.log-level.DEBUG { color: var(--muted); }
.log-level.INFO  { color: var(--accent); }
.log-level.WARN  { color: var(--warning); }
.log-level.ERROR { color: var(--danger); }

.log-msg {
  color: var(--text);
  word-break: break-word;
  max-width: 700px;
}

/* ---------- Under Construction ---------- */
.under-construction {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.uc-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 56px;
  text-align: center;
  max-width: 400px;
}

.uc-icon { font-size: 48px; margin-bottom: 16px; }

.uc-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.uc-sub {
  font-size: 14px;
  color: var(--muted);
}

.uc-badge {
  display: inline-block;
  margin-top: 16px;
  font-size: 11px;
  background: var(--tag-bg);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 20px;
  padding: 3px 12px;
}

/* ---------- Loading / Error ---------- */
.loading-text {
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
}

.error-text {
  color: var(--danger);
  font-size: 13px;
}

/* ---------- Utility ---------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-sm { font-size: 12px; }

/* ---------- Topbar Search ---------- */
.topbar-search {
  position: relative;
  flex: 1;
  max-width: 360px;
  margin: 0 16px;
}

.topbar-search input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
}

.topbar-search input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  z-index: 200;
  max-height: 320px;
  overflow-y: auto;
}

.search-result {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.search-result:hover {
  background: rgba(255,255,255,0.05);
}

.search-type-badge {
  font-size: 10px;
  color: var(--muted);
  margin-left: auto;
  white-space: nowrap;
}

.search-group-label {
  padding: 4px 12px;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(0,0,0,0.2);
}

.hidden { display: none !important; }

/* ---------- Search Page ---------- */
.search-page-bar {
  margin-bottom: 20px;
  width: 100%;
}

.search-page-bar input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 15px;
}

.search-page-bar input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-page-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-result-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s;
}

.search-result-card:hover {
  border-color: var(--accent);
}

.search-result-card .result-title {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-result-card .result-snippet {
  font-size: 12px;
  color: var(--muted);
}

.search-results-group-header {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 0 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

/* ---------- Website Status Card ---------- */
.site-status-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.site-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.site-status-row:last-child {
  border-bottom: none;
}

.site-status-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.site-name {
  font-weight: 500;
  flex-shrink: 0;
}

.site-name a {
  color: var(--text);
  text-decoration: none;
}

.site-name a:hover {
  color: var(--accent);
}

.site-url {
  flex: 1;
}

.site-latency {
  font-size: 11px;
  color: var(--muted);
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  padding: 2px 6px;
}

/* ---------- Kanban 4-column + Research ---------- */
.col-research .kanban-col-header {
  color: #8b7cf7;
}

.col-research {
  border-top: 2px solid #8b7cf7;
}

/* ---------- Responsive (768px collapse) ---------- */
@media (max-width: 1024px) {
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .project-row-1 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 56px; }

  .sidebar-brand .brand-name,
  .sidebar-brand .brand-sub,
  .nav-group-label,
  .nav-item span:not(.nav-icon),
  .nav-badge { display: none; }

  .sidebar-brand { justify-content: center; padding: 0; }
  .nav-item { justify-content: center; padding: 10px; border-left: none; border-radius: 0; }
  .nav-item.active { background: rgba(88, 166, 255, 0.15); }
  .nav-icon { width: auto; }

  .dash-grid { grid-template-columns: 1fr; }
  .docs-layout { grid-template-columns: 1fr; height: auto; }
  .agents-grid { grid-template-columns: 1fr; }
  .content { padding: 16px; }
}

@media (max-width: 900px) {
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .kanban-board { grid-template-columns: 1fr; }
}

/* ---------- Brand Version ---------- */
.brand-version {
  font-size: 10px;
  color: var(--muted);
  opacity: 0.7;
  margin-left: 4px;
}

/* ---------- Alerts Page ---------- */
.alerts-full-list { display: flex; flex-direction: column; gap: 4px; }
.alert-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.alert-row:last-child { border-bottom: none; }
.alert-row-active { background: rgba(255, 100, 100, 0.05); border-radius: 6px; padding: 8px; }
.alert-icon { flex-shrink: 0; font-size: 14px; }
.alert-text { flex: 1; font-family: ui-monospace, monospace; font-size: 12px; color: var(--text); line-height: 1.5; }

/* ---------- System Page ---------- */
.system-full-kv { display: flex; flex-direction: column; gap: 0; }
.system-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.system-row:last-child { border-bottom: none; }
.system-label { color: var(--muted); flex-shrink: 0; width: 160px; }
.system-value { flex: 1; text-align: right; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.status-ok { color: var(--text); }
.status-warn { color: #f0a020; }
.system-link { font-size: 11px; color: var(--accent); text-decoration: none; margin-left: 8px; }
.system-link:hover { text-decoration: underline; }

/* ---------- Cron Page ---------- */
.cron-table { display: flex; flex-direction: column; gap: 0; }
.cron-row { padding: 12px 0; border-bottom: 1px solid var(--border); }
.cron-row:last-child { border-bottom: none; }
.cron-row-error { background: rgba(255, 100, 80, 0.05); border-radius: 6px; padding: 12px 8px; }
.cron-row-main { display: flex; align-items: center; gap: 12px; }
.cron-status-icon { font-size: 16px; flex-shrink: 0; }
.cron-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.cron-name { font-weight: 500; font-size: 13px; }
.cron-schedule { font-size: 11px; }
.cron-times { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.cron-time-label { font-size: 10px; }
.cron-time-val { font-size: 12px; color: var(--text); }
.cron-exit-badge { font-size: 10px; background: rgba(255,80,80,0.15); color: #ff6060; border-radius: 4px; padding: 2px 6px; }
.cron-error-msg { margin-top: 6px; padding: 4px 8px; color: #ff8060; background: rgba(255,100,80,0.08); border-radius: 4px; }
