:root {
  color-scheme: light;
  --ink: #18201f;
  --muted: #66716d;
  --panel: #ffffff;
  --line: #dce4e0;
  --soft: #f4f7f5;
  --brand: #24d979;
  --brand-dark: #0f8f52;
  --nav: #111918;
  --warn: #a06300;
  --risk: #b83333;
  --ok: #16834a;
  --blue: #315cba;
  --focus: #0b6f45;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #eef3f0;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input {
  border-radius: 8px;
}

button {
  cursor: pointer;
}

button:focus,
input:focus,
select:focus,
a:focus {
  outline: 3px solid rgba(36, 217, 121, 0.35);
  outline-offset: 2px;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(36, 217, 121, 0.14), transparent 34%),
    linear-gradient(180deg, #f6faf8, #dfe8e4);
}

.login-panel {
  width: min(440px, 100%);
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 18px 45px rgba(26, 39, 34, 0.12);
}

.login-logo {
  display: block;
  width: min(220px, 70%);
  height: auto;
  margin-bottom: 18px;
  object-fit: contain;
}

.login-lede {
  margin-bottom: 8px;
  font-size: 1.05rem;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--brand-dark);
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 2rem;
  line-height: 1.1;
  margin-bottom: 10px;
}

h2 {
  font-size: 1.35rem;
  margin-bottom: 14px;
}

h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.muted {
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  min-height: 42px;
  border: 1px solid var(--line);
  padding: 0 12px;
  background: #fff;
}

.primary,
.secondary,
.ghost,
.danger {
  min-height: 40px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 800;
}

.primary {
  background: var(--brand);
  color: #06110e;
}

.secondary {
  background: #e7f3ed;
  color: #0d4f33;
  border-color: #bfe4cf;
}

.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.danger {
  background: #fbe9e9;
  color: #8d1d1d;
  border-color: #efc4c4;
}

.error-text {
  min-height: 20px;
  color: var(--risk);
  font-weight: 700;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  background: var(--nav);
  color: #eef7f2;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 148px;
  padding: 4px 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-logo {
  display: block;
  height: auto;
  object-fit: contain;
}

.brand-logo-horizontal {
  width: min(210px, 100%);
  max-height: 136px;
}

.brand-logo-compact {
  display: none;
  width: 44px;
  max-height: 44px;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav button {
  width: 100%;
  min-height: 38px;
  border: 0;
  padding: 0 10px;
  color: #d8e4de;
  background: transparent;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  background: rgba(36, 217, 121, 0.16);
  color: #fff;
}

.main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 22px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar h1 {
  font-size: 1.25rem;
  margin: 0;
}

.search {
  width: min(360px, 40vw);
}

.content {
  padding: 24px;
  overflow: auto;
}

.hero,
.welcome-panel {
  display: grid;
  gap: 18px;
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.hero p {
  max-width: 820px;
  margin-bottom: 0;
  color: var(--muted);
}

.hero-status {
  min-width: 220px;
  display: grid;
  justify-items: end;
  gap: 8px;
}

.welcome-panel {
  max-width: 1080px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.section-gap {
  margin-top: 16px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  min-width: 0;
}

.department-workspace {
  background: transparent;
  min-width: 0;
}

.department-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
}

.department-card,
.mini-card,
.priority-card,
.soft-card {
  min-width: 0;
}

.department-selector {
  display: grid;
  gap: 8px;
  width: 100%;
  text-align: left;
  color: inherit;
}

.department-selector.active {
  border-color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px var(--brand-dark);
}

.mini-card,
.priority-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.priority-list {
  display: grid;
  gap: 10px;
}

.priority-title {
  font-size: 1.2rem;
  font-weight: 900;
}

.capability-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.capability-strip span {
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f5faf7;
  color: #24463a;
  font-size: 0.78rem;
  font-weight: 800;
}

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

.metric-value {
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.12;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.list {
  display: grid;
  gap: 10px;
}

.list-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  width: max-content;
  max-width: 100%;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  background: #e8eeeb;
  color: #31413b;
  overflow-wrap: anywhere;
}

.pill.ok {
  background: #dcf5e8;
  color: var(--ok);
}

.pill.watch {
  background: #fff2d8;
  color: var(--warn);
}

.pill.risk,
.pill.critical {
  background: #fbe4e4;
  color: var(--risk);
}

.pill.blocked {
  background: #eee7ff;
  color: #50369a;
}

.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tabs button {
  min-height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 10px;
}

.tabs button.active {
  background: var(--nav);
  color: #fff;
}

.progress {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #dfe7e3;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--brand-dark);
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.timeline-item p {
  margin-bottom: 0;
}

.dot {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--line);
}

.dot.ok {
  background: var(--ok);
}

.dot.watch {
  background: var(--warn);
}

.dot.risk,
.dot.critical {
  background: var(--risk);
}

.table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table th,
.table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th {
  background: #f2f6f4;
  font-size: 0.82rem;
}

.empty {
  padding: 18px;
  border: 1px dashed #b9c6c0;
  border-radius: 8px;
  color: var(--muted);
  background: #fbfdfc;
}

.notice {
  border-left: 4px solid var(--blue);
}

.private-note {
  background: #fff8e8;
  border-color: #ecd391;
}

.mobile-menu {
  display: none;
}

@media (max-width: 940px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .sidebar.open {
    display: flex;
    position: fixed;
    z-index: 10;
    inset: 0 auto 0 0;
    width: min(280px, 88vw);
  }

  .brand {
    min-height: 54px;
  }

  .brand-logo-horizontal {
    display: none;
  }

  .brand-logo-compact {
    display: block;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-left,
  .topbar-right {
    width: 100%;
    flex-wrap: wrap;
  }

  .search {
    width: 100%;
  }

  .hero,
  .department-header {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .hero-status {
    justify-items: start;
  }

  .content {
    padding: 16px;
  }

  .hero,
  .welcome-panel,
  .card,
  .department-header {
    padding: 16px;
  }

  h1 {
    font-size: 1.65rem;
  }
}

@media (max-width: 520px) {
  .topbar-right {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-right button,
  .topbar-right select,
  .action-row button {
    width: 100%;
  }

  .metric-value {
    font-size: 1.35rem;
  }
}
