:root {
  color-scheme: light;
  font-family: "Segoe UI", Arial, sans-serif;
  --blue: #245ca6;
  --blue-dark: #173f75;
  --purple: #6f42a8;
  --green: #398c5d;
  --orange: #d97706;
  --red: #dc2626;
  --ink: #182233;
  --muted: #5d6878;
  --line: #d5dce6;
  --surface: #ffffff;
  --surface-soft: #f4f6f9;
  --focus: #facc15;
}

/* Chambre froide */
.cold-room-heading { border-left: 4px solid var(--orange); padding-left: 18px; }
.cold-room-summary {
  display: grid;
  grid-template-columns: repeat(7, minmax(125px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  overflow-x: auto;
}
.cold-room-summary > div {
  min-width: 125px;
  min-height: 72px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-top: 3px solid #64748b;
  background: var(--surface);
}
.cold-room-summary span { display: block; color: var(--muted); font-size: 12px; }
.cold-room-summary strong { display: block; margin-top: 6px; font-size: 20px; }
.cold-room-summary .summary-blue { border-top-color: var(--blue); }
.cold-room-summary .summary-green { border-top-color: var(--green); }
.cold-room-summary .summary-orange { border-top-color: var(--orange); }
.cold-room-summary .summary-red { border-top-color: var(--red); }
.cold-room-summary .summary-purple { border-top-color: var(--purple); }
.cold-room-master-detail { grid-template-columns: minmax(620px, 1.4fr) minmax(390px, .8fr); min-height: 560px; }
.cold-room-master-detail .list-panel { min-width: 0; }
.cold-room-detail { overflow-y: auto; max-height: calc(100vh - 330px); }
.cold-room-toolbar { align-items: end; }
.cold-room-toolbar .search-row { flex: 1 1 760px; grid-template-columns: minmax(170px, 220px) minmax(150px, 190px) minmax(240px, 1fr) auto; }
.cold-room-detail .detail-heading { border-top: 3px solid var(--orange); }
.condition-report {
  margin: 10px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--orange);
  background: #fffaf1;
}
.condition-report > header { display: flex; justify-content: space-between; gap: 12px; }
.condition-report > header span { color: var(--muted); font-size: 12px; }
.cold-room-defect {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 300px);
  gap: 12px;
  margin-top: 8px;
  padding: 9px;
  border: 1px solid #e5cfa9;
  background: var(--surface);
}
.cold-room-defect span, .cold-room-defect p { display: block; margin: 3px 0; color: var(--muted); font-size: 12px; }
.photo-upload { display: grid; grid-template-columns: 1fr; gap: 6px; }
.condition-dialog { width: min(1080px, calc(100vw - 32px)); }
.condition-dialog fieldset { margin-top: 14px; border: 1px solid var(--line); }
.defect-editor-row { display: grid; grid-template-columns: 1fr 1fr 130px 1.4fr auto; gap: 8px; margin: 8px 0; }
.danger-button { color: #b91c1c; border-color: #ef4444; }
.status-pill.info { color: #075985; background: #e0f2fe; }

@media (max-width: 1400px) {
  .cold-room-master-detail { grid-template-columns: minmax(560px, 1.2fr) minmax(340px, .8fr); }
  .cold-room-summary { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
  .defect-editor-row { grid-template-columns: 1fr 1fr 110px; }
  .defect-editor-row [data-field="comment"] { grid-column: 1 / 3; }
}

@media (max-width: 980px) {
  .cold-room-master-detail { display: block; }
  .cold-room-detail { max-height: none; margin-top: 12px; }
  .cold-room-toolbar, .condition-report > header { align-items: stretch; flex-direction: column; }
  .cold-room-toolbar .search-row { display: grid; grid-template-columns: 1fr 1fr; flex-basis: auto; }
  .cold-room-defect { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .cold-room-summary { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .cold-room-toolbar .search-row, .defect-editor-row { grid-template-columns: 1fr; }
  .defect-editor-row [data-field="comment"] { grid-column: auto; }
}

/* Chasse - saisons */
.hunting-heading { border-left: 4px solid #2563eb; padding-left: 18px; }
.season-summary { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.summary-tile.success { border-top-color: #16834f; }
.summary-tile.warning { border-top-color: #d97706; }
.summary-tile.neutral { border-top-color: #64748b; }
.season-table tbody tr { cursor: pointer; }
.season-table tbody tr.selected { background: #eaf2ff; box-shadow: inset 4px 0 #2563eb; }
.status-badge.season-draft { background: #fff4d6; color: #8a4b00; }
.status-badge.season-open { background: #dcfce7; color: #166534; }
.status-badge.season-closed { background: #e2e8f0; color: #334155; }
.status-badge.season-archived { background: #f1f5f9; color: #64748b; }
.nav-disabled { color: #94a3b8; padding: 9px 12px; cursor: not-allowed; }
.season-wizard-dialog { width: min(920px, calc(100vw - 36px)); }
.wizard-copy-section { margin-top: 18px; }
.wizard-copy-section .section-heading { align-items: end; }
.compact-table td, .compact-table th { padding: 8px 10px; }
.money-input { width: 110px; }
.status-message { min-height: 24px; color: #166534; margin: 8px 0; }
.status-message.error { color: #b91c1c; }
.empty-cell { color: #64748b; text-align: center; padding: 28px !important; }

@media (max-width: 900px) {
  .season-summary { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: #eef1f5;
}

body > header {
  min-height: 62px;
  padding: 12px 22px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 14px;
}

body > header h1 {
  margin: 0;
  color: var(--purple);
  font-size: 24px;
}

body > header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

body > main {
  padding: 14px 18px 18px;
}

button,
.button,
select,
input {
  min-height: 36px;
  border: 1px solid #aeb9c9;
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

button,
.button {
  padding: 7px 12px;
  text-decoration: none;
  cursor: pointer;
}

button:hover:not(:disabled),
.button:hover {
  border-color: var(--blue);
  color: var(--blue-dark);
  background: #f3f7fc;
}

button:focus-visible,
.button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(36, 92, 166, 0.25);
  outline-offset: 1px;
}

button:disabled {
  opacity: 0.44;
  cursor: not-allowed;
}

.primary,
.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
  font-weight: 600;
}

.primary:hover:not(:disabled),
.button.primary:hover {
  background: var(--blue-dark);
  color: #ffffff;
}

input,
select {
  width: 100%;
  padding: 7px 9px;
}

.login-card,
.card {
  max-width: 520px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.login-card {
  margin: 8vh auto 0;
}

.login-card h2 {
  margin: 0 0 8px;
}

.login-card label {
  display: grid;
  gap: 6px;
  margin: 15px 0;
  font-weight: 600;
}

.error {
  color: var(--red) !important;
  font-weight: 600;
}

.hint,
.empty-search,
.empty-details {
  color: var(--muted);
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.toolbar,
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.topbar > div {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.topbar > div strong {
  font-size: 18px;
}

.topbar > div span {
  color: var(--muted);
}

.environment-badge,
.beta-badge,
.feature-status-badge,
.nav-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.environment-badge { margin: 8px 0; padding: 6px 8px; }
.environment-badge.demo { color: #7c2d12; background: #ffedd5; border: 1px solid #fdba74; }
.environment-badge.real { color: #14532d; background: #dcfce7; border: 1px solid #86efac; }
.beta-badge { padding: 5px 7px; color: #4338ca !important; background: #eef2ff; border: 1px solid #c7d2fe; }
.nav-badge { margin-left: 7px; padding: 4px 5px; color: #92400e; background: #fef3c7; }

.preview-nav {
  margin-top: -6px;
  border-top: 0;
  background: #fffaf0;
}

.preview-nav a { color: #78350f; }

.preview-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 24px;
  align-items: center;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
}

.preview-heading h2 { margin: 10px 0 6px; font-size: 24px; }
.preview-heading p { margin: 0; color: var(--muted); }
.feature-status-badge { padding: 6px 8px; color: #92400e; background: #fef3c7; border: 1px solid #fcd34d; }
.preview-notice { padding: 14px; background: #fffaf0; border: 1px solid #f6d68b; }
.preview-layout { display: grid; grid-template-columns: minmax(280px, .75fr) minmax(420px, 1.25fr); gap: 16px; margin-top: 16px; }
.preview-capabilities, .preview-mock { padding: 20px; background: var(--surface); border: 1px solid var(--line); }
.preview-capabilities h3 { margin-top: 0; }
.preview-capabilities li { margin: 10px 0; }
.preview-mock { color: var(--muted); background: #f8fafc; }
.preview-mock-toolbar { display: flex; gap: 8px; }
.preview-mock-lines { display: grid; gap: 10px; margin: 24px 0; }
.preview-mock-lines span { display: block; height: 36px; border: 1px solid #dbe2ea; background: #edf1f5; }

@media (max-width: 900px) {
  .preview-heading, .preview-layout { grid-template-columns: 1fr; }
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar nav form {
  margin: 0;
}

.administration-nav a {
  padding: 7px 10px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.administration-nav a:hover,
.administration-nav a.active {
  color: var(--blue-dark);
  border-bottom-color: var(--blue);
}

.territory-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(520px, 1fr) minmax(280px, 330px);
  gap: 10px;
  height: calc(100vh - 234px);
  min-height: 500px;
  overflow: hidden;
}

.territory-sidebar,
.map-area,
.details-panel {
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--line);
}

.territory-sidebar {
  overflow-y: auto;
  transition: opacity 120ms ease;
}

.sidebar-section {
  padding: 13px;
  border-bottom: 1px solid var(--line);
}

.sidebar-section:last-child {
  border-bottom: 0;
}

.sidebar-section h2,
.sidebar-section > label:first-child {
  display: block;
  margin: 0 0 9px;
  font-size: 14px;
  font-weight: 700;
  color: var(--blue-dark);
}

.search-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.search-control input {
  min-width: 0;
}

.search-results {
  display: grid;
  gap: 4px;
  max-height: 210px;
  margin-top: 8px;
  overflow-y: auto;
}

.search-result {
  width: 100%;
  min-height: 0;
  padding: 8px;
  text-align: left;
  display: grid;
  gap: 2px;
  border-color: var(--line);
}

.search-result strong,
.search-result span,
.search-result small {
  overflow-wrap: anywhere;
}

.search-result span {
  color: var(--muted);
  font-size: 12px;
}

.search-result small {
  color: var(--blue);
}

.layer-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.layer-list label {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 7px;
}

.layer-list input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.legend-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  font-size: 12px;
}

.legend-grid span {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 8px;
}

.legend-grid i {
  width: 22px;
  height: 12px;
  display: block;
  background: color-mix(in srgb, var(--legend) 38%, transparent);
  border: 2px solid var(--legend);
}

.legend-grid i.line-legend {
  height: 0;
  background: none;
  border: 0;
  border-top: 4px solid;
}

.selected-line {
  color: #facc15;
}

.owner-line {
  color: #06b6d4;
}

.lease-line {
  color: #2563eb;
}

.summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.summary > div,
.group-metrics > div {
  display: grid;
  gap: 2px;
  padding: 8px;
  background: var(--surface-soft);
  border-left: 3px solid var(--blue);
}

.summary strong,
.group-metrics strong {
  color: var(--blue-dark);
  font-size: 17px;
}

.summary span,
.group-metrics span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.map-area {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.map-toolbar,
.map-footer {
  min-height: 44px;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
}

.map-toolbar {
  border-bottom: 1px solid var(--line);
}

.map-toolbar button {
  white-space: nowrap;
}

#perfBadge {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

#territoryMap {
  width: 100%;
  height: 100%;
  min-height: 500px;
  background: #e9edf2;
}

.map-footer {
  min-height: 34px;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.details-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.details {
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
}

.detail-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.detail-heading h2 {
  margin: 3px 0 0;
  color: var(--blue-dark);
  font-size: 20px;
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.status-pill {
  flex: 0 0 auto;
  padding: 5px 7px;
  border-left: 4px solid var(--status-color);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.parcel-facts {
  margin: 12px 0 0;
  display: grid;
  gap: 0;
}

.parcel-facts > div {
  padding: 9px 0;
  border-bottom: 1px solid #e8ecf1;
}

.parcel-facts dt {
  color: var(--muted);
  font-size: 11px;
}

.parcel-facts dd {
  margin: 3px 0 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.selection-basket {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #8ab0de;
  background: #f3f8ff;
}

.selection-basket-heading,
.relation-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.selection-basket h3,
.relation-heading h3 {
  margin: 0;
  font-size: 15px;
}

.selection-basket-heading strong {
  color: var(--blue-dark);
  font-size: 12px;
  text-align: right;
}

.field-help {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.selection-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.selection-actions button {
  min-width: 0;
  white-space: normal;
}

.group-metrics {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.maplibregl-popup-content {
  max-width: 260px;
  border-radius: 4px;
  border: 1px solid var(--line);
  box-shadow: 0 5px 16px rgba(24, 34, 51, 0.18);
  font: 12px/1.45 "Segoe UI", Arial, sans-serif;
}

.territory-shell.sidebar-collapsed {
  grid-template-columns: 0 minmax(520px, 1fr) minmax(280px, 330px);
}

.territory-shell.sidebar-collapsed .territory-sidebar {
  opacity: 0;
  overflow: hidden;
  border: 0;
}

@media (max-width: 1120px) {
  body > main {
    padding: 10px;
  }

  .territory-shell,
  .territory-shell.sidebar-collapsed {
    grid-template-columns: minmax(220px, 250px) minmax(0, 1fr);
    grid-template-rows: minmax(560px, 1fr) 300px;
    height: auto;
    min-height: calc(100vh - 120px);
    overflow: visible;
  }

  .territory-shell.sidebar-collapsed {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  .details-panel {
    grid-column: 1 / -1;
  }

  .details {
    overflow-y: auto;
  }
}

@media (max-width: 760px) {
  body > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .topbar,
  .topbar > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .territory-shell,
  .territory-shell.sidebar-collapsed {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 560px 320px;
  }

  .territory-shell.sidebar-collapsed .territory-sidebar {
    display: none;
  }

  .map-area,
  .details-panel {
    grid-column: 1;
  }

  #territoryMap {
    min-height: 470px;
  }

  .map-footer span:last-child,
  #perfBadge {
    display: none;
  }
}

/* Phase 2B - gestion foncière Web */
.land-main {
  max-width: 1920px;
  margin: 0 auto;
}

.land-nav {
  min-height: 46px;
  display: flex;
  align-items: stretch;
  gap: 2px;
  margin: 10px 0 0;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow-x: auto;
}

.land-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}

.land-nav a:hover,
.land-nav a.active {
  color: var(--blue-dark);
  background: #f4f7fb;
  border-bottom-color: var(--blue);
}

.territory-subnav {
  min-height: 36px;
  display: flex;
  align-items: stretch;
  gap: 2px;
  margin: 6px 0 10px;
  padding-left: 10px;
  border-bottom: 1px solid var(--line);
  background: #f7f9fc;
  overflow-x: auto;
}

.territory-subnav a {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  border-left: 3px solid transparent;
}

.territory-subnav a:hover,
.territory-subnav a.active {
  color: var(--blue-dark);
  background: #eaf2ff;
  border-left-color: var(--blue);
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 2px 14px;
}

.page-heading h1,
.dialog-heading h2,
.record-detail h2 {
  margin: 2px 0 0;
  font-size: 24px;
  letter-spacing: 0;
}

.page-heading p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.land-page {
  display: grid;
  gap: 12px;
}

.land-kpis {
  display: grid;
  grid-template-columns: repeat(8, minmax(125px, 1fr));
  border: 1px solid var(--line);
  background: var(--surface);
  overflow-x: auto;
}

.land-kpis > div {
  min-width: 125px;
  padding: 13px 14px;
  border-right: 1px solid var(--line);
  border-top: 3px solid var(--blue);
}

.land-kpis > div:nth-child(2),
.land-kpis > div:nth-child(5),
.land-kpis > div:nth-child(6) {
  border-top-color: var(--green);
}

.land-kpis > div:nth-child(3),
.land-kpis > div:nth-child(7) {
  border-top-color: var(--orange);
}

.land-kpis > div:nth-child(4),
.land-kpis > div:nth-child(8) {
  border-top-color: var(--red);
}

.land-kpis strong {
  display: block;
  color: var(--ink);
  font-size: 21px;
}

.land-kpis span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.land-toolbar {
  min-height: 58px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.batch-selection-summary {
  min-height: 44px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #8ab0de;
  background: #edf5ff;
}

.batch-selection-summary[hidden] {
  display: none;
}

.batch-selection-summary span {
  flex: 1;
  color: var(--muted);
}

.selection-column {
  width: 42px;
  text-align: center !important;
}

.selection-column input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.search-row,
.relation-search,
.detail-actions,
.dialog-actions,
.inline-upload {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-row input {
  width: min(420px, 45vw);
}

.search-row input,
.relation-search input,
.form-grid input,
.form-grid select,
.form-grid textarea,
.inline-upload input,
.inline-upload select {
  padding: 7px 9px;
}

textarea {
  border: 1px solid #aeb9c9;
  border-radius: 4px;
  resize: vertical;
  font: inherit;
}

.master-detail {
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(620px, 1.55fr) minmax(390px, 0.85fr);
  gap: 12px;
}

.list-panel,
.record-detail {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface);
}

.list-panel {
  display: flex;
  flex-direction: column;
}

.list-panel > h2 {
  margin: 0;
  padding: 15px 16px;
  font-size: 17px;
  border-bottom: 1px solid var(--line);
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

.list-panel > .table-wrap {
  flex: 1;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 10px;
  color: #334155;
  background: #edf2f8;
  border-bottom: 1px solid #aeb9c9;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #e5e9ef;
  vertical-align: top;
}

.data-table tbody tr {
  cursor: pointer;
}

.data-table tbody tr:hover,
.data-table tbody tr:focus {
  background: #eef6ff;
  outline: none;
}

.data-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.compact {
  max-height: 300px;
  border: 1px solid var(--line);
}

.loading-cell,
.empty-cell,
.empty-details {
  padding: 22px !important;
  color: var(--muted);
  text-align: center;
}

.pager {
  min-height: 48px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.record-detail {
  max-height: calc(100vh - 245px);
  padding: 17px;
  overflow: auto;
}

.detail-heading,
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  white-space: nowrap;
}

.status.success { border-color: #86c9a3; background: #e9f7ef; color: #17643b; }
.status.warning { border-color: #f4c775; background: #fff7e6; color: #8a4b00; }
.status.danger { border-color: #f1a1a1; background: #fff0f0; color: #a51d1d; }

.detail-actions {
  margin: 15px 0;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.danger-button {
  border-color: var(--red);
  color: var(--red);
}

.record-facts,
.parcel-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.record-facts > div,
.parcel-facts > div {
  min-width: 0;
  padding: 10px;
  background: var(--surface);
}

.record-facts .wide {
  grid-column: 1 / -1;
}

.record-facts dt {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.record-facts dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.record-facts pre {
  max-height: 220px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  font: 12px/1.45 Consolas, monospace;
}

.detail-section {
  margin-top: 18px;
}

.dispatch-summary {
  padding: 12px;
  border-left: 4px solid var(--blue);
  background: #f7faff;
}

.template-tokens {
  padding: 10px 12px;
  border-left: 4px solid var(--orange);
  background: #fff8e8;
  color: #65400a;
  font-size: 12px;
}

.editor-dialog hr {
  margin: 20px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.editor-dialog h3 {
  margin: 18px 0 8px;
}

.detail-section h3 {
  display: flex;
  justify-content: space-between;
  margin: 0 0 8px;
  font-size: 15px;
}

.detail-section h3 span {
  color: var(--muted);
  font-weight: 400;
}

.plain-list,
.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
}

.plain-list li,
.timeline li {
  padding: 9px 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e5e9ef;
}

.plain-list li:last-child,
.timeline li:last-child {
  border-bottom: 0;
}

.plain-list span,
.timeline span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.inline-upload {
  margin-bottom: 8px;
}

.editor-dialog {
  width: min(820px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 1px solid #7b8798;
  border-radius: 6px;
  box-shadow: 0 18px 52px rgba(15, 23, 42, 0.28);
}

.editor-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.editor-dialog form {
  max-height: calc(100vh - 30px);
  padding: 20px;
  overflow: auto;
}

.lease-editor {
  width: min(1120px, calc(100vw - 28px));
}

.icon-button {
  width: 36px;
  padding: 0;
  font-size: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-top: 18px;
}

.form-grid label {
  display: grid;
  gap: 5px;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.check-field {
  display: inline-flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 7px;
}

.check-field input {
  min-height: 0;
  width: auto;
  flex: 0 0 auto;
}

.dialog-actions {
  position: sticky;
  bottom: -20px;
  justify-content: flex-end;
  margin: 18px -20px -20px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.form-error,
.action-message.error {
  color: #b91c1c;
}

.form-error:not(:empty),
.action-message:not(:empty) {
  margin-top: 10px;
  padding: 10px;
  border-left: 4px solid currentColor;
  background: #fff5f5;
}

.relation-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.relation-editor section {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.relation-editor h3 {
  margin: 0 0 9px;
  font-size: 15px;
}

.relation-heading {
  margin-bottom: 9px;
}

.relation-heading h3 {
  margin: 0;
}

.relation-heading button {
  min-height: 32px;
  padding: 5px 9px;
}

.relation-search input {
  flex: 1;
  min-width: 150px;
}

.lookup-results {
  max-height: 190px;
  margin-top: 7px;
  overflow: auto;
  background: var(--surface);
}

.lookup-results button {
  width: 100%;
  height: auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border-radius: 0;
  border-width: 0 0 1px;
  text-align: left;
}

.lookup-results span {
  color: var(--muted);
  font-size: 11px;
}

.selection-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.selection-chips button {
  min-height: 30px;
  padding: 4px 8px;
  border-color: #8ab0de;
  background: #edf5ff;
  font-size: 12px;
}

.validation-panel:not(:empty) {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #e6b85f;
  background: #fff8e8;
  color: #754200;
}

.validation-panel p {
  margin: 4px 0;
}

.import-warning {
  padding: 13px 15px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  border-left: 4px solid var(--orange);
  background: #fff7e3;
}

.import-warning span {
  color: #71460b;
}

.import-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 10px;
}

.import-card {
  min-width: 0;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--blue);
  background: var(--surface);
}

.import-card:nth-child(2) { border-top-color: var(--green); }
.import-card:nth-child(3) { border-top-color: var(--purple); }
.import-card:nth-child(4) { border-top-color: var(--orange); }

.import-card h2 {
  margin: 0;
  font-size: 17px;
}

.import-card p {
  min-height: 48px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.import-card label {
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.import-card input,
.import-card select {
  width: 100%;
  padding: 6px;
}

.progress-panel {
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.progress-panel[hidden] {
  display: none;
}

.progress-panel progress {
  width: min(420px, 55vw);
}

.imports-history {
  grid-template-columns: minmax(650px, 1.15fr) minmax(440px, 0.85fr);
}

.import-rows {
  max-height: 420px;
}

.match-correction {
  margin-top: 6px;
  display: flex;
  gap: 4px;
}

.match-correction input {
  min-width: 170px;
  padding: 5px;
}

.match-correction button {
  min-height: 30px;
  padding: 4px 7px;
}

.hash-value {
  font: 11px Consolas, monospace;
  word-break: break-all;
}

.people-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
}

.people-summary > div {
  min-height: 68px;
  padding: 10px 12px;
  display: grid;
  align-content: center;
  gap: 3px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--blue);
  background: var(--surface);
}

.people-summary > div:nth-child(2) { border-top-color: var(--green); }
.people-summary > div:nth-child(3) { border-top-color: var(--orange); }
.people-summary > div:nth-child(4) { border-top-color: var(--purple); }
.people-summary span { color: var(--muted); font-size: 12px; }
.people-summary strong { color: var(--blue-dark); font-size: 22px; }

.card-summary {
  grid-template-columns: repeat(6, minmax(128px, 1fr));
}

.card-summary > div:nth-child(5) { border-top-color: var(--orange); }
.card-summary > div:nth-child(6) { border-top-color: var(--green); }
.card-summary > div.attention strong { color: #a65f00; }

.people-master-detail {
  grid-template-columns: minmax(760px, 1.35fr) minmax(390px, 0.65fr);
}

.person-record-detail {
  max-height: calc(100vh - 280px);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 16px;
  margin: 0;
}

.detail-grid > div {
  min-width: 0;
}

.detail-grid .wide {
  grid-column: 1 / -1;
}

.detail-grid dt {
  color: var(--muted);
  font-size: 11px;
}

.detail-grid dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-heading h3 {
  margin: 0;
}

.section-heading button {
  min-height: 30px;
  padding: 4px 8px;
}

.section-note,
.form-hint {
  color: var(--muted);
  font-size: 12px;
}

.history-list {
  display: grid;
  gap: 6px;
}

.history-row {
  min-width: 0;
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.history-row:last-child { border-bottom: 0; }
.history-row > div { min-width: 0; display: grid; gap: 2px; }
.history-row span { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.history-row button { min-height: 29px; padding: 4px 7px; }
.history-row.muted { opacity: 0.62; }

.document-row-actions {
  display: flex !important;
  grid-auto-flow: column;
  align-items: center;
  justify-content: end;
  gap: 5px !important;
  flex: 0 0 auto;
}

.document-row-actions .button {
  min-height: 29px;
  padding: 5px 8px;
  white-space: nowrap;
}

.linked-history-row {
  color: inherit;
  text-decoration: none;
}

.linked-history-row:hover { background: var(--surface-soft); }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.tag-list span {
  padding: 2px 5px;
  border: 1px solid #bdd0e7;
  background: #edf5ff;
  color: #17467f;
  font-size: 11px;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  width: fit-content;
  padding: 2px 7px;
  border: 1px solid #aeb9c9;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.status-pill.active { border-color: #75ad8d; background: #e8f5ed; color: #1e6d42; }
.status-pill.inactive { background: #eef1f4; color: #596779; }
.status-pill.warning { border-color: #e4b45e; background: #fff6df; color: #8a5608; }
.status-pill.danger { border-color: #e2a0a0; background: #fff0f0; color: #a51d1d; }

/* Chasse - bracelets */
.bracelets-page { display: grid; gap: 12px; }
.bracelet-toolbar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.bracelet-toolbar > label { display: grid; gap: 4px; min-width: 190px; font-size: 11px; font-weight: 700; }
.bracelet-toolbar > #refreshBraceletsButton { margin-left: auto; }
.section-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.section-tabs button { min-height: 34px; background: #fff; }
.section-tabs button.active { border-color: var(--blue); background: #eaf2ff; color: var(--blue-dark); font-weight: 700; }
.bracelet-summary { grid-template-columns: repeat(6, minmax(125px, 1fr)); }
.bracelet-summary > .summary-blue { border-top-color: var(--blue); }
.bracelet-summary > .summary-green { border-top-color: var(--green); }
.bracelet-summary > .summary-orange { border-top-color: var(--orange); }
.bracelet-summary > .summary-purple { border-top-color: var(--purple); }
.bracelet-summary > .summary-red { border-top-color: var(--red); }
.bracelet-summary > .summary-neutral { border-top-color: #64748b; }
.bracelet-summary > .summary-red strong { color: #a51d1d; }
.bracelet-summary > .summary-orange strong { color: #995b09; }
.bracelet-panel {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.bracelet-panel > .section-heading { margin-bottom: 12px; }
.bracelet-panel .section-heading h2 { margin: 0 0 3px; color: var(--blue-dark); font-size: 18px; }
.bracelet-panel .section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.bracelet-panel .filter-row { margin-bottom: 10px; }
.bracelet-panel .data-table td small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.bracelet-panel .data-table tbody tr[data-item-id] { cursor: pointer; }
.bracelet-panel .data-table tbody tr[data-item-id].selected { background: #fff8d6; box-shadow: inset 4px 0 #d7a900; }
.bracelet-panel .data-table tbody tr[data-item-id]:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.positive-value { color: #176a3d; font-weight: 700; }
.negative-value { color: #aa2424; font-weight: 700; }

@media (max-width: 1280px) {
  .bracelet-summary { grid-template-columns: repeat(3, minmax(135px, 1fr)); }
}

@media (max-width: 760px) {
  .bracelet-toolbar { align-items: stretch; }
  .bracelet-toolbar > label { width: 100%; }
  .bracelet-toolbar > #refreshBraceletsButton { margin-left: 0; }
  .section-tabs { width: 100%; }
  .section-tabs button { flex: 1; }
  .bracelet-summary { grid-template-columns: repeat(2, minmax(125px, 1fr)); }
  .bracelet-panel .section-heading { align-items: stretch; flex-direction: column; }
}

.cell-subtitle {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.choice-field {
  margin: 2px 0 0;
  padding: 10px;
  border: 1px solid var(--line);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.choice-grid label {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}

.choice-grid input { min-height: 16px; width: 16px; }

.compact-dialog {
  width: min(620px, calc(100vw - 28px));
}

.candidate-list {
  display: grid;
  gap: 6px;
  margin: 12px 0;
}

.candidate-list button {
  height: auto;
  display: grid;
  gap: 2px;
  padding: 10px;
  text-align: left;
}

.candidate-list span,
.candidate-list em {
  color: var(--muted);
  font-size: 11px;
}

.candidate-list em { color: var(--blue); }

.users-master-detail {
  grid-template-columns: minmax(720px, 1.25fr) minmax(390px, 0.75fr);
}

.person-picker {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.selected-reference {
  min-height: 38px;
  margin-top: 6px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
}

.selected-reference button {
  min-height: 24px;
  padding: 1px 6px;
}

.temporary-password-value {
  margin: 14px 0;
  padding: 16px;
  display: block;
  border: 1px solid #8ab0de;
  background: #edf5ff;
  color: #173f75;
  font: 700 18px Consolas, monospace;
  overflow-wrap: anywhere;
  user-select: all;
}

.success-message {
  padding: 10px;
  border-left: 4px solid var(--green);
  background: #e8f5ed;
  color: #1e6d42;
}

.reference-layout {
  display: grid;
  grid-template-columns: minmax(650px, 1.45fr) minmax(330px, 0.75fr);
  gap: 12px;
  align-items: start;
}

.reference-main,
.reference-side {
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
}

.reference-main > .section-heading,
.reference-side > .section-heading { padding: 12px; border-bottom: 1px solid var(--line); }
.reference-main .table-wrap { border: 0; }
.reference-list { display: grid; padding: 0 12px; }

.reference-row {
  min-width: 0;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.reference-row:last-child { border-bottom: 0; }
.reference-row > div:first-child { min-width: 0; display: grid; gap: 2px; }
.reference-row span { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.reference-row > div:last-child { display: flex; gap: 5px; flex-shrink: 0; }
.reference-row button { min-height: 28px; padding: 3px 7px; }
.reference-row.muted { opacity: 0.62; }

.color-swatch {
  --swatch: #2f855a;
  width: 13px;
  height: 13px;
  margin-right: 7px;
  display: inline-block;
  vertical-align: -2px;
  border: 1px solid #6d7888;
  background: var(--swatch);
}

.row-actions { white-space: nowrap; }
.row-actions button { min-height: 28px; margin-left: 4px; padding: 3px 7px; }
.checkbox-label { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 6px; }
.checkbox-label input { width: 16px; min-height: 16px; }
.filter-row { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; }
.filter-row label { display: grid; gap: 4px; font-size: 11px; font-weight: 600; }
.filter-row select { min-width: 190px; }

.issued-card-master-detail {
  grid-template-columns: minmax(720px, 1.45fr) minmax(360px, 0.65fr);
}

.issued-card-detail {
  max-height: calc(100vh - 300px);
}

.issued-card-table {
  min-width: 1050px;
}

.issued-card-table td:nth-child(1),
.issued-card-table td:nth-child(2),
.issued-card-table td:nth-child(5),
.issued-card-table td:nth-child(8),
.issued-card-table td:nth-child(9) {
  white-space: nowrap;
}

.card-filter-toolbar .search-field input { min-width: 230px; }

.issued-card-dialog {
  width: min(920px, calc(100vw - 28px));
}

.person-picker-field select {
  min-height: 138px;
  padding: 3px;
}

.person-picker-field option { padding: 5px 7px; }

.snapshot-preview {
  min-height: 46px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.snapshot-preview strong { display: block; margin-bottom: 6px; }
.prominent-tags span { padding: 4px 7px; font-size: 12px; }

.card-print-selection {
  padding: 9px 11px;
  border: 1px solid #a9c1df;
  border-left: 4px solid var(--blue);
  background: #f2f7fd;
}

.card-print-selection > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.selection-column {
  width: 38px;
  min-width: 38px;
  text-align: center;
}

.selection-column input {
  width: 16px;
  min-height: 16px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.card-print-body {
  min-width: 0;
  margin: 0;
  background: #e8edf3;
  color: #172235;
}

.print-toolbar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 64px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #b7c2d0;
  background: #fff;
  box-shadow: 0 2px 8px rgb(31 49 73 / 12%);
}

.print-toolbar > div { display: grid; gap: 3px; }
.print-toolbar strong { font-size: 18px; }
.print-toolbar span { color: var(--muted); font-size: 12px; }
.print-toolbar nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }

.print-exclusions {
  width: min(920px, calc(100vw - 30px));
  margin: 16px auto 0;
  padding: 12px 15px;
  border: 1px solid #e4b45e;
  border-left: 4px solid var(--orange);
  background: #fff8e7;
}

.print-exclusions h2 { margin: 0 0 4px; font-size: 15px; }
.print-exclusions p { margin: 0; color: #735013; font-size: 12px; }
.print-exclusions ul { margin: 8px 0 0; padding-left: 20px; font-size: 12px; }

.print-card-document {
  width: fit-content;
  margin: 18px auto;
}

.print-card-sheet {
  box-sizing: border-box;
  width: 210mm;
  height: 297mm;
  display: grid;
  grid-template-columns: repeat(2, 85.6mm);
  grid-template-rows: repeat(5, 53.98mm);
  column-gap: 2.822mm;
  row-gap: 1.411mm;
  align-content: center;
  justify-content: center;
  page-break-after: always;
  break-after: page;
  background: #fff;
  box-shadow: 0 4px 20px rgb(31 49 73 / 18%);
}

.print-card-sheet:last-child { page-break-after: auto; break-after: auto; }

.print-member-card {
  --card-accent: #2f66b0;
  position: relative;
  box-sizing: border-box;
  width: 85.6mm;
  height: 53.98mm;
  border: 0.22mm solid #56606e;
  background: #fff;
  color: #192331;
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

.member-card-header {
  box-sizing: border-box;
  height: 10.8mm;
  padding: 1.4mm 2.2mm;
  display: grid;
  grid-template-columns: 8mm minmax(0, 1fr);
  align-items: center;
  gap: 2mm;
  background: var(--card-accent);
  color: #fff;
}

.member-card-logo {
  width: 7.2mm;
  height: 7.2mm;
  display: grid;
  place-items: center;
  border: 0.3mm solid rgb(255 255 255 / 76%);
  border-radius: 50%;
  background: rgb(255 255 255 / 92%);
  color: var(--card-accent);
  font-size: 2.2mm;
  font-weight: 800;
}

.member-card-header div { min-width: 0; display: grid; line-height: 1.04; }
.member-card-header b,
.member-card-header strong,
.member-card-header span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-card-header b { font-size: 2.45mm; }
.member-card-header strong { font-size: 2.15mm; }
.member-card-header span { margin-top: 0.45mm; font-size: 1.8mm; }

.member-card-content {
  position: relative;
  box-sizing: border-box;
  height: 39.3mm;
  overflow: hidden;
}

.member-card-photo {
  position: absolute;
  top: 2mm;
  left: 2.2mm;
  box-sizing: border-box;
  width: 15mm;
  height: 18mm;
  display: grid;
  align-content: center;
  justify-items: center;
  border: 0.2mm solid #b9c4d1;
  background: color-mix(in srgb, var(--card-accent) 9%, white);
  color: color-mix(in srgb, var(--card-accent) 74%, #334155);
}

.member-card-photo > span { font-size: 6mm; line-height: 0.8; opacity: 0.34; }
.member-card-photo small { margin-top: 1mm; font-size: 1.55mm; }

.member-card-holder {
  position: absolute;
  top: 1.8mm;
  left: 19.3mm;
  right: 2mm;
  height: 18.3mm;
  display: grid;
  align-content: start;
  gap: 0.35mm;
  overflow: hidden;
}

.member-card-holder strong,
.member-card-holder span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-card-holder strong { font-size: 2.65mm; }
.member-card-holder span { color: #405069; font-size: 1.75mm; }

.member-card-checks {
  position: absolute;
  top: 21.2mm;
  left: 2.2mm;
  width: 39mm;
  display: grid;
  gap: 0.45mm;
  font-size: 1.55mm;
  line-height: 1.1;
}

.member-card-checks span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.member-card-rights {
  position: absolute;
  top: 21.2mm;
  left: 43mm;
  width: 28mm;
  max-height: 9.5mm;
  display: grid;
  gap: 0.5mm;
  overflow: hidden;
  font-size: 1.5mm;
  line-height: 1.2;
}

.member-card-rights > strong { color: var(--card-accent); font-size: 1.65mm; text-transform: uppercase; }

.member-card-signature {
  position: absolute;
  right: 11.8mm;
  bottom: 1.7mm;
  width: 28mm;
  padding-top: 0.5mm;
  border-top: 0.2mm solid #8c98a8;
  color: #69768a;
  font-size: 1.3mm;
}

.member-card-qr {
  position: absolute;
  right: 2.2mm;
  bottom: 1.7mm;
  box-sizing: border-box;
  width: 8mm;
  height: 8mm;
  padding: 0.8mm;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35mm;
  border: 0.2mm solid #687587;
}

.member-card-qr i { background: var(--card-accent); }
.member-card-qr i:nth-child(2),
.member-card-qr i:nth-child(4),
.member-card-qr i:nth-child(8) { background: transparent; }

.print-member-card footer {
  position: absolute;
  left: 2.2mm;
  right: 42mm;
  bottom: 1mm;
  overflow: hidden;
  color: #69768a;
  font-size: 1.25mm;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crop-mark { position: absolute; z-index: 2; display: block; background: #777; }
.crop-top-left-h { top: -0.2mm; left: -1mm; width: 1mm; height: 0.12mm; }
.crop-top-left-v { top: -1mm; left: -0.2mm; width: 0.12mm; height: 1mm; }
.crop-top-right-h { top: -0.2mm; right: -1mm; width: 1mm; height: 0.12mm; }
.crop-top-right-v { top: -1mm; right: -0.2mm; width: 0.12mm; height: 1mm; }
.crop-bottom-left-h { bottom: -0.2mm; left: -1mm; width: 1mm; height: 0.12mm; }
.crop-bottom-left-v { bottom: -1mm; left: -0.2mm; width: 0.12mm; height: 1mm; }
.crop-bottom-right-h { bottom: -0.2mm; right: -1mm; width: 1mm; height: 0.12mm; }
.crop-bottom-right-v { bottom: -1mm; right: -0.2mm; width: 0.12mm; height: 1mm; }

@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  html,
  .card-print-body { width: 210mm; margin: 0; background: #fff; }
  .screen-only { display: none !important; }
  .print-card-document { margin: 0; }
  .print-card-sheet { box-shadow: none; }
  .print-member-card { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

button.danger,
.button.danger {
  border-color: var(--red);
  color: #a51d1d;
  background: #fff;
}

button.danger:hover,
.button.danger:hover { background: #fff0f0; }

fieldset { margin: 12px 0; padding: 10px; border: 1px solid var(--line); }
legend { padding: 0 5px; font-size: 12px; font-weight: 700; }

.finance-page { min-width: 0; }
.finance-toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.finance-toolbar > label { min-width: 190px; }
.finance-toolbar .section-tabs { flex: 1 1 520px; }
.finance-summary { grid-template-columns: repeat(8, minmax(112px, 1fr)); }
.finance-panel { min-width: 0; }
.finance-panel .data-table { min-width: 960px; }
.finance-panel .data-table td small,
.finance-panel .data-table td strong + small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.subsection-heading { margin-top: 22px; }
.positive-value { color: #087443; font-weight: 700; }
.negative-value { color: #b42318; font-weight: 700; }
.danger-link { color: #a51d1d; }

@media (max-width: 1280px) {
  .land-kpis { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
  .master-detail,
  .imports-history { grid-template-columns: minmax(520px, 1.35fr) minmax(330px, 0.8fr); }
  .import-cards { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
  .people-master-detail { grid-template-columns: minmax(620px, 1.2fr) minmax(350px, 0.8fr); }
  .issued-card-master-detail { grid-template-columns: minmax(600px, 1.2fr) minmax(340px, 0.8fr); }
  .users-master-detail { grid-template-columns: minmax(600px, 1.15fr) minmax(350px, 0.85fr); }
  .reference-layout { grid-template-columns: minmax(560px, 1.2fr) minmax(300px, 0.8fr); }
  .finance-summary { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
}

@media (max-width: 920px) {
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading p { text-align: left; }
  .master-detail,
  .imports-history { grid-template-columns: 1fr; }
  .record-detail { max-height: none; }
  .people-summary { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .issued-card-master-detail { grid-template-columns: 1fr; }
  .issued-card-detail { max-height: none; }
  .relation-editor { grid-template-columns: 1fr; }
  .reference-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .land-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions { justify-content: stretch; }
  .toolbar-actions > * { flex: 1; }
  .batch-selection-summary { align-items: stretch; flex-direction: column; }
  .search-row { align-items: stretch; flex-direction: column; }
  .search-row input { width: 100%; }
  .land-kpis { grid-template-columns: repeat(2, minmax(125px, 1fr)); }
  .import-cards { grid-template-columns: 1fr; }
  .form-grid,
  .record-facts { grid-template-columns: 1fr; }
  .choice-grid,
  .detail-grid { grid-template-columns: 1fr; }
  .record-facts .wide,
  .form-grid .wide { grid-column: 1; }
  .finance-toolbar { align-items: stretch; flex-direction: column; }
  .finance-toolbar > label,
  .finance-toolbar .section-tabs { width: 100%; min-width: 0; flex-basis: auto; }
  .finance-summary { grid-template-columns: repeat(2, minmax(125px, 1fr)); }
}
