/* ============================================================
   VARIABLES CSS — THÈME PROCÉDURES-COLLECTIVES.COM
   ============================================================ */
:root {
  /* Couleurs principales */
  --pc-primary:       #1e40af;
  --pc-primary-light: #3b82f6;
  --pc-primary-dark:  #1e3a8a;
  --pc-primary-bg:    #eff6ff;

  /* Statuts procédures */
  --pc-liquidation:   #ef4444;
  --pc-redressement:  #f59e0b;
  --pc-sauvegarde:    #10b981;
  --pc-conciliation:  #8b5cf6;

  /* Neutres */
  --pc-900: #0f172a;
  --pc-800: #1e293b;
  --pc-700: #374151;
  --pc-600: #4b5563;
  --pc-500: #6b7280;
  --pc-400: #9ca3af;
  --pc-300: #d1d5db;
  --pc-200: #e5e7eb;
  --pc-100: #f3f4f6;
  --pc-50:  #f9fafb;

  /* Ombres */
  --pc-shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --pc-shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --pc-shadow-lg: 0 10px 24px rgba(0,0,0,.10);

  /* Rayon */
  --pc-radius-sm: 6px;
  --pc-radius-md: 10px;
  --pc-radius-lg: 14px;

  /* Transitions */
  --pc-transition: 220ms ease;
}

/* ——— Base ——— */
body {
  font-family: 'Nunito', sans-serif;
  background-color: #f0f4fb;
  color: var(--pc-900);
}

/* ——— Bandeau titre page ——— */
.page-header {
  background: #fff;
  border-bottom: 1px solid var(--pc-200);
  padding: .875rem 0;
}

/* ——— Carte filtres ——— */
.card-filters {
  border-top: 3px solid var(--pc-primary) !important;
  border-radius: var(--pc-radius-md) !important;
  box-shadow: var(--pc-shadow-md) !important;
}

/* ——— Carte tableau ——— */
.card-grid {
  border-radius: var(--pc-radius-md) !important;
  box-shadow: var(--pc-shadow-md) !important;
  overflow: hidden;
}

/* Logo dans la navbar */
.brand-logo {
  max-height: 60px;
  width: auto;
  height: auto;
  display: block;
}

@media (max-width: 992px) {
  .brand-logo {
    max-height: 50px;
  }
}

/* Adapter la hauteur de la navbar */
.navbar {
  min-height: 60px;
}

