/* ========================================
   KillerGrowth Mission Control — Styles
   ======================================== */

:root {
  --bg: #222222;
  --surface: #2a2a2a;
  --surface2: #323232;
  --border: #3a3a3a;
  --accent: #ccff00;
  --accent-dim: #99cc00;
  --text: #f0f0f0;
  --muted: #888888;
  --danger: #ff4444;
  --warning: #ffaa00;
  --success: #44cc66;
  --sidebar-bg: #1a1a1a;
  --sidebar-w: 240px;
  --radius: 8px;
  --radius-sm: 4px;
}

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

body {
  font-family: 'Roboto', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

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

/* ---- Login Page ---- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-kg-logo {
  max-width: 200px;
  height: auto;
  display: block;
  margin: 0 auto 12px;
}

.login-logo .logo-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 8px;
}

.login-logo h1 {
  font-size: 24px;
  color: var(--accent);
}

.login-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

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

.error-msg {
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Roboto', sans-serif;
}

.btn-primary {
  background: var(--accent);
  color: #111;
}

.btn-primary:hover { filter: brightness(1.1); }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--border); }

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover { filter: brightness(1.1); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  padding: 4px 8px;
}

.btn-ghost:hover { color: var(--text); }

.btn-full { width: 100%; justify-content: center; }

.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header .logo-icon {
  font-size: 28px;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-list {
  list-style: none;
  flex: 1;
  padding: 8px 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  transition: all 0.15s;
  text-decoration: none;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
}

.nav-link.active {
  color: var(--accent);
  background: rgba(204, 255, 0, 0.05);
  border-left-color: var(--accent);
  font-weight: 500;
}

.nav-icon { font-size: 18px; width: 24px; text-align: center; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name { font-size: 13px; font-weight: 500; }
.user-role { font-size: 11px; color: var(--muted); text-transform: uppercase; }

.btn-logout {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s;
}

.btn-logout:hover { color: var(--danger); border-color: var(--danger); }

/* ---- Main Content ---- */
.content {
  margin-left: var(--sidebar-w);
  padding: 24px 32px;
  min-height: 100vh;
}

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

.page-header h1 {
  font-size: 28px;
  color: var(--text);
}

.page-header .page-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}

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

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

.card-header h3 {
  font-size: 16px;
  color: var(--text);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ---- Stat Cards ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  font-family: 'Roboto Condensed', sans-serif;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 8px;
}

/* ---- Tags/Badges ---- */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-urgent { background: rgba(255, 68, 68, 0.15); color: var(--danger); }
.tag-high { background: rgba(255, 170, 0, 0.15); color: var(--warning); }
.tag-normal { background: rgba(204, 255, 0, 0.1); color: var(--accent); }
.tag-low { background: rgba(136, 136, 136, 0.15); color: var(--muted); }

.tag-active { background: rgba(68, 204, 102, 0.15); color: var(--success); }
.tag-inactive { background: rgba(136, 136, 136, 0.15); color: var(--muted); }
.tag-planning { background: rgba(100, 149, 237, 0.15); color: #6495ed; }
.tag-review { background: rgba(255, 170, 0, 0.15); color: var(--warning); }
.tag-complete, .tag-done, .tag-signed { background: rgba(68, 204, 102, 0.15); color: var(--success); }

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

.kanban-column {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 400px;
}

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

.kanban-column-header h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kanban-count {
  background: var(--surface2);
  color: var(--muted);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}

.kanban-cards {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.kanban-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.kanban-card-title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

.kanban-card-client {
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 4px;
}

/* ---- Client Cards ---- */
.client-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.15s;
}

.client-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.client-card-name {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.client-card-industry {
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.client-card-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.health-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}

.health-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}

/* ---- Progress Bars ---- */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
}

/* ---- Agent Hub ---- */
.agent-hub-container {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}

.agent-canvas {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  min-height: 500px;
  overflow: hidden;
}

.agent-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.agent-node:hover { transform: scale(1.1); }

.agent-dot {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s;
}

.agent-dot.active {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(204, 255, 0, 0.3);
  animation: pulse 2s infinite;
}

