:root {
  color-scheme: light;
  font-family: Inter, system-ui, sans-serif;
  color: #1f2a1a;
  background: #f4f7f0;
  --green: #3d7a1a;
  --green-light: #e8f4dc;
  --line: #dfe7d9;
  --muted: #64705e;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 1100px; }
.admin-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 30px; color: white;
  background: linear-gradient(100deg, #315f17, #5bac26);
}
.eyebrow { margin: 0 0 4px; opacity: .8; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
h1 { margin: 0; font-size: 24px; }
main { padding: 24px 30px 40px; }
.summary-card, .legend, .fiif-card {
  display: flex; justify-content: space-between; gap: 24px;
  padding: 18px 20px; margin-bottom: 16px;
  background: white; border: 1px solid var(--line); border-radius: 12px;
}
.summary-card h2 { margin: 0 0 6px; font-size: 18px; }
.summary-card p, .legend p { margin: 4px 0; color: var(--muted); }
.legend { display: block; font-size: 13px; }
.fiif-card {
  display: block;
  border-color: #c5ddb0;
  background: linear-gradient(180deg, #f7fbf3 0%, #fff 48%);
}
.fiif-card-head {
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
  margin-bottom: 14px;
}
.fiif-card h2 { margin: 0 0 4px; font-size: 18px; }
.fiif-sub { margin: 0; color: var(--muted); font-size: 13px; }
.fiif-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.fiif-kpi {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.fiif-kpi-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.fiif-kpi strong { font-size: 22px; font-weight: 700; color: var(--green); }
.fiif-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
}
.fiif-panel h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #42523a;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.fiif-table-wrap {
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.fiif-table-wrap table { font-size: 12px; }
.fiif-table-wrap th { position: sticky; top: 0; }
.fiif-empty { color: var(--muted); font-style: italic; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 7px; padding: 9px 13px;
  background: var(--green); color: white; cursor: pointer;
  text-decoration: none; font: 600 13px Inter, system-ui, sans-serif; white-space: nowrap;
}
.button.secondary { background: white; color: var(--green); }
.button.small { padding: 6px 9px; font-size: 12px; }
.impersonation-banner {
  position: sticky; top: 0; z-index: 20;
  display: flex; gap: 16px; align-items: center; justify-content: space-between;
  padding: 12px 18px; background: #7a3b00; color: #fff8ef; font-size: 14px;
}
.impersonation-banner .btn,
.impersonation-banner .impersonation-end {
  border: 0; border-radius: 7px; padding: 8px 12px;
  background: #fff8ef; color: #7a3b00; cursor: pointer; font: 600 13px Inter, system-ui, sans-serif;
}
.table-wrap {
  overflow: auto; background: white; border: 1px solid var(--line);
  border-radius: 12px;
}
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { position: sticky; top: 0; background: #f8faf6; color: #42523a; white-space: nowrap; z-index: 1; }
tbody tr:hover { background: #fbfdf9; }
.email { font-weight: 600; white-space: nowrap; }
.sub { color: var(--muted); font-size: 10px; margin-top: 4px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.date { white-space: nowrap; line-height: 1.4; }
.date small { display: block; color: var(--muted); }
.badge {
  display: inline-block; border-radius: 999px; padding: 4px 8px;
  background: #eef2eb; color: #52604c; font-weight: 600; white-space: nowrap;
}
.badge.ok { background: var(--green-light); color: #2d6412; }
.badge.warn { background: #fff3d3; color: #775600; }
.badge.off { background: #f3e6e4; color: #8a3328; }
.detail { margin-top: 5px; color: var(--muted); white-space: nowrap; }
.error { padding: 14px; border-radius: 8px; color: #8a241b; background: #fbe7e4; }
@media (max-width: 1100px) {
  .fiif-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fiif-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  body { min-width: 0; }
  main { padding: 16px; }
  .admin-header { padding: 18px 16px; }
  .table-wrap { overflow-x: auto; }
  table { min-width: 1450px; }
  .fiif-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fiif-card-head { flex-direction: column; }
}
