/*
 * Styles pour l'application ConstaSafe
 * Conçu pour une lecture claire et une distinction visuelle des statuts
 */

:root {
  --bs-primary: #0a58ca;
  --bs-link-color: #0a58ca;
  --bs-link-color-rgb: 10, 88, 202;
  --bg-color: #f8f9fa;
  --text-color: #343a40;
  --card-bg: #ffffff;
  --navbar-bg: var(--bs-primary);
  --navbar-text: #ffffff; /* Ensure contrast ratio > 4.5:1 with --bs-primary */
  --table-header-bg: #e9ecef;
  --footer-bg: #343a40;
  --footer-text: #ffffff;
  --error-bg: #f8d7da;
  --error-border: #f5c6cb;
  --error-text: #721c24;
  --status-pending: #dc3545;
  --status-in-progress: #856404;
  --status-done: #1e7e34;
  --border-color: #ced4da;
  --chart-pending: #ffc107;
  --chart-in-progress: #0d6efd;
  --chart-done: #198754;

  /* Spacing & typography */
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --font-size-base: clamp(1rem, 1.2vw, 1.125rem);
  --line-height-base: 1.6;
  --layout-gutter: clamp(0.5rem, 1.5vw, 2rem);
  --container-padding-inline: clamp(1rem, 3vw, 3rem);
  --container-padding-block: clamp(1rem, 2.5vw, 2.75rem);
  --container-radius: clamp(0.5rem, 1vw, 1rem);
  --container-max-width: min(100%, calc(100vw - var(--layout-gutter) * 2));
  --report-text-max-inline-size: min(100%, 72ch);
}

html {
  background-color: var(--bg-color);
}

/* Dark theme variables */
[data-bs-theme='dark'] {
  color-scheme: dark;
  --bs-primary: #0a58ca;
  --bs-link-color: #5ab4ff;
  --bs-link-color-rgb: 90, 180, 255;
  --bg-color: #181a1b;
  --text-color: #f1f1f1;
  --card-bg: #242424;
  --navbar-bg: #1c1c1c;
  --navbar-text: #f1f1f1;
  --table-header-bg: #2e2e2e;
  --footer-bg: #1c1c1c;
  --footer-text: #f1f1f1;
  --error-bg: #742a2a;
  --error-border: #ad3e3e;
  --error-text: #ffd2d2;
  --status-pending: #ff6b6b;
  --status-in-progress: #b38600;
  --status-done: #59d889;
  --chart-pending: #ffd066;
  --chart-in-progress: #5ab4ff;
  --chart-done: #59d889;
  --border-color: #555;
}

[data-bs-theme='dark'] .form-check-input:checked {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

.btn:not(.btn-close) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--btn-gap, 0.5rem);
}

.btn .btn-leading-icon {
  font-size: 0.95em;
  line-height: 1;
}

.btn .btn-label {
  line-height: 1.25;
  display: inline-flex;
  align-items: center;
}

[data-bs-theme='dark'] .btn .btn-leading-icon {
  color: inherit;
}


.btn-primary {
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-disabled-bg: var(--bs-primary);
  --bs-btn-disabled-border-color: var(--bs-primary);
  background-color: var(--bs-btn-bg);
  border-color: var(--bs-btn-border-color);
}

body {
  font-family: "Segoe UI", Tahoma, sans-serif;
  background-color: var(--bg-color);
  margin: 0;
  padding: var(--layout-gutter);
  color: var(--text-color);
  color-scheme: light;
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  box-sizing: border-box;
  border: 0;
  transition:
    background-color 0.3s,
    color 0.3s;
}


.print-only {
  display: none !important;
}

.report-print-header,
.report-print-footer {
  width: 100%;
}

.report-print-header__title,
.report-print-header__line,
.report-print-header__custom,
.report-print-footer__primary,
.report-print-footer__meta {
  margin: 0;
}

.report-print-header__share,
.report-print-footer__meta {
  word-break: break-word;
}


.header {
  background-color: var(
    --navbar-bg
  ); /* Couleur institutionnelle ConstaSafe/CFST */
  color: var(--navbar-text);
  padding: 20px;
  text-align: center;
}

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-inline: auto;
  margin-block-start: clamp(0.75rem, 1.5vw, 2.5rem);
  margin-block-end: clamp(0.75rem, 1.5vw, 2.5rem);
  background: var(--card-bg);
  padding: var(--container-padding-block) var(--container-padding-inline);
  box-shadow: 0 2px 8px rgba(var(--bs-black-rgb), 0.1);
  border: 1px solid var(--border-color);
  border-radius: var(--container-radius);
}

