/* ============================================================
   MISSION CONTROL — OpenClaw Dashboard
   OTFT / Apple Liquid Glass aesthetic — clean, minimal, premium
   ============================================================ */

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

/* ── CSS Variables ── */
:root {
  --bg:         #050505;
  --bg2:        #0a0a0a;
  --card-bg:    rgba(255,255,255,0.04);
  --card-hover: rgba(255,255,255,0.06);
  --border:     rgba(255,255,255,0.08);
  --border-hi:  rgba(255,255,255,0.16);
  --blue:       #3b82f6;
  --blue-dim:   rgba(59,130,246,0.10);
  --green:      #22c55e;
  --green-dim:  rgba(34,197,94,0.10);
  --amber:      #f59e0b;
  --amber-dim:  rgba(245,158,11,0.10);
  --red:        #ef4444;
  --red-dim:    rgba(239,68,68,0.10);
  --purple:     #a855f7;
  --purple-dim: rgba(168,85,247,0.10);
  --txt:        #f0f0f0;
  --txt2:       #888888;
  --txt3:       #555555;
  --mono:       'SF Mono','Cascadia Code','Fira Code','Consolas',monospace;
  --sans:       -apple-system,BlinkMacSystemFont,'Segoe UI',system-ui,sans-serif;
  --r:          16px;
  --r-sm:       10px;
  --sidebar-w:  220px;
  --sidebar-collapsed-w: 60px;
  --transition: 0.2s ease;
}

/* ── Base ── */
html {
  height: 100%;
  font-size: 14px;
}

body {
  font-family: var(--sans);
  color: var(--txt);
  background-color: var(--bg);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.14);
}

/* ── App Shell Layout ── */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.025);
  border-right: 1px solid var(--border);
  transition: width var(--transition), min-width var(--transition);
  overflow: hidden;
  position: relative;
  z-index: 100;
  flex-shrink: 0;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-w);
  min-width: var(--sidebar-collapsed-w);
}

/* Sidebar Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}

.logo-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition), width var(--transition);
}

.logo-title {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--txt);
  text-transform: uppercase;
}

.logo-sub {
  font-family: var(--sans);
  font-size: 10px;
  color: var(--txt3);
  letter-spacing: 0.5px;
}

.sidebar.collapsed .logo-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  color: var(--txt2);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--txt);
}

.nav-item.active {
  background: rgba(59,130,246,0.10);
  color: var(--blue);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 60%;
  background: var(--blue);
  border-radius: 0 2px 2px 0;
}

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

.nav-label {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition), width var(--transition);
}

.sidebar.collapsed .nav-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px 8px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  min-width: 0;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

.status-text {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--txt3);
  white-space: nowrap;
  transition: opacity var(--transition);
}

.sidebar.collapsed .status-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-footer {
  justify-content: center;
}

.sidebar.collapsed .sidebar-status {
  display: none;
}

.collapse-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--txt3);
  border-radius: var(--r-sm);
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.collapse-btn:hover {
  border-color: var(--border-hi);
  color: var(--txt);
}

.sidebar.collapsed .collapse-btn {
  transform: rotate(180deg);
}

/* ── Main Content ── */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  min-width: 0;
}

/* ── Glass Card Base ── */
.glass {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Panel variant */
.glass.panel {
  position: relative;
  overflow: hidden;
  padding: 20px;
}

/* ── Page ── */
.page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.25s ease;
}

/* ── Page Header ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--txt);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 12px;
  color: var(--txt3);
  margin-top: 4px;
  letter-spacing: 0.2px;
}

/* ── Panel Title ── */
.panel-title {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--txt3);
  margin-bottom: 16px;
}

/* ── Grid Layouts ── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* ── Stat Grid ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

/* ── Stat Card ── */
.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  background: var(--card-hover);
  border-color: var(--border-hi);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.stat-icon {
  font-size: 20px;
  color: var(--txt3);
  flex-shrink: 0;
}

