:root {
  --green-950: #0e2f1e;
  --green-900: #123f27;
  --green-800: #1b5e3a;
  --green-700: #28794c;
  --green-600: #36945e;
  --green-200: #b9ddc4;
  --green-100: #e3f1e7;
  --green-50: #f2f8f4;
  --ink: #16231b;
  --muted: #637168;
  --line: #dce7df;
  --surface: #ffffff;
  --canvas: #f4f7f5;
  --danger: #a62d38;
  --danger-bg: #fff1f2;
  --warning: #805b12;
  --warning-bg: #fff8e8;
  --shadow: 0 14px 34px rgba(18, 63, 39, 0.08);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--green-700);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
}

.brand-mark-small {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 1.4rem;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--green-900);
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
  padding: 0 17px;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.button:hover {
  border-color: var(--green-600);
}

.button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(54, 148, 94, 0.28);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button-primary {
  border-color: var(--green-800);
  background: var(--green-800);
  color: #fff;
}

.button-primary:hover {
  border-color: var(--green-900);
  background: var(--green-900);
}

.button-ghost {
  min-height: 36px;
  border-color: rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #fff;
  padding: 0 14px;
}

.button-ghost:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.button-small {
  min-height: 36px;
  white-space: nowrap;
  font-size: 0.84rem;
  padding: 0 13px;
}

.button-block {
  width: 100%;
}

.alert {
  margin-bottom: 20px;
  border: 1px solid;
  border-radius: 10px;
  padding: 13px 15px;
  font-size: 0.9rem;
}

.alert-error {
  border-color: #e5b2b7;
  background: var(--danger-bg);
  color: var(--danger);
}

.alert-warning {
  border-color: #ead49c;
  background: var(--warning-bg);
  color: var(--warning);
}

.alert-success {
  border-color: var(--green-200);
  background: var(--green-50);
  color: var(--green-900);
}

.alert code {
  font-weight: 700;
}

/* Login */
.login-page {
  background: #081d12;
  min-height: 100vh;
}

.login-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(340px, 1fr) minmax(480px, 1.15fr);
}

.login-brand {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  padding: clamp(48px, 8vw, 100px);
  background:
    radial-gradient(ellipse 120% 90% at 20% 20%, rgba(74, 222, 128, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 140% 120% at 50% 0%, #1c5437 0%, #113c24 50%, #081e13 100%);
  color: #fff;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.login-brand-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 24px;
}

.login-brand-logo {
  width: 240px;
  height: auto;
  max-width: 85%;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.38));
  margin-bottom: 20px;
  transition: transform 0.3s ease;
}

.login-brand-logo:hover {
  transform: scale(1.02);
}

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
  color: #bbf7d0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  width: fit-content;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}

.login-brand h1 {
  max-width: 580px;
  margin: 0;
  font-size: clamp(2.2rem, 3.8vw, 3.4rem);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.login-brand > p:last-of-type {
  max-width: 520px;
  margin: 18px 0 0;
  color: #d1e7d7;
  font-size: 1.05rem;
  line-height: 1.6;
}

.login-brand-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.login-brand-highlights span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  color: #f0fdf4;
  font-weight: 500;
  backdrop-filter: blur(6px);
}

.login-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 40px 24px;
  background: #f4f8f5;
}

.login-card {
  width: min(100%, 450px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(10, 35, 20, 0.07);
  padding: clamp(28px, 5vw, 48px);
}

.login-heading {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 26px;
}

.login-heading h2 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  color: var(--green-950);
  font-weight: 750;
}

.login-heading .eyebrow {
  margin-bottom: 2px;
}

.lock-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: #eaf6ee;
  color: var(--green-800);
  border: 1px solid #cce8d5;
}

.login-form {
  display: grid;
  gap: 18px;
}

.login-form label,
.field {
  display: grid;
  gap: 6px;
}

.login-form label > span,
.field > span {
  color: #435249;
  font-size: 0.82rem;
  font-weight: 750;
}

.login-form input,
.field input,
.field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cad8ce;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form input:hover,
.field input:hover,
.field select:hover {
  border-color: #8fb99a;
}

.login-form input:focus,
.field input:focus,
.field select:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(42, 126, 78, 0.15);
  outline: none;
}