/* Report view layout */
.container.cs-page {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

@media (min-width: 992px) {
  .container.cs-page {
    margin-block-start: clamp(0.75rem, 1vw, 1.5rem);
  }

  body > nav.navbar + .container.cs-page {
    margin-block-start: clamp(0.75rem, 1.5vw, 2.5rem);
  }
}

.report-description p,
.report-constat-item p,
.report-constat-item ul:not(.list-group) li,
.report-constat-item ol:not(.list-group) li {
  max-inline-size: var(--report-text-max-inline-size);
}


.cs-main {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

.cs-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

.container.cs-page > .modal {
  align-self: stretch;
}

.cs-header {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.cs-header-main {
  flex: 1 1 auto;
}

.cs-header-photo {
  flex: 0 0 auto;
  align-self: flex-start;
}

.cs-header-photo .img-thumbnail {
  max-width: 100%;
  height: auto;
}

@media (min-width: 1200px) {
  .cs-main {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "header sidebar"
      "content sidebar";
    column-gap: clamp(2rem, 4vw, 3rem);
    row-gap: var(--spacing-xl);
    align-items: start;
  }

  .cs-header {
    grid-area: header;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: clamp(1.5rem, 3vw, 2.5rem);
  }

  .cs-header-photo {
    max-width: min(22rem, 40%);
  }

  .cs-header-photo .img-thumbnail {
    width: 100%;
    height: auto;
  }

  .cs-content {
    grid-area: content;
    margin-top: 0 !important;
  }

  .cs-sidebar {
    grid-area: sidebar;
    position: sticky;
    top: clamp(1.5rem, 3vw, 3rem);
    align-self: start;
  }

  .cs-sidebar .row {
    --bs-gutter-x: 1.25rem;
    --bs-gutter-y: 1.5rem;
  }

  .cs-sidebar .row > *:first-child {
    margin-top: 0;
  }

  .cs-sidebar .cs-visual-summary > .col-md-4,
  .cs-sidebar .cs-visual-summary > .col-lg-4 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .cs-main > .modal {
    grid-column: 1 / -1;
  }
}

.cs-sidebar .cs-visual-summary .analytics-chart-square {
  width: 100%;
  margin-inline: auto;
}

.report-constat-details-wrapper[hidden] {
  display: none !important;
}

.report-constat-summary {
  cursor: pointer;
}

.report-constat-summary:focus {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

.report-constat-toggle {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.report-constat-toggle:focus {
  box-shadow: none;
}

.report-constat-toggle i {
  transition: transform 0.2s ease;
}

.report-constat-item[data-expanded="1"] .report-constat-toggle i {
  transform: rotate(90deg);
}

.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.button {
  background-color: var(--bs-success);
  color: var(--bs-white);
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
}

[data-constat-list].report-constats-condensed > .report-constat-item {
  transition: max-height 0.2s ease, padding 0.2s ease;
}

[data-constat-list].report-constats-condensed > .report-constat-item[data-expanded="0"] {
  max-height: 12rem;
  overflow: hidden;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

[data-constat-list].report-constats-condensed > .report-constat-item[data-expanded="1"] {
  max-height: none;
  overflow: visible;
}

[data-constat-list].report-constats-condensed > .report-constat-item .report-constat-body {
  gap: 0.75rem;
}

[data-constat-list].report-constats-condensed > .report-constat-item .report-constat-summary h3 {
  margin-bottom: 0.25rem;
}

@media (prefers-reduced-motion: reduce) {
  [data-constat-list].report-constats-condensed > .report-constat-item {
    transition: none;
  }
}

.button:hover {
  background-color: var(--bs-success);
}

.filter-form {
  /* display: inline-block; */
  display: flex;
  flex-wrap: wrap;
}

.filter-form select {
  padding: 6px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

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

.table th,
.table td {
  border: 1px solid var(--border-color);
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: left;
}

.table th {
  background-color: var(--table-header-bg);
  font-weight: 600;
}

.table .empty {
  text-align: center;
  padding: 20px;
  color: var(--text-color);
}

.table.table-details col.table-details-label {
  width: 42%;
  min-width: 11rem;
}

.table.table-details col.table-details-value {
  width: 58%;
}

.table.table-details > :not(caption) > * > th,
.table.table-details > :not(caption) > * > td {
  vertical-align: top;
}

.table.table-details > :not(caption) > * > td {
  word-break: break-word;
}

@media (min-width: 768px) {
  .table.table-details col.table-details-label {
    width: 36%;
  }

  .table.table-details col.table-details-value {
    width: 64%;
  }
}

@media (min-width: 1200px) {
  .table.table-details col.table-details-label {
    width: 32%;
  }

  .table.table-details col.table-details-value {
    width: 68%;
  }
}

.status-en-attente {
  color: var(--status-pending);
  font-weight: 600;
}
.status-en-cours {
  color: var(--status-in-progress);
  font-weight: 600;
}
.status-terminee {
  color: var(--status-done);
  font-weight: 600;
}

.form-group {
  margin-bottom: var(--spacing-md);
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
}

.required {
  color: var(--bs-danger);
}

.input-text,
.input-date,
select,
.input-textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
}

.input-textarea {
  min-height: 100px;
  resize: vertical;
}

.error {
  background-color: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
  padding: var(--spacing-md);
  border-radius: 4px;
  margin-bottom: var(--spacing-md);
  list-style: none;
}

/* Styles pour la page details */
.details th {
  width: 25%;
  background-color: var(--table-header-bg);
  font-weight: 600;
}
/* 2) Cards avec une ombre plus prononcée */
.card {
  border-radius: 0.75rem;
  background-color: var(--card-bg);
  box-shadow: 0 0.125rem 0.25rem rgba(var(--bs-black-rgb), 0.075);
}



/* 4) Alerts */
.alert {
  border-radius: 0.5rem;
}

/* 5) Footer (si vous voulez un footer custom) */
footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 1rem 0;
  text-align: center;
}

/* 6) Formulaires (ajout d’un padding interne) */
.form-control {
  padding: 0.75rem 1rem;
}

.navbar {
  box-shadow: 0 2px 4px rgba(var(--bs-black-rgb), 0.1);
}

body > nav.navbar {
  width: calc(100% + var(--layout-gutter) * 2);
  margin-top: calc(var(--layout-gutter) * -1);
  margin-left: calc(var(--layout-gutter) * -1);
  margin-right: calc(var(--layout-gutter) * -1);
  border-radius: 0;
}

/* 7) Navigation : si vous souhaitez un survol différent */
.navbar-nav .nav-link {
  padding-right: 1rem;
  padding-left: 1rem;
  transition: background-color 0.2s ease-in-out;
}
.navbar-nav .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 0.25rem;
}

/* Ajustements pour le mode sombre */
.navbar.bg-primary {
  background-color: var(--navbar-bg) !important;
}
.navbar.bg-primary .navbar-brand,
.navbar.bg-primary .nav-link,
.navbar.bg-primary .navbar-text {
  color: var(--navbar-text) !important;
}

/* Offcanvas menu colors */
.navbar-offcanvas {
  background-color: var(--navbar-bg) !important;
  color: var(--navbar-text) !important;
}
.navbar-offcanvas .nav-link,
.navbar-offcanvas .dropdown-item,
.navbar-offcanvas .offcanvas-title {
  color: var(--navbar-text) !important;
}
.navbar-offcanvas .nav-link:hover,
.navbar-offcanvas .dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 0.25rem;
}

/* Highlight overdue measures */
.overdue {
  background-color: var(--error-bg) !important;
  color: var(--error-text);
  font-weight: bold;
  border-left: 4px solid var(--bs-danger);
}

/* Highlight draft observations */
.draft {
  background-color: var(--bs-secondary-bg-subtle) !important;
  border-left: 4px dashed var(--bs-secondary);
  font-style: italic;
}

/* Completed measure styling */
.measure-completed {
  text-decoration: line-through;
  opacity: 0.7;
}

/* Tables responsives sur mobile */
@media (max-width: 768px) {
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 576px) {
  :root {
    --container-padding-inline: clamp(0.75rem, 4vw, 1.5rem);
    --container-padding-block: clamp(0.75rem, 3.5vw, 1.5rem);
  }

  .container {
    margin-inline: 0;
    margin-block: var(--layout-gutter);
    border-radius: clamp(0.5rem, 2vw, 0.75rem);
    box-shadow: 0 1px 4px rgba(var(--bs-black-rgb), 0.12);
  }
}

/* Image editor modal */
#imageEditorModal canvas {
  max-width: 100%;
  height: auto;
}

/* Dark mode adjustments for image editor */
[data-bs-theme='dark'] #imageEditorModal .modal-content {
  background-color: var(--card-bg);
  color: var(--text-color);
}

[data-bs-theme='dark'] #imageEditorModal .btn-close {
  filter: invert(1);
}

