:root {
  color-scheme: light;
  --ink: #18231e;
  --muted: #66736c;
  --line: #dfe6e1;
  --surface: #ffffff;
  --surface-subtle: #f4f7f5;
  --surface-soft: #f8faf9;
  --canvas: #edf2ef;
  --forest: #174f3c;
  --forest-strong: #0f3c2d;
  --mint: #d9efe5;
  --lime: #bde26d;
  --amber: #c47724;
  --red: #b54848;
  --blue: #315f88;
  --shadow: 0 18px 50px rgba(24, 52, 39, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
  overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
}

.login-page {
  color: white;
  background:
    radial-gradient(circle at 12% 12%, rgba(189, 226, 109, 0.16), transparent 30%),
    linear-gradient(145deg, #0d2b22 0%, #174f3c 62%, #0f3c2d 100%);
}
.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 470px);
  align-items: center;
  gap: clamp(3rem, 8vw, 9rem);
  width: min(1180px, calc(100% - 3rem));
  min-height: 100vh;
  margin: 0 auto;
  padding: 3rem 0;
}
.login-introduction { max-width: 650px; }
.login-brand { margin-bottom: clamp(3rem, 8vh, 6rem); }
.login-introduction .eyebrow { color: var(--lime); }
.login-introduction h1 {
  max-width: 620px;
  margin: 0.6rem 0 1.25rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.045em;
}
.login-introduction > p:not(.eyebrow) { max-width: 580px; color: #c1d2ca; line-height: 1.7; }
.login-capabilities { display: grid; gap: 0.65rem; margin: 1.8rem 0 0; padding: 0; list-style: none; }
.login-capabilities li { color: #dce8e2; font-size: 0.86rem; }
.login-capabilities li::before { margin-right: 0.7rem; color: var(--lime); content: "✓"; font-weight: 900; }
.login-card {
  padding: clamp(1.8rem, 4vw, 2.7rem);
  color: var(--ink);
  background: white;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 18px;
  box-shadow: 0 35px 90px rgba(4, 20, 15, 0.35);
}
.login-card h2 { margin: 0.35rem 0 0.45rem; font-family: Georgia, "Times New Roman", serif; font-size: 2.1rem; font-weight: 500; }
.login-help { margin: 0 0 1.7rem; color: var(--muted); font-size: 0.82rem; line-height: 1.55; }
.login-card label { display: grid; gap: 0.45rem; margin: 1rem 0; color: var(--muted); font-size: 0.74rem; font-weight: 750; }
.login-card input { width: 100%; padding: 0.8rem 0.85rem; color: var(--ink); background: white; border: 1px solid #b8c7bf; border-radius: 9px; outline: 0; }
.login-card input:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(23, 79, 60, 0.12); }
.login-card button { margin-top: 0.65rem; }
.login-message { padding: 0.7rem 0.8rem; color: #873737; background: #f9e4e4; border-radius: 8px; font-size: 0.76rem; }
.login-message.success { color: var(--forest); background: var(--mint); }
.login-security { margin: 1.4rem 0 0; color: var(--muted); text-align: center; font-size: 0.67rem; }

button, input, select { font: inherit; }
button { cursor: pointer; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  color: white;
  background: var(--forest-strong);
  border-radius: 0.5rem;
}
.skip-link:focus { top: 1rem; }

.shell { display: grid; grid-template-columns: 285px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 1.75rem 1.35rem;
  color: white;
  background:
    radial-gradient(circle at 15% 5%, rgba(189, 226, 109, 0.13), transparent 28%),
    linear-gradient(160deg, #153e31 0%, #0d2b22 100%);
}

.brand { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 2rem; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--forest-strong);
  background: var(--lime);
  border-radius: 12px 5px 12px 5px;
  font-weight: 900;
  font-size: 1.3rem;
}
.brand strong, .brand span { display: block; }
.brand strong { font-size: 1.12rem; letter-spacing: 0.01em; }
.brand span { margin-top: 0.1rem; color: #a9bdb4; font-size: 0.72rem; letter-spacing: 0.16em; }

.primary-button, .secondary-button {
  min-height: 42px;
  padding: 0.7rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 750;
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}
.primary-button { color: #10281f; background: var(--lime); box-shadow: 0 8px 20px rgba(189, 226, 109, 0.12); }
.primary-button:hover { background: #caec83; transform: translateY(-1px); }
.primary-button:disabled { cursor: not-allowed; opacity: 0.55; transform: none; }
.secondary-button { color: var(--ink); background: white; border-color: var(--line); }
.secondary-button:hover { background: var(--surface-subtle); }
.full-width { width: 100%; }
.compact-button { min-height: 36px; padding: 0.5rem 0.8rem; font-size: 0.76rem; }

.sidebar-section { display: flex; min-height: 0; flex: 1; flex-direction: column; margin-top: 1.75rem; }
.section-caption { display: flex; align-items: center; justify-content: space-between; color: #a9bdb4; font-size: 0.74rem; font-weight: 750; letter-spacing: 0.09em; text-transform: uppercase; }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 1.2rem;
}
.icon-button:hover { background: rgba(255, 255, 255, 0.1); }
.case-filters { display: grid; gap: 0.45rem; margin-top: 0.75rem; }
.case-filters > div { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 0.4rem; }
.case-filters input, .case-filters select {
  min-width: 0; width: 100%; padding: 0.52rem 0.58rem; color: white; background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 7px; font-size: 0.7rem;
}
.case-filters input::placeholder { color: #94aea2; }
.case-filters select option { color: var(--ink); background: white; }
.case-list { overflow-y: auto; margin: 0.65rem -0.4rem 0; padding: 0 0.4rem; }
.case-pagination { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.45rem; margin-top: 0.45rem; }
.case-pagination span { color: #94aea2; text-align: center; font-size: 0.66rem; }
.case-pagination button { width: 30px; height: 28px; color: white; background: rgba(255,255,255,0.08); border: 0; border-radius: 6px; }
.case-pagination button:disabled { cursor: not-allowed; opacity: 0.35; }
.case-item {
  width: 100%;
  margin-bottom: 0.35rem;
  padding: 0.75rem 0.8rem;
  color: #dce7e2;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
}
.case-item:hover { background: rgba(255, 255, 255, 0.06); }
.case-item.active { color: white; background: rgba(255, 255, 255, 0.1); border-color: rgba(189, 226, 109, 0.28); }
.case-item strong, .case-item span { display: block; }
.case-item strong { overflow: hidden; font-size: 0.88rem; text-overflow: ellipsis; white-space: nowrap; }
.case-item span { margin-top: 0.25rem; color: #94aea2; font-size: 0.72rem; }
.case-list-empty { color: #94aea2; font-size: 0.82rem; line-height: 1.45; }

.environment-card { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.9rem; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 10px; }
.environment-card strong, .environment-card span { display: block; }
.environment-card strong { font-size: 0.77rem; }
.environment-card span { margin-top: 0.2rem; color: #94aea2; font-size: 0.67rem; }
.status-dot { width: 8px; height: 8px; margin-top: 0.3rem; background: var(--lime); border-radius: 50%; box-shadow: 0 0 0 4px rgba(189, 226, 109, 0.13); }

.main-content { min-width: 0; padding: 2rem clamp(1.3rem, 3vw, 3.5rem) 4rem; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; max-width: 1440px; margin: 0 auto 1.75rem; }
.topbar h1 { margin: 0.18rem 0 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 3vw, 3rem); font-weight: 500; letter-spacing: -0.035em; }
.topbar-meta { display: flex; align-items: center; gap: 0.9rem; }
.security-badge, .format-badge { padding: 0.42rem 0.62rem; color: var(--forest); background: var(--mint); border-radius: 999px; font-size: 0.72rem; font-weight: 750; }
.account-badge { display: flex; align-items: center; gap: 0.45rem; padding: 0.42rem 0.62rem; color: var(--forest); background: var(--mint); border-radius: 999px; font-size: 0.72rem; }
.account-badge span { color: #16835a; font-size: 0.55rem; }
.account-badge strong { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-button { padding: 0.42rem 0.62rem; color: var(--forest); background: transparent; border: 1px solid #b8c7bf; border-radius: 8px; font-size: 0.7rem; font-weight: 750; }
.logout-button:hover { background: white; }
.personal-export-link { white-space: nowrap; text-decoration: none; }
.muted { color: var(--muted); font-size: 0.76rem; }
.eyebrow { margin: 0; color: var(--forest); font-size: 0.68rem; font-weight: 850; letter-spacing: 0.13em; text-transform: uppercase; }

.workspace, .empty-state { max-width: 1440px; margin: 0 auto; }
.panel { background: var(--surface); border: 1px solid rgba(76, 102, 89, 0.12); border-radius: 14px; box-shadow: var(--shadow); }
.empty-state { display: grid; justify-items: center; padding: clamp(3rem, 8vw, 7rem) 2rem; text-align: center; }
.empty-state h2 { margin: 1.6rem 0 0.65rem; font-family: Georgia, "Times New Roman", serif; font-size: 2rem; font-weight: 500; }
.empty-state p { max-width: 580px; margin: 0 0 1.4rem; color: var(--muted); line-height: 1.65; }
.empty-illustration { display: flex; gap: 0.65rem; }
.empty-illustration span { display: grid; place-items: center; width: 70px; height: 84px; color: var(--forest); background: var(--surface-subtle); border: 1px solid var(--line); border-radius: 5px 16px 5px 5px; font-size: 0.72rem; font-weight: 850; }
.empty-illustration span:nth-child(2) { transform: translateY(-9px); background: var(--mint); }

.overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.metric-card { padding: 1.15rem 1.25rem; background: var(--surface); border: 1px solid rgba(76, 102, 89, 0.12); border-radius: 12px; }
.metric-card > span, .metric-card small { display: block; color: var(--muted); }
.metric-card > span { font-size: 0.75rem; font-weight: 650; }
.metric-card strong { display: block; margin: 0.35rem 0 0.2rem; font-family: Georgia, "Times New Roman", serif; font-size: 1.8rem; font-weight: 500; }
.metric-card small { font-size: 0.68rem; }
.metric-card.accent { color: white; background: var(--forest); }
.metric-card.accent > span, .metric-card.accent small { color: #bad0c6; }
.metric-card.accent strong { color: var(--lime); font-family: inherit; font-size: 1.1rem; font-weight: 800; }

.content-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 0.72fr); gap: 1rem; }
.primary-column, .secondary-column { display: grid; align-content: start; gap: 1rem; }
.upload-panel, .deliveries-panel, .case-card, .capability-card { padding: 1.4rem; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-heading h2, .case-card h2 { margin: 0.2rem 0 0; font-size: 1.1rem; }
.drop-zone { display: grid; justify-items: center; padding: 2rem 1rem; color: var(--muted); text-align: center; background: var(--surface-subtle); border: 1.5px dashed #aabbb2; border-radius: 11px; transition: background 120ms ease, border-color 120ms ease; }
.drop-zone:hover, .drop-zone.dragging { background: #edf7f1; border-color: var(--forest); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone strong { margin: 0.55rem 0 0.25rem; color: var(--ink); font-size: 0.9rem; }
.drop-zone > span:not(.drop-icon):not(.selected-file) { font-size: 0.73rem; }
.drop-icon { display: grid; place-items: center; width: 42px; height: 42px; color: var(--forest); background: var(--mint); border-radius: 50%; font-size: 1.3rem; font-weight: 900; }
.selected-file { margin-top: 0.75rem; color: var(--forest); font-size: 0.8rem; font-weight: 800; }
.upload-metadata-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; margin-top: 1rem; }
.upload-metadata-grid label { display: grid; gap: 0.35rem; color: var(--muted); font-size: 0.72rem; font-weight: 700; }
.upload-metadata-grid .full-grid-field { grid-column: 1 / -1; }
.upload-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.form-message { min-height: 1.2em; margin: 0; color: var(--red); font-size: 0.78rem; }

.delivery-list { display: grid; gap: 0.65rem; }
.delivery-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: 0.9rem 1rem; background: var(--surface-subtle); border: 1px solid transparent; border-radius: 10px; }
.delivery-row:hover { border-color: var(--line); }
.delivery-file { display: flex; align-items: center; min-width: 0; gap: 0.8rem; }
.file-mark { display: grid; flex: 0 0 40px; place-items: center; height: 46px; color: var(--forest); background: var(--mint); border-radius: 7px; font-size: 0.67rem; font-weight: 900; }
.delivery-file strong, .delivery-file span { display: block; }
.delivery-file strong { overflow: hidden; font-size: 0.84rem; text-overflow: ellipsis; white-space: nowrap; }
.delivery-file span { margin-top: 0.22rem; color: var(--muted); font-size: 0.7rem; }
.delivery-actions { display: flex; align-items: center; gap: 0.65rem; }
.status-pill { padding: 0.35rem 0.55rem; border-radius: 999px; font-size: 0.68rem; font-weight: 800; }
.status-queued, .status-running, .status-uploaded, .status-analyzing, .status-under_review { color: var(--blue); background: #dceaf6; }
.status-succeeded, .status-analyzed, .status-validated, .status-pass { color: var(--forest); background: var(--mint); }
.status-validated_with_reservations { color: #754717; background: #f5e6d2; }
.status-failed, .status-rejected, .status-fail, .status-error { color: var(--red); background: #f5dddd; }
.status-partial, .status-not_evaluable { color: #754717; background: #f5e6d2; }
.result-button { padding: 0.42rem 0.65rem; color: var(--forest); background: white; border: 1px solid var(--line); border-radius: 7px; font-size: 0.72rem; font-weight: 800; }
.progress-track { width: 86px; height: 5px; overflow: hidden; appearance: none; background: #cfdad4; border: 0; border-radius: 99px; }
.progress-track::-webkit-progress-bar { background: #cfdad4; border-radius: 99px; }
.progress-track::-webkit-progress-value { background: var(--blue); border-radius: 99px; transition: width 300ms ease; }
.progress-track::-moz-progress-bar { background: var(--blue); border-radius: 99px; }

.case-card h2 { margin-bottom: 1rem; font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; font-weight: 500; }
.case-card dl { margin: 0; }
.case-card dl div { padding: 0.65rem 0; border-top: 1px solid var(--line); }
.case-card dt { color: var(--muted); font-size: 0.68rem; }
.case-card dd { overflow-wrap: anywhere; margin: 0.2rem 0 0; font-size: 0.78rem; font-weight: 700; }
.case-card .report-download { margin-top: 1rem; }

.new-user-form { padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.user-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.case-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.8rem; }
.rules-dialog { width: min(960px, calc(100vw - 2rem)); }
.rule-profile-form { padding: 1rem 0 1.3rem; border-bottom: 1px solid var(--line); }
.code-editor { min-height: 230px; font: 0.76rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; }
.compact-code-editor { min-height: 140px; }
.import-field input { padding: 0.6rem; background: var(--surface-subtle); border: 1px dashed var(--line); border-radius: 8px; }
.rule-profile-list { display: grid; gap: 0.7rem; max-height: 360px; overflow: auto; }
.rule-profile-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: 0.85rem 1rem; background: var(--surface-subtle); border-radius: 10px; }
.rule-profile-card strong, .rule-profile-card span { display: block; }
.rule-profile-card span { margin-top: 0.2rem; color: var(--muted); font-size: 0.72rem; }
.rule-profile-actions { display: flex; gap: 0.45rem; }
.full-grid-field { grid-column: 1 / -1; }
.user-password-field { grid-column: 1 / -1; }
.role-selector { display: flex; flex-wrap: wrap; gap: 0.55rem 1rem; margin: 0.9rem 0 0; padding: 0.75rem; border: 1px solid var(--line); border-radius: 9px; }
.role-selector legend { padding: 0 0.35rem; color: var(--muted); font-size: 0.7rem; font-weight: 750; }
.role-selector label, .toggle-label { font-size: 0.76rem; font-weight: 650; }
.users-heading { display: flex; align-items: baseline; justify-content: space-between; margin: 1.2rem 0 0.7rem; }
.users-heading h3 { margin: 0; }
.user-list { display: grid; max-height: 48vh; gap: 0.75rem; overflow: auto; }
.user-card { padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-subtle); }
.user-card-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.7rem; }
.user-card-heading strong, .user-card-heading span { display: block; }
.user-update-form { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(190px, 1fr) auto minmax(260px, 1.4fr) auto; align-items: end; gap: 0.7rem; }
.access-administration-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.access-administration-grid section { padding: 1rem; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: 10px; }
.access-administration-grid h3 { margin: 0 0 0.75rem; font-size: 0.9rem; }
.invitation-link { margin-top: 0.8rem; padding: 0.75rem; overflow-wrap: anywhere; color: var(--forest); background: white; border: 1px solid var(--line); border-radius: 8px; font-size: 0.72rem; }
.compact-roles { margin: 0; padding: 0.48rem 0.65rem; }
.password-update-form { display: grid; grid-template-columns: 1fr auto; gap: 0.7rem; margin-top: 0.7rem; }

@media (max-width: 760px) {
  .user-form-grid, .case-form-grid, .user-update-form, .password-update-form, .access-administration-grid { grid-template-columns: 1fr; }
  .full-grid-field { grid-column: auto; }
  .user-password-field { grid-column: auto; }
  .topbar-meta { flex-wrap: wrap; justify-content: flex-end; }
}
.capability-card ul { display: grid; gap: 0.7rem; margin: 0.9rem 0 0; padding: 0; list-style: none; }
.capability-card li { display: flex; gap: 0.55rem; color: var(--muted); font-size: 0.76rem; line-height: 1.4; }
.capability-card li span { color: var(--forest); font-weight: 900; }

.dialog { width: min(92vw, 520px); padding: 1.4rem; color: var(--ink); background: white; border: 0; border-radius: 15px; box-shadow: 0 30px 100px rgba(13, 43, 34, 0.24); }
.dialog::backdrop { background: rgba(13, 43, 34, 0.54); backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.dialog-heading h2 { margin: 0.2rem 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.65rem; font-weight: 500; }
.dialog label { display: grid; gap: 0.4rem; margin: 0.85rem 0; color: var(--muted); font-size: 0.75rem; font-weight: 750; }
.dialog input, .dialog select, .dialog textarea { width: 100%; padding: 0.72rem 0.8rem; color: var(--ink); background: white; border: 1px solid #bac8c0; border-radius: 8px; outline: 0; }
.dialog input:focus, .dialog select:focus, .dialog textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(23, 79, 60, 0.12); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.65rem; margin-top: 1.25rem; }
.dialog.users-dialog { width: min(920px, calc(100vw - 2rem)); }
.dialog.case-dialog { width: min(760px, calc(100vw - 2rem)); }
.dialog .role-selector label, .dialog .toggle-label { display: flex; align-items: center; gap: 0.25rem; margin: 0; }
.dialog .role-selector input, .dialog .toggle-label input { width: auto; padding: 0; }
.result-dialog { width: min(94vw, 840px); }
.result-content { display: grid; gap: 1rem; max-height: 68vh; overflow: auto; }
.result-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.65rem; }
.result-metric { padding: 0.85rem; background: var(--surface-subtle); border-radius: 9px; }
.result-metric span, .result-metric strong { display: block; }
.result-metric span { color: var(--muted); font-size: 0.67rem; }
.result-metric strong { margin-top: 0.3rem; font-size: 1.05rem; }
.result-section { padding-top: 1rem; border-top: 1px solid var(--line); }
.result-section h3 { margin: 0 0 0.65rem; font-size: 0.86rem; }
.result-section ul { margin: 0; padding-left: 1.15rem; color: var(--muted); font-size: 0.75rem; line-height: 1.55; }
.rule-results { display: grid; gap: 0.65rem; }
.rule-result { border: 1px solid var(--line); border-left-width: 4px; border-radius: 0.75rem; padding: 0.8rem 0.9rem; background: var(--surface-soft); }
.rule-result p { margin: 0.45rem 0 0; color: var(--muted); }
.rule-result-heading { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
.rule-pass { border-left-color: #16835a; }
.rule-fail, .rule-error { border-left-color: #b73636; }
.rule-not_evaluable { border-left-color: #b47a13; }
.rule-finding { font-size: 0.76rem; padding-left: 0.75rem; border-left: 2px solid var(--line); }
.technical-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem 1rem; margin: 0; }
.technical-list div { min-width: 0; }
.technical-list dt { color: var(--muted); font-size: 0.66rem; }
.technical-list dd { overflow-wrap: anywhere; margin: 0.15rem 0 0; font-size: 0.75rem; font-weight: 700; }
.report-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.report-download { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-size: 0.76rem; }
.geo-map { display: block; width: 100%; height: 390px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #eef4f0; }
.map-attributes { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.45rem 1rem; margin: 0.7rem 0 0; padding: 0.8rem; background: var(--surface-subtle); border-radius: 10px; }
.map-attributes div { min-width: 0; }
.map-attributes dt { color: var(--muted); font-size: 0.65rem; }
.map-attributes dd { overflow-wrap: anywhere; margin: 0.15rem 0 0; font-size: 0.74rem; font-weight: 700; }
.map-background { fill: #eef4f0; }
.map-grid { stroke: #d8e4dc; stroke-width: 1; }
.map-entity { fill: rgba(23, 79, 60, 0.08); stroke: #174f3c; stroke-width: 3; vector-effect: non-scaling-stroke; }
.map-finding { fill: rgba(181, 72, 72, 0.14); stroke: #b54848; stroke-width: 4; vector-effect: non-scaling-stroke; }
.map-entity-point { fill: #174f3c; stroke: white; stroke-width: 2; }
.map-finding-point { fill: #b54848; stroke: white; stroke-width: 2; }
.map-legend { display: flex; flex-wrap: wrap; gap: 0.55rem 1rem; margin-top: 0.55rem; color: var(--forest); font-size: 0.7rem; }
.map-legend .finding { color: var(--red); }
.map-legend .unlocalizable { color: #754717; }
.unlocalizable-findings { margin-top: 0.7rem !important; padding: 0.7rem 0.7rem 0.7rem 1.8rem !important; background: #f5e6d2; border-radius: 8px; }
.decision-form, .comment-form { display: grid; gap: 0.7rem; margin-top: 0.75rem; }
.decision-form label { display: grid; gap: 0.35rem; color: var(--muted); font-size: 0.7rem; font-weight: 700; }
.decision-form select, .decision-form textarea, .comment-form textarea {
  width: 100%; padding: 0.65rem 0.75rem; color: var(--ink); background: white;
  border: 1px solid var(--line); border-radius: 8px; resize: vertical;
}
.decision-form button, .comment-form button { justify-self: end; }
.decision-context, .decision-warning { margin: 0; padding: 0.75rem; border-radius: 8px; font-size: 0.76rem; }
.decision-context { color: var(--forest); background: var(--mint); }
.decision-warning { color: #754717; background: #f5e6d2; border-left: 4px solid var(--amber); }
.decision-form .decision-acknowledgement {
  display: flex; align-items: flex-start; gap: 0.55rem; margin: 0; padding: 0.7rem;
  color: var(--ink); background: var(--surface-subtle); border-radius: 8px; line-height: 1.4;
}
.decision-form .decision-acknowledgement input { width: auto; margin-top: 0.15rem; }
.review-rationale { padding: 0.75rem; background: var(--surface-subtle); border-radius: 8px; white-space: pre-wrap; }
.comment-list { display: grid; gap: 0.55rem; }
.comment-item { padding: 0.7rem 0.8rem; background: var(--surface-subtle); border-radius: 8px; }
.comment-item p { margin: 0 0 0.35rem; white-space: pre-wrap; }
.comment-item span { font-size: 0.67rem; }
.comment-form { grid-template-columns: 1fr auto; align-items: end; }

.toast-region { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 110; display: grid; gap: 0.5rem; }
.toast { max-width: 380px; padding: 0.8rem 1rem; color: white; background: var(--forest-strong); border-left: 4px solid var(--lime); border-radius: 8px; box-shadow: var(--shadow); font-size: 0.78rem; }
.toast.error { border-left-color: #ef8a8a; }
.error-action { padding: 0.75rem; color: var(--ink); background: var(--surface-subtle); border-left: 4px solid var(--amber); border-radius: 8px; }

@media (max-width: 1040px) {
  .shell { grid-template-columns: 235px minmax(0, 1fr); }
  .topbar { align-items: flex-start; flex-direction: column; gap: 1rem; }
  .topbar-meta { width: 100%; flex-wrap: wrap; }
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .secondary-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .login-layout { grid-template-columns: 1fr; gap: 2rem; width: min(100% - 1.5rem, 520px); padding: 1.2rem 0; }
  .login-introduction { display: none; }
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 1rem; }
  .brand { margin-bottom: 1rem; }
  .sidebar-section { max-height: min(48vh, 420px); margin-top: 1rem; }
  .environment-card { display: none; }
  .main-content { padding: 1.2rem 0.9rem 3rem; }
  .topbar { align-items: flex-start; }
  .topbar-meta .muted { display: none; }
  .account-badge strong, #logout-button { font-size: 0; }
  .account-badge strong::after { content: "Compte"; font-size: 0.68rem; }
  #logout-button::after { content: "Sortir"; font-size: 0.68rem; }
  .personal-export-link { display: none; }
  .overview-grid, .secondary-column, .result-summary { grid-template-columns: 1fr 1fr; }
  .delivery-row { grid-template-columns: 1fr; }
  .delivery-actions { justify-content: flex-end; }
  .upload-actions { align-items: stretch; flex-direction: column; }
  .upload-metadata-grid { grid-template-columns: 1fr; }
  .upload-metadata-grid .full-grid-field { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
