:root {
  --ahis-blue: #0B3B8C;
  --ahis-blue-strong: #0B4FD8;
  --ahis-green: #078B45;
  --ahis-red: #D62828;
  --ahis-yellow: #F4C542;
  --ahis-purple: #5B259F;
  --ahis-bg: #F8FAFC;
  --ahis-card: #FFFFFF;
  --ahis-border: #DDE7F5;
  --ahis-text: #0B1F4D;
  --ahis-muted: #6B7280;
  --ahis-shadow-sm: 0 6px 18px rgba(11, 31, 77, 0.05);
  --ahis-radius: 0.75rem;
  --ahis-radius-sm: 0.4rem;
  --ahis-control-height: 2.2rem;
  --ahis-btn-height: 2.2rem;
  --ahis-font-size: 14px;
  --ahis-label-size: 12px;
}

.lims-content {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #0f172a;
}

.ahis-lims-page,
.lims-analysis-shell,
.lims-reception-page,
.lims-request-form {
  color: #0f172a;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.ahis-lims-page,
.lims-analysis-shell,
.lims-reception-page {
  font-size: 14px;
}

.btn-ahis-primary,
.btn-ahis-success,
.btn-ahis-danger,
.btn-ahis-warning,
.btn-ahis-outline,
.btn-ahis-purple {
  min-height: var(--ahis-btn-height);
  padding: 0.38rem 0.82rem;
  border-radius: var(--ahis-radius-sm);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.btn-ahis-primary {
  background: var(--ahis-blue-strong);
  border-color: var(--ahis-blue-strong);
  color: #fff;
}

.btn-ahis-success {
  background: var(--ahis-green);
  border-color: var(--ahis-green);
  color: #fff;
}

.btn-ahis-danger {
  background: var(--ahis-red);
  border-color: var(--ahis-red);
  color: #fff;
}

.btn-ahis-warning {
  background: var(--ahis-yellow);
  border-color: var(--ahis-yellow);
  color: var(--ahis-text);
}

.btn-ahis-purple {
  background: var(--ahis-purple);
  border-color: var(--ahis-purple);
  color: #fff;
}

.btn-ahis-outline {
  background: #fff;
  border: 1px solid var(--ahis-border);
  color: var(--ahis-text);
}

.btn-ahis-primary:hover,
.btn-ahis-primary:focus,
.btn-ahis-success:hover,
.btn-ahis-success:focus,
.btn-ahis-danger:hover,
.btn-ahis-danger:focus,
.btn-ahis-warning:hover,
.btn-ahis-warning:focus,
.btn-ahis-purple:hover,
.btn-ahis-purple:focus,
.btn-ahis-outline:hover,
.btn-ahis-outline:focus {
  filter: brightness(0.98);
  box-shadow: 0 0 0 0.12rem rgba(11, 79, 216, 0.12);
}

.crud-page,
.crud-page-narrow {
  max-width: 1240px;
  margin: 0 auto;
}

.lims-header-bar {
  padding-bottom: 0.45rem;
  margin-bottom: 1rem;
  border-bottom: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--ahis-green), var(--ahis-yellow), var(--ahis-red)) 1;
}

.lims-header-bar h1 {
  margin: 0;
  color: var(--ahis-text);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
}

.lims-header-bar .subtitle,
.lims-header-org,
.lims-header-org .code-line {
  color: var(--ahis-muted);
}

.section-title {
  margin: 0.5rem 0 0.35rem;
  color: var(--ahis-muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
}

.card-ahis,
.table-ahis-wrap,
.lims-filter-card,
.lims-table-card,
.analysis-card,
.side-card {
  border: 1px solid var(--ahis-border);
  border-radius: var(--ahis-radius);
  background: var(--ahis-card);
  box-shadow: var(--ahis-shadow-sm);
}

.table-ahis {
  --bs-table-bg: transparent;
  margin-bottom: 0;
}

.table-ahis thead th,
.lims-table-card table thead th {
  padding: 0.68rem 0.8rem;
  border-bottom: 1px solid var(--ahis-border);
  color: var(--ahis-text);
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}

.table-ahis tbody td,
.lims-table-card table tbody td {
  padding: 0.68rem 0.8rem;
  border-color: #edf2f7;
  vertical-align: middle;
  color: var(--ahis-text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}

.lims-page-header,
.analysis-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.lims-page-header h1,
.analysis-page-header h1 {
  margin: 0;
  color: var(--ahis-text);
  font-size: clamp(20px, 1rem + 0.7vw, 24px);
  font-weight: 600;
  line-height: 1.3;
}

.lims-page-header p,
.analysis-page-header p {
  margin: 0.2rem 0 0;
  color: var(--ahis-muted);
  font-size: 14px;
  line-height: 1.55;
}

.lims-page-kicker,
.analysis-overline {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.45rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--ahis-border);
  background: #f3f7ff;
  color: var(--ahis-blue);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

.analysis-badge,
.lims-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  line-height: 1.25;
}

.badge-neutral,
.lims-badge-draft {
  color: var(--ahis-muted);
  background: #eef2f7;
}

.badge-success,
.lims-badge-received {
  color: var(--ahis-green);
  background: #eaf6ef;
}

.badge-info,
.lims-badge-in-progress {
  color: var(--ahis-blue-strong);
  background: #eef4ff;
}

.badge-warning,
.lims-badge-normal {
  color: #9a6d00;
  background: #fff7db;
}

.badge-danger,
.lims-badge-urgent {
  color: var(--ahis-red);
  background: #fdeceb;
}

.analysis-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--ahis-blue);
  font-size: 0.7rem;
  font-weight: 700;
}