/* Navigation arrows for detail views */
.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(var(--bs-black-rgb), 0.4);
  color: var(--bs-white);
  padding: 0.7rem;
  border-radius: 50%;
  z-index: 2000;
  cursor: pointer;
}

body.modal-open .nav-arrow {
  display: none;
}

.nav-arrow i {
  font-size: 1.5rem;
  line-height: 1;
}

.nav-arrow:hover {
  background: rgba(var(--bs-black-rgb), 0.6);
}

.nav-arrow-left {
  left: 10px;
}

.nav-arrow-right {
  right: 10px;
}

@media (min-width: 576px) {
  .nav-arrow {
    padding: 1rem;
  }

  .nav-arrow i {
    font-size: 1rem;
  }
}

/* File preview modal */
#filePreviewModal img.file-preview-img {
  max-width: 100%;
  height: auto;
  max-height: 80vh;
}
#filePreviewModal iframe.file-preview-pdf {
  width: 100%;
  max-width: 80vw;
  aspect-ratio: 210/297;
  max-height: 80vh;
}

/* Autocomplete select */
.autocomplete-select-wrapper .autocomplete-list {
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
}

/* Reusable scroll container for modals */
.modal-scroll {
  max-height: 200px;
  overflow-y: auto;
}
.modal-iframe {
  min-height: 80vh;
}