.login-form .button-primary {
  background: linear-gradient(135deg, #1b5e3a 0%, #123f27 100%);
  border: none;
  min-height: 46px;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(27, 94, 58, 0.25);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.login-form .button-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(27, 94, 58, 0.32);
}

.login-note {
  margin: 19px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

/* Dashboard */
.admin-header {
  position: sticky;
  z-index: 30;
  top: 0;
  background: radial-gradient(ellipse 130% 160% at 25% 0%, #1c5437 0%, #103b23 55%, #092315 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(9, 35, 21, 0.22);
  color: #fff;
}

.admin-header-inner {
  display: flex;
  width: min(100% - 40px, 1440px);
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  text-decoration: none;
}

.admin-logo {
  height: 32px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
  transition: transform 0.2s ease;
}

.admin-logo:hover {
  transform: scale(1.02);
}

.admin-brand-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.22);
}

.admin-brand-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #86efac;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.admin-account {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-account form {
  margin: 0;
}

.account-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #d1e7d7;
  font-size: 0.82rem;
  font-weight: 500;
}

.account-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
}

.company-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2f1e6;
  font-size: 0.78rem;
  font-weight: 600;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.35;
  margin-left: 4px;
}

.role-badge-admin {
  background: rgba(74, 222, 128, 0.2);
  color: #86efac;
  border: 1px solid rgba(74, 222, 128, 0.4);
}

.role-badge-supervisor {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.role-badge-viewer {
  background: rgba(226, 232, 240, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(226, 232, 240, 0.25);
}

.button-logout {
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 8px;
  font-size: 0.84rem;
  min-height: 34px;
  padding: 0 13px;
  transition: all 0.2s;
}

.button-logout:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
}

.admin-shell {
  width: min(100% - 40px, 1440px);
  margin: 0 auto;
  padding: 42px 0 80px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.page-heading h1,
.detail-hero h1 {
  margin: 0;
  color: var(--green-950);
  font-size: clamp(2rem, 3vw, 3rem);
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.page-heading > div > p:last-child,
.detail-hero > div > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
}

.updated-at {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card {
  display: grid;
  min-height: 142px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(20, 56, 35, 0.04);
  padding: 22px;
}

.metric-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.045em;
}

.metric-card strong {
  margin: 4px 0 0;
  color: var(--green-900);
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.metric-card small {
  color: #7a887f;
  font-size: 0.76rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(20, 56, 35, 0.04);
}

.panel-heading {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 17px 22px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1.04rem;
  letter-spacing: -0.015em;
}

.panel-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.text-link,
.back-link {
  color: var(--green-700);
  font-size: 0.84rem;
  font-weight: 750;
  text-decoration: none;
}

.text-link:hover,
.back-link:hover {
  text-decoration: underline;
}

.filters-panel {
  margin-bottom: 20px;
}

.filters-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.7fr) repeat(6, minmax(125px, 1fr)) auto;
  align-items: end;
  gap: 13px;
  padding: 19px 22px 22px;
}

.filter-button {
  min-height: 44px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: start;
  gap: 20px;
}

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

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

th,
td {
  border-bottom: 1px solid #e8eee9;
  padding: 15px 17px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #fafcfb;
  color: #6b786f;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fbfdfb;
}

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

td {
  font-size: 0.87rem;
}

.company-name,
.score-value {
  display: block;
  color: var(--green-950);
}

.table-secondary {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
}

.mini-badge {
  display: inline-flex;
  margin-top: 7px;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.65rem;
  font-weight: 750;
}

.mini-badge-contact {
  background: var(--green-100);
  color: var(--green-800);
}

.mini-badge-archived {
  background: #f1f5f3;
  color: #55665b;
  border: 1px solid #cad8ce;
}

.score-value {
  margin-bottom: 5px;
  font-size: 1rem;
}

.level-badge,
.consent-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.67rem;
  font-weight: 800;
  white-space: nowrap;
}

.level-1 {
  background: #edf3ef;
  color: #5c7263;
}

.level-2 {
  background: #e0eee4;
  color: #426e50;
}

.level-3 {
  background: #d3e9d9;
  color: #2c6840;
}

.level-4 {
  background: #c3e3cc;
  color: #1f6438;
}

.level-5 {
  background: var(--green-800);
  color: #fff;
}

.level-neutral {
  background: #edf0ee;
  color: var(--muted);
}

.date-cell {
  color: #536159;
  white-space: nowrap;
}

.action-cell {
  text-align: right;
}