.stat-body {
  min-width: 0;
}

.stat-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--txt);
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-label {
  font-size: 10px;
  color: var(--txt3);
  letter-spacing: 1px;
  margin-top: 3px;
  text-transform: uppercase;
}

/* ── Security Gauge ── */
.gauge-center {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 0 4px;
}

.gauge-svg {
  display: block;
  overflow: visible;
}

.gauge-bg {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 8;
}

.gauge-ring {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4,0,0.2,1);
}

.gauge-score {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 600;
}

.gauge-label {
  font-family: var(--sans);
  letter-spacing: 1.5px;
}

/* Score summary row */
.score-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.score-box {
  text-align: center;
  padding: 10px 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.score-n {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--txt);
}

.score-t {
  font-size: 10px;
  color: var(--txt3);
  letter-spacing: 0.8px;
  margin-top: 2px;
  text-transform: uppercase;
}

.audit-time {
  font-size: 11px;
  color: var(--txt3);
  text-align: center;
  margin-top: 12px;
  font-family: var(--mono);
}

/* ── Kanban Board ── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}

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

.column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.column-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.column-title {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--txt2);
  flex: 1;
}

.column-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt3);
  background: rgba(255,255,255,0.05);
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 22px;
  text-align: center;
}

.column-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
  padding: 4px;
  border-radius: var(--r);
  transition: background var(--transition), border-color var(--transition);
  border: 2px solid transparent;
}

.column-cards.drag-over {
  background: rgba(59,130,246,0.05);
  border-color: rgba(59,130,246,0.25);
}

.drop-placeholder {
  height: 2px;
}

/* Kanban Card */
.kanban-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  display: flex;
  align-items: stretch;
  cursor: grab;
  position: relative;
  transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  overflow: hidden;
}

.kanban-card:hover {
  background: var(--card-hover);
  border-color: var(--border-hi);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card.dragging {
  opacity: 0.4;
  transform: scale(0.97);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.card-priority-bar {
  width: 3px;
  min-width: 3px;
  border-radius: 2px 0 0 2px;
  flex-shrink: 0;
}

.card-body {
  flex: 1;
  padding: 10px 12px;
  min-width: 0;
}

.card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--txt);
  line-height: 1.3;
  margin-bottom: 4px;
  word-break: break-word;
}

.card-desc {
  font-size: 12px;
  color: var(--txt3);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.card-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 4px;
  color: var(--red);
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition), background var(--transition);
}

.kanban-card:hover .card-delete {
  opacity: 1;
}

.card-delete:hover {
  background: rgba(239,68,68,0.25) !important;
}

.add-card-btn {
  background: transparent;
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: var(--r-sm);
  color: var(--txt3);
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: all var(--transition);
  letter-spacing: 0.3px;
}

.add-card-btn:hover {
  border-color: rgba(59,130,246,0.3);
  color: var(--blue);
  background: var(--blue-dim);
}

/* ── Kanban Summary (Dashboard) ── */
.kanban-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ks-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ks-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ks-label {
  font-size: 12px;
  color: var(--txt2);
  width: 90px;
  flex-shrink: 0;
}

.ks-bar-wrap {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
  overflow: hidden;
}

.ks-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  min-width: 2px;
}

.ks-count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--txt3);
  width: 20px;
  text-align: right;
  flex-shrink: 0;
}

.ks-total {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt3);
  text-align: center;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  letter-spacing: 0.5px;
}

/* ── Memory Layout ── */
.memory-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  min-height: calc(100vh - 180px);
  align-items: start;
}

.memory-sidebar {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  max-height: calc(100vh - 180px);
}

.memory-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 4px;
}

.memory-list-header .panel-title {
  margin-bottom: 0;
}

.file-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt3);
  background: rgba(255,255,255,0.05);
  padding: 2px 7px;
  border-radius: 20px;
}

