/* ANAIM Operations: shared visual language for the workspace and map controls. */
:root {
  --v3-font-body: 'Inter', sans-serif;
  --v3-font-head: 'Poppins', sans-serif;
  --v3-radius-xs: 8px;
  --v3-radius-sm: 10px;
  --v3-radius-md: 14px;
  --v3-radius-lg: 18px;
  --v3-shadow-sm: none;
  --v3-shadow-md: 0 8px 28px #102f2412;
  --v3-shadow-lg: 0 14px 40px #102f2420;
}

[data-bs-theme='light'],
:root {
  --app-bg: linear-gradient(145deg, #eaf0ed 0, #f4f6f5 420px);
  --app-primary: #176b50;
  --app-primary-strong: #10543e;
  --app-primary-soft: #e7f2ec;
  --app-brand-yellow: #b78016;
  --app-brand-red: #bb403b;
  --app-text: #253a33;
  --app-text-strong: #132b22;
  --app-muted: #63746c;
  --app-border: #dce4df;
  --app-border-strong: #b8c8bf;
  --app-surface: #fff;
  --app-surface-soft: #f3f6f4;
  --app-surface-strong: #fff;
  --app-input: #fff;
  --app-input-focus: #fff;
  --app-focus-ring: 0 0 0 3px #176b5025;
}

[data-bs-theme='dark'] {
  --app-bg: linear-gradient(145deg, #182921 0, #101b17 420px);
  --app-primary: #76c9a6;
  --app-primary-strong: #9adbbf;
  --app-primary-soft: #243d31;
  --app-brand-yellow: #e3ba63;
  --app-brand-red: #ef9990;
  --app-text: #dfe9e3;
  --app-text-strong: #f2f7f4;
  --app-muted: #a7b8ae;
  --app-border: #31443a;
  --app-border-strong: #536e5e;
  --app-surface: #1a2922;
  --app-surface-soft: #21332a;
  --app-surface-strong: #18271f;
  --app-input: #17251e;
  --app-input-focus: #21332a;
  --app-focus-ring: 0 0 0 3px #76c9a640;
}

body {
  font-family: var(--v3-font-body);
  font-size: .9rem;
  line-height: 1.6;
  background: var(--app-bg) !important;
}

body::before {
  display: none;
}

h1,
h2,
h3,
h4,
h5,
h6,
.page-title,
.brand-name {
  font-family: var(--v3-font-head);
  color: var(--app-text-strong);
}

.page-title {
  font-size: clamp(1.4rem, 2vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -.035em;
}

.page-subtitle {
  max-width: 72ch;
  font-size: .875rem;
  line-height: 1.6;
}

.hero-kicker {
  color: var(--app-primary);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.page-shell {
  padding-bottom: 36px !important;
}

.surface-card,
.kpi-card,
.module-subcard,
.hero-strip {
  background: var(--app-surface) !important;
  border: 1px solid var(--app-border) !important;
  border-radius: var(--v3-radius-md) !important;
  box-shadow: none !important;
  backdrop-filter: none;
}

.surface-card::before,
.kpi-card::before,
.module-subcard::after {
  display: none !important;
}

.surface-card:hover,
.kpi-card:hover,
.module-subcard:hover,
.login-card:hover {
  transform: none !important;
  box-shadow: none !important;
}

.hero-strip {
  padding: 24px;
}

.dashboard-intro {
  padding: 8px 0 0;
}

.dashboard-toolbar {
  align-items: flex-start !important;
}

.dashboard-toolbar-actions {
  flex-shrink: 0;
}

.dashboard-intro .hero-stats {
  margin-top: 16px;
}

.hero-stat {
  min-height: 28px;
  border: 0 !important;
  border-radius: 6px !important;
  padding: 4px 8px;
  background: var(--app-surface-soft) !important;
  color: var(--app-muted) !important;
  font-size: .75rem;
  font-weight: 500;
}

.hero-stat i {
  color: var(--app-primary);
  background: none;
  width: auto;
  height: auto;
}

.hero-stat strong {
  color: var(--app-text);
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 14px;
  margin: 0 0 24px !important;
}

.dashboard-kpi-grid>[class*='col-'] {
  width: auto;
  padding: 0;
  margin: 0;
}

.kpi-card {
  position: relative;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 164px;
}

.kpi-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px !important;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-size: .85rem;
  box-shadow: none;
}

.kpi-label {
  color: var(--app-muted);
  font-weight: 500;
  font-size: .78rem;
  line-height: 1.45;
  margin: 0;
}

.kpi-value {
  font-family: var(--v3-font-head);
  font-size: clamp(1.75rem, 2.5vw, 2.15rem);
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  margin-top: auto;
}

.dashboard-analytics-card {
  padding: 22px;
}

.dashboard-card-title {
  font-size: .95rem;
  font-weight: 600;
}

.dashboard-card-title i {
  color: var(--app-muted);
}

.dashboard-pie-wrap {
  min-height: 280px;
}

.operations-tabs {
  display: flex;
  gap: 24px;
  align-items: center;
  overflow-x: auto;
  margin: -8px 0 24px;
  border-bottom: 1px solid var(--app-border);
  scrollbar-width: thin;
}

.operations-tabs a {
  padding: 12px 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  color: var(--app-muted);
  font-size: .8rem;
  font-weight: 500;
}

.operations-tabs a[aria-current='page'] {
  color: var(--app-primary);
  border-color: var(--app-primary);
  font-weight: 650;
}

.operations-tabs a:hover {
  color: var(--app-primary);
}

.operations-tabs a > i {
  margin-right: 7px;
}

.btn {
  border-radius: 9px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: 0;
  min-height: 40px;
  box-shadow: none !important;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.btn:hover {
  transform: none !important;
}

.btn-primary {
  background: var(--app-primary);
  border-color: var(--app-primary);
  color: var(--app-surface);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--app-primary-strong);
  border-color: var(--app-primary-strong);
  color: var(--app-surface);
}

.btn-outline-secondary {
  background: var(--app-surface);
  border-color: var(--app-border-strong);
  color: var(--app-text);
}

.btn-outline-secondary:hover {
  background: var(--app-surface-soft);
  color: var(--app-text-strong);
  border-color: var(--app-muted);
}

.action-btn {
  padding: 9px 14px;
}

.form-control,
.form-select {
  border-radius: 9px;
  min-height: 42px;
  padding: 9px 12px;
  border-color: var(--app-border-strong);
  background-color: var(--app-input);
  color: var(--app-text);
  font-size: .875rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--app-primary);
  background-color: var(--app-input-focus);
  box-shadow: var(--app-focus-ring);
}

.form-label {
  font-size: .8rem;
  color: var(--app-text);
  font-weight: 600;
}

.form-text {
  font-size: .75rem;
  color: var(--app-muted);
}

.form-check-input:checked {
  background-color: var(--app-primary);
  border-color: var(--app-primary);
}

.data-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.search-box {
  max-width: 440px;
}

.search-box .input-group-text {
  background: var(--app-surface-soft);
  color: var(--app-muted);
  border-color: var(--app-border-strong);
}

.data-table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--app-text);
  font-size: .82rem;
}

