@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --ink: #13221c;
  --muted: #647067;
  --line: #d7dfd8;
  --panel: #eef4ef;
  --surface: #ffffff;
  --accent: #16734b;
  --accent-dark: #0f4f35;
  --accent-soft: #dff0e7;
  --danger: #b42318;
  --warn: #b7791f;
  --focus: #204f3d;
}

* {
  box-sizing: border-box;
}

[x-cloak] {
  display: none !important;
}

body {
  min-height: 100vh;
  background: var(--panel);
  color: var(--ink);
  font-family: "Inter", "Aptos", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button {
  font: inherit;
}

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

.sidebar {
  background: #0f3f2d;
  color: #f7fafc;
  padding: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.sidebar .button.is-light {
  background: #e5f2eb;
  color: #0f3f2d;
  font-weight: 700;
}

.brand h1,
.topbar h2,
.login-panel h2,
.drawer h2 {
  font-size: 23px;
  line-height: 1.15;
  font-weight: 800;
  margin: 0;
}

.eyebrow {
  color: #708178;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.sidebar .eyebrow {
  color: #a8d5bd;
}

.nav-item,
.project-link {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #e4f3ea;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover,
.project-link:hover,
.nav-item.active,
.project-link.active {
  background: #19573f;
  color: #fff;
}

.menu-label {
  color: #a8d5bd;
  margin: 20px 0 8px;
}

.health-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #94a3b8;
}

.health-dot.green {
  background: #22c55e;
}

.health-dot.yellow {
  background: #eab308;
}

.health-dot.red {
  background: #ef4444;
}

.workspace {
  padding: 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.search {
  width: 260px;
}

.input:focus,
.textarea:focus,
.select select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.125em rgba(22, 115, 75, 0.18);
}

.button.is-dark {
  background: var(--accent-dark);
  color: #fff;
}

.button.is-dark:hover {
  background: #0b3e2a;
}

.login-panel {
  max-width: 420px;
  margin: 12vh auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}

.login-panel .label {
  margin-top: 14px;
}

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

.view-help {
  align-items: center;
  border: 1px solid #cbd9ce;
  border-radius: 8px;
  box-shadow: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  background: #fbfdfb;
}

.view-help p:not(.eyebrow) {
  color: #42515c;
  margin: 0;
  max-width: 760px;
}

.view-help .tags {
  flex: 0 0 auto;
  justify-content: flex-end;
  margin: 0;
}

.metric {
  border: 1px solid #d5ded7;
  border-radius: 8px;
  min-height: 96px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--accent);
}

.metric:hover {
  box-shadow: 0 10px 24px rgba(23, 32, 38, 0.08);
  transform: translateY(-1px);
}

.metric span {
  display: block;
  font-size: 34px;
  font-weight: 760;
  line-height: 1;
  margin: 8px 0 6px;
  color: var(--accent-dark);
}

.metric small {
  color: #405248;
  text-transform: uppercase;
  font-weight: 700;
}

.metric em {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-style: normal;
}

.metric-open {
  background: #ffffff;
  border-color: #cfd9d2;
}

.metric-blocked {
  background: #fffafa;
  border-color: #efc9c4;
}

.metric-blocked::before {
  background: var(--danger);
}

.metric-high {
  background: #fffdf3;
  border-color: #eadca7;
}

.metric-high::before {
  background: var(--warn);
}

.metric-due {
  background: #f1f8f4;
  border-color: #b9d8c5;
}

.tabs.is-toggle li.is-active a {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tabs.is-toggle a {
  border-color: #cdd8d0;
  color: #35473d;
}

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

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.section-head {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  margin: 8px 0 12px;
}

.section-head h3 {
  font-size: 18px;
  font-weight: 720;
  margin: 0;
}

.project-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  min-height: 112px;
  padding: 16px;
  text-align: left;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  background: var(--accent);
  content: "";
  inset: 0 auto 0 0;
  position: absolute;
  width: 4px;
}

.project-card:hover {
  border-color: #93b39e;
  box-shadow: 0 10px 24px rgba(23, 32, 38, 0.08);
  transform: translateY(-1px);
}

.project-card strong,
.project-card span {
  display: block;
}

.project-card span {
  color: var(--muted);
}

.project-counts {
  white-space: nowrap;
  text-align: right;
  color: #405248;
}

.guide-page {
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 880px) 220px;
  align-items: start;
}

.guide-outline {
  border-left: 1px solid #cbd9ce;
  padding-left: 16px;
  position: sticky;
  top: 28px;
}

.guide-outline a {
  color: #43564a;
  display: block;
  font-size: 14px;
  padding: 6px 0;
}

.guide-outline a:hover {
  color: var(--accent);
}

.guide-doc {
  background: #fbfdfb;
  border: 1px solid #cbd9ce;
  border-radius: 8px;
  padding: 34px 40px;
}

.guide-section {
  border-top: 1px solid #dbe5dd;
  padding: 28px 0;
  scroll-margin-top: 24px;
}

.guide-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.guide-section:last-child {
  padding-bottom: 0;
}

.guide-section h3 {
  color: var(--ink);
  font-size: 30px;
  font-weight: 800;
  margin: 0 0 10px;
}