/* Navbar search field */
.navbar .search-input {
  width: 180px;
}

@media (max-width: 991.98px) {
  .navbar .search-input {
    width: 100%;
  }
}

/* Zone actions de masse au-dessus des tableaux */
.mass-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Permissions matrix enhancements */
.perm-checkbox:hover,
.perm-checkbox:focus {
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Negation button for filters */
.negate-btn.active {
  color: var(--bs-danger);
  border-color: var(--bs-danger);
}

.perm-checkbox.modified {
  outline: 2px solid var(--bs-danger);
}

.permissions-table .perm-group-header th {
  background-color: var(--table-header-bg);
}

/* Attachments preview in reference modal */
#refDetFiles img {
  max-width: 100%;
  height: auto;
  max-height: 60vh;
}

/* Brand logo styling */
.navbar-brand img {
  height: 30px;
}

.login-logo {
  max-height: 100px;
}

/* Inline attachments list used in observation detail */
.attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-left: 0;
}
.attachments-list li {
  flex: 0 0 calc(25% - 0.5rem);
  max-width: calc(25% - 0.5rem);
  list-style: none;
  text-align: center;
}
.attachments-list img {
  max-width: 100%;
  height: auto;
}

/* Reference modal attachments */
#refDetFiles > div {
  flex: 0 0 calc(25% - 0.5rem);
}

/* General modal dark mode styles */
[data-bs-theme='dark'] .modal-content {
  background-color: var(--card-bg);
  color: var(--text-color);
}
[data-bs-theme='dark'] .modal-header,
[data-bs-theme='dark'] .modal-footer {
  border-color: var(--border-color);
}

/* Dark mode colors for striped/hover tables */
[data-bs-theme='dark'] .table-striped > tbody > tr:nth-of-type(odd),
[data-bs-theme='dark'] .table-hover > tbody > tr:hover {
  background-color: var(--table-header-bg);
}

/* Utility classes */
.scroll-area {
  max-height: 200px;
  overflow-y: auto;
}

.color-btn-black {
  background: var(--bs-black);
}

.color-btn-red {
  background: var(--bs-danger);
}

.color-btn-green {
  background: var(--bs-success);
}

.color-btn-blue {
  background: var(--bs-primary);
}

.color-btn-yellow {
  background: var(--bs-warning);
}

.stroke-range {
  width: 120px;
}

.canvas-touch-none {
  touch-action: none;
}

/* Ensure selects with action buttons fit their container */
.input-group > .form-select {
  flex: 1 1 auto;
  width: 1%;
}

.form-floating textarea {
  height: 6rem;
}

