:root {
  --bg: #f5f6f2;
  --surface: #ffffff;
  --surface-alt: #eef1f0;
  --text: #282f39;
  --muted: #65717f;
  --line: #d8ded9;
  --accent: #16b481;
  --accent-bright: #1bc9b4;
  --accent-dark: #138357;
  --warning: #9a641f;
  --success: #138357;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(40, 47, 57, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(27, 201, 180, 0.14), transparent 260px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-background="plain"] {
  background: var(--bg);
}

body[data-background="dark"] {
  background:
    linear-gradient(180deg, rgba(40, 47, 57, 0.92), rgba(40, 47, 57, 0.18) 280px, transparent 420px),
    var(--bg);
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 28px;
}

.workspace {
  width: min(1240px, 100%);
  margin: 0 auto;
}

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

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
}

.brand-logo {
  width: clamp(150px, 22vw, 260px);
  height: auto;
  flex: 0 0 auto;
}

.brand-title {
  min-width: 0;
  border-left: 4px solid var(--accent-bright);
  padding-left: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3.4vw, 3.2rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.topbar-actions,
.segmented,
.page-tabs,
.form-heading,
.table-header {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.menu-wrap {
  position: relative;
  display: inline-flex;
}

.export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  display: grid;
  min-width: 168px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(24, 38, 55, 0.16);
  padding: 6px;
}

.export-menu button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  min-height: 34px;
  padding: 0 10px;
  text-align: left;
  font-weight: 800;
}

.export-menu button:hover {
  background: rgba(22, 180, 129, 0.12);
  color: var(--accent-dark);
}

.row-menu-wrap {
  display: inline-flex;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-bright);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  padding: 14px 16px;
}

.completion-celebration {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid rgba(22, 180, 129, 0.35);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  padding: 12px 14px;
}

.completion-celebration img {
  width: 70px;
  height: auto;
}

.completion-celebration strong,
.completion-celebration span {
  display: block;
}

.completion-celebration span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.page-tabs {
  gap: 6px;
  margin-bottom: 14px;
}

.page-tab {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  min-height: 38px;
  padding: 0 14px;
  font-weight: 800;
}

.page-tab.active {
  border-color: var(--accent);
  background: rgba(22, 180, 129, 0.14);
  color: var(--accent-dark);
}

.global-search {
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(40, 47, 57, 0.08);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 14px;
  padding: 14px;
}

.global-search input {
  min-height: 44px;
}

.global-search span:last-child {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  padding-bottom: 11px;
  white-space: nowrap;
}

.home-page {
  display: grid;
  gap: 16px;
}

.home-hero {
  background:
    linear-gradient(90deg, rgba(40, 47, 57, 0.92), rgba(40, 47, 57, 0.68) 48%, rgba(40, 47, 57, 0.14)),
    url("./assets/documentation-cover.jpeg") center / cover no-repeat;
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: clamp(430px, 54vh, 620px);
  overflow: hidden;
  padding: clamp(28px, 5vw, 62px);
  position: relative;
}

.home-hero::after {
  background: var(--accent-bright);
  bottom: 0;
  content: "";
  height: 6px;
  left: 0;
  position: absolute;
  right: 0;
}

.home-hero-content {
  color: #ffffff;
  display: grid;
  gap: 16px;
  max-width: 720px;
}

.home-hero-content .eyebrow {
  color: #82f2d6;
}

.home-hero h2 {
  font-size: clamp(2.2rem, 5vw, 4.9rem);
  line-height: 0.98;
  margin: 0;
  max-width: 820px;
}

.home-hero p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.65;
  margin: 0;
  max-width: 660px;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.home-actions .ghost-button {
  background: rgba(255, 255, 255, 0.9);
}

.home-mission {
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  padding: 22px;
}

.home-mission h2 {
  color: var(--text);
  font-size: 1.55rem;
  line-height: 1.2;
}

.home-mission p:last-child {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.65;
  margin: 0;
}

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

.home-feature-grid article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(40, 47, 57, 0.08);
  min-height: 210px;
  padding: 18px;
}

