/* Overrides Tailwind / polish */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #D4C9B8; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #A89F92; }
::-webkit-scrollbar-track { background: transparent; }

input[type=number] { font-variant-numeric: tabular-nums; }
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }

.htmx-request { opacity: 0.6; }
.htmx-request.htmx-indicator { opacity: 1; }

/* ── V0.3 Toast notifications ────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: calc(100vw - 3rem);
}
.toast {
  background: #1A1A1A;
  color: #F5F0E8;
  padding: 0.7rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 6px 24px -4px rgba(0,0,0,.35);
  border-left: 4px solid #6B7B8C;
  transform: translateX(20px);
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
  pointer-events: auto;
  min-width: 260px;
  max-width: 380px;
}
.toast-visible { transform: translateX(0); opacity: 1; }
.toast-success { border-left-color: #16A34A; }
.toast-error   { border-left-color: #DC2626; }
.toast-warning { border-left-color: #D97706; }
.toast-info    { border-left-color: #2563EB; }

/* ── V0.3 SortableJS drag&drop visuels ────────────────────────────── */
.sortable-ghost {
  opacity: 0.35;
  background: #EBE3D4 !important;
}
.sortable-drag {
  cursor: grabbing;
  box-shadow: 0 14px 40px -8px rgba(0,0,0,.35) !important;
  transform: rotate(-1.5deg);
}
.kanban-card-handle { cursor: grab; }
.kanban-card-handle:active { cursor: grabbing; }
.kanban-col-body.drag-over {
  background: rgba(198, 139, 60, 0.07);
  border-radius: 0.5rem;
}

/* ── V0.3 Lista style Excel ───────────────────────────────────────── */
.tbl-excel {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.tbl-excel thead {
  background: #1E2640;
  color: #F5F0E8;
  position: sticky;
  top: 0;
  z-index: 5;
}
.tbl-excel th {
  padding: 0.55rem 0.7rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-right: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
}
.tbl-excel tbody tr {
  border-bottom: 1px solid #EBE3D4;
  transition: background .15s ease;
}
.tbl-excel tbody tr:nth-child(even) { background: #FAF7F0; }
.tbl-excel tbody tr:hover { background: #FFF6E0; }
.tbl-excel td {
  padding: 0.45rem 0.7rem;
  border-right: 1px solid #EBE3D4;
  white-space: nowrap;
}
.tbl-excel td.col-num { font-family: 'JetBrains Mono', monospace; }
.tbl-excel .sla-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.4rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}
.tbl-excel .sla-verde   { background: #DCFCE7; color: #166534; }
.tbl-excel .sla-naranja { background: #FED7AA; color: #9A3412; }
.tbl-excel .sla-rojo    { background: #FECACA; color: #991B1B; }
.tbl-excel .sla-gris    { background: #E5E7EB; color: #475569; }

/* ── V0.3 Cloche notifications dropdown ───────────────────────────── */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 22rem;
  max-width: calc(100vw - 2rem);
  background: white;
  border: 1px solid #EBE3D4;
  border-radius: 0.5rem;
  box-shadow: 0 18px 50px -8px rgba(0,0,0,.25);
  z-index: 50;
  max-height: 70vh;
  overflow-y: auto;
}
/* V0.7 (hotfix) — cloche dans le cadre profil (bas de sidebar) : le dropdown
   s'ouvre vers la DROITE de la cloche, aligné en bas (ne sort pas par le bas). */
.notif-dd-sidebar .notif-dropdown {
  top: auto;
  bottom: 0;
  left: calc(100% + 0.5rem);
  right: auto;
  width: 20rem;
  max-width: calc(100vw - 5rem);
}
.notif-item {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #F5F0E8;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: background .15s ease;
}
.notif-item:hover { background: #FAF7F0; }
.notif-item.is-unread { background: #FFF6E0; }
.notif-badge {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  background: #DC2626;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 9999px;
  padding: 0.05rem 0.35rem;
  min-width: 1.1rem;
  text-align: center;
  line-height: 1.1;
}
[x-cloak] { display: none !important; }

/* ── V2.9 (récupération V2.7) — workflow steps : PAS de line-through, animation check-pop ── */
.workflow-step--completado .step-label { color: rgb(75, 85, 99); text-decoration: none !important; }
.workflow-step--completado { background: rgba(34, 197, 94, 0.05); }
.workflow-step--en_curso { background: rgba(99, 102, 241, 0.08); border-left: 3px solid rgb(99, 102, 241); }
.workflow-step--atrasado { background: rgba(239, 68, 68, 0.06); border-left: 3px solid rgb(239, 68, 68); }

@keyframes check-pop {
  0%   { transform: scale(0) rotate(-45deg); opacity: 0; }
  50%  { transform: scale(1.3) rotate(0deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.check-pop-in { animation: check-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
  50%      { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.18); }
}
.glow-success { animation: glow-pulse 1.2s ease-out; }

/* Badges retard cumulé (V2.9 vague 2) — gravité low/medium/high */
.badge-retard { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.7rem; font-weight: 700;
  border-radius: 9999px; padding: 0.1rem 0.45rem; line-height: 1.1; white-space: nowrap; }
.badge-retard--low    { background: rgb(254, 243, 199); color: rgb(146, 64, 14); }
.badge-retard--medium { background: rgb(255, 237, 213); color: rgb(154, 52, 18); }
.badge-retard--high   { background: rgb(254, 226, 226); color: rgb(153, 27, 27); animation: glow-pulse 1.6s ease-out infinite; }
