:root {
  --bg: #0a0a0a;
  --bg-card: #111111;
  --bg-card-hover: #1a1a1a;
  --bg-sidebar: #0d0d0d;
  --border: #222;
  --text: #e0e0e0;
  --text-dim: #666;
  --text-bright: #fff;
  --accent: #00ff88;
  --accent-dim: #00cc6a;
  --accent-glow: rgba(0,255,136,0.15);
  --danger: #ff4444;
  --warning: #ffaa00;
  --blue: #4488ff;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Space Grotesk', sans-serif;
  --radius: 6px;
  --sidebar-w: 260px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 14px;
  min-height: 100vh; -webkit-font-smoothing: antialiased;
}

/* ── Layout ───────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); background: var(--bg-sidebar);
  border-right: 1px solid var(--border); position: fixed;
  height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
}
.sidebar-logo {
  padding: 16px 20px; font-family: var(--font-mono); font-weight: 700;
  font-size: 15px; color: var(--accent); letter-spacing: 2px;
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
}

.sidebar-section { padding: 12px 0; }
.sidebar-section-title {
  padding: 0 20px 8px; font-family: var(--font-mono); font-size: 10px;
  font-weight: 600; color: var(--text-dim); text-transform: uppercase;
  letter-spacing: 1.5px;
}

.sidebar-group-title {
  padding: 10px 20px 4px; font-family: var(--font-mono); font-size: 11px;
  font-weight: 600; color: var(--text); cursor: pointer;
  letter-spacing: 0.3px; transition: color 0.1s;
  border-left: 3px solid transparent;
}
.sidebar-group-title { display: flex; align-items: center; }
.sidebar-group-title:hover { color: var(--accent); }
.sidebar-group-title.active { color: var(--accent); border-left-color: var(--accent); }
.sidebar-group-add { font-size: 14px; color: var(--text-dim); opacity: 0; transition: opacity 0.15s; padding: 0 4px; }
.sidebar-group-title:hover .sidebar-group-add { opacity: 0.7; }
.sidebar-group-add:hover { opacity: 1 !important; color: var(--accent); }

.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 20px; cursor: pointer; transition: all 0.1s;
  border-left: 3px solid transparent;
}
.sidebar-item:hover { background: rgba(255,255,255,0.03); }
.sidebar-item.active { background: var(--accent-glow); border-left-color: var(--accent); }
.sidebar-item .dot-online { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); flex-shrink: 0; }
.sidebar-item .dot-offline { width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim); flex-shrink: 0; }
.sidebar-item-name { font-size: 13px; font-weight: 500; color: var(--text-bright); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-item-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); flex-shrink: 0; }
.sidebar-tg-link {
  font-size: 12px; color: var(--accent); text-decoration: none;
  opacity: 0; transition: opacity 0.1s; flex-shrink: 0; padding: 0 2px;
}
.sidebar-item:hover .sidebar-tg-link { opacity: 1; }
.sidebar-tg-link:hover { color: var(--text-bright); }

.sidebar-item-badge {
  font-family: var(--font-mono); font-size: 9px; padding: 1px 5px;
  border-radius: 3px; flex-shrink: 0;
}
.badge-admin { background: var(--accent-glow); color: var(--accent); }
.badge-user { background: rgba(255,255,255,0.05); color: var(--text-dim); }
.badge-head { background: var(--accent-glow); color: var(--accent); }
.badge-owner {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: var(--bg); font-weight: 700; letter-spacing: 0.5px;
}

.sidebar-bottom {
  margin-top: auto; border-top: 1px solid var(--border); padding: 8px 0;
}

.content { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; min-width: 0; overflow-x: hidden; }

/* ── Content Header ───────────── */
.content-header {
  padding: 16px 32px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.content-header h2 { font-size: 18px; font-weight: 600; color: var(--text-bright); }

/* ── Tabs (inside content) ────── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); padding: 0 32px; }
.tab {
  padding: 10px 16px; font-family: var(--font-mono); font-size: 12px;
  font-weight: 600; color: var(--text-dim); background: none; border: none;
  border-bottom: 2px solid transparent; cursor: pointer; transition: all 0.1s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-content { padding: 24px 32px; overflow-wrap: break-word; word-break: break-word; }

/* ── Buttons ──────────────────── */
.btn {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  padding: 8px 16px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text); transition: all 0.1s; letter-spacing: 0.5px;
}
.btn:hover { border-color: var(--text-dim); color: var(--text-bright); }
.btn-primary { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-dim); }
.btn-danger { color: var(--danger); border-color: transparent; background: none; }
.btn-danger:hover { border-color: var(--danger); }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn.loading { opacity: 0.6; pointer-events: none; }
.btn.loading::after {
  content: ''; width: 12px; height: 12px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: spin 0.6s linear infinite;
  display: inline-block; margin-left: 6px; vertical-align: middle;
}

