:root {
  --bg: #081018;
  --bg-accent: #101d2a;
  --surface: rgba(17, 27, 39, 0.9);
  --surface-strong: rgba(22, 35, 50, 0.96);
  --surface-soft: rgba(255, 255, 255, 0.04);
  --border: rgba(160, 196, 255, 0.16);
  --border-strong: rgba(160, 196, 255, 0.28);
  --text: #edf4ff;
  --muted: #8ba0bb;
  --primary: #82aaff;
  --secondary: #5eead4;
  --warning: #fbbf24;
  --danger: #fb7185;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
  font-family: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(94, 234, 212, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(130, 170, 255, 0.12), transparent 30%),
    linear-gradient(180deg, var(--bg-accent) 0%, var(--bg) 52%, #060b11 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 28px 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.25rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
}

.hero p {
  max-width: 56ch;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.hero-status {
  display: grid;
  gap: 12px;
}

.hero-stat,
.panel,
.task-card,
.automation-card,
.kpi-card,
.column {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-stat {
  padding: 16px 18px;
  border-radius: 18px;
  backdrop-filter: blur(10px);
}

.hero-stat span,
.kpi-card span,
.task-card-meta,
.column-empty,
.automation-card p,
.section-heading p,
.bullet-list,
.field span,
.inline-error,
.empty-state {
  color: var(--muted);
}

.hero-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  text-transform: capitalize;
}

.hero-stat strong[data-tone='flowing'] {
  color: var(--secondary);
}

.hero-stat strong[data-tone='backlogged'] {
  color: var(--warning);
}

.hero-stat strong[data-tone='idle'] {
  color: var(--primary);
}

.top-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(9, 15, 24, 0.72);
  backdrop-filter: blur(12px);
}

.nav-link {
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--muted);
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
  background: rgba(130, 170, 255, 0.12);
}

.page-content {
  min-height: 50vh;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 20px;
}

.panel {
  padding: 22px;
  border-radius: 22px;
  backdrop-filter: blur(12px);
}

.panel.wide {
  grid-column: span 2;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.section-heading p {
  margin: 6px 0 0;
  line-height: 1.5;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card {
  padding: 16px;
  border-radius: 16px;
  background: var(--surface-strong);
}

.kpi-card strong {
  display: block;
  margin-top: 10px;
  font-size: 22px;
  line-height: 1.2;
}

.kpi-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.bullet-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
}

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

.column {
  padding: 14px;
  border-radius: 18px;
  background: var(--surface-strong);
}

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

.column-header h3 {
  margin: 0;
  font-size: 15px;
}

.column-header span {
  min-width: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(130, 170, 255, 0.12);
  text-align: center;
  font-size: 12px;
  color: var(--primary);
}

.column-cards {
  display: grid;
  gap: 10px;
}

.task-card {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.task-card-title {
  font-weight: 600;
  line-height: 1.35;
}

.task-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 12px;
}

.column-empty,
.empty-state {
  padding: 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  line-height: 1.5;
}

.error-state,
.inline-error {
  color: var(--danger);
}

.card-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: var(--border-strong);
}

.primary-button {
  padding: 13px 16px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #6ee7f9);
  color: #071018;
  font-weight: 800;
  cursor: pointer;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.automation-list {
  display: grid;
  gap: 14px;
}

.automation-card {
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--surface-strong);
}

.automation-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.automation-topline h3 {
  margin: 0;
  font-size: 16px;
}

.automation-topline span {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(130, 170, 255, 0.12);
  color: var(--primary);
  text-transform: capitalize;
  font-size: 12px;
  font-weight: 700;
}

.automation-topline span[data-state='active'] {
  background: rgba(94, 234, 212, 0.12);
  color: var(--secondary);
}

.automation-topline span[data-state='warming'] {
  background: rgba(251, 191, 36, 0.14);
  color: var(--warning);
}

@media (max-width: 980px) {
  .hero,
  .page-grid,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .panel.wide {
    grid-column: auto;
  }

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

@media (max-width: 640px) {
  .app-shell {
    padding: 24px 16px 40px;
  }

  .top-nav {
    overflow-x: auto;
  }
}