.memory-section-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--txt3);
  padding: 10px 16px 4px;
  text-transform: uppercase;
}

.memory-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--transition);
  border-left: 2px solid transparent;
  overflow: hidden;
}

.memory-file-item:hover {
  background: rgba(255,255,255,0.03);
}

.memory-file-item.active {
  background: var(--blue-dim);
  border-left-color: var(--blue);
}

.mf-icon {
  color: var(--txt3);
  font-size: 14px;
  flex-shrink: 0;
}

.memory-file-item.active .mf-icon {
  color: var(--blue);
}

.mf-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.mf-name {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mf-date,
.mf-size {
  font-size: 11px;
  color: var(--txt3);
  font-family: var(--mono);
}

.mf-size {
  flex-shrink: 0;
}

/* Memory Viewer */
.memory-viewer {
  padding: 0;
  overflow: hidden;
  max-height: calc(100vh - 180px);
  display: flex;
  flex-direction: column;
}

.memory-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.mc-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mc-icon {
  color: var(--blue);
  font-size: 14px;
}

.mc-name {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--txt);
  font-weight: 500;
}

.mc-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--txt3);
  font-family: var(--mono);
}

.mc-sep {
  color: var(--txt3);
}

.memory-content-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.memory-pre {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--txt2);
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
}

/* Memory Loading */
.memory-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px;
  color: var(--txt3);
  font-size: 13px;
}

/* Recent Memory on Dashboard */
.memory-recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.memory-recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

.memory-recent-item:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--border-hi);
  transform: translateY(-1px);
}

.memory-icon {
  color: var(--txt3);
  font-size: 14px;
  flex-shrink: 0;
}

.memory-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.memory-name {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.memory-date {
  font-size: 11px;
  color: var(--txt3);
}

.memory-size {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt3);
  flex-shrink: 0;
}

/* ── System Page ── */
.sys-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sys-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

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

.sys-lbl {
  font-size: 10px;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  min-width: 120px;
  flex-shrink: 0;
}

.sys-val {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--txt);
  word-break: break-all;
}

.mem-display {
  margin-bottom: 16px;
}

.mem-bar-wrap {
  height: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.mem-bar {
  height: 100%;
  background: var(--blue);
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  min-width: 2px;
}

.mem-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt3);
}

.mem-pct {
  color: var(--blue);
  font-weight: 600;
}

.sys-raw {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt3);
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 140px;
  overflow-y: auto;
  line-height: 1.6;
}

/* ── Security Page ── */
.security-top {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items: start;
}

.security-gauge-panel {
  display: flex;
  flex-direction: column;
}

.security-findings-panel {
  min-height: 300px;
}

.findings-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 4px;
}

.finding-card {
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.02);
  overflow: hidden;
  cursor: pointer;
  transition: background var(--transition);
}

.finding-card:hover {
  background: rgba(255,255,255,0.04);
}

.finding-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.finding-title {
  flex: 1;
  font-size: 12.5px;
  color: var(--txt);
  line-height: 1.3;
}

.finding-chevron {
  color: var(--txt3);
  font-size: 16px;
  transition: transform var(--transition);
  flex-shrink: 0;
}

.finding-card.expanded .finding-chevron {
  transform: rotate(90deg);
}

.finding-body {
  display: none;
  padding: 0 12px 12px;
  border-top: 1px solid var(--border);
  margin-top: 0;
}

.finding-card.expanded .finding-body {
  display: block;
}

.finding-detail,
.finding-remediation {
  font-size: 12px;
  color: var(--txt2);
  margin-top: 8px;
  line-height: 1.5;
}

.finding-remediation {
  color: var(--amber);
}