/* ── Cards ────────────────────── */
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.lib-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 10px; transition: all 0.1s; cursor: pointer;
}
.lib-card:hover { border-color: var(--accent); }
.lib-card-title { font-weight: 600; font-size: 12px; color: var(--text-bright); margin-bottom: 2px; }
.lib-card-desc { font-size: 10px; color: var(--text-dim); margin-bottom: 3px; max-height: 28px; overflow: hidden; }
.lib-card-meta { font-family: var(--font-mono); font-size: 9px; color: var(--text-dim); }

/* ── Toolkit compact ──────────── */
.toolkit-compact .tk-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px;
}
.toolkit-compact .tk-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.toolkit-compact .tk-title {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  color: var(--text); text-transform: uppercase; letter-spacing: 1px;
}
.toolkit-compact .tk-count {
  display: inline-block; min-width: 18px; padding: 0 5px;
  background: var(--border); color: var(--text-dim);
  border-radius: 10px; font-size: 9px; text-align: center; margin-left: 4px;
}
.toolkit-compact .tk-details { margin-top: 6px; }
.toolkit-compact .tk-details summary {
  cursor: pointer; font-family: var(--font-mono); font-size: 9px;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px;
  user-select: none; padding: 2px 0;
}
.toolkit-compact .tk-details summary:hover { color: var(--text); }
.toolkit-compact .tk-section-wip { opacity: 0.65; position: relative; }
.toolkit-compact .tk-section-wip::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg, transparent, transparent 14px, rgba(255,170,0,0.025) 14px, rgba(255,170,0,0.025) 28px);
  pointer-events: none; border-radius: var(--radius);
}
.tk-wip-badge {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  font-family: var(--font-mono); font-size: 8px; font-weight: 600;
  background: rgba(255,170,0,0.15); color: var(--warning);
  border: 1px solid rgba(255,170,0,0.3); border-radius: 3px;
  text-transform: uppercase; letter-spacing: 1px;
}