.data-table thead th {
  padding: 12px 14px;
  font-size: .7rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--app-muted);
  background: var(--app-surface-soft);
  border-bottom: 1px solid var(--app-border);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 14px;
  font-weight: 400;
  border-color: var(--app-border);
  font-variant-numeric: tabular-nums;
}

.data-table tbody tr:hover td {
  background: var(--app-surface-soft);
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.table-actions .btn {
  min-width: 34px;
  min-height: 34px;
  padding: 5px 8px;
}

.ui-badge,
.geometry-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  font-size: .7rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid transparent;
  line-height: 1.3;
  white-space: nowrap;
}

.ui-badge--primary,
.ui-badge--active,
.ui-badge--success,
.geometry-badge--point {
  background: var(--app-primary-soft);
  color: var(--app-primary-strong);
}

.ui-badge--secondary {
  background: var(--app-surface-soft);
  color: var(--app-muted);
  border-color: var(--app-border);
}

.ui-badge--warning,
.ui-badge--draft,
.ui-badge--inactive,
.geometry-badge--polygon {
  background: color-mix(in srgb, var(--app-brand-yellow) 14%, var(--app-surface));
  color: var(--app-brand-yellow);
}

.ui-badge--danger,
.ui-badge--video,
.geometry-badge--polyline {
  background: color-mix(in srgb, var(--app-brand-red) 12%, var(--app-surface));
  color: var(--app-brand-red);
}

.ui-badge--image {
  background: var(--app-surface-soft);
  color: var(--app-text);
}

.geometry-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--app-border-strong);
  border-radius: 12px;
  background: var(--app-surface-soft);
  max-width: 42rem;
  margin-inline: auto;
}

.empty-state p {
  max-width: 48ch;
  margin-inline: auto;
}

.empty-icon {
  background: var(--app-primary-soft);
  color: var(--app-primary);
  box-shadow: none;
  border-radius: 12px;
}

.login-card {
  border: 1px solid var(--app-border) !important;
  background: var(--app-surface);
  border-radius: 18px;
  box-shadow: none !important;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--app-primary);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: no-preference) {
  .dashboard-kpi-grid {
    animation: operations-enter 240ms ease-out both;
  }

  @keyframes operations-enter {
    from {
      opacity: 0;
      transform: translateY(5px);
    }

    to {
      opacity: 1;
      transform: none;
    }
  }
}

@media (max-width: 767.98px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .kpi-card {
    padding: 16px;
    min-height: 150px;
  }

  .hero-strip,
  .dashboard-analytics-card {
    padding: 18px;
  }

  .dashboard-toolbar-actions {
    width: 100%;
  }

  .dashboard-toolbar-actions>.btn {
    flex: 1;
  }

  .operations-tabs {
    gap: 20px;
    margin-bottom: 20px;
  }
}

