:root {
  --bg: #05070b;
  --bg-2: #080c14;
  --panel: rgba(12, 17, 29, 0.82);
  --panel-2: rgba(17, 24, 39, 0.72);
  --line: rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.16);
  --text: #ffffff;
  --muted: #a7b0c0;
  --soft: #d7deea;
  --blue: #4f8cff;
  --cyan: #4de3ff;
  --violet: #8b5cf6;
  --green: #41f6a3;
  --amber: #ffc857;
  --red: #ff5c7a;
  --shadow-blue: 0 0 42px rgba(79,140,255,.22);
  --shadow-cyan: 0 0 48px rgba(77,227,255,.14);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Manrope', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 8%, rgba(79,140,255,.18), transparent 28%),
    radial-gradient(circle at 90% 12%, rgba(139,92,246,.12), transparent 30%),
    radial-gradient(circle at 55% 85%, rgba(77,227,255,.08), transparent 34%),
    linear-gradient(180deg, #05070b 0%, #070a12 48%, #030407 100%);
  letter-spacing: -0.02em;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(22px);
  background: rgba(5, 7, 11, .68);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.header-left { display: flex; align-items: center; gap: 22px; min-width: 0; }
.logo-mark { display: none; }
.brand-logo-wrap { width: 168px; min-width: 168px; display: flex; align-items: center; }
.brand-logo { width: 168px; height: auto; display: block; filter: drop-shadow(0 14px 34px rgba(0,0,0,.5)); }
.header-right { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; font-weight: 700; }
.header-status, .header-time {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 18px rgba(65,246,163,.85); }

.filter-bar { max-width: 1440px; margin: 28px auto 0; padding: 0 32px; }
.filter-bar-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  width: fit-content;
  box-shadow: var(--shadow-cyan);
}
.filter-btn {
  border: 0;
  color: var(--muted);
  background: transparent;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  transition: .22s ease;
}
.filter-btn:hover { color: #fff; background: rgba(255,255,255,.06); }
.filter-btn.active { color: #fff; background: linear-gradient(135deg, rgba(79,140,255,.95), rgba(77,227,255,.72)); box-shadow: 0 0 28px rgba(79,140,255,.35); }
.filter-btn.urgent.active { background: linear-gradient(135deg, rgba(255,92,122,.95), rgba(255,200,87,.75)); }

.main { max-width: 1440px; margin: 26px auto 64px; padding: 0 32px; }
.ceo-section { margin-bottom: 24px; }
.agents-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.bottom-row { display: grid; grid-template-columns: 1.05fr .95fr; gap: 20px; margin-top: 20px; }

.agent-card, .panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17,24,39,.78), rgba(7,10,18,.84));
  box-shadow: 0 24px 80px rgba(0,0,0,.38), 0 0 0 1px rgba(255,255,255,.025), var(--shadow-blue);
}
.agent-card::before, .panel::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.12), transparent 28%, transparent 70%, rgba(77,227,255,.07));
  opacity: .65;
}
.agent-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(circle at 20% 0%, rgba(79,140,255,.25), transparent 38%);
  opacity: .55;
}
.agent-card { padding: 22px; transition: transform .24s ease, border-color .24s ease, box-shadow .24s ease; }
.agent-card:hover { transform: translateY(-4px); border-color: rgba(77,227,255,.28); box-shadow: 0 28px 90px rgba(0,0,0,.44), 0 0 58px rgba(79,140,255,.26); }
.ceo-card { min-height: 320px; background: linear-gradient(135deg, rgba(14,23,45,.92), rgba(7,10,18,.88)); border-color: rgba(79,140,255,.28); }
.card-header { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.agent-icon {
  width: 52px; height: 52px;
  border-radius: 18px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, rgba(79,140,255,.95), rgba(139,92,246,.85));
  box-shadow: 0 0 32px rgba(79,140,255,.3);
  font-size: 22px;
  font-weight: 900;
}
.ceo-icon { background: linear-gradient(135deg, #4f8cff, #4de3ff); color: #04111f; }
.card-header-text { flex: 1; min-width: 0; }
.agent-name { margin: 0; color: #fff; font-size: 22px; line-height: 1.05; font-weight: 900; letter-spacing: -.045em; }
.agent-role { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; font-weight: 800; letter-spacing: .01em; }
.status-badge {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
}
.status-active { color: #b8ffdc; background: rgba(65,246,163,.09); border-color: rgba(65,246,163,.18); }
.status-idle { color: #d8e3f5; background: rgba(255,255,255,.055); }
.status-pending { color: #ffe7a9; background: rgba(255,200,87,.09); border-color: rgba(255,200,87,.18); }
.agent-desc { position: relative; z-index: 1; color: var(--soft); line-height: 1.55; margin: 0 0 18px; font-size: 14px; }
.card-meta { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.meta-item { padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.035); }
.meta-label { display:block; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 5px; }
.meta-value { color: #fff; font-size: 13px; font-weight: 800; }
.priority-critical { color: #ff8aa0; }
.priority-high { color: #ffd377; }
.priority-medium { color: #8fd7ff; }
.priority-low { color: #a8f5c8; }
.progress-row { position: relative; z-index: 1; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-bottom: 18px; }
.progress-label, .progress-pct { color: var(--muted); font-size: 12px; font-weight: 900; }
.progress-bar { height: 9px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.08); }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); box-shadow: 0 0 24px rgba(77,227,255,.55); }
.card-section { position: relative; z-index: 1; margin-top: 16px; }
.card-section h4 { margin: 0 0 10px; color: #fff; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.task-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.task-list li { color: var(--soft); font-size: 13px; line-height: 1.35; padding-left: 20px; position: relative; }
.task-list li::before { content: ''; position: absolute; left: 0; top: .45em; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 14px rgba(79,140,255,.7); }
.task-list li.done { color: var(--muted); }
.task-list li.done::before { background: var(--green); box-shadow: 0 0 14px rgba(65,246,163,.7); }
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tag { color: #eaf2ff; background: rgba(79,140,255,.10); border: 1px solid rgba(79,140,255,.18); padding: 7px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.panel { padding: 24px; }
.panel-title { position: relative; z-index: 1; margin: 0 0 18px; color: #fff; font-size: 19px; font-weight: 900; letter-spacing: -.035em; }
.workflow-list { position: relative; z-index: 1; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.workflow-item { display: flex; justify-content: space-between; gap: 16px; padding: 15px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.035); }
.workflow-name { color: #fff; font-weight: 850; }
.workflow-time { color: var(--muted); font-size: 13px; margin-top: 3px; }
.workflow-status { height: fit-content; padding: 6px 9px; border-radius: 999px; color: #cfe8ff; background: rgba(79,140,255,.12); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.notes-content { position: relative; z-index: 1; color: var(--soft); line-height: 1.6; font-size: 14px; }
.notes-content code { color: #b7ddff; background: rgba(79,140,255,.11); padding: 2px 6px; border-radius: 7px; }
.notes-content strong { color: #fff; }
.notes-tip { margin-top: 18px; padding: 14px; border-radius: 16px; background: rgba(79,140,255,.10); border: 1px solid rgba(79,140,255,.18); }

.gate-screen { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: radial-gradient(circle at 50% 15%, rgba(79,140,255,.16), transparent 32%), #05070b; }
.gate-screen.hidden { display: none; }
.gate-card { width: min(420px, calc(100vw - 32px)); padding: 36px; border: 1px solid var(--line-strong); border-radius: 28px; background: rgba(12,17,29,.88); box-shadow: 0 30px 100px rgba(0,0,0,.55), 0 0 50px rgba(79,140,255,.18); text-align: center; backdrop-filter: blur(18px); }
.gate-logo { width: 210px; max-width: 80%; height: auto; display: block; margin: 0 auto 22px; filter: drop-shadow(0 16px 40px rgba(0,0,0,.5)); }
.gate-badge { display:inline-flex; padding: 7px 12px; border-radius: 999px; color: #bfe9ff; background: rgba(79,140,255,.10); border: 1px solid rgba(77,227,255,.18); font-size: 11px; font-weight: 900; letter-spacing: .14em; margin-bottom: 14px; }
.gate-card p { color: var(--muted); margin: 0 0 20px; font-weight: 700; }
.gate-card input { width: 100%; border: 1px solid var(--line-strong); border-radius: 16px; padding: 15px 16px; background: rgba(2,6,23,.66); color: #fff; outline: none; margin-bottom: 12px; font: inherit; }
.gate-card input:focus { border-color: rgba(77,227,255,.45); box-shadow: 0 0 0 4px rgba(77,227,255,.08); }
.gate-card button { width: 100%; border: 0; border-radius: 16px; padding: 15px 16px; background: linear-gradient(135deg, var(--blue), var(--cyan)); color: #031020; font-weight: 950; cursor: pointer; font: inherit; }
.gate-error { min-height: 20px; color: #ff9bad; margin-top: 12px; font-size: 14px; font-weight: 800; }

.hidden-by-filter { display: none !important; }
@media (max-width: 1100px) { .agents-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bottom-row { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .header-inner { padding: 18px; align-items: flex-start; }
  .header-right { flex-direction: column; align-items: flex-end; gap: 8px; }
  .brand-logo-wrap { width: 122px; min-width: 122px; }
  .brand-logo { width: 122px; }
  .filter-bar, .main { padding-left: 16px; padding-right: 16px; }
  .filter-bar-inner { border-radius: 22px; width: 100%; }
  .agents-grid { grid-template-columns: 1fr; }
  .card-meta { grid-template-columns: 1fr; }
}