.file-drop-zone {
  position: relative;
}
.file-drop-zone.dragover {
  outline: 2px dashed var(--navbar-bg);
  background-color: var(--table-header-bg);
}

/* Custom color for moderate severity */
.bg-orange {
  background-color: var(--bs-orange) !important;
}
.text-bg-orange {
  color: var(--bs-white);
  background-color: var(--bs-orange) !important;
}

/* Styles for offline cache settings modal */
.cache-settings-modal {
  /* rely on Bootstrap modal positioning */
}

.cache-settings-modal .modal-content {
  background-color: var(--bs-body-bg);
  padding: 20px;
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
}

.cache-settings-modal .settings-section {
  /* spacing handled via Bootstrap utilities */
}

.cache-settings-modal .settings-section label {
  display: block;
}

.cache-settings-modal .cache-size {
  /* spacing handled via Bootstrap utilities */
}

.cache-settings-modal .stats-section {
  /* spacing handled via Bootstrap utilities */
}

.cache-settings-modal .progress {
  height: 1.25rem;
}

.cache-settings-modal .progress-bar {
  --bs-progress-bar-bg: var(--bs-success);
  transition: width 0.3s ease;
}

.cache-settings-modal table {
  width: 100%;
  border-collapse: collapse;
}

.cache-settings-modal th,
.cache-settings-modal td {
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid var(--bs-border-color);
}

.cache-settings-modal .actions {
  text-align: right;
}

.cache-settings-modal .actions button {
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

.cache-settings-modal .primary {
  background-color: var(--bs-success);
  color: var(--bs-white);
}

.cache-settings-modal .secondary {
  background-color: var(--bs-secondary-bg);
  color: var(--bs-body-color);
}

/* Debug outlines for modal events */
.debug-modal-open {
  outline: 3px dashed var(--bs-primary);
}

#networkStatusBtn i {
  width: 1rem;
  height: 1rem;
  font-size: 1rem;
}

#networkStatusBtn:hover,
#networkStatusBtn:focus {
  background-color: rgba(255, 255, 255, 0.1);
}

.analytics-chart-square,
.analytics-chart-bars-wrapper {
  width: 100%;
  display: flex;
  position: relative;
}

.analytics-chart-square {
  aspect-ratio: 1 / 1;
  align-items: stretch;
  justify-content: stretch;
}

.analytics-chart {
  width: 100%;
  height: 100%;
  display: block;
}

.analytics-chart-bars-wrapper {
  min-height: 14rem;
  align-items: stretch;
  justify-content: stretch;
}

.analytics-chart-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.analytics-chart-legend-item svg {
  flex-shrink: 0;
}

.analytics-chart-legend-item span {
  flex: 1 1 auto;
  min-width: 0;
}

@media (min-width: 768px) {
  .analytics-chart-square {
    max-width: 16rem;
    margin-inline: auto;
  }

  .analytics-chart-bars-wrapper {
    min-height: 16rem;
  }
}

@media (min-width: 1200px) {
  .analytics-chart-square {
    max-width: 18rem;
  }
}

@page {
  size: A4;
  margin: 1.5cm;
}

