:root {
  color-scheme: dark;
  --bg: #080b09;
  --panel: #111710;
  --panel-2: #171f18;
  --line: #293529;
  --ink: #f3f7f0;
  --muted: #a8b4a4;
  --accent: #9bb794;
  --accent-2: #c1d6ba;
  --danger: #ff6b6b;
  --warn: #f5c451;
  --blue: #8db9f2;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}

button,
input,
select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1510;
  color: var(--ink);
  font: inherit;
}

button {
  padding: 8px 12px;
  cursor: pointer;
}

button:hover,
button:focus-visible {
  border-color: var(--accent);
}

input,
select {
  width: 100%;
  padding: 8px 10px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(320px, auto);
  gap: 18px;
  align-items: center;
  padding: 16px max(18px, calc((100vw - 1440px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 9, .96);
}

h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: 0;
}

p {
  margin: 0;
}

.app-header p,
.muted,
.meta {
  color: var(--muted);
}

main {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 42px;
}

.login-form {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(150px, .7fr) auto;
  gap: 8px;
}

.login-form button,
.user-panel button,
.tab.active {
  border-color: #8fad87;
  background: #8fad87;
  color: #071009;
  font-weight: 760;
}

.user-panel {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
}

.user-panel span {
  color: var(--accent-2);
  font-weight: 700;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(320px, 440px);
  gap: 18px;
  align-items: stretch;
  min-height: 360px;
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.auth-copy {
  display: grid;
  align-content: center;
  gap: 10px;
}

.auth-copy h2 {
  margin: 0;
  max-width: 620px;
  font-size: 31px;
  line-height: 1.1;
  letter-spacing: 0;
}

.auth-copy p {
  max-width: 540px;
  color: var(--muted);
}

.eyebrow {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-shell .login-form {
  align-self: center;
  grid-template-columns: 1fr;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d130e;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.notice {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

.notice b {
  color: var(--ink);
}

.notice:empty {
  display: none;
}

.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.stat {
  min-height: 76px;
  padding: 11px 13px;
  text-align: left;
  background: var(--panel);
}

.stat b {
  display: block;
  font-size: 27px;
  line-height: 1;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
}

.stat.urgent b {
  color: var(--danger);
}

.stat.warning b {
  color: var(--warn);
}

.toolbar {
  position: sticky;
  top: 76px;
  z-index: 9;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 240px) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 9, .96);
}

.tabs {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.tab {
  color: var(--muted);
  background: #111710;
}

.view-root {
  padding-top: 14px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 10px;
}

.section-head h2 {
  margin: 0;
  font-size: 20px;
}

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

.row-list {
  display: grid;
  gap: 8px;
}

.item {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.item.compact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.item h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.item p {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.pill-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #101610;
  font-size: 12px;
}

.pill.open,
.pill.plant {
  color: var(--accent-2);
  border-color: #40563c;
}

.pill.done {
  color: var(--blue);
  border-color: #30465e;
}

.pill.cancelled,
.pill.critical,
.pill.high,
.pill.overdue {
  color: var(--danger);
  border-color: #5c3030;
}

.pill.deferred,
.pill.medium,
.pill.today,
.pill.warn {
  color: var(--warn);
  border-color: #5b4a22;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .45fr);
  gap: 10px;
}

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

@media (max-width: 900px) {
  .app-header,
  .auth-shell,
  .toolbar,
  .split {
    grid-template-columns: 1fr;
  }

  .login-form {
    grid-template-columns: 1fr;
  }

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

  .toolbar {
    top: 118px;
  }
}