.map-page-ui .map-ui-panel,
.map-detail-card {
  border-radius: var(--v3-radius-md);
  border: 1px solid var(--app-border-strong);
  background: color-mix(in srgb, var(--app-surface-strong) 92%, transparent);
  box-shadow: var(--v3-shadow-md);
  backdrop-filter: blur(14px);
}

.map-overlay-panel {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.map-overlay-panel>.map-ui-head,
.map-overlay-panel>.map-filter-panel-body {
  padding-left: 1rem;
  padding-right: 1rem;
}

.map-overlay-panel>.map-ui-head {
  position: sticky;
  top: 0;
  z-index: 4;
  padding-top: 0.9rem;
  padding-bottom: 0.7rem;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--app-surface-strong) 98%, transparent) 0%,
      color-mix(in srgb, var(--app-surface-strong) 92%, transparent) 100%);
  border-bottom: 1px solid var(--app-border);
}

.map-overlay-panel>.map-filter-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  padding-top: 0.8rem;
  padding-bottom: 1rem;
  overflow-y: auto;
  max-height: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.map-overlay-panel>.map-filter-panel-body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.map-page-ui .map-ui-head h1 {
  font-weight: 800;
  letter-spacing: 0.01em;
}

.map-page-ui .map-ui-stats .hero-stat {
  border-radius: 12px !important;
  border-color: var(--app-border-strong) !important;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--app-surface-soft) 82%, transparent),
      color-mix(in srgb, var(--app-surface-soft) 92%, transparent)) !important;
  min-height: 46px;
  justify-content: flex-start;
}

.map-page-ui .map-ui-stats .hero-stat i {
  width: 1.42rem;
  height: 1.42rem;
}

.map-page-ui .map-ui-stats .hero-stat span {
  font-weight: 800;
}

.map-page-ui .map-ui-section {
  border: 1px solid var(--app-border);
  border-radius: 12px;
  padding: 0.75rem;
  background: color-mix(in srgb, var(--app-surface-soft) 88%, transparent);
}

.map-page-ui .map-ui-section+.map-ui-section {
  margin-top: 0.8rem;
}

.map-control-group {
  border-radius: 12px;
  background: color-mix(in srgb, var(--app-surface-soft) 92%, transparent);
}

.map-control-group .form-check {
  padding: 0.3rem 0 0.2rem 2.2rem;
  border-bottom: 1px dashed color-mix(in srgb, var(--app-border) 72%, transparent);
}

.map-control-group .form-check:last-child {
  border-bottom: 0;
}

.map-control-group .form-check-input {
  margin-left: -2.2rem;
}

.map-control-group .form-check-input:checked {
  background-color: var(--app-primary);
  border-color: var(--app-primary);
}

#mapApplyFilters {
  box-shadow: 0 6px 14px color-mix(in srgb, var(--app-primary) 26%, transparent);
}

#mapResetFilters {
  border-color: color-mix(in srgb, var(--app-border-strong) 90%, transparent);
}

.map-right-panel,
.map-polygon-panel {
  border-radius: var(--v3-radius-md) !important;
  box-shadow: var(--v3-shadow-md) !important;
}

.map-right-panel-head,
.map-polygon-panel-head {
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--app-border);
}

.map-detail-card {
  box-shadow: var(--v3-shadow-md);
}

.map-detail-main h2 {
  font-weight: 800;
  letter-spacing: 0.01em;
}

.map-detail-main .btn {
  min-height: 36px;
}

.map-detail-meta div {
  padding: 0.46rem 0.58rem;
}

.map-photo-card,
.map-polygon-card {
  border-radius: 14px;
  border-color: var(--app-border-strong);
  transition: box-shadow 0.16s ease, border-color 0.16s ease;
}

.map-photo-card:hover,
.map-polygon-card:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--app-primary) 40%, var(--app-border));
  box-shadow: 0 6px 14px color-mix(in srgb, var(--app-primary) 16%, transparent);
}

.map-photo-card-body strong,
.map-polygon-card-body strong {
  letter-spacing: 0.02em;
}

.map-detail-card {
  border-bottom: 0;
}

.map-photo-card-play i {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.24);
}

.login-page::before {
  background:
    linear-gradient(140deg, rgba(4, 11, 18, 0.82), rgba(9, 24, 42, 0.72)),
    url('/images/mining-infrastructure.svg');
  background-size: cover;
  background-position: center;
}

[data-bs-theme='light'] .login-page::before {
  background:
    linear-gradient(140deg, rgba(236, 244, 252, 0.74), rgba(215, 229, 244, 0.75)),
    url('/images/mining-infrastructure.svg');
  background-size: cover;
  background-position: center;
}

.login-card {
  border-radius: var(--v3-radius-lg);
  border: 1px solid var(--app-border-strong);
  background: color-mix(in srgb, var(--app-surface-strong) 94%, transparent);
  box-shadow: var(--v3-shadow-md);
  backdrop-filter: blur(10px);
}

.login-card:hover {
  box-shadow: var(--v3-shadow-md);
  transform: none;
}

