:root {
  color-scheme: dark;
  --bg: #080a12;
  --panel: #11131c;
  --panel-strong: #171a26;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f5e9ff;
  --muted: #a9a0b8;
  --faint: #6f6880;
  --purple: #5b3df5;
  --blue: #118dff;
  --green: #2ecc71;
  --orange: #f39c12;
  --pink: #e84393;
  --red: #e74c3c;
  --cyan: #25d6ff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% -10%, rgba(17, 141, 255, 0.18), transparent 34rem),
    radial-gradient(circle at 82% 2%, rgba(232, 67, 147, 0.13), transparent 30rem),
    linear-gradient(135deg, #080a12 0%, #0d1019 45%, #090b12 100%);
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 430px);
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 19, 28, 0.92);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.auth-card h1 {
  margin: 4px 0 8px;
  font-size: 2rem;
}

.auth-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.auth-card input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.auth-error {
  min-height: 18px;
  margin: 0;
  color: #ff9a9a;
  font-size: 0.86rem;
}

.auth-brand {
  padding: 0;
}

.inline-form {
  display: grid;
  gap: 12px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.inline-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}

.inline-form input,
.inline-form select,
.inline-form textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: rgba(8, 10, 18, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  font-weight: 900;
}

.brand strong,
.brand span,
.agent-feed strong,
.agent-feed span {
  display: block;
}

.brand span,
.agent-feed span,
.subtle {
  color: var(--muted);
  font-size: 0.82rem;
}

.nav-list {
  display: grid;
  gap: 5px;
  margin-top: 22px;
}

.nav-list p {
  margin: 14px 10px 4px;
  color: var(--faint);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border-left: 2px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
}

.nav-item svg {
  width: 17px;
  height: 17px;
}

.nav-item.active,
.nav-item:hover {
  color: var(--text);
  border-left-color: var(--purple);
  background: rgba(255, 255, 255, 0.07);
}

.agent-feed {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.feed-head {
  display: flex;
  gap: 9px;
  align-items: center;
}

.feed-item {
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.feed-item strong {
  color: var(--text);
  font-size: 0.84rem;
}

.status-dot,
.status-pill span,
.live-pill span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 18px rgba(46, 204, 113, 0.72);
}

.main {
  min-width: 0;
  width: min(1500px, 100%);
  padding: 28px;
}

.topbar,
.section-head,
.panel-head,
.dialog-head,
.top-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  min-width: 0;
  margin: -28px 0 24px;
  padding: 24px 0 16px;
  background: linear-gradient(180deg, rgba(8, 10, 18, 0.97), rgba(8, 10, 18, 0.78));
  backdrop-filter: blur(18px);
}

.topbar > div:first-child {
  min-width: 0;
}