.home-feature-grid span {
  color: var(--accent-dark);
  display: block;
  font-size: 0.78rem;
  font-weight: 900;
  margin-bottom: 14px;
}

.home-feature-grid h3 {
  font-size: 1.08rem;
  margin-bottom: 9px;
}

.home-feature-grid p {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.55;
  margin: 0;
}

.admin-page,
.admin-grid,
.customers-page,
.reports-page,
.detail-page {
  min-width: 0;
}

.admin-intro,
.detail-header {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-bright);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  padding: 18px;
}

.detail-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.detail-header h2 {
  font-size: 1.45rem;
}

.admin-intro p,
.detail-header p {
  color: var(--muted);
  font-weight: 700;
  margin: 6px 0 0;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.reports-grid {
  align-items: start;
  grid-template-columns: 1fr;
}

.settings-panel {
  margin-top: 14px;
}

.settings-form {
  margin-bottom: 14px;
}

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

.theme-grid input[type="color"] {
  min-height: 44px;
  padding: 4px;
}

.settings-status {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.auth-panel > div > strong,
.auth-panel > div > span {
  display: block;
}

.auth-panel > div > span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.auth-panel .auth-callback {
  color: var(--accent-dark);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.78rem;
  font-weight: 800;
  margin-top: 4px;
  word-break: break-all;
}

.bootstrap-panel {
  display: grid;
  gap: 12px;
  background: var(--surface);
  border: 1px solid rgba(22, 180, 129, 0.35);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  padding: 16px;
}

.bootstrap-panel h2 {
  font-size: 1rem;
}

.bootstrap-panel p,
#bootstrapStatus {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.bootstrap-form {
  display: grid;
  gap: 12px;
}

.icon-button,
.ghost-button,
.segment,
.primary-button,
.action-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  min-height: 38px;
  padding: 0 12px;
  font-weight: 700;
}

.icon-button:hover,
.ghost-button:hover,
.action-button:hover {
  border-color: var(--accent);
}

.overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--accent);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

.metric small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.controls {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
  margin-bottom: 14px;
}

.search-field {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.field-help {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
  margin-top: -4px;
}

.customer-logo-preview {
  align-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  padding: 10px;
}

.customer-logo-preview img {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  max-height: 54px;
  max-width: 180px;
  object-fit: contain;
  padding: 6px;
}

.customer-row-logo {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: block;
  height: 34px;
  margin-bottom: 7px;
  max-width: 130px;
  object-fit: contain;
  padding: 4px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
  flex: 0 0 auto;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  min-height: 42px;
  padding: 9px 11px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 180, 129, 0.18);
}

.segmented {
  align-self: end;
  gap: 4px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
}

.segment {
  border-color: transparent;
  background: transparent;
  min-width: 92px;
}

.segment.active {
  background: var(--surface);
  border-color: var(--line);
  color: var(--accent-dark);
  box-shadow: 0 4px 12px rgba(40, 47, 57, 0.08);
}

.content-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.task-workspace {
  display: grid;
  gap: 14px;
}

.task-editor {
  gap: 14px;
}

.task-editor-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) minmax(160px, 0.7fr) minmax(220px, 1fr);
  gap: 10px;
  align-items: end;
}

.task-title-field {
  min-width: 0;
}