/* ── Settings tab ──────────────── */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px; }
.settings-block {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
}
.settings-block-title {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  color: var(--text); text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.settings-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.settings-row:last-child { margin-bottom: 0; }
.settings-row label {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px;
  min-width: 80px; flex-shrink: 0;
}
.settings-row .form-input,
.settings-row .form-select {
  flex: 1; padding: 4px 8px; font-size: 12px; min-height: 0; height: 26px;
}
.sidebar-version {
  font-family: var(--font-mono); font-size: 9px; color: var(--text-dim);
  text-align: center; padding: 8px 0 4px; letter-spacing: 1px;
  border-top: 1px solid var(--border); margin-top: 8px;
}
.settings-claude-preview {
  font-size: 12px; line-height: 1.6; color: var(--text);
  max-height: 280px; overflow-y: auto;
  padding: 6px 0; margin-top: 4px;
}

/* ── Identity Card (preview-on-click) ─────────────────── */
.identity-card {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--bg-card) 0%, #0f0f0f 100%);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 18px 20px; margin-top: 12px;
  display: flex; align-items: center; gap: 18px;
  cursor: pointer; transition: all 0.2s ease;
}
.identity-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 0% 0%, var(--accent-glow), transparent 50%);
  opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
}
.identity-card:hover {
  border-color: var(--accent); transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0,255,136,0.08);
}
.identity-card:hover::before { opacity: 1; }
.identity-card-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  font-size: 20px; color: var(--accent);
  position: relative; z-index: 1;
}
.identity-card-body { flex: 1; min-width: 0; position: relative; z-index: 1; }
.identity-card-label {
  font-family: var(--font-mono); font-size: 9px; font-weight: 600;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 4px;
}
.identity-card-title {
  font-size: 14px; font-weight: 600; color: var(--text-bright);
  margin-bottom: 4px;
}
.identity-card-snippet {
  font-size: 12px; color: var(--text-dim); line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.identity-card-snippet.empty { font-style: italic; color: #444; }
.identity-card-meta {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-dim);
  margin-top: 6px; letter-spacing: 0.5px;
}
.identity-card-arrow {
  flex-shrink: 0; color: var(--text-dim); font-size: 18px;
  transition: transform 0.2s ease, color 0.2s ease;
  position: relative; z-index: 1;
}
.identity-card:hover .identity-card-arrow {
  transform: translateX(4px); color: var(--accent);
}

/* ── Markdown View (preview modal) ────────────────────── */
.modal-md { max-width: 820px !important; }
.modal-md .modal-body { padding: 28px 36px; }
.modal-md .modal-footer { padding: 14px 24px; gap: 12px; }
.md-modal-meta {
  display: flex; flex-direction: column; gap: 2px;
  font-family: var(--font-mono); font-size: 10px; color: var(--text-dim);
}
.md-modal-file { color: var(--accent); letter-spacing: 0.5px; }
.md-modal-stat { font-size: 9px; opacity: 0.7; }

.md-view {
  font-family: var(--font-body); font-size: 14px; line-height: 1.75;
  color: var(--text); max-height: 65vh; overflow-y: auto;
  padding-right: 8px;
}
.md-view h2, .md-view h3, .md-view h4 {
  color: var(--text-bright) !important; font-weight: 600;
  letter-spacing: -0.01em;
}
.md-view h2 { font-size: 22px !important; margin: 24px 0 10px !important;
  padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.md-view h2:first-child { margin-top: 0 !important; }
.md-view h3 { font-size: 17px !important; margin: 20px 0 8px !important; color: var(--accent) !important; }
.md-view h4 { font-size: 14px !important; margin: 16px 0 4px !important;
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-dim) !important; }
.md-view div { margin: 4px 0; }
.md-view code { font-size: 13px !important; }
.md-view strong { color: var(--text-bright); }
.md-view::-webkit-scrollbar { width: 6px; }
.md-view::-webkit-scrollbar-track { background: transparent; }
.md-view::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.md-view::-webkit-scrollbar-thumb:hover { background: #333; }

.md-view-empty {
  text-align: center; padding: 60px 20px; color: var(--text-dim);
}
.md-empty-icon { font-size: 48px; color: var(--border); margin-bottom: 16px; }
.md-empty-text { font-size: 16px; color: var(--text); margin-bottom: 8px; }
.md-empty-hint { font-size: 13px; color: var(--text-dim); }

/* ── Markdown Editor (edit mode in modal) ─────────────── */
.md-edit-wrap { display: flex; flex-direction: column; gap: 8px; }
.md-editor {
  width: 100%; min-height: 60vh;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 16px 18px; font-family: var(--font-mono); font-size: 13px;
  line-height: 1.6; resize: vertical;
  outline: none; transition: border-color 0.15s ease;
}
.md-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-glow); }
.md-edit-hint {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-dim);
  text-align: right; padding-right: 4px; letter-spacing: 0.5px;
}
.md-edit-hint kbd {
  display: inline-block; padding: 1px 5px; margin: 0 2px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 3px;
  font-family: var(--font-mono); font-size: 9px; color: var(--text);
}

/* ── User List (Company → Users tab) ──────────────────── */
.user-list { display: flex; flex-direction: column; gap: 1px; }
.user-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; cursor: pointer;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; transition: all 0.15s ease;
}
.user-row + .user-row { margin-top: 4px; }
.user-row:hover {
  border-color: var(--accent); background: #131313;
  transform: translateX(2px);
}
.user-row-main { flex: 1; min-width: 0; }
.user-row-name {
  font-size: 13px; color: var(--text-bright); font-weight: 500;
  display: flex; align-items: center; flex-wrap: wrap;
}
.user-row-sub {
  display: flex; align-items: center; gap: 6px; margin-top: 3px;
  font-family: var(--font-mono); font-size: 10px; color: var(--text-dim);
}
.user-row-id { letter-spacing: 0.5px; }
.user-row-agent { color: var(--accent); }
.user-row-msgs { color: var(--text-dim); }
.user-row-dot { opacity: 0.4; }
.user-row-time {
  flex-shrink: 0; font-family: var(--font-mono);
  font-size: 10px; color: var(--text-dim);
  text-align: right; min-width: 80px;
}
.user-row-arrow {
  color: var(--text-dim); font-size: 16px;
  transition: transform 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}