.top-actions {
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#projectLine {
  overflow-wrap: anywhere;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

h2 {
  margin-bottom: 0;
  font-size: 1.2rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 0.98rem;
}

.icon-button,
.primary-button,
.secondary-button,
.segmented button,
.status-pill,
.meta-pill {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.icon-button {
  width: 40px;
  padding: 0;
}

.icon-button.small {
  width: 34px;
  min-height: 34px;
}

.icon-button svg,
.primary-button svg,
.secondary-button svg {
  width: 18px;
  height: 18px;
}

.primary-button {
  padding: 0 15px;
  border-color: rgba(91, 61, 245, 0.65);
  background: linear-gradient(135deg, var(--purple), #215dff);
  font-weight: 850;
}

.secondary-button {
  padding: 0 15px;
  font-weight: 800;
}

.status-pill,
.meta-pill {
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.project-switcher {
  display: inline-grid;
  gap: 4px;
  min-width: min(220px, 100%);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-switcher select {
  min-height: 40px;
  letter-spacing: 0;
  text-transform: none;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: stretch;
  min-height: 270px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(17, 19, 28, 0.97), rgba(17, 19, 28, 0.72)),
    linear-gradient(135deg, rgba(91, 61, 245, 0.2), rgba(37, 214, 255, 0.08));
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 800px;
}

.hero-copy h2 {
  max-width: 790px;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1;
}

.hero-copy p {
  max-width: 640px;
  margin: 16px 0 0;
  color: var(--muted);
}

.live-pill,
.score-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(46, 204, 113, 0.24);
  border-radius: 999px;
  color: var(--green);
  background: rgba(46, 204, 113, 0.08);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-console,
.panel,
.metric-card,
.agent-card,
.mini-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 19, 28, 0.84);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.hero-console {
  align-self: center;
}

.console-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.console-row:last-child {
  border-bottom: 0;
}

.console-row span,
.metric-card span,
th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.console-row strong {
  font-size: 1.5rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.metric-card,
.mini-card {
  min-height: 126px;
  padding: 17px;
}

.metric-card strong {
  display: block;
  margin: 14px 0 7px;
  color: var(--green);
  font-size: 2rem;
}

.metric-card small,
.mini-card small {
  color: var(--faint);
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: 18px;
  margin-top: 18px;
}

.panel {
  min-height: 320px;
  padding: 18px;
}

.setup-panel {
  min-height: 0;
  margin-top: 18px;
  border-color: rgba(91, 61, 245, 0.36);
}

.setup-panel.configured {
  display: none;
}

.company-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.tool-panel {
  max-width: 980px;
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.agent-grid.compact {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.agent-card {
  min-height: 184px;
  padding: 16px;
  border-top: 3px solid var(--agent-color);
}

.agent-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.agent-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--agent-color);
  color: #070a12;
  font-weight: 950;
}

.agent-card p,
.task-row p,
.competitor-row p,
.platform-row p,
.mini-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.agent-task {
  min-height: 52px;
  margin: 16px 0 12px;
  font-weight: 800;
}

.agent-meta,
.task-title,
.competitor-title,
.platform-title,
.mini-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agent-meta {
  color: var(--faint);
  font-size: 0.82rem;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.segmented button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  color: var(--muted);
  background: transparent;
}

.segmented button.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.status-grid,
.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.scope-panel {
  min-height: 0;
  margin: 18px 0;
}

.scope-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-card p strong {
  color: var(--text);
}

.task-list,
.platform-list,
.competitor-list,
.cluster-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.task-row,
.platform-row,
.competitor-row,
.recommendation-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.task-title h3,
.competitor-title h3 {
  margin: 0;
}

.pill,
.rank-pill,
.intent-pill,
.task-priority {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: capitalize;
}

.pill {
  color: var(--cyan);
  background: rgba(37, 214, 255, 0.08);
}

.rank-pill {
  color: var(--green);
  background: rgba(46, 204, 113, 0.08);
}

.intent-pill {
  color: var(--cyan);
  background: rgba(37, 214, 255, 0.08);
}

.task-priority {
  color: var(--orange);
  background: rgba(243, 156, 18, 0.08);
}

.table-wrap {
  overflow-x: auto;
  margin-top: 16px;
}

.user-create-form {
  margin-top: 18px;
}

.user-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.user-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.user-card-head,
.user-actions,
.user-badges {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-card-head {
  justify-content: space-between;
}

.user-card-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.user-badges,
.user-actions {
  flex-wrap: wrap;
}

.project-access-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.check-item {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.84rem;
  font-weight: 760;
}

.check-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--purple);
}

table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

td {
  color: #ece5f7;
}

.bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.donut-wrap {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  margin-top: 18px;
}

.donut {
  display: grid;
  width: 160px;
  height: 160px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--blue) 0 45%, var(--purple) 45% 75%, var(--orange) 75% 92%, var(--pink) 92% 100%);
  position: relative;
}

.donut::after {
  position: absolute;
  content: "";
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--panel);
}

.donut span {
  z-index: 1;
  font-weight: 950;
}

.legend-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.kanban-column {
  min-width: 220px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.kanban-column h3 {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kanban-card {
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  background: rgba(17, 19, 28, 0.9);
}

.kanban-card strong {
  display: block;
  margin-bottom: 8px;
}

.kanban-card small {
  color: var(--muted);
}

.chat-box {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.chat-message {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.chat-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  padding: 0 12px;
}

textarea {
  min-height: 96px;
  padding: 12px;
  resize: vertical;
}

option {
  background: var(--panel);
}

dialog {
  width: min(620px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-strong);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.task-form {
  display: grid;
  gap: 15px;
  padding: 20px;
}

.task-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 850;
}

.company-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 850;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.submit {
  min-height: 48px;
}

@media (max-width: 1240px) {
  .metric-grid,
  .agent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-col,
  .hero-band {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 840px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    max-height: none;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-list p {
    grid-column: 1 / -1;
  }

  .nav-item {
    justify-content: center;
  }

  .nav-item span {
    display: none;
  }

  .main {
    padding: 18px;
  }

  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    margin: -18px 0 18px;
    padding: 18px 0;
  }

  .top-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .hero-copy h2 {
    font-size: 2.05rem;
    line-height: 1.05;
  }

  .metric-grid,
  .agent-grid,
  .agent-grid.compact,
  .status-grid,
  .report-grid,
  .scope-grid,
  .donut-wrap,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .top-actions,
  .primary-button {
    width: 100%;
  }

  .nav-list {
    grid-template-columns: repeat(5, 1fr);
  }

  .hero-band,
  .panel {
    min-width: 0;
    padding: 16px;
  }
}