@media (max-width: 1199.98px) {
  .app-header {
    margin: 0.55rem 0.6rem 0;
    border-radius: 12px;
  }
}

@media (max-width: 991.98px) {
  .data-card-head {
    align-items: stretch;
  }

  .search-box {
    max-width: none;
  }

  .hero-strip {
    border-radius: var(--v3-radius-md) !important;
  }

  .map-page {
    --map-filter-sidebar-width: clamp(214px, 40vw, 290px);
  }

  .map-page-ui .map-ui-panel,
  .map-detail-card {
    border-radius: 12px;
  }

  .map-overlay-panel>.map-ui-head,
  .map-overlay-panel>.map-filter-panel-body {
    padding-left: 0.72rem;
    padding-right: 0.72rem;
  }

  .map-page-ui .map-ui-section {
    padding: 0.62rem;
  }

  .map-detail-meta div {
    padding: 0.42rem 0.52rem;
  }
}

@media (max-width: 767.98px) {

  .surface-card,
  .kpi-card,
  .module-subcard {
    border-radius: 14px !important;
  }

  .table-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .btn {
    min-height: 38px;
  }
}

/* Operational labels use sentence case, not the legacy all-caps card treatment. */
.kpi-label {
  text-transform: none;
  letter-spacing: 0;
}

.dashboard-kpi-grid:has(> :nth-child(6):last-child) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-toolbar:has(form) {
  flex-direction: column !important;
  align-items: stretch !important;
}

.dashboard-toolbar>div:has(> form) {
  flex-wrap: wrap;
  align-items: center;
}

.dashboard-toolbar form {
  flex: 1;
  flex-wrap: wrap;
}

.dashboard-toolbar form .form-select {
  flex: 1;
  min-width: 175px;
}

.chart-empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 240px;
  padding: 24px;
  color: var(--app-muted);
  background: var(--app-surface-soft);
  border-radius: 10px;
  font-size: .85rem;
}

@media (max-width: 767.98px) {
  .dashboard-kpi-grid:has(> :nth-child(6):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-toolbar form {
    width: 100%;
  }
}

/* An empty register must fit the viewport instead of inheriting wide data columns. */
.table-responsive:has(tbody > tr:only-child td[colspan] .empty-state) table {
  min-width: 0 !important;
  width: 100%;
  table-layout: fixed;
}

.table-responsive:has(tbody > tr:only-child td[colspan] .empty-state) thead {
  display: none;
}

.table-responsive:has(tbody > tr:only-child td[colspan] .empty-state) td {
  white-space: normal;
}

/* Structured data entry: preserve one form and its native validation. */
.operations-form-page .module-form-card {
  padding: 24px;
}

.operations-form-page .module-form-grid {
  margin: 0;
}

.operations-form-page .form-label {
  text-transform: none;
  letter-spacing: 0;
}

.operations-form-heading {
  padding-top: 4px;
}

.operations-required-hint {
  margin: 12px 0 0;
  color: var(--app-muted);
  font-size: .75rem;
}

.operations-form-section {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 8px 0 24px;
}

.operations-form-section+.operations-form-section {
  border-top: 1px solid var(--app-border);
  padding-top: 24px;
}

.operations-form-section legend {
  display: flex;
  align-items: center;
  gap: 10px;
  float: none;
  width: auto;
  font-family: var(--v3-font-head);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.operations-form-section legend span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  border-radius: 7px;
  font-size: .7rem;
}

.operations-form-hint {
  color: var(--app-muted);
  font-size: .8rem;
  margin: 0 0 18px 38px;
}

.operations-form-section .form-label:has(+ :required)::after {
  content: ' *';
  color: var(--app-brand-red);
}

.operations-form-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid var(--app-border);
  padding-top: 20px;
}

.operations-form-actions .btn {
  min-width: 125px;
}

.operations-incident-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.operations-incident-detail dl {
  font-size: .85rem;
}

.operations-incident-detail dt {
  font-weight: 500;
  color: var(--app-muted);
  padding-block: 8px;
}

.operations-incident-detail dd {
  margin: 0;
  padding-block: 8px;
  overflow-wrap: anywhere;
}

.operations-detail-section {
  border-top: 1px solid var(--app-border);
  padding-top: 20px;
  margin-top: 20px;
}

.operations-long-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
  font-size: .875rem;
}

.operations-workflow-actions form+form {
  border-top: 1px solid var(--app-border);
  padding-top: 16px;
}

.register-toolbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.register-search {
  flex: 1 1 280px;
  min-width: 0;
}

.register-status {
  flex: 0 1 220px;
}

.register-toolbar .form-label {
  text-transform: none;
  letter-spacing: 0;
}

.register-toolbar>.btn {
  min-height: 42px;
}

.register-result-count {
  color: var(--app-muted);
  font-size: .75rem;
  margin: 14px 0;
  font-variant-numeric: tabular-nums;
}