.chip-dispatch {
  background: #eef4ff;
  color: var(--ahis-blue-strong);
}

.chip-receive {
  background: #eaf6ef;
  color: var(--ahis-green);
}

.chip-reprise {
  background: #fdeceb;
  color: var(--ahis-red);
}

.badge-etat,
.badge-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 12px;
  font-weight: 600;
}

.badge-soft-light {
  background: #f8f9fb;
  color: var(--ahis-muted);
  border: 1px solid var(--ahis-border);
}

.badge-soft-warn {
  background: #fff8e5;
  color: #8a6a00;
  border: 1px solid #ffe7a3;
}

.badge-soft-ok {
  background: #e9f9ef;
  color: #087443;
  border: 1px solid #c6f0d7;
}

.badge-soft-ko {
  background: #feecec;
  color: #a11219;
  border: 1px solid #ffc7ca;
}

.lims-action-btn {
  min-height: var(--ahis-btn-height);
  border-radius: var(--ahis-radius-sm);
  font-size: 13px;
  font-weight: 600;
}

.lims-filter-card .form-control,
.lims-filter-card .form-select,
.analysis-filter-grid .form-control,
.analysis-filter-grid .form-select,
.analysis-card .form-control,
.analysis-card .form-select,
.analysis-card textarea,
.side-card .form-control,
.side-card .form-select {
  min-height: var(--ahis-control-height);
  border-color: var(--ahis-border);
  border-radius: var(--ahis-radius-sm);
  font-size: 0.8rem;
}

.lims-filter-card label,
.analysis-filter-grid label,
.analysis-card label,
.side-card label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--ahis-text);
  font-size: 12px;
  font-weight: 600;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.section-head h2 {
  margin: 0;
  color: var(--ahis-blue);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
}

.card-section .card-header,
.crud-card-body,
.card-ahis .card-body,
.crud-form-card .card-body,
.crud-list-card .card-body {
  padding: 1rem 1.1rem;
}

.card-section .card-header {
  background: linear-gradient(90deg, rgba(11, 79, 216, 0.04), rgba(244, 197, 66, 0.07), rgba(214, 40, 40, 0.04));
  border-bottom: 1px solid var(--ahis-border);
}

.section-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: #f3f7ff;
  color: var(--ahis-blue);
  font-size: 0.72rem;
  font-weight: 800;
}

.analysis-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem 1rem;
}

.analysis-summary-grid > div {
  display: grid;
  gap: 0.15rem;
}

.analysis-summary-grid strong {
  color: var(--ahis-text);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.analysis-summary-grid span,
.analysis-summary-grid p,
.analysis-summary-grid a {
  color: var(--ahis-muted);
  font-size: 0.8rem;
}

.summary-span-2 {
  grid-column: span 2;
}

.analysis-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.8rem;
}

.analysis-timeline li {
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #edf2f7;
}

.analysis-timeline li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.analysis-timeline strong,
.analysis-timeline span,
.analysis-timeline small {
  display: block;
}

.analysis-timeline span,
.analysis-timeline small {
  color: var(--ahis-muted);
  font-size: 0.76rem;
}

.pagination .page-link {
  color: var(--ahis-blue);
  border-color: var(--ahis-border);
  border-radius: 0.55rem;
  margin: 0 0.12rem;
  font-size: 0.76rem;
}

.pagination .page-item.active .page-link,
.pagination .page-link:hover {
  background: #eef4ff;
  border-color: var(--ahis-blue-strong);
  color: var(--ahis-blue-strong);
}

.modal-content {
  border: 1px solid var(--ahis-border);
  border-radius: 1rem;
  box-shadow: 0 18px 42px rgba(11, 31, 77, 0.14);
}

.modal-header,
.modal-footer {
  border-color: var(--ahis-border);
}

.modal-title {
  color: var(--ahis-text);
  font-size: 17px;
  font-weight: 600;
}

.alert {
  border-radius: 0.8rem;
  font-size: 13px;
  line-height: 1.5;
}

.table-lims {
  font-size: 13px;
}

.table-lims th {
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.table-lims td {
  font-size: 13px;
  font-weight: 400;
  vertical-align: middle;
}

.sidebar-menu > li.bf-menu.menu-lims > a,
.sidebar-menu > li.bf-menu.menu-lims > a i.fa,
.sidebar-menu > li.bf-menu.menu-lims > .treeview-menu > li > a {
  color: var(--ahis-text) !important;
}

.sidebar-menu > li.bf-menu.menu-lims.active > a,
.sidebar-menu > li.bf-menu.menu-lims.menu-open > a {
  background: rgba(7, 139, 69, 0.08) !important;
}

.sidebar-menu > li.bf-menu.menu-lims > .treeview-menu > li.active > a {
  background: rgba(7, 139, 69, 0.08) !important;
  border: 1px solid rgba(7, 139, 69, 0.14);
}

@media (max-width: 991.98px) {
  .lims-page-header,
  .analysis-page-header {
    flex-direction: column;
  }
}

@media (max-width: 767.98px) {
  .analysis-summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-span-2 {
    grid-column: auto;
  }
}
