:root {
  --bg: #f6f8f5;
  --panel: #ffffff;
  --ink: #17211b;
  --muted: #647067;
  --line: #dce4dc;
  --green: #1f7a4a;
  --green-2: #74a85f;
  --amber: #b7791f;
  --red: #b42318;
  --blue: #236192;
  --shadow: 0 12px 30px rgba(23, 33, 27, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
button, input, select { font: inherit; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 284px;
  background: #14251b;
  color: #eef7ef;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 56px;
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #eef7ef;
  object-fit: contain;
  padding: 3px;
}
.brand strong { display: block; font-size: 13px; line-height: 1.2; }
.brand span { color: #a9c6ad; font-size: 12px; }
.nav-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: #dcebdd;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  margin-bottom: 3px;
}
.nav-btn.active, .nav-btn:hover { background: rgba(255,255,255,.11); color: white; }
.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: contain;
  background: rgba(255,255,255,.92);
  padding: 3px;
  flex: 0 0 auto;
}
.shell {
  margin-left: 284px;
  min-height: 100vh;
  padding: 22px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}
h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: 0; }
p { margin: 0; }
.topbar p, .muted { color: var(--muted); }
.actions { display: flex; gap: 8px; }
.icon-btn, .primary, .secondary, .danger {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
}
.icon-btn { width: 42px; height: 40px; padding: 0; }
.primary { background: var(--green); border-color: var(--green); color: white; }
.secondary:hover, .icon-btn:hover { border-color: var(--green); }
.danger { color: var(--red); border-color: #f2c8c4; }
.link-btn {
  border: 0;
  background: transparent;
  color: var(--green);
  cursor: pointer;
  padding: 0;
  text-align: left;
}
.public-access {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
}
.access-panel {
  width: min(430px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
  display: grid;
  gap: 12px;
}
.access-panel h2 { margin: 0; }
.access-panel label { display: grid; gap: 6px; color: var(--muted); }
.status-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}
.source-pill {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  min-height: 76px;
}
.source-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.process-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: contain;
  background: #eef5ef;
  border: 1px solid var(--line);
  padding: 3px;
}
.source-pill strong { display: block; font-size: 12px; }
.source-pill span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.ok { color: var(--green); }
.warn { color: var(--amber); }
.bad { color: var(--red); }
.risk-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
}
.risk-green {
  background: #e7f5e7;
  color: #166534;
  border: 1px solid #b7dfb7;
}
.risk-yellow {
  background: #fff7df;
  color: #92400e;
  border: 1px solid #f0cf7a;
}
.risk-red {
  background: #fde8e6;
  color: #9f1d15;
  border: 1px solid #f3b5ad;
}
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.card h2, .card h3 { margin: 0 0 10px; font-size: 17px; }
.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.card-title h2, .card-title h3 { margin: 0; }
.hero-logo {
  width: 76px;
  height: 76px;
  object-fit: contain;
}
.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { display: block; font-size: 24px; margin-top: 6px; }
.form-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}
.sheet-map {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.sheet-map span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf8;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 12px;
}
label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: white;
  color: var(--ink);
}
.source-path {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 12px;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0;
}
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; background: white; min-width: 760px; }
th, td { padding: 10px 11px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
th { background: #eef5ef; color: #34453a; font-weight: 700; }
.bar {
  height: 12px;
  background: #e8eee8;
  border-radius: 999px;
  overflow: hidden;
}
.bar span { display: block; height: 100%; background: var(--green-2); }
.message {
  border: 1px solid #d7e5d8;
  background: #f2faf2;
  color: #255b36;
  padding: 12px;
  border-radius: 8px;
  margin: 10px 0;
}
.inspect-box {
  margin: 6px 0 14px;
}
.inspect-box table {
  min-width: 620px;
}
.inspect-box td:last-child {
  width: 150px;
}
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tab { border: 1px solid var(--line); background: white; border-radius: 8px; padding: 9px 12px; cursor: pointer; }
.tab.active { background: var(--green); border-color: var(--green); color: white; }
.invite-preview {
  white-space: pre-wrap;
  background: #f7faf7;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
}
.mobile-nav { display: none; }
@media (max-width: 900px) {
  .sidebar { display: none; }
  .shell { margin-left: 0; padding: 14px 14px 78px; }
  .status-band, .grid.two, .grid.three, .grid.four, .form-row { grid-template-columns: 1fr; }
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: white;
    border-top: 1px solid var(--line);
    z-index: 5;
  }
  .mobile-nav button {
    border: 0;
    background: white;
    padding: 8px 4px;
    color: var(--muted);
    font-size: 11px;
  }
  .mobile-nav img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
    margin: 0 auto 2px;
  }
  .mobile-nav button.active { color: var(--green); font-weight: 700; }
  .topbar { align-items: center; }
  h1 { font-size: 21px; }
  table { min-width: 0; }
  .table-wrap table, .table-wrap thead, .table-wrap tbody, .table-wrap tr, .table-wrap th, .table-wrap td { display: block; }
  .table-wrap thead { display: none; }
  .table-wrap tr { border-bottom: 1px solid var(--line); padding: 8px; }
  .table-wrap td { border: 0; padding: 5px 0; }
  .table-wrap td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; }
}
@media print {
  .sidebar, .mobile-nav, .actions, .toolbar, .tabs, button, input, select { display: none !important; }
  .shell { margin: 0; padding: 0; }
  .card, .metric { box-shadow: none; break-inside: avoid; }
}