/* Severity badges in findings */
.sev-badge {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.8px;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.sev-critical {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
}

.sev-warning {
  background: var(--amber-dim);
  color: var(--amber);
  border: 1px solid rgba(245,158,11,0.2);
}

.sev-info {
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(59,130,246,0.2);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  width: 100%;
  max-width: 480px;
  position: relative;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
}

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

.modal-close {
  background: transparent;
  border: none;
  color: var(--txt3);
  font-size: 14px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all var(--transition);
}

.modal-close:hover {
  background: rgba(255,255,255,0.06);
  color: var(--txt);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 18px;
  border-top: 1px solid var(--border);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: var(--sans);
  letter-spacing: 0.2px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: #ffffff;
  color: #000000;
  border-color: transparent;
}

.btn-primary:hover:not(:disabled) {
  background: rgba(255,255,255,0.88);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--txt2);
  border-color: var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255,255,255,0.05);
  border-color: var(--border-hi);
  color: var(--txt);
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(239,68,68,0.25);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239,68,68,0.18);
}

/* ── Forms ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-input,
.form-select,
.form-textarea {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--txt);
  font-size: 13px;
  padding: 9px 12px;
  font-family: var(--sans);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: rgba(59,130,246,0.45);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.08);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--txt3);
}

.form-select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23555555' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.form-select option {
  background: var(--bg2);
  color: var(--txt);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

/* ── Badges / Pills ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.badge-high {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(239,68,68,0.18);
}

.badge-medium {
  background: var(--amber-dim);
  color: var(--amber);
  border-color: rgba(245,158,11,0.18);
}

.badge-low {
  background: var(--blue-dim);
  color: var(--blue);
  border-color: rgba(59,130,246,0.18);
}

.badge-label {
  background: rgba(255,255,255,0.05);
  color: var(--txt2);
  border-color: var(--border);
}

.badge-critical {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(239,68,68,0.18);
}

.badge-warning {
  background: var(--amber-dim);
  color: var(--amber);
  border-color: rgba(245,158,11,0.18);
}

.badge-info {
  background: var(--blue-dim);
  color: var(--blue);
  border-color: rgba(59,130,246,0.18);
}

.pill-green {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-family: var(--mono);
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(34,197,94,0.18);
}

.pill-red {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-family: var(--mono);
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.18);
}

/* ── Text Utility Colors ── */
.text-green  { color: var(--green) !important; }
.text-red    { color: var(--red) !important; }
.text-amber  { color: var(--amber) !important; }
.text-blue   { color: var(--blue) !important; }
.text-purple { color: var(--purple) !important; }
.text-txt    { color: var(--txt) !important; }
.text-txt2   { color: var(--txt2) !important; }
.text-txt3   { color: var(--txt3) !important; }

/* ── Loading Skeletons ── */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.03) 25%,
    rgba(255,255,255,0.07) 50%,
    rgba(255,255,255,0.03) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
  border-radius: 4px;
}

.skeleton-card {
  height: 80px;
  border-radius: var(--r);
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.02) 25%,
    rgba(255,255,255,0.05) 50%,
    rgba(255,255,255,0.02) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
  border: 1px solid var(--border);
}

.skeleton-text {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.03) 25%,
    rgba(255,255,255,0.07) 50%,
    rgba(255,255,255,0.03) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
  margin-bottom: 8px;
}

.skeleton-lines {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-lines::before,
.skeleton-lines::after {
  content: '';
  display: block;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.03) 25%,
    rgba(255,255,255,0.07) 50%,
    rgba(255,255,255,0.03) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
}

.skeleton-lines::after {
  width: 65%;
}

.skeleton-gauge {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  margin: 16px auto;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.03) 25%,
    rgba(255,255,255,0.07) 50%,
    rgba(255,255,255,0.03) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
}

/* ── Spinner ── */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.08);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* ── Error / Empty States ── */
.error-msg {
  color: var(--red);
  font-size: 13px;
  padding: 16px;
  background: var(--red-dim);
  border: 1px solid rgba(239,68,68,0.18);
  border-radius: var(--r-sm);
  text-align: center;
}