.user-row:hover .user-row-arrow { color: var(--accent); transform: translateX(3px); }

.user-row-chips {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px;
}
.user-agent-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 9px;
  background: var(--bg); border: 1px solid var(--border);
  padding: 2px 7px; border-radius: 3px;
  color: var(--accent);
  letter-spacing: 0.5px;
}
.user-agent-chip-count {
  color: var(--text-dim); font-size: 9px;
}

/* ── Reminders list (Company → Reminders tab) ─────────── */
.reminder-group { margin-bottom: 20px; }
.reminder-group-title {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: var(--text); text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 8px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.reminder-group-title .count {
  background: var(--bg); color: var(--text-dim);
  padding: 1px 6px; border-radius: 8px; font-size: 9px;
}
.reminder-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 12px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 6px;
  margin-bottom: 4px; transition: border-color 0.15s ease;
}
.reminder-row:hover { border-color: #333; }
.reminder-icon {
  flex-shrink: 0; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid var(--border); border-radius: 5px;
  color: var(--accent); font-size: 12px;
}
.reminder-body { flex: 1; min-width: 0; }
.reminder-label { font-size: 13px; color: var(--text-bright); font-weight: 500; }
.reminder-meta {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-dim);
  margin-top: 3px;
}
.reminder-meta .reminder-type {
  display: inline-block; padding: 1px 6px;
  background: var(--bg); border-radius: 3px; margin-right: 6px;
  color: var(--accent);
}
.reminder-prompt {
  font-size: 11px; color: var(--text-dim); margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 600px;
}

/* ── Section ──────────────────── */
.section { margin-bottom: 28px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 1.5px;
}

.block {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}

.empty-state {
  text-align: center; padding: 32px; color: var(--text-dim);
  font-size: 13px; font-family: var(--font-mono);
}

/* ── Agent Cards ──────────────── */
.agent-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.agent-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px; cursor: pointer;
  transition: all 0.15s;
}
.agent-card:hover { border-color: var(--accent); background: var(--bg-card-hover); }
.agent-card-header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.agent-card-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.agent-card-online { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.agent-card-offline { background: var(--text-dim); }
.agent-card-name { font-size: 13px; font-weight: 600; color: var(--text-bright); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-card-badge { font-family: var(--font-mono); font-size: 8px; padding: 1px 5px; border-radius: 3px; flex-shrink: 0; }
.agent-card-role {
  font-size: 11px; color: var(--text-dim); margin-bottom: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.agent-card-stats {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-dim);
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.agent-card-tags-inline { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.agent-card-lastactive { font-family: var(--font-mono); font-size: 9px; color: var(--text-dim); margin-top: 3px; }
.agent-card-tg {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  color: var(--accent); text-decoration: none; flex-shrink: 0;
  white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis;
}
.agent-card-tg:hover { color: var(--text-bright); }
.agent-card-autopilot {
  font-size: 12px; background: var(--bg-card); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 3px 10px; cursor: pointer; transition: all 0.1s;
  font-family: var(--font-mono);
}
.agent-card-autopilot:hover { border-color: var(--accent); color: var(--accent); }
.agent-card-autopilot.autopilot-active {
  background: var(--accent-glow); color: var(--accent); border-color: var(--accent);
  animation: pulse-glow 2s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 4px var(--accent-glow); }
  50% { box-shadow: 0 0 12px var(--accent-glow); }
}
.agent-card-autopilot-status {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-dim);
  margin-top: 6px; min-height: 14px;
}

/* ── Activity Feed ────────────── */
.feed-item {
  padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.03);
}
.feed-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.feed-agent { font-weight: 600; font-size: 12px; color: var(--accent); }
.feed-arrow { color: var(--text-dim); font-size: 11px; }
.feed-user { font-weight: 500; font-size: 12px; color: var(--blue); }
.feed-time { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); margin-left: auto; }
.feed-text { font-size: 13px; color: var(--text); line-height: 1.5; word-break: break-word; overflow-wrap: break-word; }