.empty-state,
.not-found {
  display: grid;
  justify-items: center;
  padding: 60px 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state > span,
.not-found > span {
  color: var(--green-600);
  font-size: 2.4rem;
}

.empty-state h3,
.not-found h1 {
  margin: 10px 0 3px;
  color: var(--green-950);
}

.empty-state p,
.not-found p {
  margin: 0;
}

.not-found .button {
  margin-top: 22px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-top: 1px solid var(--line);
  padding: 16px 20px;
  color: var(--muted);
  font-size: 0.79rem;
}

.pagination a {
  color: var(--green-700);
  font-weight: 750;
  text-decoration: none;
}

.pagination .disabled {
  color: #a7b0aa;
}

.pillar-panel {
  position: sticky;
  top: 88px;
}

.pillar-list {
  display: grid;
  gap: 17px;
  padding: 20px 22px 24px;
}

.pillar-row > div,
.pillar-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.pillar-row span,
.pillar-card span {
  color: #405047;
  font-size: 0.88rem;
  font-weight: 700;
}

.pillar-row strong,
.pillar-card strong {
  color: var(--green-900);
  font-size: 1.05rem;
}

progress {
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e5ece7;
}

progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #e5ece7;
}

progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green-700), var(--green-600));
}

progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green-700), var(--green-600));
}

/* Detail */
.detail-shell {
  max-width: 1240px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 24px;
}

.detail-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 25px;
}

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

.detail-score > strong {
  color: var(--green-900);
  font-size: 2.1rem;
  letter-spacing: -0.04em;
}

.detail-score .level-badge {
  padding: 6px 11px;
  font-size: 0.75rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.data-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 8px 22px 22px;
}

.data-list > div {
  min-width: 0;
  border-bottom: 1px solid #edf1ee;
  padding: 14px 10px 14px 0;
}

.data-list > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.data-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.data-list dd {
  overflow-wrap: anywhere;
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 650;
}

.consent-badge.yes {
  background: var(--green-100);
  color: var(--green-800);
}

.consent-badge.no {
  background: #edf0ee;
  color: #66736b;
}

.pillar-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 20px 22px 24px;
}

.pillar-card {
  border: 1px solid #e1e9e3;
  border-radius: 10px;
  background: #fbfdfb;
  padding: 15px;
}

.pillar-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.answers-section {
  margin-top: 36px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 17px;
}

.section-heading h2 {
  margin: 0;
  color: var(--green-950);
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.section-heading > span {
  color: var(--muted);
  font-size: 0.88rem;
}

.answer-group + .answer-group {
  margin-top: 18px;
}

.answer-group-heading {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 15px 22px;
}

.answer-group-heading > div {
  display: flex;
  align-items: center;
  gap: 13px;
}

.answer-group-heading h3 {
  margin: 0;
  font-size: 1.15rem;
}

.answer-group-heading > strong {
  color: var(--green-800);
  font-size: 1.25rem;
}

.pillar-index {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 9px;
  background: var(--green-100);
  color: var(--green-800);
  font-size: 0.82rem;
  font-weight: 850;
}

.answer-list {
  margin: 0;
  padding: 0 22px;
  list-style: none;
  counter-reset: questions;
}

.answer-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 155px;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid #e8eee9;
  padding: 17px 0;
  counter-increment: questions;
}

.answer-list li:last-child {
  border-bottom: 0;
}

.answer-list p {
  position: relative;
  margin: 0;
  padding-left: 36px;
  font-size: 1.02rem;
  line-height: 1.5;
}

.answer-list p::before {
  position: absolute;
  top: 0;
  left: 0;
  color: #91a098;
  content: counter(questions, decimal-leading-zero);
  font-size: 0.82rem;
  font-weight: 800;
}

.answer-score {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 9px;
  border-radius: 9px;
  padding: 7px 10px;
}

.answer-score strong {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
}

.answer-score span {
  font-size: 0.82rem;
  font-weight: 800;
}

.score-1 {
  background: #edf3ef;
  color: #50695a;
}

.score-2 {
  background: #e4f0e7;
  color: #3f704d;
}

.score-3 {
  background: #d9ecde;
  color: #2f6f43;
}

.score-4 {
  background: #cbe6d2;
  color: #21683a;
}

.score-5 {
  background: var(--green-800);
  color: #fff;
}

.score-5 strong {
  color: var(--green-900);
}