@media print {
  :root {
    color-scheme: light;
  }

  body {
    margin: 0;
    padding: 0;
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 1.1rem;
    line-height: 1.5;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .container.cs-page {
    display: block;
  }

  .container.cs-page .cs-sidebar {
    position: static;
  }

  .cs-main,
  .cs-header,
  .cs-header-main,
  .cs-header-photo,
  .cs-content,
  .cs-sidebar {
    display: block !important;
    width: 100% !important;
  }

  .cs-header-photo {
    margin-top: 1rem !important;
  }

  .cs-sidebar {
    margin-top: 2rem !important;
  }

  .cs-main .d-flex,
  .cs-main .d-inline-flex,
  .cs-main .d-lg-flex,
  .cs-sidebar .d-flex,
  .cs-sidebar .d-inline-flex,
  .cs-sidebar .d-lg-flex {
    display: block !important;
  }

  .row {
    display: block !important;
    margin-inline: 0 !important;
  }

  .row > [class*="col-"] {
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  small,
  .small {
    font-size: 0.95em;
  }

  main,
  header,
  footer,
  .container,
  .card,
  .modal-content,
  .table,
  .table-responsive,
  .list-group-item,
  .accordion-item,
  .accordion-body,
  .analytics-chart-square,
  .analytics-chart-bars-wrapper {
    background: #ffffff !important;
    color: #000000 !important;
    box-shadow: none !important;
    border-color: #0000001a;
  }

  .container,
  .card,
  .modal-content,
  .accordion-body,
  .list-group-item {
    margin-inline: 0;
    margin-block: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0;
  }

  .modal,
  .offcanvas,
  nav.navbar,
  .btn,
  .btn-group,
  .dropdown-menu,
  .pagination,
  form,
  .toast,
  .alert-dismissible .btn-close,
  .print-hidden {
    display: none !important;
  }

  .nav-arrow {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

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

  .analytics-chart-square {
    max-width: 14rem;
  }

  thead {
    display: table-header-group;
  }

  tbody tr,
  .card,
  .accordion-item,
  .list-group-item,
  .modal-content,
  .table-responsive,
  .analytics-chart-square,
  .analytics-chart-bars-wrapper {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  table th,
  table td {
    padding: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
  }

  ul,
  ol {
    padding-inline-start: 1.25rem;
  }

  a[href^="http"]:not(.no-print-url)::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    word-break: break-all;
  }

  img,
  svg,
  video,
  canvas,
  iframe {
    max-width: 100% !important;
    height: auto !important;
  }

  .table-responsive {
    overflow: visible !important;
  }

  .report-print-header,
  .report-print-footer {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.5rem;
  }

  .report-print-header {
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.65);
  }

  .report-print-header__title {
    font-size: 1.4rem;
    font-weight: 600;
  }

  .report-print-header__line,
  .report-print-header__custom {
    font-size: 0.95rem;
  }

  .report-print-header__custom {
    margin-bottom: 0.35rem;
  }

  .report-print-header__primary {
    flex: 1 1 55%;
    min-width: 12rem;
  }

  .report-print-header__share {
    flex: 1 1 35%;
    min-width: 10rem;
    font-size: 0.9rem;
    text-align: right;
  }

  .report-print-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
  }

  .report-print-value {
    display: block;
  }

  .report-print-footer {
    margin-top: 2rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.35);
    font-size: 0.9rem;
  }

  .report-print-footer__primary {
    flex: 1 1 auto;
    min-width: 12rem;
  }

  .report-print-footer__meta {
    flex: 0 0 auto;
    font-size: 0.85rem;
    text-align: right;
  }

  .shared-view-toolbar,
  .shared-view-actions,
  .shared-actions,
  [data-share-close],
  [data-share-toolbar],
  [data-share-action],
  [data-measure-upload-section],
  [data-close-form],
  [data-close-observation-wrapper],
  [data-close-feedback],
  [data-close-tooltip],
  [data-close-responsible-feedback],
  [data-close-responsible],
  [data-close-responsible-function],
  [data-close-responsible-email],
  [data-close-responsible-phone],
  #sharedMesDetUploadWrapper,
  #sharedMesDetFiles,
  #sharedMesDetUpload,
  template[data-measure-upload-template] {
    display: none !important;
  }

  .badge,
  .status,
  .tag,
  .card-title,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: inherit !important;
  }
}

.shared-view form,
.shared-view button,
.shared-view .btn,
.shared-view input,
.shared-view select,
.shared-view textarea {
  display: revert !important;
}

@supports selector(:has(*)) {
  .shared-view .card:has(form[action$="send_notification.php"]),
  .shared-view .card:has(form[action*="/send_notification.php"]),
  .shared-view .card:has(form[action$="delegate_observation.php"]),
  .shared-view .card:has(form[action*="/delegate_observation.php"]),
  .shared-view .card:has(form[action$="close_observation.php"]),
  .shared-view .card:has(form[action*="/close_observation.php"]),
  .shared-view .card:has([name="send_notification"]),
  .shared-view form[name="send_notification"],
  .shared-view .card:has([name="delegate_observation"]),
  .shared-view form[name="delegate_observation"],
  .shared-view .card:has([name="close_observation"]),
  .shared-view form[name="close_observation"] {
    display: none !important;
  }
}
@media (max-width: 991.98px) {
  .navbar .dropdown-user {
    position: relative;
  }

  .navbar .dropdown-user .dropdown-menu-user {
    position: absolute;
    right: 0;
    left: auto;
    top: calc(100% + 0.25rem);
    z-index: 1050;
    margin-top: 0;
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--bs-box-shadow-lg);
  }
}