.empty-msg {
  color: var(--txt3);
  font-size: 13px;
  text-align: center;
  padding: 24px 16px;
}

/* ── Animations ── */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(34,197,94,0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(34,197,94,0);
  }
}

@keyframes shimmer {
  from {
    background-position: -200% 0;
  }
  to {
    background-position: 200% 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Selection ── */
::selection {
  background: rgba(59,130,246,0.25);
  color: var(--txt);
}

/* ── Focus visible ── */
*:focus-visible {
  outline: 2px solid rgba(59,130,246,0.4);
  outline-offset: 2px;
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

/* ── Mobile Responsive ── */
@media (max-width: 1100px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
  .security-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .memory-layout {
    grid-template-columns: 1fr;
  }
  .memory-sidebar {
    max-height: 280px;
  }
  .memory-viewer {
    max-height: 500px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: var(--sidebar-collapsed-w);
    min-width: var(--sidebar-collapsed-w);
  }

  .sidebar .logo-text,
  .sidebar .nav-label,
  .sidebar .status-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
  }

  .sidebar .nav-item {
    justify-content: center;
    padding: 10px 8px;
  }

  .sidebar .sidebar-footer {
    justify-content: center;
  }

  .sidebar .sidebar-status {
    display: none;
  }

  .main-content {
    padding: 16px;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .kanban-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .memory-layout {
    grid-template-columns: 1fr;
  }

  .score-row {
    grid-template-columns: repeat(3, 1fr);
  }

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

/* ============================================================
   Usage Panel & Page Styles
   ============================================================ */

/* Monthly meter */
.usage-meter-wrap {
  margin-bottom: 20px;
}

.usage-meter-large {
  margin-bottom: 4px;
}

.usage-meter-track {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.usage-meter-track-lg {
  height: 14px;
  border-radius: 7px;
  margin-bottom: 10px;
}

.usage-meter-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

.usage-meter-labels {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.usage-meter-val {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--txt2);
}

.usage-meter-val-lg {
  font-size: 15px;
}

.usage-meter-pct {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--txt2);
}

.usage-meter-sub {
  font-size: 11px;
  color: var(--txt3);
  margin-top: 4px;
}

/* Section label */
.usage-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--txt3);
  text-transform: uppercase;
  margin-bottom: 10px;
  margin-top: 20px;
}

/* Stat grid inside usage panel */
.usage-stats {
  margin-bottom: 0;
}

.usage-stats .stat-card {
  padding: 12px 14px;
}

.usage-stats .stat-value {
  font-size: 16px;
}

/* Bar chart */
.usage-chart-wrap {
  margin-top: 4px;
}

.usage-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
  padding-top: 20px;
}

.usage-bar-chart-lg {
  height: 140px;
  gap: 4px;
  padding-top: 28px;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.usage-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 3px;
}

.usage-bar-val {
  font-size: 9px;
  color: var(--txt3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.usage-bar-outer {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  background: rgba(255,255,255,0.04);
  border-radius: 3px 3px 0 0;
  overflow: hidden;
  min-height: 4px;
}

.usage-bar-inner {
  width: 100%;
  border-radius: 3px 3px 0 0;
  opacity: 0.85;
  transition: height 0.6s cubic-bezier(0.4,0,0.2,1);
  min-height: 2px;
}

.usage-bar-label {
  font-size: 10px;
  color: var(--txt3);
  text-align: center;
}

.usage-bar-date {
  font-size: 9px;
  color: var(--txt3);
  opacity: 0.6;
}

/* Model breakdown */
.usage-model-wrap {
  margin-top: 4px;
}

.usage-model-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.usage-model-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.usage-model-row-full {
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}

.usage-model-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.usage-model-name {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt2);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-model-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
  overflow: hidden;
}

.usage-model-bar-fill {
  height: 100%;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
  min-width: 2px;
}

.usage-model-pct {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt3);
  min-width: 36px;
  text-align: right;
}

.usage-model-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--txt3);
}