.agent-dot.center {
  width: 72px;
  height: 72px;
  font-size: 28px;
  border-width: 3px;
}

.agent-name {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.agent-node.active .agent-name { color: var(--accent); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(204, 255, 0, 0.3); }
  50% { box-shadow: 0 0 24px rgba(204, 255, 0, 0.6); }
}

.agent-line {
  position: absolute;
  height: 1px;
  background: var(--border);
  transform-origin: left center;
  pointer-events: none;
}

.agent-line.active {
  background: var(--accent);
  opacity: 0.4;
}

.agent-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.agent-detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.agent-detail-panel h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.agent-detail-role {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}

.activity-feed {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 400px;
  overflow-y: auto;
}

.activity-feed-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.activity-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.activity-item:last-child { border-bottom: none; }

.activity-agent {
  color: var(--accent);
  font-weight: 500;
}

.activity-time {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

/* ---- Filters ---- */
.filters-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.filters-bar select,
.filters-bar input[type="text"] {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 6px 12px;
  font-size: 13px;
  font-family: 'Roboto', sans-serif;
}

.filters-bar select:focus,
.filters-bar input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---- Tables ---- */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

th {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--muted);
  background: var(--surface);
}

td { color: var(--text); }

tr:hover td { background: rgba(255, 255, 255, 0.02); }

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

.template-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s;
}

.template-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.template-preview {
  height: 140px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--border);
}

.template-info {
  padding: 16px;
}

.template-info h4 {
  font-size: 15px;
  margin-bottom: 4px;
}

.template-info p {
  font-size: 12px;
  color: var(--muted);
}

/* ---- Pipeline Columns ---- */
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.pipeline-column {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pipeline-column-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pipeline-card {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.pipeline-card:hover { background: rgba(255,255,255,0.02); }
.pipeline-card:last-child { border-bottom: none; }

.pipeline-company {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 4px;
}

.pipeline-contact { font-size: 12px; color: var(--muted); }
.pipeline-value { font-size: 13px; color: var(--accent); font-weight: 500; margin-top: 4px; }

/* ---- Intel Cards ---- */
.intel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.intel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

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

.intel-card-header h4 { font-size: 15px; flex: 1; }

.bookmark-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  transition: transform 0.15s;
}

.bookmark-btn:hover { transform: scale(1.2); }

.intel-category {
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.intel-summary {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* ---- Memory ---- */
.memory-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 32px;
  font-size: 14px;
  line-height: 1.8;
}

.memory-content h1, .memory-content h2, .memory-content h3 {
  color: var(--accent);
  margin-top: 24px;
  margin-bottom: 12px;
}

.memory-content h1 { font-size: 24px; }
.memory-content h2 { font-size: 20px; }
.memory-content h3 { font-size: 16px; }

.memory-content p { margin-bottom: 12px; color: var(--muted); }
.memory-content ul, .memory-content ol { padding-left: 24px; margin-bottom: 12px; color: var(--muted); }
.memory-content li { margin-bottom: 4px; }
.memory-content code {
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13px;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

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

.modal-header h2 { font-size: 20px; }

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-close:hover { color: var(--text); }

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

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

.alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  border-left: 3px solid;
  font-size: 13px;
}

.alert-item.warning { border-left-color: var(--warning); }
.alert-item.danger { border-left-color: var(--danger); }
.alert-item.info { border-left-color: #6495ed; }

.alert-icon { font-size: 16px; }

/* ---- Sections ---- */
.section { margin-bottom: 24px; }

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

.section-header h2 {
  font-size: 18px;
}

/* ---- Detail View ---- */
.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.detail-back {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
}

.detail-back:hover { color: var(--text); border-color: var(--accent); }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ---- Scrollbar ---- */
::-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(--muted); }

/* ---- Two Column Layout ---- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* ---- Move Dropdown ---- */
.move-menu {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  z-index: 50;
  min-width: 150px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.move-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 12px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-family: 'Roboto', sans-serif;
}

.move-menu button:hover { background: var(--surface2); }