.register-no-results {
  padding: 28px 16px;
  background: var(--app-surface-soft);
  border-radius: 10px;
  text-align: center;
  margin-bottom: 16px;
}

[data-register] [hidden] {
  display: none !important;
}

.register-record-link {
  color: var(--app-primary-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.register-record-title {
  white-space: normal;
  overflow-wrap: anywhere;
  min-width: 160px;
  max-width: 260px;
  line-height: 1.5;
  margin-top: 4px;
}

.operations-register-page .data-table th {
  white-space: nowrap;
}

.operations-register-page .data-table td.text-end {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.infrastructure-register-intro .hero-stats {
  padding-top: 16px;
  border-top: 1px solid var(--app-border);
}

.infrastructure-register-table>table {
  min-width: 960px;
}

.infrastructure-register-table:focus-visible {
  outline: 2px solid var(--app-primary);
  outline-offset: 4px;
}

.infrastructure-register-table td {
  vertical-align: middle;
  min-width: 100px;
}

.infrastructure-register-table td:first-child {
  min-width: 190px;
  max-width: 280px;
}

.infrastructure-register-table td:not(:last-child) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.infrastructure-register-table .geometry-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.infrastructure-register-table .infrastructure-register-actions {
  flex-wrap: nowrap;
}

.infrastructure-register-actions .btn {
  min-width: 40px;
  min-height: 40px;
}

.infrastructure-register-notes {
  min-width: 170px;
  max-width: 280px;
}

.infrastructure-register-notes summary {
  cursor: pointer;
  color: var(--app-primary-strong);
  font-size: .8rem;
}

.infrastructure-register-notes summary:focus-visible {
  outline: 2px solid var(--app-primary);
  outline-offset: 3px;
}

.infrastructure-register-notes p {
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
  margin: 12px 0 0;
}

.infrastructure-register-scroll-hint {
  font-size: .75rem;
  color: var(--app-muted);
  margin: 0 0 12px;
}

.draft-progress-help {
  padding: 14px 16px;
  font-size: .8rem;
  color: var(--app-muted);
  background: var(--app-surface-soft);
  border: 1px solid var(--app-border);
  border-radius: 9px;
  margin-bottom: 16px;
}

.draft-register-page .draft-progress-cell {
  min-width: 220px;
}

.draft-progress-bar {
  background-color: var(--app-primary);
}

.draft-record-label {
  display: block;
  margin-top: 6px;
  color: var(--app-muted);
  font-size: .72rem;
  font-weight: 400;
}

.infrastructure-record-back {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--app-muted);
  font-size: .8rem;
  text-underline-offset: 3px;
}

.infrastructure-record-header .page-head>div:first-child {
  flex: 1 1 320px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.infrastructure-record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.infrastructure-record-actions .btn {
  min-height: 42px;
}

.infrastructure-record-page .infrastructure-record-card {
  padding: 24px;
}

.infrastructure-record-tabs {
  flex-wrap: wrap;
  gap: 4px;
}

.infrastructure-record-tabs .nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: .85rem;
}

.infrastructure-record-tab-count {
  background: var(--app-surface-soft);
  color: var(--app-muted);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: .75rem;
}

.infrastructure-record-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 32px;
}

.infrastructure-record-grid>* {
  min-width: 0;
}

.infrastructure-record-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
}

.infrastructure-record-facts dt {
  font-size: .78rem;
  font-weight: 500;
  color: var(--app-muted);
  margin-bottom: 6px;
}

.infrastructure-record-facts dd {
  font-size: .9rem;
  margin: 0;
  overflow-wrap: anywhere;
}

.infrastructure-record-fact-wide {
  grid-column: 1 / -1;
}

.infrastructure-record-geometry {
  padding-left: 32px;
  border-left: 1px solid var(--app-border);
}

.infrastructure-record-geometry .geometry-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.infrastructure-record-observation {
  border-top: 1px solid var(--app-border);
  margin-top: 28px;
  padding-top: 24px;
}

.infrastructure-record-reference {
  color: var(--app-muted);
  font-size: .75rem;
  padding-top: 20px;
  margin: 24px 0 0;
  border-top: 1px solid var(--app-border);
  overflow-wrap: anywhere;
}

.infrastructure-record-delete {
  border-top: 1px solid var(--app-border);
  margin-top: 28px;
  padding-top: 20px;
}

.infrastructure-record-delete summary {
  cursor: pointer;
  font-size: .8rem;
  color: var(--app-muted);
}

.infrastructure-record-delete summary:focus-visible {
  outline: 2px solid var(--app-primary);
  outline-offset: 4px;
}

.infrastructure-linked-table table {
  min-width: 730px;
}

.infrastructure-linked-table td {
  min-width: 100px;
  overflow-wrap: anywhere;
}

.infrastructure-linked-table td:first-child {
  min-width: 190px;
  max-width: 300px;
}

.infrastructure-linked-table .btn {
  min-height: 40px;
}

.infrastructure-linked-table:focus-visible {
  outline: 2px solid var(--app-primary);
  outline-offset: 4px;
}