/* Session list */
.usage-session-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.usage-session-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.usage-session-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.usage-session-name {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.usage-session-cost {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt3);
  flex-shrink: 0;
  margin-left: 8px;
}

/* Cache panel */
.usage-cache-wrap {
  text-align: center;
  padding: 16px 0 8px;
}

.usage-cache-big {
  font-family: var(--mono);
  font-size: 48px;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 8px;
}

.usage-cache-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.usage-cache-sub {
  font-size: 12px;
  color: var(--txt3);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Shared: Status Badges ── */
.status-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid transparent;
  flex-shrink: 0;
}

.status-badge-green {
  color: var(--green);
  background: var(--green-dim);
  border-color: rgba(34,197,94,0.25);
}

.status-badge-muted {
  color: var(--txt3);
  background: rgba(255,255,255,0.04);
  border-color: var(--border);
}

.status-badge-amber {
  color: var(--amber);
  background: var(--amber-dim);
  border-color: rgba(245,158,11,0.25);
}

/* ── Shared: Secondary Button ── */
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--txt2);
  border-radius: var(--r-sm);
  padding: 7px 14px;
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  border-color: var(--border-hi);
  color: var(--txt);
}

/* ── Calendar Page ── */
.cal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.cal-heartbeat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cal-meta-text {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt2);
}

.cal-meta-muted {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt3);
}

.cal-meta-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--txt3);
}

.cal-meta-sep {
  color: var(--txt3);
  font-size: 11px;
}

.cal-day-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}

.cal-day-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--txt3);
  text-align: center;
  padding: 4px 0;
  text-transform: uppercase;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-cell {
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  position: relative;
  transition: background var(--transition);
  min-height: 44px;
}

.cal-cell-empty {
  background: transparent;
  border-color: transparent;
}

.cal-cell-today {
  background: var(--blue-dim);
  border-color: rgba(59,130,246,0.2);
}

.cal-cell-has-tasks {
  background: rgba(255,255,255,0.04);
  border-color: var(--border);
}

.cal-cell-today.cal-cell-has-tasks {
  background: var(--blue-dim);
  border-color: rgba(59,130,246,0.3);
}

.cal-day-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--txt2);
  line-height: 1;
}

.cal-cell-today .cal-day-num {
  color: var(--blue);
  font-weight: 600;
}

.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
  flex-shrink: 0;
}

.cal-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.cal-legend-text {
  font-size: 11px;
  color: var(--txt3);
}

.cal-jobs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cal-job-card {
  padding: 14px 16px;
  border-radius: var(--r-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background var(--transition);
}

.cal-job-card:hover {
  background: var(--card-hover);
}

.cal-job-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cal-job-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--txt);
}

.cal-job-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cal-schedule-code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--blue);
  background: var(--blue-dim);
  padding: 1px 6px;
  border-radius: 4px;
}

.cal-job-desc {
  font-size: 12px;
  color: var(--txt3);
}

/* ── Docs Page ── */
.page-docs {
  height: calc(100vh - 48px);
  overflow: hidden;
}

.docs-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  min-height: calc(100vh - 180px);
  align-items: start;
}

.docs-sidebar {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  max-height: calc(100vh - 180px);
}

.docs-viewer {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  max-height: calc(100vh - 180px);
}

.docs-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 60px 24px;
  text-align: center;
  height: 100%;
}

.docs-empty-icon {
  font-size: 32px;
  opacity: 0.4;
}

.docs-empty-title {
  font-size: 14px;
  color: var(--txt2);
  font-weight: 500;
}

.docs-empty-sub {
  font-size: 12px;
  color: var(--txt3);
}

.docs-markdown {
  font-size: 12px;
  line-height: 1.7;
  color: var(--txt);
  tab-size: 2;
}

/* ── Agents Page ── */
.agent-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform var(--transition), background var(--transition);
}