.score-missing {
  background: #f0f1f0;
  color: #737b76;
}

@media (max-width: 1250px) {
  .filters-grid {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }

  .field-search {
    grid-column: span 2;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pillar-panel {
    position: static;
  }

  .pillar-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: auto;
    padding: 55px 32px;
  }

  .login-brand h1 {
    font-size: clamp(2.5rem, 8vw, 4.2rem);
  }

  .login-panel {
    min-height: auto;
    padding: 50px 24px;
  }

  .metrics-grid,
  .pillar-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 700px) {
  .admin-header-inner,
  .admin-shell {
    width: min(100% - 24px, 1440px);
  }

  .account-badge,
  .account-name,
  .company-badge {
    display: none;
  }

  .admin-shell {
    padding-top: 28px;
  }

  .page-heading,
  .detail-hero,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics-grid,
  .filters-grid,
  .pillar-list,
  .pillar-cards,
  .data-list {
    grid-template-columns: 1fr;
  }

  .field-search {
    grid-column: auto;
  }

  .metric-card {
    min-height: 120px;
  }

  .panel-heading,
  .filters-grid,
  .pillar-list,
  .pillar-cards,
  .data-list,
  .answer-group-heading,
  .answer-list {
    padding-left: 16px;
    padding-right: 16px;
  }

  .data-list > div,
  .data-list > div:nth-last-child(-n + 2) {
    border-bottom: 1px solid #edf1ee;
  }

  .data-list > div:last-child {
    border-bottom: 0;
  }

  .answer-list li {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .answer-score {
    width: 155px;
    margin-left: 32px;
  }

  .detail-score {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .pagination {
    flex-wrap: wrap;
  }
}

/* Ações em lote e botões adicionais */
.batch-toolbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: var(--green-50);
  border: 1px solid var(--green-200);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.batch-toolbar strong {
  color: var(--green-900);
  font-size: 1rem;
}

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

.th-checkbox,
.td-checkbox {
  width: 40px;
  text-align: center;
  padding-left: 14px;
  padding-right: 4px;
}

.th-checkbox input,
.td-checkbox input {
  width: 17px;
  height: 17px;
  accent-color: var(--green-800);
  cursor: pointer;
}

.action-cell-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.button-danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.button-danger:hover {
  border-color: #831e28;
  background: #831e28;
}

.button-danger-ghost {
  min-height: 36px;
  border-color: #f1c7cb;
  background: transparent;
  color: var(--danger);
  padding: 0 10px;
  font-size: 0.8rem;
}

.button-danger-ghost:hover {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.button-outline {
  min-height: 36px;
  border-color: #cad8ce;
  background: transparent;
  color: var(--ink);
  padding: 0 10px;
  font-size: 0.8rem;
}

.button-outline:hover {
  border-color: var(--green-700);
  background: var(--green-50);
}

.button-secondary {
  border-color: #cad8ce;
  background: #fff;
  color: var(--green-900);
}

.button-secondary:hover {
  border-color: var(--green-700);
  background: var(--green-50);
}

.detail-actions-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.print-header,
.print-footer {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm 14mm 14mm 14mm;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html,
  body {
    background: #fff !important;
    color: #121815 !important;
    font-size: 15px !important;
    line-height: 1.45 !important;
  }

  /* Ocultar elementos de navegação e controle de tela */
  .admin-header,
  .back-link,
  .detail-actions-bar,
  .button,
  .alert,
  .account-badge,
  .company-badge {
    display: none !important;
  }

  .admin-shell,
  .detail-shell {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Cabeçalho impresso institucional */
  .print-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #1b5e3a;
    padding-bottom: 14px;
    margin-bottom: 20px;
  }

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

  .print-logo {
    width: 170px;
    height: auto;
    object-fit: contain;
  }

  .print-brand-text .print-title {
    font-size: 1.42rem;
    font-weight: 800;
    color: #123d24;
    letter-spacing: -0.02em;
  }

  .print-brand-text .print-subtitle {
    font-size: 0.95rem;
    color: #3b4e43;
    font-weight: 600;
  }

  .print-meta {
    text-align: right;
    font-size: 0.85rem;
    color: #3b4e43;
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: flex-end;
  }

  .print-badge-confidential {
    display: inline-block;
    background: #e8f5e9;
    color: #1b5e3a;
    border: 1px solid #c8e6c9;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: 3px;
  }

  /* Hero do diagnóstico */
  .detail-hero {
    background: #f4f8f5 !important;
    border: 1px solid #d6e4d9 !important;
    border-radius: 8px !important;
    padding: 16px 20px !important;
    margin-bottom: 18px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .detail-hero h1 {
    font-size: 1.8rem !important;
    margin: 3px 0 6px !important;
    color: #123d24 !important;
  }

  .detail-hero .eyebrow {
    font-size: 0.82rem !important;
    color: #2e7d32 !important;
    font-weight: 800 !important;
    text-transform: uppercase;
  }

  .detail-hero p {
    font-size: 1.05rem !important;
    color: #3b4e43 !important;
    margin: 0 !important;
  }

  .detail-score {
    text-align: right;
  }

  .detail-score strong {
    font-size: 2.5rem !important;
    color: #123d24 !important;
    display: block;
    line-height: 1;
  }

  .level-badge {
    display: inline-block !important;
    padding: 4px 12px !important;
    font-size: 0.9rem !important;
    border-radius: 6px !important;
    font-weight: 750 !important;
    margin-top: 6px;
  }

  /* Painéis de Informações */
  .detail-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
    margin-bottom: 18px !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .panel {
    border: 1px solid #dce5df !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    background: #fff !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .panel-heading {
    padding: 12px 18px !important;
    border-bottom: 1px solid #edf1ee !important;
  }

  .panel-heading h2 {
    font-size: 1.15rem !important;
    color: #123d24 !important;
    margin: 0 !important;
  }

  .panel-heading p {
    font-size: 0.88rem !important;
    margin: 3px 0 0 !important;
  }

  .data-list {
    padding: 8px 18px 16px !important;
  }

  .data-list > div {
    padding: 9px 8px 9px 0 !important;
  }

  .data-list dt {
    font-size: 0.78rem !important;
  }

  .data-list dd {
    font-size: 1.02rem !important;
  }

  /* Grid de Pilares */
  .pillar-cards {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 12px !important;
    padding: 16px 18px !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .pillar-card {
    padding: 12px !important;
    border: 1px solid #dce5df !important;
    border-radius: 6px !important;
    background: #fbfdfb !important;
  }

  .pillar-card span {
    font-size: 0.94rem !important;
    font-weight: 750;
  }

  .pillar-card strong {
    font-size: 1.12rem !important;
  }

  progress {
    height: 8px !important;
    margin-top: 8px !important;
    border: 1px solid #cad8ce;
  }

  progress::-webkit-progress-value {
    background: #1b5e3a !important;
  }

  progress::-moz-progress-bar {
    background: #1b5e3a !important;
  }

  .pillar-card small {
    font-size: 0.78rem !important;
    margin-top: 5px !important;
  }

  /* Seção de Respostas */
  .answers-section {
    margin-top: 24px !important;
  }

  .section-heading {
    margin-bottom: 14px !important;
  }

  .section-heading h2 {
    font-size: 1.45rem !important;
  }

  .section-heading > span {
    font-size: 0.92rem !important;
  }

  .answer-group {
    margin-top: 16px !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .answer-group-heading {
    min-height: 52px !important;
    padding: 12px 18px !important;
  }

  .answer-group-heading h3 {
    font-size: 1.12rem !important;
  }

  .answer-group-heading > strong {
    font-size: 1.28rem !important;
  }

  .pillar-index {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.82rem !important;
  }

  .answer-list {
    padding: 0 18px !important;
  }

  .answer-list li {
    padding: 11px 0 !important;
    gap: 16px !important;
    grid-template-columns: minmax(0, 1fr) 155px !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .answer-list p {
    font-size: 1.02rem !important;
    line-height: 1.45 !important;
    padding-left: 32px !important;
  }

  .answer-list p::before {
    font-size: 0.85rem !important;
  }

  .answer-score {
    padding: 6px 10px !important;
    border-radius: 7px !important;
    gap: 8px !important;
    grid-template-columns: 28px 1fr !important;
  }

  .answer-score strong {
    width: 26px !important;
    height: 26px !important;
    font-size: 0.9rem !important;
  }

  .answer-score span {
    font-size: 0.82rem !important;
  }

  /* Rodapé do relatório */
  .print-footer {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #cad8ce;
    padding-top: 12px;
    margin-top: 26px;
    font-size: 0.82rem;
    color: #55665b;
  }
}