.infrastructure-location-empty {
  padding: 40px 24px;
  text-align: center;
  border: 1px dashed var(--app-border-strong);
  border-radius: 12px;
  background: var(--app-surface-soft);
}

.infrastructure-location-empty>i {
  display: block;
  color: var(--app-muted);
  margin-bottom: 16px;
  font-size: 1.5rem;
}

.infrastructure-entry-form .operations-form-section legend span {
  flex-shrink: 0;
}

.infrastructure-entry-form .form-control,
.infrastructure-entry-form .form-select {
  min-height: 44px;
}

.infrastructure-entry-form .infrastructure-partners-select {
  min-height: 120px;
  padding: 8px;
}

.infrastructure-partners-select option {
  padding: 8px 10px;
}

.infrastructure-submit-help {
  padding: 14px 16px;
  border: 1px solid var(--app-border);
  border-radius: 9px;
  background: var(--app-surface-soft);
  color: var(--app-muted);
  font-size: .8rem;
}

.asset-record-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
  margin: 0;
}

.asset-record-facts dt {
  font-size: .78rem;
  font-weight: 500;
  color: var(--app-muted);
  margin-bottom: 5px;
}

.asset-record-facts dd {
  margin: 0;
  font-size: .875rem;
  overflow-wrap: anywhere;
}

.asset-record-page .col-xl-4 .asset-record-section {
  border-left: 1px solid var(--app-border);
  padding-left: 24px;
}

.asset-record-page .col-xl-4 .asset-record-facts {
  grid-template-columns: 1fr;
}

.asset-record-page .geometry-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.asset-record-specific {
  padding-top: 24px;
  margin-top: 8px;
  border-top: 1px solid var(--app-border);
}

.asset-record-specific td {
  overflow-wrap: anywhere;
  white-space: normal;
}

.asset-record-specific table {
  table-layout: fixed;
  width: 100%;
}

.asset-record-page .module-toolbar {
  flex-wrap: wrap;
}

.asset-media-card {
  padding: 14px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface);
  min-width: 0;
}

.asset-media-card .immo-media-preview-btn {
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 16 / 10;
}

.asset-media-card .immo-photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--app-surface-soft);
}

.asset-media-card h3 {
  overflow-wrap: anywhere;
  font-size: .875rem;
}

.asset-media-card .d-flex>div:first-child {
  min-width: 0;
}

.asset-media-description {
  font-size: .8rem;
  overflow-wrap: anywhere;
  max-height: 96px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.asset-media-card small {
  font-size: .72rem;
}

.asset-media-card .btn {
  min-width: 40px;
  min-height: 40px;
}

@media (max-width: 1199px) {
  .asset-record-page .col-xl-4 .asset-record-section {
    border-left: 0;
    border-top: 1px solid var(--app-border);
    padding: 24px 0 0;
  }

  .asset-record-page .col-xl-4 .asset-record-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {

  .asset-record-facts,
  .asset-record-page .col-xl-4 .asset-record-facts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575px) {
  .infrastructure-entry-form .operations-form-hint {
    margin-left: 0;
  }

  .infrastructure-entry-form .operations-form-actions .btn {
    flex: 1 1 100%;
  }
}

@media (max-width: 1199px) {
  .infrastructure-record-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .infrastructure-record-geometry {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--app-border);
    padding-top: 24px;
  }
}

@media (max-width: 575px) {
  .infrastructure-record-actions {
    width: 100%;
  }

  .infrastructure-record-actions .btn {
    flex: 1 1 auto;
  }

  .infrastructure-record-facts {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .infrastructure-record-tabs .nav-link {
    padding: 10px;
  }

  .infrastructure-record-page .immo-location-map {
    min-height: 320px;
  }
}

.global-dashboard .dashboard-kpi-grid>div {
  min-width: 0;
  width: auto;
  padding: 0;
  margin: 0;
}

.global-dashboard .kpi-card {
  min-height: 210px;
}

.global-kpi-detail {
  color: var(--app-muted);
  font-size: .75rem;
  margin: 0;
}

.global-kpi-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--app-primary-strong);
  font-size: .75rem;
  border-top: 1px solid var(--app-border);
  padding-top: 10px;
  margin-top: 4px;
}

.global-volume-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  font-size: .8rem;
  padding: 0 0 20px;
  color: var(--app-muted);
}

.global-volume-summary strong {
  color: var(--app-text);
  font-variant-numeric: tabular-nums;
}

.global-quick-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  border-block: 1px solid var(--app-border);
  padding-block: 20px;
}

.global-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 18px;
}

.global-section-heading p {
  font-size: .8rem;
}

.global-module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.global-module-card {
  padding: 22px;
  min-width: 0;
}

.global-module-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.global-module-heading .kpi-icon {
  flex-shrink: 0;
}

.global-module-card>p {
  font-size: .8rem;
  line-height: 1.6;
}

.global-module-links {
  padding: 0;
  margin: 0;
  list-style: none;
}