.guide-section h4 {
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 8px;
}

.guide-section p:not(.eyebrow) {
  color: #4d5d53;
  margin-bottom: 12px;
  max-width: 760px;
}

.guide-token {
  background: #e5f2eb;
  border-radius: 8px;
  color: #0f3f2d;
  display: inline-flex;
  font-weight: 800;
  padding: 8px 10px;
}

.guide-section pre {
  background: #102b21;
  border-radius: 8px;
  color: #e8f5ee;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.55;
  margin: 16px 0 0;
  overflow-x: auto;
  padding: 14px;
  max-width: 800px;
}

.guide-section code {
  background: transparent;
  color: inherit;
  font-size: inherit;
  padding: 0;
}

.feedback-page {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr);
  max-width: 1040px;
}

.feedback-form,
.feedback-list {
  border: 1px solid #cbd9ce;
  border-radius: 8px;
  box-shadow: none;
}

.feedback-form h3,
.feedback-list h3 {
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 6px;
}

.feedback-form p:not(.eyebrow) {
  color: #4d5d53;
  margin-bottom: 18px;
  max-width: 760px;
}

.feedback-form form {
  display: grid;
  gap: 14px;
}

.feedback-form label {
  display: grid;
  gap: 6px;
}

.feedback-form label > span {
  color: #405248;
  font-size: 13px;
  font-weight: 700;
}

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

.feedback-item {
  align-items: flex-start;
  border-top: 1px solid #dbe5dd;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 16px 0;
}

.feedback-item:first-of-type {
  border-top: 0;
}

.feedback-item h4 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  margin: 8px 0 4px;
}

.feedback-item p {
  color: #4d5d53;
  margin: 0;
}

.feedback-item small,
.feedback-item time {
  color: var(--muted);
  font-size: 13px;
}

.feedback-item time {
  flex: 0 0 auto;
}

.feedback-type.bug {
  background: #ffe4e2;
  color: var(--danger);
}

.feedback-type.enhancement {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

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

.work-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
  overflow: hidden;
  background: var(--surface);
}

.work-panel .panel-heading {
  align-items: center;
  background: #fbfdfb;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  display: flex;
  font-size: 15px;
  font-weight: 760;
  justify-content: space-between;
  padding: 12px 14px;
  text-transform: none;
}

.table-wrap {
  display: block;
  padding: 0;
  width: 100%;
  overflow-x: auto;
}

.raidc-table {
  margin: 0;
}

.raidc-table th {
  background: #f3f8f4;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.raidc-table td,
.raidc-table th {
  vertical-align: middle;
}

.raidc-table tbody tr {
  cursor: pointer;
}

.raidc-table tbody tr:hover .item-main strong {
  color: var(--accent);
}

.item-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.item-main strong {
  font-weight: 700;
}

.item-sub {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 7px;
  font-size: 13px;
  margin-top: 4px;
  text-transform: capitalize;
}

.raidc-table small {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 8px;
  background: #e8eee9;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.priority {
  font-weight: 800;
  text-transform: uppercase;
}

.priority.high {
  background: #fff4cf;
  color: #7a4f00;
}

.priority.critical,
.pill.critical {
  background: #ffe4e2;
  color: var(--danger);
}

.priority.low,
.pill.low {
  background: var(--accent-soft);
  color: #17613b;
}

.priority.medium {
  background: #e8eee9;
  color: #2b3f33;
}

.pill.high {
  background: #fff4cf;
  color: #7a4f00;
}

.empty {
  padding: 24px;
  color: var(--muted);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(23, 32, 38, 0.2);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 100vw);
  height: 100vh;
  overflow: auto;
  background: #fff;
  border-left: 1px solid var(--line);
  padding: 24px;
  box-shadow: -10px 0 30px rgba(23, 32, 38, 0.18);
}

.drawer-close {
  border: 0;
  background: #e8eee9;
  border-radius: 6px;
  min-height: 34px;
  padding: 0 10px;
  float: right;
  cursor: pointer;
}

.drawer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  margin: 12px 0 18px;
}

.quick-edit,
.create-grid {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.quick-edit {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  margin-bottom: 16px;
}

.quick-edit select,
.quick-edit input,
.create-grid select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
}

.tag.is-info.is-light {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.tag.is-dark.is-light {
  background: #eef2ef;
  color: #27382f;
}

.note-form {
  margin: 16px 0 22px;
}

.note-form .textarea {
  margin-bottom: 8px;
}

.drawer h3 {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.update {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.update strong {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
}

.update p {
  margin: 2px 0;
}

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

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

  .sidebar {
    position: static;
    height: auto;
  }

  .topbar,
  .top-actions,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    width: 100%;
  }

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

  .view-help,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .guide-page {
    grid-template-columns: 1fr;
  }

  .guide-outline {
    position: static;
  }

  .guide-doc {
    padding: 22px;
  }

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

  .feedback-item {
    flex-direction: column;
  }

  .raidc-table th:nth-child(4),
  .raidc-table td:nth-child(4),
  .raidc-table th:nth-child(5),
  .raidc-table td:nth-child(5) {
    display: none;
  }

  .work-panel .panel-heading {
    font-size: 14px;
  }
}
