:root {
  color-scheme: light;
  --ink:#17211b;
  --muted:#66736b;
  --line:#dde4df;
  --soft:#f4f7f5;
  --brand:#214f3b;
  --brand-dark:#17392b;
  --white:#ffffff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing:border-box; }
body { margin:0; color:var(--ink); background:#f8faf9; }
a { color:inherit; }
.shell { width:min(1440px, calc(100% - 40px)); margin:0 auto; padding:38px 0 64px; }
.home-shell { width:min(980px, calc(100% - 40px)); padding-top:72px; }
.eyebrow { color:var(--brand); font-size:.78rem; font-weight:800; letter-spacing:.09em; text-transform:uppercase; margin-bottom:8px; }
h1 { margin:0; font-size:clamp(2rem, 5vw, 3.7rem); line-height:1.02; letter-spacing:-.045em; }
.lede { color:var(--muted); font-size:1.05rem; margin:14px 0 0; max-width:700px; }
.org-grid { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:14px; margin-top:42px; }
.org-card { display:flex; min-height:148px; flex-direction:column; justify-content:space-between; padding:24px; text-decoration:none; background:var(--white); border:1px solid var(--line); border-radius:18px; box-shadow:0 5px 18px rgba(20,47,35,.045); transition:transform .12s ease, border-color .12s ease; }
.org-card:hover { transform:translateY(-2px); border-color:#9eb6a9; }
.org-card strong { font-size:1.7rem; letter-spacing:-.03em; }
.org-card span { color:var(--muted); }
.master-card { background:var(--brand); color:white; border-color:var(--brand); grid-column:span 3; min-height:120px; }
.master-card span { color:#d9e7df; }
.directory-header { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin-bottom:30px; }
.back-link { display:inline-block; color:var(--muted); text-decoration:none; font-size:.9rem; margin-bottom:24px; }
.sync-box { background:var(--white); border:1px solid var(--line); border-radius:14px; padding:14px 16px; min-width:180px; }
.sync-box .label { display:block; color:var(--muted); font-size:.75rem; text-transform:uppercase; letter-spacing:.06em; margin-bottom:3px; }
.toolbar { display:grid; grid-template-columns:minmax(280px,2fr) minmax(190px,1fr) minmax(170px,1fr) auto; gap:12px; align-items:end; padding:16px; background:var(--white); border:1px solid var(--line); border-radius:16px; }
.toolbar label span { display:block; color:var(--muted); font-size:.78rem; font-weight:700; margin:0 0 6px; }
input, select, button { font:inherit; }
input, select { width:100%; min-height:42px; border:1px solid #cfd9d3; border-radius:10px; padding:9px 11px; background:white; color:var(--ink); }
input:focus, select:focus { outline:2px solid #9cc2ae; outline-offset:1px; }
.secondary-button { min-height:42px; border:1px solid #cfd9d3; background:var(--soft); color:var(--ink); border-radius:10px; padding:9px 14px; cursor:pointer; }
.summary-row { display:flex; align-items:center; justify-content:space-between; color:var(--muted); font-size:.88rem; padding:14px 2px 10px; }
.summary-row strong { color:var(--ink); font-size:1rem; }
.table-card { background:var(--white); border:1px solid var(--line); border-radius:16px; overflow:hidden; }
.table-scroll { overflow:auto; max-height:calc(100vh - 330px); }
table { width:100%; border-collapse:separate; border-spacing:0; min-width:1080px; }
th, td { border-bottom:1px solid #edf1ee; padding:11px 12px; text-align:left; vertical-align:top; }
th { position:sticky; top:0; z-index:2; background:#f7f9f8; color:#4a5b51; font-size:.75rem; text-transform:uppercase; letter-spacing:.045em; cursor:pointer; user-select:none; }
td { font-size:.9rem; }
td.name-cell strong { display:block; }
td.name-cell span { color:var(--muted); font-size:.8rem; }
.score { font-variant-numeric:tabular-nums; font-weight:750; }
.reason { color:var(--muted); font-size:.82rem; }
.empty-state { padding:48px 20px; text-align:center; color:var(--muted); }
.error { color:#8a2d2d !important; }
@media (max-width:850px) {
  .org-grid { grid-template-columns:1fr 1fr; }
  .master-card { grid-column:span 2; }
  .directory-header { align-items:flex-start; flex-direction:column; }
  .toolbar { grid-template-columns:1fr 1fr; }
  .search-wrap { grid-column:span 2; }
}
@media (max-width:560px) {
  .shell,.home-shell { width:min(100% - 24px, 100%); padding-top:28px; }
  .org-grid,.toolbar { grid-template-columns:1fr; }
  .master-card,.search-wrap { grid-column:span 1; }
  .org-card { min-height:120px; }
}

.login-card { width:min(520px,100%); margin:9vh auto 0; padding:30px; background:white; border:1px solid var(--line); border-radius:18px; box-shadow:0 10px 30px rgba(20,47,35,.06); }
.login-card form { margin-top:24px; }
.login-card label span { display:block; color:var(--muted); font-size:.82rem; font-weight:700; margin-bottom:7px; }
.primary-button { width:100%; margin-top:12px; min-height:44px; border:0; border-radius:10px; background:var(--brand); color:white; font-weight:750; cursor:pointer; }
.primary-button:hover { background:var(--brand-dark); }
.login-message { min-height:22px; color:var(--muted); font-size:.9rem; margin:16px 0 0; }
.header-actions { display:flex; gap:10px; align-items:stretch; }
.header-actions .secondary-button { align-self:stretch; }