.global-module-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding-block: 8px;
  color: var(--app-text);
  font-size: .82rem;
  border-bottom: 1px solid var(--app-border);
}

.global-module-links li:last-child a {
  border-bottom: 0;
}

.global-module-links a:hover {
  color: var(--app-primary-strong);
}

.global-module-links i {
  color: var(--app-muted);
  font-size: .65rem;
}

.global-module-links a:focus-visible,
.global-kpi-link:focus-visible {
  outline: 2px solid var(--app-primary);
  outline-offset: 3px;
}

@media (max-width: 1199.98px) {
  .global-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.operations-closed-note {
  padding: 12px;
  background: var(--app-primary-soft);
  border-radius: 8px;
  color: var(--app-primary-strong);
  font-size: .85rem;
}

@media (min-width: 1200px) {
  .operations-workflow-card {
    position: sticky;
    top: 20px;
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
  }
}

@media (max-width: 575.98px) {
  .global-module-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .global-quick-actions .btn {
    flex: 1 1 100%;
    text-align: left;
  }

  .register-status {
    flex: 1 1 160px;
  }

  .register-toolbar>.btn {
    flex: 1 1 120px;
  }

  .operations-form-page .module-form-card {
    padding: 18px;
  }

  .operations-form-actions .btn {
    flex: 1;
  }

  .operations-form-hint {
    margin-left: 0;
  }
}
/* Incident and tonnage register tabs */
.operations-view-switcher-kicker,
.register-stage-heading span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  color: var(--app-primary-strong);
  font-size: .69rem;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.operations-view-switcher {
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: var(--v3-radius-md);
  background: color-mix(in srgb, var(--app-surface) 82%, var(--app-surface-soft));
}

.operations-view-switcher-head,
.register-stage-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.operations-view-switcher-head h2,
.register-stage-heading h2 {
  margin: 0;
  font-size: .96rem;
  font-weight: 650;
}

.operations-view-switcher-head p,
.register-stage-heading p {
  max-width: 420px;
  margin: 0;
  color: var(--app-muted);
  font-size: .76rem;
  text-align: right;
}

.incident-scope-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.incident-scope-tab {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 10px 11px;
  color: var(--app-text);
  text-decoration: none;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface);
  transition: border-color 140ms ease, background-color 140ms ease;
}

.incident-scope-tab:hover,
.incident-scope-tab:focus-visible {
  color: var(--app-text-strong);
  border-color: var(--app-border-strong);
  background: var(--app-surface-soft);
}

.incident-scope-tab:focus-visible,
.register-stage-tab:focus-visible {
  outline: 2px solid var(--app-primary);
  outline-offset: 2px;
}

.incident-scope-tab.is-active {
  color: var(--app-primary-strong);
  border-color: color-mix(in srgb, var(--app-primary) 42%, var(--app-border));
  background: var(--app-primary-soft);
  box-shadow: inset 3px 0 0 var(--app-primary);
}

.incident-scope-icon,
.register-stage-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  color: var(--app-muted);
  background: var(--app-surface-soft);
}

.incident-scope-tab.is-active .incident-scope-icon {
  color: var(--app-surface);
  background: var(--app-primary);
}

.incident-scope-copy {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.incident-scope-copy > span {
  font-size: .78rem;
  font-weight: 700;
  white-space: normal;
}

.incident-scope-copy small {
  overflow: hidden;
  margin-top: 3px;
  color: var(--app-muted);
  font-size: .66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incident-scope-tab strong,
.register-stage-tab strong {
  min-width: 25px;
  padding: 3px 6px;
  color: var(--app-muted);
  font-size: .7rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  text-align: center;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface-soft);
}

.incident-scope-tab.is-active strong {
  color: var(--app-primary-strong);
  border-color: color-mix(in srgb, var(--app-primary) 24%, var(--app-border));
  background: var(--app-surface);
}

.register-stage-section {
  margin: -4px -4px 20px;
  padding: 2px 4px 20px;
  border-bottom: 1px solid var(--app-border);
}

.register-stage-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 7px;
}

.register-stage-tab {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 8px;
  color: var(--app-muted);
  font-size: .74rem;
  font-weight: 650;
  text-align: left;
  border: 1px solid var(--app-border);
  border-radius: 9px;
  background: var(--app-surface);
}

.register-stage-tab:hover {
  color: var(--app-text-strong);
  border-color: var(--app-border-strong);
  background: var(--app-surface-soft);
}

.register-stage-tab.is-active {
  color: var(--app-primary-strong);
  border-color: color-mix(in srgb, var(--app-primary) 42%, var(--app-border));
  background: var(--app-primary-soft);
}

.register-stage-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.register-stage-tab.is-active .register-stage-icon {
  color: var(--app-surface);
  background: var(--app-primary);
}

.register-stage-tab.is-active strong {
  color: var(--app-primary-strong);
  background: var(--app-surface);
}