.documentation-panel {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid rgba(180, 35, 24, 0.25);
  border-left: 4px solid var(--danger);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

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

.documentation-heading h2 {
  margin: 0;
}

.documentation-heading span,
.confidential-stamp {
  border: 1px solid rgba(180, 35, 24, 0.28);
  border-radius: 6px;
  background: rgba(180, 35, 24, 0.1);
  color: var(--danger);
  padding: 5px 8px;
  font-size: 0.76rem;
  font-weight: 900;
}

.documentation-form {
  display: grid;
  gap: 12px;
}

.documentation-field-section {
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.documentation-section-title h3 {
  color: var(--accent-dark);
  margin: 0;
}

.documentation-section-title p {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
  margin: 4px 0 0;
}

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

.documentation-upload-field {
  background: var(--surface);
  border: 1px dashed rgba(22, 180, 129, 0.46);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 100%;
  padding: 10px;
}

.documentation-upload-field span {
  color: var(--text);
  font-weight: 800;
}

.documentation-upload-field input[type="file"] {
  background: #f8fbfa;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
}

.documentation-upload-field small,
.documentation-upload-field a {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.documentation-upload-field a {
  color: var(--accent-dark);
}

.report-field-list {
  display: grid;
  gap: 12px;
}

.report-field-section {
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.report-field-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-long-field {
  grid-column: 1 / -1;
}

.report-field-list textarea {
  min-height: 96px;
}

.report-preview {
  margin-top: 16px;
}

.report-document {
  display: grid;
  gap: 14px;
}

.report-cover {
  align-items: center;
  background: #f3fbf7;
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: 8px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 18px;
}

.report-cover h2 {
  color: var(--text);
  margin: 2px 0 4px;
}

.report-cover p {
  color: var(--muted);
  font-weight: 700;
  margin: 0;
}

.report-cover img {
  max-height: 72px;
  max-width: 180px;
  object-fit: contain;
}

.report-section-note {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.structured-docs {
  display: grid;
  gap: 12px;
}

.embedded-structured-docs {
  margin-top: 2px;
}

.structured-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
}

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

.structured-heading h3 {
  color: var(--accent-dark);
  margin: 0;
}

.structured-heading p {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 4px 0 0;
}

.structured-rows {
  display: grid;
  gap: 10px;
}

.structured-add-row {
  display: flex;
  justify-content: flex-start;
  padding-top: 10px;
}

.structured-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.structured-row-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.structured-row-title strong {
  color: var(--text);
  text-transform: capitalize;
}

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

.documentation-preview {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 16px;
}

.documentation-preview h3 {
  margin: 10px 0 12px;
}

.documentation-client-logo {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: block;
  max-height: 66px;
  max-width: 220px;
  object-fit: contain;
  padding: 8px;
}

.documentation-preview h4 {
  margin: 14px 0 6px;
  color: var(--accent-dark);
}

.documentation-preview p {
  white-space: pre-wrap;
}

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

.structured-preview-table {
  border-collapse: collapse;
  width: 100%;
}

.structured-preview-table caption {
  color: var(--accent-dark);
  font-weight: 900;
  margin-bottom: 5px;
  text-align: left;
}

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

.structured-preview-table th {
  background: #e7f4ee;
  color: var(--accent-dark);
  width: 28%;
}

.documentation-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.documentation-meta div {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
}

.documentation-meta dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.documentation-meta dd {
  margin: 3px 0 0;
  font-weight: 800;
}

.project-form,
.table-area {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.project-form {
  display: grid;
  gap: 13px;
  padding: 18px;
}

.form-heading {
  justify-content: space-between;
  gap: 12px;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  min-height: 44px;
}

.primary-button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.project-form.locked {
  background: #f8faf9;
}

.table-area {
  min-width: 0;
}

.table-header {
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.table-header span {
  color: var(--muted);
  font-weight: 700;
}

.table-wrap {
  position: relative;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.permissions-table,
.customers-table,
.documentation-table,
.tasks-table {
  min-width: 760px;
}

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

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #f8faf9;
}

.link-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  text-align: left;
  font-weight: 800;
}

.link-button:hover {
  color: var(--accent-dark);
}

.project-title {
  display: block;
  font-weight: 800;
}

.project-meta,
.project-notes {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.project-code {
  display: inline-flex;
  margin-top: 7px;
  border: 1px solid rgba(22, 180, 129, 0.28);
  border-radius: 6px;
  background: rgba(22, 180, 129, 0.12);
  color: var(--accent-dark);
  padding: 3px 7px;
  font-size: 0.72rem;
  font-weight: 900;
}

.permission-modules {
  display: grid;
  gap: 4px;
  min-width: 190px;
}

.permission-modules span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 800;
  min-width: 152px;
}

#accessBadge {
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
}

.status-pill strong,
.status-pill small {
  display: block;
}

.status-pill small {
  margin-top: 1px;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.status-pill.completed {
  background: rgba(19, 131, 87, 0.14);
  border-color: rgba(19, 131, 87, 0.26);
  color: var(--success);
}

.status-pill.completed .status-dot {
  background: var(--success);
}

.status-pill.ongoing {
  background: rgba(154, 100, 31, 0.13);
  border-color: rgba(154, 100, 31, 0.24);
  color: var(--warning);
}

.status-pill.ongoing .status-dot {
  background: var(--warning);
}

.compact-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.compact-pill.completed {
  background: rgba(19, 131, 87, 0.14);
  border-color: rgba(19, 131, 87, 0.26);
  color: var(--success);
}

.compact-pill.ongoing {
  background: rgba(154, 100, 31, 0.13);
  border-color: rgba(154, 100, 31, 0.24);
  color: var(--warning);
}

.progress-cell {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 44px;
  align-items: center;
  gap: 10px;
  min-width: 170px;
}

.progress-cell strong {
  color: var(--text);
  font-size: 0.88rem;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
}

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

.planner-link {
  color: var(--accent-dark);
  font-weight: 700;
  overflow-wrap: anywhere;
}

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

.subtask-row td {
  background: #f7fbf9;
  border-top: 0;
}

.subtask-row td:first-child {
  padding-left: 42px;
  position: relative;
}

.subtask-row td:first-child::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 0;
  width: 12px;
  height: 50%;
  border-left: 2px solid rgba(22, 180, 129, 0.42);
  border-bottom: 2px solid rgba(22, 180, 129, 0.42);
  border-bottom-left-radius: 6px;
}

.subtask-title {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-weight: 800;
}

.subtask-title::before {
  content: "Subtask";
  margin-right: 8px;
  border: 1px solid rgba(22, 180, 129, 0.28);
  border-radius: 6px;
  background: rgba(22, 180, 129, 0.12);
  color: var(--accent-dark);
  padding: 3px 7px;
  font-size: 0.72rem;
  font-weight: 900;
}

.read-only-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.assignee-pill {
  display: grid;
  gap: 2px;
  color: var(--text);
  font-weight: 800;
}

.assignee-pill small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.subtask-summary {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.subtask-summary strong {
  color: var(--text);
  font-size: 0.82rem;
}

.subtask-summary ul {
  display: grid;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.subtask-summary li {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.subtask-summary li.done {
  color: var(--success);
}

.subtask-summary li.more {
  color: var(--accent-dark);
}

.action-button {
  min-height: 34px;
  padding: 0 10px;
}

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

.empty-state {
  padding: 46px 18px;
  text-align: center;
}

.empty-state p {
  color: var(--muted);
  margin-bottom: 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .app-shell {
    padding: 18px;
  }

  .topbar,
  .global-search,
  .controls,
  .content-grid,
  .admin-grid,
  .home-mission,
  .home-feature-grid,
  .task-editor-grid,
  .structured-field-grid,
  .documentation-field-grid,
  .report-field-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .global-search span:last-child {
    padding-bottom: 0;
    white-space: normal;
  }

  .brand-lockup {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .brand-title {
    border-left: 0;
    border-top: 4px solid var(--accent-bright);
    padding: 14px 0 0;
    width: 100%;
  }

  .topbar-actions {
    justify-content: start;
  }

  .auth-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .completion-celebration {
    grid-template-columns: 1fr;
  }

  .detail-header,
  .detail-stats {
    grid-template-columns: 1fr;
  }

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

  .home-hero {
    min-height: 520px;
  }

  .home-hero h2 {
    font-size: 2.45rem;
  }

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

  .segment {
    flex: 1;
  }
}

@media (max-width: 520px) {
  .two-column {
    grid-template-columns: 1fr;
  }

  .home-hero {
    padding: 24px;
  }

  .home-actions {
    display: grid;
  }

  .icon-button {
    flex: 1;
  }
}
