/* ====== Ars Longa — Brand layer (non intrusif) ====== */

/* --- Topbar ---
   Suit desormais les couleurs de marque du design system centralise
   (--brand/--brand-ink, definies dans ui.css et pilotees depuis
   AL-HUB > Admin > Apparence > Couleurs) au lieu d'un instantane fige de
   ces memes couleurs — integration HUB du 30.08.2026. Le fallback
   conserve exactement les valeurs precedentes, donc aucun changement
   visuel tant que ui.css n'est pas charge ou que la teinte HUB ne change
   pas. */
.topbar{
  background:var(--brand, #010a2c);
  color:var(--brand-ink, #fef5d3);
}
.topbar a, .topbar .nav a, .topbar .menu a{
  color:var(--brand-ink, #fef5d3);
  text-decoration:none;
}
.topbar a:hover{ opacity:.9; }
.topbar .btn, .topbar button{
  background:transparent;
  border:1px solid rgba(254,245,211,.3);
  color:var(--brand-ink, #fef5d3);
  border-radius:10px;
  padding:6px 10px;
}
.topbar .btn:hover{ background:rgba(254,245,211,.08); }

/* --- Boutons standards (y compris “Nouvelle tâche”, “Afficher”, “Éditer”) --- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  border-radius:10px; padding:8px 12px; cursor:pointer;
  border:1px solid var(--line, #e5e7eb); background:var(--card, #fff); color:var(--ink, #111);
  text-decoration:none; line-height:1.2; font-size:14px;
}
/* Anneau de focus aligne sur l'accent du design system (comme .al-input:focus
   dans ui.css) au lieu d'un bleu Tailwind sans rapport avec la charte —
   integration HUB, chantier 3, 30.08.2026. */
.btn:focus{outline:2px solid var(--accent-600, #3b82f6); outline-offset:1px;}
a.btn, a.btn:link, a.btn:visited{ text-decoration:none; }
/* .btn-primary et .btn-danger (base) sont entierement masquees par les regles
   du meme nom dans webapp.css, chargee juste apres (memes 3 proprietes
   redefinies a chaque fois) - laissees telles quelles, jamais rendues.
   Integration HUB, chantier 3, 30.08.2026 - ne pas "corriger" leurs couleurs,
   ca n'aurait aucun effet visuel ; supprimer un jour si confirme inutile. */
.btn-primary{background:#3b82f6; border-color:#3b82f6; color:#fff;}
.btn-primary:hover{background:#2563eb; border-color:#2563eb;}
.btn-outline{background:var(--card, #fff); border-color:var(--line, #cbd5e1); color:var(--ink, #0f172a);}
.btn-outline:hover{background:#f8fafc;}
.btn-danger{background:#ef4444; border-color:#ef4444; color:#fff;}
/* .btn-danger:hover, contrairement a la regle de base, EST rendue : le
   pseudo-classe :hover la rend plus specifique que le .btn-danger de
   webapp.css, qui gagne sinon. Alignee sur le meme procede que
   .btn-primary:hover de webapp.css (assombrir la couleur active via un
   filtre plutot qu'une teinte figee) - integration HUB, chantier 3,
   30.08.2026. */
.btn-danger:hover{filter:brightness(0.92);}
.btn-sm{padding:6px 10px; font-size:13px;}
.btn-lg{padding:10px 14px; font-size:15px;}

/* --- Tableaux --- */
.table{width:100%; border-collapse:collapse; font-size:14px;}
.table thead tr{background:#f8fafc;}
.table th,.table td{padding:8px 10px; border-bottom:1px solid var(--line, #e5e7eb); text-align:left;}
.table tbody tr:hover{background:#f5f7ff;}
.table th:last-child,.table td:last-child{text-align:right;}
/* Meme teinte que le badge TomSelect de layouts/webapplayout.blade.php
   (chantier 3, meme jour) - un seul "badge indigo" recolore de la meme facon
   partout dans Webapp. */
.table .badge{display:inline-block; padding:3px 8px; border-radius:999px; background:var(--accent-50, #eef2ff); color:var(--accent-700, #3730a3); font-size:12px;}

/* --- Utilitaires génériques (repris partout dans les vues) --- */
.muted{color:var(--muted, #6b7280);}
.nowrap{white-space:nowrap;}
.num{text-align:right; font-variant-numeric:tabular-nums;}
/* .ok/.err : meme traitement que .al-alert.ok/.err de ui.css (fond tinte +
   bordure pleine de la couleur de statut) - chantier 3, 30.08.2026. */
.ok{padding:10px 14px; border-radius:8px; background:var(--success-bg, #ecfdf5); color:var(--success-text, #065f46); border:1px solid var(--success, #a7f3d0); margin-bottom:12px;}
.err{padding:10px 14px; border-radius:8px; background:var(--danger-bg, #fef2f2); color:var(--danger-text, #991b1b); border:1px solid var(--danger, #fecaca); margin-bottom:12px;}

/* Conteneur de tableau */
.table-card{border:1px solid var(--line, #e5e7eb); border-radius:12px; background:var(--card, #fff); overflow:hidden;}

/* --- Fallback tables (si la vue n’ajoute pas .table) --- */
.card table, .table-card table, .content table { width:100%; border-collapse:collapse; font-size:14px; }
.card table thead tr, .table-card table thead tr, .content table thead tr { background:#f8fafc; }
.card table th, .card table td, .table-card table th, .table-card table td, .content table th, .content table td {
  padding:8px 10px; border-bottom:1px solid var(--line, #e5e7eb); text-align:left;
}
.card table tbody tr:hover, .table-card table tbody tr:hover, .content table tbody tr:hover { background:#f5f7ff; }
.card table th:last-child, .card table td:last-child, .table-card table th:last-child, .table-card table td:last-child,
.content table th:last-child, .content table td:last-child { text-align:right; }

/* Actions en colonnes : <a> rendus comme des boutons outline sm */
.table .actions, .card table .actions, .content table .actions {
  display:flex; gap:8px; justify-content:flex-end;
}
.table .actions a, .card table .actions a, .content table .actions a{
  text-decoration:none;
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  padding:6px 10px; border-radius:10px; border:1px solid var(--line, #cbd5e1); background:var(--card, #fff); color:var(--ink, #0f172a);
  font-size:13px; line-height:1.2;
}
.table .actions a:hover, .card table .actions a:hover, .content table .actions a:hover{ background:#f8fafc; }

/* --- Formulaires (pages d’ajout / consultation) --- */
.form-card{background:var(--card, #fff); border:1px solid var(--line, #e5e7eb); border-radius:12px; padding:16px;}
.form-grid{display:grid; gap:12px;}
.form-grid.cols-2{grid-template-columns:1fr 1fr;}
@media (max-width: 991.98px){ .form-grid.cols-2{grid-template-columns:1fr;} }
.form-row{display:flex; flex-direction:column; gap:6px;}
/* Libelle en gris ardoise fonce+gras (pas var(--muted), plus clair, qui
   allegerait la hierarchie visuelle des formulaires) - garde tel quel,
   distinct du .al-label plus discret de ui.css, chantier 3, 30.08.2026. */
.form-row label{font-weight:600; color:#334155;}
.form-row input[type="text"], .form-row input[type="email"], .form-row input[type="date"],
.form-row input[type="number"], .form-row input[type="password"], .form-row select, .form-row textarea{
  border:1px solid var(--line, #cbd5e1); border-radius:10px; padding:8px 10px; background:var(--card, #fff); color:var(--ink, #0f172a);
}
.form-row textarea{min-height:110px;}
.help{color:var(--muted, #64748b); font-size:13px;}

/* Groupe d’actions (une seule définition, utilisée partout) */
.form-actions, .btn-row, .settings-actions{
  display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-top:12px;
}
.form-actions .btn + .btn, .btn-row .btn + .btn, .settings-actions .btn + .btn{ margin-left:0; } /* gap gère l’écart */

/* --- Alerts --- */
.alert{border-radius:10px; padding:10px 12px;}
.alert-success{background:var(--success-bg, #f0fdf4); color:var(--success-text, #166534); border:1px solid var(--success, #bbf7d0);}
.alert-danger{background:var(--danger-bg, #fef2f2); color:var(--danger, #b91c1c); border:1px solid var(--danger, #fecaca);}

/* --- Menu vertical (Discussions / Settings-like) --- */
.menu.nav-vertical a{
  display:block; padding:8px 10px; border-radius:8px; text-decoration:none; color:inherit;
}
.menu.nav-vertical a:hover{ background:#f5f5f5; }

/* Masquer l’ancien reset sous le formulaire (on l’a déplacé) */
.filters-reset-outside{ display:none; }

/* ================================
   Demandes > Filtres (clean & unique)
   ================================ */
.filters-inline{
  display:flex; flex-wrap:wrap; gap:10px; align-items:flex-end;
}
/* Tous les enfants directs (même si .col-*) : largeur homogène, responsive */
.filters-inline > *,
.filters-inline > [class^="col-"],
.filters-inline > [class*=" col-"]{
  flex: 1 1 260px;   /* base */
  min-width:220px;   /* pas trop petit */
  max-width:320px;   /* pas trop grand */
}
/* Les contrôles s’étirent à 100% dans leur bloc */
.filters-inline input[type="text"],
.filters-inline input[type="date"],
.filters-inline input[type="number"],
.filters-inline select,
.filters-inline .form-control,
.filters-inline .input-group{ width:100%; }
/* Évite d’anciens “verrous” de largeur */
.filters-inline select[name="funder_id"],
.filters-inline select[name="funders[]"],
.filters-inline .filter-wide{ min-width:unset; max-width:unset; }
/* 2e ligne : actions à droite */
.filters-actions{
  flex:1 1 100%;
  display:flex; gap:10px; justify-content:flex-end;
  margin-top:6px;
}

/* ================================
   Espacement robuste des actions (incl. Settings)
   ================================ */
.proj-main a.btn, .proj-main button.btn{
  display:inline-flex; align-items:center; justify-content:center; white-space:nowrap;
}
.proj-main a.btn, .proj-main form.d-inline, .proj-main form.d-inline-block{
  margin-right:10px; margin-bottom:8px;
}
.proj-main .d-flex, .proj-main .btn-row, .proj-main .form-actions{
  gap:10px; flex-wrap:wrap;
}

/* === Demandes > Filtres (grid 4 colonnes + hauteurs uniformes) === */
.filters-inline{
  display:grid;
  grid-template-columns: repeat(4, minmax(200px,1fr));
  gap:12px 10px;
  align-items:end;
}
.filters-inline > *{ min-width:0; } /* permet aux blocs de rétrécir harmonieusement */
.filters-actions{
  grid-column: 1 / -1;               /* actions sur toute la ligne */
  display:flex; gap:10px; justify-content:flex-end; margin-top:0;
}
/* Hauteurs homogènes champs / boutons */
.filters-inline .form-select,
.filters-inline .form-control{ height:38px; }
.filters-inline .btn{ height:38px; line-height:36px; }

/* Responsif : passe à 3 / 2 / 1 colonnes si la place manque */
@media (max-width: 1200px){ .filters-inline{ grid-template-columns: repeat(3, minmax(200px,1fr)); } }
@media (max-width: 900px) { .filters-inline{ grid-template-columns: repeat(2, minmax(200px,1fr)); } }
@media (max-width: 600px) { .filters-inline{ grid-template-columns: 1fr; } }


/* === Demandes > Filtres : actions alignées à droite + même hauteur === */
.filters-actions{
  grid-column: 1 / -1;
  display:flex;
  justify-content:flex-end;   /* aligne à droite */
  align-items:center;
  gap:10px;
  margin-top:0;
}
.filters-actions .btn{
  display:inline-flex;
  align-items:center;         /* centre vertical */
  justify-content:center;
  height:38px;                /* même hauteur que les selects */
  line-height:36px;           /* compense le border:1px */
  padding:0 12px;             /* garde la même hauteur totale */
  box-sizing:border-box;      /* sécurité sur le calcul hauteur */
}

/* Demandes (bloc filtres façon "On tour") : hauteur cohérente + alignement parfait */
.card .form-select, .card .form-control{ height:38px; }
.card .btn{ height:38px; padding:0 12px; line-height:36px; }


/* ==== Modèle commun : sections de filtres (4 colonnes) ====
   Bloc entierement remplace par "Uniformisation exacte des filtres"
   juste en dessous (memes selecteurs, memes proprietes, plus bas dans le
   fichier = plus specifique a egalite) : aucune couleur d'ici n'est jamais
   rendue. Laisse tel quel (pas de "correction" utile), chantier 3,
   30.08.2026 - a supprimer un jour si confirme inutile. ==== */
.filters-section{
  padding:16px; border:1px solid var(--border, #e5e7eb); border-radius:12px; background:#fff;
}
.filters-grid{
  display:grid; grid-template-columns:repeat(4,1fr); gap:12px;
}
@media (max-width: 1100px){
  .filters-grid{ grid-template-columns:repeat(2,1fr); }
}
@media (max-width: 640px){
  .filters-grid{ grid-template-columns:1fr; }
}
.filters-section .muted{
  color:#6b7280; font-size:12px; line-height:1; padding:2px 0 0;
}
.filters-section select,
.filters-section input[type="text"],
.filters-section input[type="search"],
.filters-section input[type="date"]{
  width:100%; height:40px; padding:8px 10px;
  border:1px solid #e5e7eb; border-radius:8px; background:#fff; font-size:14px;
}
.filters-actions{
  display:flex; gap:8px; justify-content:flex-end; align-items:stretch; margin-top:12px;
}
.filters-actions .btn{ height:40px; }

/* ==== Uniformisation exacte des filtres (modèle On tour) ==== */
.filters-section{
  padding: 0;               /* pas de carte visuelle, comme On tour */
  background: transparent;
  border: 0;
}
.filters-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;                /* On tour: espacement compact */
  align-items: end;         /* aligne champs uniformément */
}
@media (max-width:1100px){ .filters-grid{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:640px) { .filters-grid{ grid-template-columns:1fr; } }

.filters-section .muted{
  color: var(--muted, #6b7280);
  font-size: 12px;
  line-height: 1;
  margin-bottom: -2px;      /* labels visuellement proches du champ */
}

.filters-section select,
.filters-section input[type="text"],
.filters-section input[type="search"],
.filters-section input[type="date"]{
  width: 100%;
  height: 40px;             /* hauteur uniforme avec les boutons */
  padding: 8px 10px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 8px;
  background: var(--card, #fff);
  font-size: 14px;
}

.filters-actions{
  display: flex;
  gap: 8px;
  justify-content: flex-end;  /* boutons à droite, comme On tour */
  align-items: stretch;
  margin-top: 8px;
}
.filters-actions .btn{
  height: 40px;               /* même hauteur que les champs */
  line-height: 40px;          /* aligne verticalement le texte */
  padding: 0 14px;            /* compacité On tour */
}