.agent-card:hover {
  background: var(--card-hover);
  transform: translateY(-1px);
}

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

.agent-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--txt);
}

.agent-role-badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--txt3);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 10px;
}

.agent-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.agent-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.agent-dot-active {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse 2s infinite;
}

.agent-dot-inactive {
  background: var(--txt3);
}

.agent-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.agent-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.agent-meta-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--txt3);
}

.agent-meta-val {
  font-size: 12px;
  color: var(--txt2);
}

.agent-model-code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--blue);
  background: var(--blue-dim);
  padding: 1px 6px;
  border-radius: 4px;
}

.agent-sessions {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.agent-sessions-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--txt3);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.agent-session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
}

.agent-session-key {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt2);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.agent-session-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.agent-session-tag {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--txt3);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
}

.agent-session-tokens {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--blue);
  background: var(--blue-dim);
  padding: 1px 6px;
  border-radius: 4px;
}

.agent-session-age {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--txt3);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .docs-layout,
  .memory-layout {
    grid-template-columns: 1fr;
    min-height: unset;
  }

  .docs-sidebar,
  .memory-sidebar,
  .docs-viewer,
  .memory-viewer {
    max-height: 300px;
  }

  .cal-grid {
    gap: 2px;
  }

  .cal-cell {
    min-height: 36px;
  }

  .cal-day-num {
    font-size: 10px;
  }
}

/* ============================================================
   Freedom Meter — Quit My Job progress tracker
   ============================================================ */

.freedom-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.freedom-tagline {
  font-size: 11px;
  color: var(--txt2);
  font-family: var(--mono);
}

.freedom-zone-badge {
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid;
}

/* Composite track: bg zones + fill overlay */
.freedom-meter-wrap {
  position: relative;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
  margin-bottom: 10px;
}

.freedom-track-bg {
  position: absolute;
  inset: 0;
  display: flex;
}

.freedom-zone {
  height: 100%;
}

.freedom-track-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 7px;
  min-width: 2px;
}

.freedom-marker {
  position: absolute;
  top: -2px;
  width: 2px;
  height: calc(100% + 4px);
  border-left: 2px dashed;
  opacity: 0.7;
  transform: translateX(-50%);
}

.freedom-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 18px;
}

.freedom-legend-item {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--txt2);
  display: flex;
  align-items: center;
  gap: 5px;
}

.freedom-legend-sub {
  color: var(--txt3);
  font-size: 9px;
}

.freedom-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.freedom-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.freedom-stat-center {
  text-align: center;
  align-items: center;
}

.freedom-stat-right {
  text-align: right;
  align-items: flex-end;
}

.freedom-stat-val {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--txt);
  line-height: 1;
}

.freedom-stat-unit {
  font-size: 11px;
  color: var(--txt2);
  font-weight: 400;
}

.freedom-progress-pct {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.freedom-stat-label {
  font-size: 10px;
  color: var(--txt3);
  font-family: var(--mono);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.freedom-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--txt2);
  font-family: var(--mono);
}

.freedom-footer-sep {
  color: var(--txt3);
}

.freedom-footer-gap {
  color: var(--red);
  opacity: 0.85;
}

/* ============================================================
   OTFT Project Card
   ============================================================ */

.otft-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.otft-badge {
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(59,130,246,0.4);
  background: rgba(59,130,246,0.1);
  color: var(--blue);
}

.otft-sub {
  font-size: 11px;
  color: var(--txt3);
  font-family: var(--mono);
}

.otft-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.otft-metric {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px;
  text-align: center;
}

.otft-metric-val {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
}

.otft-metric-label {
  font-size: 9px;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--mono);
}

.otft-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.otft-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--txt2);
  font-family: var(--mono);
}

.otft-item-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.otft-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.otft-link {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--blue);
  cursor: pointer;
  opacity: 0.8;
  transition: opacity var(--transition);
}

.otft-link:hover {
  opacity: 1;
}