.navbar-brand {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

/* Menu */
.navbar-nav .nav-link {
  padding: .5rem .75rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.navbar-nav .nav-link.active {
  color: var(--pc-primary);
}

.navbar-nav .nav-link:hover {
  color: var(--pc-primary);
  background: var(--pc-primary-bg);
  border-radius: var(--pc-radius-sm);
}

/* Breadcrumb personnalisé */
.breadcrumb {
  background-color: transparent;
  padding: 0;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: #6c757d;
}

.breadcrumb-item a {
  color: #0d6efd;
  text-decoration: none;
}

.breadcrumb-item a:hover {
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: #6c757d;
}

/* Cards */
.card {
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

/* Table et grilles */
.x-scroll.card {
  overflow-x: hidden;
  overflow-y: visible;
}

.grid {
  display: grid;
  width: 100%;
  align-items: stretch;
  grid-auto-rows: auto;
  grid-template-columns:
    100px              /* Date */
    minmax(0, 1.5fr)   /* Société */
    105px              /* SIREN */
    minmax(0, 1.1fr)   /* Nature */
    minmax(0, 1.5fr);  /* Activité */
  row-gap: 0;
}

.grid-header,
#gridBody {
  display: contents;
}

.grid-row {
  display: contents;
}

/* Effet hover sur les lignes */
.grid-row:hover .cell {
  background-color: var(--pc-primary-bg);
}

/* Lien entreprise — style moderne */
.cell a.company-link {
  color: var(--pc-900);
  text-decoration: none;
  font-weight: 700;
  font-size: .875rem;
  transition: color var(--pc-transition);
}
.cell a.company-link:hover {
  color: var(--pc-primary);
  text-decoration: none;
}
.cell a.company-link::after {
  content: '\F138';              /* bi-chevron-right */
  font-family: 'bootstrap-icons';
  font-size: .6rem;
  vertical-align: middle;
  margin-left: .3rem;
  opacity: 0;
  transition: opacity var(--pc-transition), transform var(--pc-transition);
  transform: translateX(-3px);
  display: inline-block;
  color: var(--pc-primary);
}
.cell a.company-link:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.cell {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 0;
  text-align: left;
  padding: .35rem .9rem;
  line-height: 1.35;
  border-bottom: 1px solid #f1f3f5;
  background: #fff;
  transition: background-color 0.2s ease;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  color: #495057;
}

.cell.wrap {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word;
}

.cell.nowrap {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell.th {
  font-weight: 700;
  cursor: pointer;
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
  border-bottom: 2px solid #e9ecef;
  user-select: none;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: #495057;
}

.cell.th:hover {
  background-color: #f8f9fa;
}

.cell.th i {
  opacity: .5;
  margin-left: .25rem;
  transition: opacity 0.2s ease;
  font-size: 0.875rem;
}

.cell.th:hover i {
  opacity: 1;
}

/* Badge pour nature procédure */
.badge-nature {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-nature.redressement {
  background-color: rgba(245,158,11,.12);
  color: #92400e;
  border: 1px solid rgba(245,158,11,.4);
}

.badge-nature.liquidation {
  background-color: rgba(239,68,68,.12);
  color: #991b1b;
  border: 1px solid rgba(239,68,68,.4);
}

.badge-nature.sauvegarde {
  background-color: rgba(16,185,129,.12);
  color: #065f46;
  border: 1px solid rgba(16,185,129,.4);
}

.badge-nature.conciliation {
  background-color: rgba(139,92,246,.12);
  color: #5b21b6;
  border: 1px solid rgba(139,92,246,.4);
}

/* États */
.empty {
  padding: 2rem 1rem;
  text-align: center;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  background-color: #f8f9fa;
  color: #6c757d;
}

.empty i {
  font-size: 3rem;
  opacity: 0.3;
  display: block;
  margin-bottom: 1rem;
}

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 1rem;
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
}

/* Buttons */
.btn {
  font-weight: 600;
  transition: all 0.2s ease;
}

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

.btn-primary:hover {
  background-color: var(--pc-primary-dark);
  border-color: var(--pc-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(30,64,175,.25);
}

.btn-outline-secondary:hover {
  transform: translateY(-1px);
}

/* Links */
.link-muted {
  color: #6c757d;
  text-decoration: none;
  transition: color 0.2s ease;
}

.link-muted:hover {
  color: #0d6efd;
  text-decoration: underline;
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
  height: 60px;
  margin-bottom: 0.5rem;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  max-width: 400px;
}

.toast-custom {
  background: white;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
  border-left: 4px solid #0d6efd;
  animation: slideInRight 0.3s ease;
}

.toast-custom.success {
  border-left-color: #198754;
}

.toast-custom.error {
  border-left-color: #dc3545;
}

.toast-custom.warning {
  border-left-color: #ffc107;
}

.toast-custom .btn-close {
  padding: 0;
  margin-left: auto;
}

@keyframes slideInRight {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateX(120%);
  }
}

/* Forms */
.form-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.5rem;
}

.form-select:focus,
.form-control:focus {
  border-color: var(--pc-primary);
  box-shadow: 0 0 0 3px rgba(30,64,175,.12);
}

/* Input groups */
.input-group-text {
  font-weight: 600;
  font-size: 0.875rem;
  background-color: #f8f9fa;
  border-color: #dee2e6;
}

/* Stats dans les filtres */
.small.text-secondary {
  font-size: 0.875rem;
}

.small.text-secondary span {
  font-weight: 600;
  color: #212529;
}

/* Alerts */
.alert {
  border-radius: 8px;
  border: none;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
}

/* Footer */
footer {
  background-color: #fff;
  border-top: 1px solid #dee2e6;
}

/* Icônes dans les titres */
h1 i, h2 i, h3 i, h4 i, h5 i, h6 i {
  vertical-align: middle;
}

/* Responsive */
@media (max-width: 992px) {
  .grid {
    grid-template-columns: 90px minmax(0,1.4fr) 95px minmax(0,1fr) minmax(0,1.4fr);
  }
}

@media (max-width: 768px) {
  .toast-container {
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .grid {
    display: block;
  }

  .grid-header {
    display: none;
  }

  .grid-row {
    display: block;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .grid-row:hover .cell {
    background: white;
  }

  .cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f3f5;
    min-height: auto;
  }

  .cell:last-child {
    border-bottom: none;
  }

  .cell::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6c757d;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
  }

  .cell.th {
    display: none;
  }

  /* Mobile: ajuster les badges */
  .badge-nature {
    margin-top: 0.25rem;
  }

  /* Mobile: breadcrumb plus compact */
  .breadcrumb {
    font-size: 0.75rem;
  }
}

/* Utilitaires */
.hover-primary:hover {
  color: #0d6efd !important;
}

/* Spinner Bootstrap customisé */
.spinner-border {
  vertical-align: middle;
}

/* Amélioration des tables Bootstrap si utilisées ailleurs */
.table {
  font-size: 0.9rem;
}

.table th {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: #495057;
}

/* ——— Page entreprise ——— */
.ent-hero {
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid #e9ecef;
}

.ent-name {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
}

.ent-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.ent-card-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6c757d;
  margin-bottom: .25rem;
}

.ent-card-value {
  font-weight: 700;
  font-size: 0.95rem;
  color: #212529;
}

/* Timeline procédures */
.ent-timeline {
  border-left: 3px solid #e9ecef;
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ent-timeline-item {
  position: relative;
}

.ent-timeline-item::before {
  content: '';
  position: absolute;
  left: -1.85rem;
  top: .35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #dee2e6;
  border: 2px solid #fff;
}

.ent-timeline-item.is-latest::before {
  background: var(--pc-primary);
}

.ent-timeline-date {
  font-size: 0.8rem;
  color: #6c757d;
  margin-bottom: .25rem;
}

.ent-timeline-content {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}