:root {
  --green-900: #113b25;
  --green-800: #185233;
  --green-700: #20703f;
  --green-600: #28864c;
  --green-100: #e7f2ea;
  --green-050: #f4faf6;
  --ink: #1e2a24;
  --muted: #69756d;
  --line: #dce5dd;
  --soft: #f6f8f6;
  --white: #ffffff;
  --red: #b42318;
  --red-soft: #fde7e7;
  --yellow: #946200;
  --yellow-soft: #fff4d8;
  --purple: #663399;
  --purple-soft: #f1e9fb;
  --grey-soft: #eef1ef;
  --shadow: 0 8px 28px rgba(17, 59, 37, .08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f3f6f4;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 58px 1fr;
}

.topbar {
  height: 58px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--green-800), var(--green-600));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: .02em;
}

.brand-title {
  font-weight: 800;
  color: var(--green-900);
  font-size: 16px;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

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

.search {
  width: 260px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 10px;
  background: var(--soft);
}

.btn {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.btn.primary {
  background: var(--green-700);
  border-color: var(--green-700);
  color: white;
}

.btn:hover {
  filter: brightness(.98);
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 300px;
  min-height: calc(100vh - 58px);
}

.sidebar {
  background: var(--green-900);
  color: white;
  padding: 14px 10px;
  overflow: auto;
}

.nav-section {
  color: rgba(255,255,255,.58);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 11px;
  font-weight: 700;
  padding: 14px 10px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255,255,255,.86);
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 9px;
  margin: 2px 0;
  font-size: 13px;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255,255,255,.12);
  color: white;
}

.nav-index {
  font-size: 11px;
  opacity: .68;
  min-width: 22px;
}

.main {
  padding: 18px;
  overflow: auto;
}

.right-panel {
  background: var(--white);
  border-left: 1px solid var(--line);
  padding: 16px;
  overflow: auto;
}

.page-head {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.breadcrumb {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

h1 {
  margin: 0;
  color: var(--green-900);
  font-size: 22px;
}

.page-purpose {
  color: var(--muted);
  margin: 7px 0 0;
  max-width: 950px;
  line-height: 1.45;
}

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

.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(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px;
  box-shadow: var(--shadow);
}

.card-title {
  font-weight: 800;
  color: var(--green-900);
  margin-bottom: 7px;
}

.card-sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.metric {
  font-size: 26px;
  font-weight: 800;
  color: var(--green-800);
  margin-top: 6px;
}

.table-wrap {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px;
  border-bottom: 1px solid var(--line);
  background: #fbfdfb;
}

.table-title {
  color: var(--green-900);
  font-weight: 800;
}

.filter-row {
  display: flex;
  gap: 8px;
}

.filter-row input,
.filter-row select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  background: white;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  padding: 10px;
}

td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  vertical-align: top;
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
}

.badge.approved,
.badge.complete {
  background: var(--green-100);
  color: var(--green-800);
}

.badge.pending,
.badge.review {
  background: var(--yellow-soft);
  color: var(--yellow);
}

.badge.high,
.badge.missing {
  background: var(--red-soft);
  color: var(--red);
}

.badge.restricted,
.badge.privileged {
  background: var(--purple-soft);
  color: var(--purple);
}

.badge.neutral,
.badge.archive {
  background: var(--grey-soft);
  color: var(--muted);
}

.progress {
  width: 100%;
  height: 8px;
  background: var(--grey-soft);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 9px;
}

.progress > span {
  display: block;
  height: 100%;
  background: var(--green-700);
}

.right-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--green-900);
  margin: 6px 0 10px;
}

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

.meta-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

.meta-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}

.meta-value {
  color: var(--ink);
  font-weight: 700;
}

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

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

.form-row label {
  color: var(--green-900);
  font-weight: 700;
  font-size: 13px;
}

.form-row input,
.form-row select,
.form-row textarea {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  background: white;
}

.dropzone {
  border: 2px dashed #b8c9bb;
  border-radius: 14px;
  padding: 28px;
  background: var(--green-050);
  text-align: center;
  color: var(--green-900);
  font-weight: 800;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #edf5ef, #ffffff);
  padding: 24px;
}

.login-card {
  width: 430px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin-top: 14px;
}

.small-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.notice {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--green-050);
  color: var(--green-900);
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 230px minmax(0, 1fr);
  }
  .right-panel {
    display: none;
  }
  .grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .search {
    display: none;
  }
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: 1fr;
  }
}

/* MOBIVAT PHASE 6 SMALL CONTROLS */
.mini-btn {
  border: 1px solid #cddbd2;
  background: #f7faf8;
  color: #0f3f28;
  padding: 5px 8px;
  margin: 2px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.mini-btn:hover {
  background: #e7f2ea;
}
textarea {
  width: 100%;
  border: 1px solid #d8e2dc;
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
  resize: vertical;
}

/* MOBIVAT PHASE 8 FILE CONTROLS */
.file-policy-note {
  font-size: 12px;
  color: #4b5b52;
  line-height: 1.5;
}

/* MOBIVAT PHASE 9 REVIEW CONTROLS */
.danger-mini {
  border-color: #e0b4b4 !important;
  background: #fff7f7 !important;
  color: #9b1c1c !important;
}
.danger-mini:hover {
  background: #fde7e7 !important;
}