/* ── Table ────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px;
  padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border);
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.table tr { cursor: pointer; transition: background 0.1s; }
.table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Item List ────────────────── */
.item-list { list-style: none; }
.item-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.item-list li:last-child { border-bottom: none; }
.item-name { font-weight: 500; font-size: 13px; color: var(--text-bright); }
.item-desc { font-size: 12px; color: var(--text-dim); }

/* ── Tags ─────────────────────── */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: var(--font-mono); font-size: 11px; padding: 2px 8px;
  border-radius: 3px; border: 1px solid var(--border); color: var(--text-dim);
}
.tag-skill { border-color: #335; color: var(--blue); }
.tag-conn { border-color: #353; color: var(--accent); }

/* ── Tooltip ──────────────────── */
[data-tooltip] { position: relative; cursor: default; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 0;
  background: #1a1a1a; color: var(--text); border: 1px solid var(--border);
  font-family: var(--font-body); font-size: 11px; font-weight: 400;
  padding: 6px 10px; border-radius: 4px;
  white-space: normal; max-width: 280px; width: max-content;
  z-index: 100; pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* ── Forms ────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }
.form-label {
  display: block; font-family: var(--font-mono); font-size: 11px;
  font-weight: 600; color: var(--text-dim); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-family: var(--font-mono);
  font-size: 13px; padding: 10px 12px; outline: none; transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent); }
.form-textarea { resize: vertical; min-height: 120px; }
.form-textarea.tall { min-height: 300px; }
.form-hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; font-family: var(--font-mono); }
.form-input.invalid, .form-textarea.invalid { border-color: var(--danger) !important; }
.form-error { font-size: 11px; color: var(--danger); margin-top: 4px; font-family: var(--font-mono); }

textarea.code-editor {
  width: 100%; min-height: 300px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--accent); font-family: var(--font-mono); font-size: 13px;
  padding: 16px; resize: vertical; outline: none;
}
textarea.code-editor:focus { border-color: var(--accent); }

/* ── Modal ────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: all 0.15s; backdrop-filter: blur(4px);
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-overlay.active .modal { transform: translateY(0) scale(1); opacity: 1; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; width: 90%; max-width: 600px; max-height: 85vh;
  overflow-y: auto; transform: translateY(16px) scale(0.98); opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.modal-wide { max-width: 720px; }
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--bg-card); z-index: 1;
}
.modal-header h3 { font-size: 16px; font-weight: 600; color: var(--text-bright); }
.modal-close {
  background: none; border: none; color: var(--text-dim); font-size: 20px;
  cursor: pointer; padding: 4px 8px; line-height: 1;
}
.modal-close:hover { color: var(--text-bright); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  position: sticky; bottom: 0; background: var(--bg-card); z-index: 1;
}

/* ── Toast ────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 2000;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 20px;
  color: var(--text); box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transform: translateX(120%); transition: transform 0.25s ease;
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px;
}
.toast.show { transform: translateX(0); }
.toast-success { border-left: 3px solid var(--accent); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--blue); }

/* ── Loading ──────────────────── */
.loading-overlay {
  position: fixed; inset: 0; background: var(--bg);
  z-index: 9999; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px; transition: opacity 0.3s;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Progress Bar ─────────────── */
.progress-bar { background: var(--border); height: 6px; border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }

/* ── Chart Bar ───────────────── */
.chart-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.chart-label { width: 90px; font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-bar { flex: 1; background: var(--border); height: 14px; border-radius: 3px; overflow: hidden; }
.chart-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.chart-value { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); min-width: 40px; text-align: right; }

/* ── Stat Block (company settings) ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat-card-label { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); text-transform: uppercase; }
.stat-card-value { font-size: 22px; font-weight: 600; color: var(--text-bright); }

/* ── Details/Summary ─────────── */
.details-header { cursor: pointer; font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; user-select: none; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