@media (max-width: 991.98px) {
  .incident-scope-tabs,
  .register-stage-tabs {
    display: flex;
    overflow-x: auto;
    padding-bottom: 3px;
    scroll-snap-type: x proximity;
  }

  .incident-scope-tab {
    flex: 0 0 245px;
    scroll-snap-align: start;
  }

  .register-stage-tab {
    flex: 0 0 190px;
    scroll-snap-align: start;
  }
}

@media (max-width: 575.98px) {
  .operations-view-switcher-head,
  .register-stage-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .operations-view-switcher {
    padding: 15px;
  }

  .operations-view-switcher-head p,
  .register-stage-heading p {
    text-align: left;
  }

  .incident-scope-tab {
    flex-basis: min(235px, 82vw);
  }
}

.app-notification-menu { margin-left: auto; }
.nav-notification-btn {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--bs-body-color);
  border: 1px solid var(--bs-border-color);
  border-radius: 999px;
}
.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 19px;
  padding: 1px 5px;
  color: #fff;
  font-size: .68rem;
  line-height: 17px;
  text-align: center;
  background: #c43131;
  border-radius: 999px;
}
.notification-dropdown { width: min(370px, calc(100vw - 1.5rem)); padding: .75rem; }
.notification-dropdown-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.notification-enable-push { width: 100%; margin: .5rem 0; }
.notification-empty { margin: .75rem 0 .25rem; color: var(--bs-secondary-color); text-align: center; }
.notification-list { display: grid; gap: .35rem; max-height: 360px; overflow-y: auto; }
.notification-item { display: grid; gap: .16rem; padding: .65rem; color: var(--bs-body-color); text-decoration: none; border-radius: .65rem; }
.notification-item:hover { background: color-mix(in srgb, var(--bs-primary) 8%, transparent); }
.notification-item.is-unread { background: color-mix(in srgb, var(--bs-primary) 12%, transparent); }
.notification-item span { color: var(--bs-secondary-color); font-size: .84rem; }
.notification-item small { color: var(--bs-tertiary-color); font-size: .73rem; }
.notification-dropdown-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: .6rem;
  padding: .7rem .65rem .15rem;
  color: var(--app-primary-strong);
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
  border-top: 1px solid var(--app-border);
}
.notification-dropdown-footer:hover { color: var(--app-primary); }

.notification-page { max-width: 1180px; }
.notification-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}
.notification-page-head > div:first-child { max-width: 730px; }
.notification-page-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
}
.notification-page-unread {
  display: grid;
  min-width: 94px;
  padding: .55rem .75rem;
  color: var(--app-muted);
  font-size: .7rem;
  line-height: 1.15;
  text-align: center;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface);
}
.notification-page-unread strong {
  color: var(--app-text-strong);
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}
.notification-page-card { overflow: hidden; padding: 0; }
.notification-page-card-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--app-border);
}
.notification-page-list { display: grid; }
.notification-page-item {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  color: var(--app-text);
  text-decoration: none;
  border-bottom: 1px solid var(--app-border);
  transition: background-color 140ms ease;
}
.notification-page-item:last-child { border-bottom: 0; }
.notification-page-item:hover,
.notification-page-item:focus-visible {
  color: var(--app-text-strong);
  background: var(--app-surface-soft);
}
.notification-page-item:focus-visible {
  z-index: 1;
  outline: 2px solid var(--app-primary);
  outline-offset: -2px;
}
.notification-page-item.is-unread {
  box-shadow: inset 3px 0 0 var(--app-primary);
  background: color-mix(in srgb, var(--app-primary) 7%, var(--app-surface));
}
.notification-page-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--app-muted);
  border-radius: 11px;
  background: var(--app-surface-soft);
}
.notification-page-item.is-unread .notification-page-icon {
  color: var(--app-primary-strong);
  background: var(--app-primary-soft);
}
.notification-page-copy { display: grid; min-width: 0; gap: .2rem; }
.notification-page-title-row {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.notification-page-title-row strong {
  overflow: hidden;
  color: var(--app-text-strong);
  font-size: .9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notification-page-copy > span:not(.notification-page-title-row) {
  color: var(--app-muted);
  font-size: .8rem;
  line-height: 1.45;
}
.notification-page-copy small {
  display: flex;
  align-items: center;
  gap: .35rem;
  color: var(--app-muted);
  font-size: .7rem;
}
.notification-page-new {
  flex: 0 0 auto;
  padding: .18rem .45rem;
  color: var(--app-primary-strong);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 999px;
  background: var(--app-primary-soft);
}
.notification-page-action {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--app-primary-strong);
  font-size: .75rem;
  font-weight: 750;
  white-space: nowrap;
}
.notification-page-empty { padding: 4rem 1rem; }

@media (max-width: 767.98px) {
  .notification-page-head {
    align-items: stretch;
    flex-direction: column;
  }
  .notification-page-summary { justify-content: space-between; }
  .notification-page-item {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: .75rem;
    padding: .9rem 1rem;
  }
  .notification-page-icon { width: 38px; height: 38px; }
  .notification-page-action {
    grid-column: 2;
    justify-content: flex-start;
  }
}
