/*!
 * URBA 2026 — custom.css
 * Thème global Bootstrap 5.3.x (mobile-first)
 * Dépose ce fichier dans /assets/custom.css (ou adapte le chemin dans inc/layout.php)
 */

/* --- Variables & couleurs (Bootstrap 5.3 color modes) --- */
:root,
[data-bs-theme="light"]{
  /* Couleurs appli */
  --app-bg: #f6f8fb;
  --app-card: #ffffff;
  --app-border: #e6edf5;
  --app-muted: #64748b;
  --app-title: #0f172a;

  --app-primary: #4f46e5;   /* indigo */
  --app-info:    #0ea5e9;   /* cyan */
  --app-success: #10b981;
  --app-warning: #f59e0b;
  --app-danger:  #ef4444;

  --app-radius: 16px;
  --app-radius-sm: 12px;
  --app-shadow: 0 10px 25px rgba(15,23,42,.06);

  /* Timeline (ticket / track) */
  --commentaire: var(--app-info);
  --maj: #94a3b8;

  /* Override Bootstrap (via CSS variables) */
  --bs-primary: var(--app-primary);
  --bs-primary-rgb: 79,70,229;
  --bs-link-color: var(--app-primary);
  --bs-link-hover-color: #4338ca;

  /* Forms */
  --bs-border-radius: 0.9rem;      /* ~14px */
  --bs-border-radius-sm: 0.75rem;
  --bs-border-radius-lg: 1rem;
  --bs-focus-ring-color: rgba(79,70,229,.18);
}

[data-bs-theme="dark"]{
  --app-bg: #0b1220;
  --app-card: #0f172a;
  --app-border: rgba(148,163,184,.18);
  --app-muted: #94a3b8;
  --app-title: #e2e8f0;

  --app-shadow: 0 10px 25px rgba(0,0,0,.35);

  --bs-link-color: #a5b4fc;
  --bs-link-hover-color: #c7d2fe;
  --bs-focus-ring-color: rgba(165,180,252,.22);
}

/* --- Base --- */
html{ scroll-behavior: smooth; }
body{
  background: var(--app-bg);
  color: var(--app-title);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a{ text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover{ text-decoration-thickness: .12em; }

::selection{ background: rgba(79,70,229,.20); }
*{ -webkit-tap-highlight-color: transparent; }

/* --- Layout helpers --- */
.wrap,
.app-wrap{
  max-width: 1280px;
  margin: 0 auto;
}
main.container{
  padding-top: 1rem;
  padding-bottom: 2rem;
}

/* --- Navbar --- */
.navbar.bg-body-tertiary{
  /* look “app” + lisible sur mobile */
  background-color: rgba(var(--bs-body-bg-rgb), .88) !important;
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid rgba(148,163,184,.18);
}
.navbar .navbar-brand .logo{
  font-weight: 900;
  letter-spacing: .02em;
  line-height: 1;
}
.navbar .btn{
  border-radius: 999px;
}

/* --- Cards / panels --- */
.card,
.ticket-card,
.cardx,
.dashboard-card,
.table-container,
.app-card{
  background: var(--app-card);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
}
.card.shadow-sm{ box-shadow: var(--app-shadow) !important; }
.card .card-header{
  background: transparent;
  border-bottom: 1px solid rgba(148,163,184,.18);
}

/* --- Titles / labels --- */
.section-label{
  font-size: .75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--app-muted);
  margin-bottom: .75rem;
  display:block;
}

/* --- Forms --- */
.form-control,
.form-select,
.input-group-text{
  border-radius: 0.85rem;
}
.form-control,
.form-select{
  border-width: 1.5px;
}
.form-control:focus,
.form-select:focus{
  box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color);
  border-color: rgba(var(--bs-primary-rgb), .55);
}
.form-control::placeholder{ color: rgba(100,116,139,.75); }
[data-bs-theme="dark"] .form-control::placeholder{ color: rgba(148,163,184,.65); }

.btn{
  border-radius: 0.9rem;
  font-weight: 700;
}
.btn-action{ font-weight: 800; }
.btn-outline-primary{ --bs-btn-border-color: rgba(var(--bs-primary-rgb), .45); }
.btn-outline-primary:hover{ --bs-btn-border-color: rgba(var(--bs-primary-rgb), .65); }

/* --- Alerts --- */
.alert{
  border-radius: var(--app-radius-sm);
  border-width: 1px;
  box-shadow: 0 6px 18px rgba(15,23,42,.06);
}
[data-bs-theme="dark"] .alert{
  box-shadow: 0 10px 25px rgba(0,0,0,.35);
}

/* --- Description / blocs texte --- */
.description-box,
.desc{
  background: rgba(241,245,249,.85);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  padding: 1rem;
  line-height: 1.55;
}
[data-bs-theme="dark"] .description-box,
[data-bs-theme="dark"] .desc{
  background: rgba(2,6,23,.35);
}

/* --- Map --- */
.mapbox{
  height: 300px;
  border-radius: var(--app-radius);
  overflow: hidden;
  border: 1px solid rgba(148,163,184,.18);
  box-shadow: 0 6px 18px rgba(15,23,42,.08);
}
[data-bs-theme="dark"] .mapbox{
  box-shadow: 0 10px 25px rgba(0,0,0,.35);
}

/* --- Thumbnails grid --- */
.thumb-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.thumb-grid img{
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,.9);
  box-shadow: 0 6px 14px rgba(15,23,42,.10);
  transition: transform .15s ease, filter .15s ease;
}
.thumb-grid img:hover{
  transform: translateY(-2px);
  filter: brightness(.96);
}

/* --- Tables (admin) --- */
.table-container{ overflow: hidden; }
.table{ margin-bottom: 0; }
.table thead th{
  background: rgba(248,250,252,.9);
  color: var(--app-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 1rem;
  border-bottom: 2px solid rgba(226,232,240,.9);
}
[data-bs-theme="dark"] .table thead th{
  background: rgba(2,6,23,.25);
  border-bottom-color: rgba(148,163,184,.18);
}
.table tbody td{
  padding: 1rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(241,245,249,.95);
}
[data-bs-theme="dark"] .table tbody td{
  border-bottom-color: rgba(148,163,184,.14);
}
.table tbody tr:hover{
  background: rgba(79,70,229,.04);
}
[data-bs-theme="dark"] .table tbody tr:hover{
  background: rgba(165,180,252,.06);
}

/* --- Badges / pills (users.php etc) --- */
.user-avatar{
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-weight: 900;
  border: 1px solid rgba(var(--bs-primary-rgb), .18);
  background: rgba(var(--bs-primary-rgb), .08);
  color: var(--bs-primary);
}
.role-badge{
  background: rgba(148,163,184,.14);
  color: rgba(51,65,85,.95);
  font-weight: 800;
  font-size: 0.70rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.18);
}
.status-pill{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: .75rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.20);
  background: rgba(248,250,252,.85);
  color: rgba(51,65,85,.95);
}
[data-bs-theme="dark"] .role-badge,
[data-bs-theme="dark"] .status-pill{
  background: rgba(2,6,23,.25);
  color: var(--app-title);
}

/* --- Timeline (ticket.php / track.php) --- */
.timeline-wrap{ position: relative; padding: 8px 6px 6px 6px; }
.timeline{
  position: relative;
  margin: 0;
  padding: 0 0 0 22px;
  list-style: none;
}
.timeline::before{
  content:"";
  position:absolute;
  left: 10px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, rgba(148,163,184,.35), rgba(148,163,184,.10));
  border-radius: 999px;
}
.titem{ position: relative; padding: 12px 0; }
.tdot{
  position:absolute;
  left: 2px;
  top: 18px;
  width: 18px; height: 18px;
  border-radius: 999px;
  background: var(--app-card);
  border: 2px solid var(--maj);
  box-shadow: 0 6px 14px rgba(15,23,42,.10);
}
.tdot.commentaire{ border-color: var(--commentaire); }
.tdot.maj{ border-color: var(--maj); }

.tcard{
  margin-left: 12px;
  background: var(--app-card);
  border: 1px solid rgba(148,163,184,.18);
  border-radius: var(--app-radius-sm);
  padding: 12px;
  box-shadow: 0 8px 18px rgba(15,23,42,.05);
}
[data-bs-theme="dark"] .tcard{ box-shadow: 0 10px 25px rgba(0,0,0,.35); }

.tmeta{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.tleft{ display:flex; align-items:center; gap: 8px; min-width:0; flex-wrap: wrap; }
.ttime{ font-size:.75rem; color: var(--app-muted); white-space: nowrap; }
.tbody{
  font-size:.92rem;
  color: var(--app-title);
  white-space: pre-wrap;
  line-height: 1.45;
}
.tright{ display:flex; align-items:center; gap: 10px; flex-wrap: wrap; }

.badgetype,
.badgevis{
  font-size:.70rem;
  font-weight: 900;
  letter-spacing: .06em;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(248,250,252,.85);
  color: rgba(51,65,85,.95);
}
.badgetype.commentaire{
  background: rgba(14,165,233,.10);
  border-color: rgba(14,165,233,.22);
  color: #075985;
}
.badgetype.maj{
  background: rgba(148,163,184,.18);
  border-color: rgba(148,163,184,.28);
  color: rgba(51,65,85,.95);
}
.badgevis.public{
  background: rgba(16,185,129,.10);
  border-color: rgba(16,185,129,.22);
  color: #065f46;
}
.badgevis.private{
  background: rgba(245,158,11,.12);
  border-color: rgba(245,158,11,.25);
  color: #92400e;
}
[data-bs-theme="dark"] .badgetype,
[data-bs-theme="dark"] .badgevis{
  background: rgba(2,6,23,.25);
  color: var(--app-title);
}

/* --- Modal photo (ticket) --- */
.modal-photo-view .modal-content{ background: transparent; border: none; }
#modalImage{
  border-radius: var(--app-radius);
  max-height: 85vh;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  display: block;
}
.modal-backdrop.show{ opacity: .85; }

/* --- Responsive polish (mobile-first) --- */
@media (max-width: 575.98px){
  main.container{ padding-top: .75rem; padding-left: .75rem; padding-right: .75rem; }
  .navbar .btn{ padding: .35rem .6rem; }
  .thumb-grid{ grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .mapbox{ height: 240px; }
  .tcard{ padding: 10px; }
  .table thead th{ padding: .85rem .75rem; }
  .table tbody td{ padding: .85rem .75rem; }
}

/* Respect du “reduced motion” */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ transition: none !important; }
}




  :root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-app: #f1f5f9;
    --radius: 16px;
  }

  body {
    background-color: var(--bg-app);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #1e293b;
    padding-top: 20px;
  }

  .page-header { margin-bottom: 2rem; }
  .page-header h1 { font-weight: 800; letter-spacing: -0.02em; color: #0f172a; }

  .report-container {
    background: #ffffff;
    border-radius: var(--radius);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
    padding: 2.5rem;
    margin-bottom: 3rem;
  }

  .form-label {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #64748b;
    margin-bottom: 0.6rem;
  }

  .form-control, .form-select {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .form-control:focus, .form-select:focus {
    background-color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
  }

  /* ✅ Champ lieu totalement non éditable côté UI */
  #address[readonly]{
    cursor: not-allowed;
    user-select: text;
    -webkit-user-select: text;
  }

  .upload-zone {
    border: 2px dashed #e2e8f0;
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    background: #f8fafc;
    transition: all 0.2s;
    cursor: pointer;
  }
  .upload-zone:hover { border-color: var(--primary); background: #f5f3ff; }

  .thumb-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: none;
  }
  .thumb-grid::-webkit-scrollbar { display: none; }
  .thumb-grid img {
    flex: 0 0 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  }

  .mapbox { height: 350px; border-radius: var(--radius); filter: grayscale(0.2); }
  #geoStatus { border-radius: 12px; border: none; font-size: 0.9rem; }

  .btn-primary {
    background-color: var(--primary);
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.39);
  }
  .btn-primary:hover { background-color: var(--primary-hover); transform: translateY(-1px); }

  .btn-light {
    background-color: #f1f5f9;
    border: none;
    color: #475569;
    font-weight: 600;
  }

  .mairie-pill {
    display:flex; align-items:center; gap:.6rem;
    padding: .85rem 1rem;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 14px;
    box-shadow: 0 8px 16px -12px rgba(0,0,0,0.2);
    margin-bottom: 1rem;
  }

  @media (max-width: 768px) {
    body { padding-top: 10px; }
    .report-container { padding: 1.5rem; border-radius: 0; border: none; background: transparent; box-shadow: none; }
    .form-control, .form-select { font-size: 16px; }
    .mapbox { height: 250px; }
    .fixed-bottom-mobile {
      position: fixed; bottom: 0; left: 0; right: 0;
      background: white; padding: 15px; border-top: 1px solid #e2e8f0; z-index: 1050;
    }
    .spacer-bottom { height: 210px; }
  }


  :root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-app: #f1f5f9;
    --radius: 16px;
  }

  body {
    background-color: var(--bg-app);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #1e293b;
    padding-top: 20px;
  }

  .page-header { margin-bottom: 2rem; }
  .page-header h1 { font-weight: 800; letter-spacing: -0.02em; color: #0f172a; }

  .report-container {
    background: #ffffff;
    border-radius: var(--radius);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
    padding: 2.5rem;
    margin-bottom: 3rem;
  }

  .form-label {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #64748b;
    margin-bottom: 0.6rem;
  }

  .form-control, .form-select {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .form-control:focus, .form-select:focus {
    background-color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
  }

  /* ✅ Champ lieu totalement non éditable côté UI */
  #address[readonly]{
    cursor: not-allowed;
    user-select: text;
    -webkit-user-select: text;
  }

  .upload-zone {
    border: 2px dashed #e2e8f0;
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    background: #f8fafc;
    transition: all 0.2s;
    cursor: pointer;
  }
  .upload-zone:hover { border-color: var(--primary); background: #f5f3ff; }

  .thumb-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: none;
  }
  .thumb-grid::-webkit-scrollbar { display: none; }
  .thumb-grid img {
    flex: 0 0 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  }

  .mapbox { height: 350px; border-radius: var(--radius); filter: grayscale(0.2); }
  #geoStatus { border-radius: 12px; border: none; font-size: 0.9rem; }

  .btn-primary {
    background-color: var(--primary);
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.39);
  }
  .btn-primary:hover { background-color: var(--primary-hover); transform: translateY(-1px); }

  .btn-light {
    background-color: #f1f5f9;
    border: none;
    color: #475569;
    font-weight: 600;
  }

  .mairie-pill {
    display:flex; align-items:center; gap:.6rem;
    padding: .85rem 1rem;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 14px;
    box-shadow: 0 8px 16px -12px rgba(0,0,0,0.2);
    margin-bottom: 1rem;
  }

  @media (max-width: 768px) {
    body { padding-top: 10px; }
    .report-container { padding: 1.5rem; border-radius: 0; border: none; background: transparent; box-shadow: none; }
    .form-control, .form-select { font-size: 16px; }
    .mapbox { height: 250px; }
    .fixed-bottom-mobile {
      position: fixed; bottom: 0; left: 0; right: 0;
      background: white; padding: 15px; border-top: 1px solid #e2e8f0; z-index: 1050;
    }
    .spacer-bottom { height: 210px; }
  }
:root {
    --admin-bg: #f4f7fa;
    --primary-indigo: #4f46e5;
  }
  body { background-color: var(--admin-bg); font-family: 'Inter', system-ui, -apple-system, sans-serif; }

  .dashboard-card {
    background: white; border: none; border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  }

  .table thead th {
    background: #f8fafc; color: #64748b; font-weight: 600;
    text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.05em;
    padding: 15px; border-bottom: 2px solid #edf2f7;
  }

  .ticket-id { font-weight: 700; color: var(--primary-indigo); font-family: monospace; }

  .img-thumb-admin {
    width: 50px; height: 50px; object-fit: cover; border-radius: 8px;
    transition: transform 0.2s; cursor: pointer; border: 1px solid #eee;
  }
  .img-thumb-admin:hover { transform: scale(1.1); }

  .truncate-multiline {
    display: -webkit-box; -webkit-box-orient: vertical;
    overflow: hidden; font-size: 0.85rem; color: #475569;
  }

  .action-btn { border-radius: 8px; padding: 6px 12px; transition: all 0.2s; }

  /* Custom Scrollbar */
  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

  /* Filter bar */
  .filter-bar form { margin: 0; }
  .filter-bar .filter-select { min-width: 170px; }
  .filter-bar .filter-label{
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    line-height: 1;
  }
  .filter-bar .filter-label::after{ content: " :"; }

  @media (max-width: 576px) {
    .filter-bar { gap: 10px !important; }
    .filter-bar .filter-select { min-width: 140px; }
  }

  /* Mobile table -> cards */
  @media (max-width: 768px) {
    .container-fluid { padding-left: 12px; padding-right: 12px; }
    h1.h3 { font-size: 1.25rem; }

    .dashboard-card { padding: 12px !important; }
    .action-btn { padding: 8px 12px; }

    #prosTable thead { display: none; }

    #prosTable tbody tr {
      display: block;
      margin: 0 0 12px 0;
      background: #fff;
      border: 1px solid #e5e7eb;
      border-radius: 14px;
      overflow: hidden;
      box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    }

    #prosTable tbody td {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 10px;
      padding: 10px 12px;
      border-top: 1px solid #f1f5f9;
      white-space: normal;
    }
    #prosTable tbody td:first-child {
      border-top: 0;
      background: #f8fafc;
    }

    #prosTable tbody td::before {
      content: attr(data-label);
      flex: 0 0 42%;
      font-weight: 700;
      color: #64748b;
      text-transform: uppercase;
      font-size: 0.65rem;
      letter-spacing: 0.06em;
      padding-top: 2px;
    }

    #prosTable tbody td > * { flex: 1 1 auto; min-width: 0; }
    .img-thumb-admin { width: 44px; height: 44px; border-radius: 10px; }
    #prosTable tbody td[data-label="Actions"] { justify-content: flex-end; }
    #prosTable tbody td[data-label="Actions"] button { width: 100%; }
  }

  /* Modal image */
  #photoModalImg{
    width:100%;
    height:auto;
    max-height:80vh;
    object-fit:contain;
    display:block;
  }
  :root {
    --admin-bg: #f4f7fa;
    --primary-indigo: #4f46e5;
    --radius-lg: 12px;
  }
  body { background-color: var(--admin-bg); font-family: 'Inter', system-ui, sans-serif; }
  .form-card {
    background: white; border: none; border-radius: var(--radius-lg);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
    padding: 2rem;
  }
  .form-section-title {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--primary-indigo);
    margin-bottom: 1.5rem; display: flex; align-items: center; gap: 10px;
  }
  .form-section-title::after { content: ""; flex: 1; height: 1px; background: #e2e8f0; }
  .form-label { font-weight: 600; color: #334155; font-size: 0.9rem; }
  .form-control {
    padding: 0.75rem 1rem; border-radius: 8px; border: 1.5px solid #e2e8f0;
    transition: all 0.2s;
  }
  .form-control:focus {
    border-color: var(--primary-indigo); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
  }
  .btn-action { font-weight: 600; padding: 0.75rem 1.5rem; border-radius: 8px; transition: all 0.2s; }
  .status-box {
    background: #f8fafc; border: 1px solid #e2e8f0;
    padding: 1rem; border-radius: 8px;
  }
  .input-group-text { background-color: #f8fafc; border-color: #e2e8f0; color: #64748b; }
  .mini-hint { font-size: .85rem; color:#64748b; }
    :root {
        --admin-bg: #f4f7fa;
        --primary-indigo: #4f46e5;
        --glass-border: rgba(226, 232, 240, 0.8);
    }
    body { background-color: var(--admin-bg); font-family: 'Inter', system-ui, sans-serif; }

    /* Layout & Cards */
    .dashboard-card {
        background: white; border: 1px solid var(--glass-border); border-radius: 12px;
        box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); padding: 1.5rem;
    }

    .table-container { background: white; border-radius: 12px; overflow: hidden; border: 1px solid var(--glass-border); }
    
    /* Table Styling */
    .table thead th {
        background: #f8fafc; color: #64748b; font-weight: 600;
        text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em;
        padding: 1rem; border-bottom: 2px solid #edf2f7;
    }
    .table tbody td { padding: 1.1rem 1rem; vertical-align: middle; border-bottom: 1px solid #f1f5f9; }

    /* Badges & Icons */
    .mairie-icon {
        width: 40px; height: 40px; background: #f5f3ff; color: var(--primary-indigo);
        display: flex; align-items: center; justify-content: center;
        border-radius: 10px; font-size: 1.2rem;
    }
    
    .slug-badge {
        font-family: 'SFMono-Regular', Consolas, monospace;
        background: #f1f5f9; color: #64748b; font-size: 0.8rem;
        padding: 2px 8px; border-radius: 4px;
    }

    .status-pill {
        display: inline-flex; align-items: center; gap: 6px;
        font-size: 0.8rem; font-weight: 700; padding: 4px 12px; border-radius: 20px;
    }
    .status-on { background: #ecfdf5; color: #065f46; }
    .status-off { background: #f1f5f9; color: #475569; }
    .dot { width: 8px; height: 8px; border-radius: 50%; }
    .dot-on { background: #10b981; box-shadow: 0 0 6px #10b981; }
    .dot-off { background: #94a3b8; }

    /* Action buttons */
    .btn-action { border-radius: 8px; font-weight: 600; padding: 0.5rem 1rem; transition: all 0.2s; }
    .btn-edit-outline { 
        color: var(--primary-indigo); background: transparent; 
        border: 1px solid #e2e8f0; 
    }
    .btn-edit-outline:hover { 
        background: #f5f3ff; border-color: var(--primary-indigo); 
    }
:root{
  --bg:#f6f8fb;
  --card:#fff;
  --border:#e6edf5;
  --muted:#64748b;
  --title:#0f172a;

  --commentaire:#0ea5e9; /* note en base */
  --maj:#94a3b8;         /* log en base */

  --shadow: 0 10px 25px rgba(15,23,42,.06);
}

body { background: var(--bg); font-family: Inter, system-ui, -apple-system, sans-serif; color: var(--title); }

.ticket-card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.section-label{
  font-size: .75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: .75rem;
  display:block;
}

.description-box{
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  line-height: 1.55;
}

.thumb-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap:10px;
}
.thumb-grid img{
  width:100%;
  aspect-ratio:1;
  object-fit:cover;
  border-radius:12px;
  cursor:pointer;
  border: 2px solid #fff;
  box-shadow: 0 6px 14px rgba(15,23,42,.10);
  transition: transform .15s ease, filter .15s ease;
}
.thumb-grid img:hover { transform: translateY(-2px); filter: brightness(.95); }

.mapbox{
  height: 260px;
  border-radius: 16px;
  overflow:hidden;
  border:1px solid var(--border);
  box-shadow: 0 6px 18px rgba(15,23,42,.08);
}

.btn-action { font-weight: 700; border-radius: 10px; }
.form-control, .form-select { border-radius: 10px; border: 1.5px solid #e2e8f0; }

/* ========= Timeline ========= */
.timeline-wrap{ position: relative; padding: 8px 6px 6px 6px; }
.timeline{
  position: relative;
  margin: 0;
  padding: 0 0 0 22px;
  list-style: none;
}
.timeline::before{
  content:"";
  position:absolute;
  left: 10px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, rgba(148,163,184,.35), rgba(148,163,184,.1));
  border-radius: 99px;
}
.titem{ position: relative; padding: 12px 0; }
.tdot{
  position:absolute;
  left: 2px;
  top: 18px;
  width: 18px; height: 18px;
  border-radius: 99px;
  background: #fff;
  border: 2px solid var(--maj);
  box-shadow: 0 6px 14px rgba(15,23,42,.10);
}
.tdot.commentaire{ border-color: var(--commentaire); }
.tdot.maj{ border-color: var(--maj); }

.tcard{
  margin-left: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 8px 18px rgba(15,23,42,.05);
}

.tmeta{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.tleft{ display:flex; align-items:center; gap: 8px; min-width:0; flex-wrap: wrap; }
.badgetype{
  font-size:.70rem;
  font-weight:900;
  letter-spacing:.06em;
  border-radius:999px;
  padding: 4px 10px;
  border:1px solid var(--border);
  background:#f8fafc;
  color:#334155;
}
.badgetype.commentaire{ background: rgba(14,165,233,.10); border-color: rgba(14,165,233,.20); color:#075985; }
.badgetype.maj{ background: rgba(148,163,184,.18); border-color: rgba(148,163,184,.28); color:#334155; }

.badgevis{
  font-size:.70rem;
  font-weight:800;
  border-radius:999px;
  padding: 4px 10px;
  border:1px solid var(--border);
  background:#fff;
  color:#475569;
}
.badgevis.public{ background: rgba(16,185,129,.10); border-color: rgba(16,185,129,.22); color:#065f46; }
.badgevis.private{ background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.25); color:#92400e; }

.tname{
  font-weight: 850;
  font-size:.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.ttime{ font-size:.75rem; color: var(--muted); white-space: nowrap; }
.tbody{
  font-size:.92rem;
  color:#0f172a;
  white-space: pre-wrap;
  line-height: 1.45;
}

.tright{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-del{
  border-radius: 999px;
  padding: 2px 10px;
  font-size: .75rem;
}

/* Switch compact */
.form-switch .form-check-input{ cursor:pointer; }
.pub-label{ font-size:.78rem; color: var(--muted); }

/* Modal Photo */
.modal-photo-view .modal-content { background: transparent; border: none; }
#modalImage { border-radius: 14px; max-height: 85vh; width: auto; max-width: 100%; margin: 0 auto; display: block; }
.modal-backdrop.show { opacity: 0.85; }
  :root {
        --admin-bg: #f4f7fa;
        --primary-indigo: #4f46e5;
        --glass-border: rgba(226, 232, 240, 0.8);
    }
    body { background-color: var(--admin-bg); font-family: 'Inter', system-ui, sans-serif; }

    /* Layout & Cards */
    .dashboard-card {
        background: white; border: 1px solid var(--glass-border); border-radius: 12px;
        box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); padding: 1.5rem;
    }

    .table-container { background: white; border-radius: 12px; overflow: hidden; border: 1px solid var(--glass-border); }
    
    /* Table Styling */
    .table thead th {
        background: #f8fafc; color: #64748b; font-weight: 600;
        text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em;
        padding: 1rem; border-bottom: 2px solid #edf2f7;
    }
    .table tbody td { padding: 1.1rem 1rem; vertical-align: middle; border-bottom: 1px solid #f1f5f9; }

    /* Avatars & Badges */
    .user-avatar {
        width: 40px; height: 40px; background: #f5f3ff; color: var(--primary-indigo);
        display: flex; align-items: center; justify-content: center;
        border-radius: 10px; font-weight: 700; font-size: 1rem;
        border: 1px solid #e0e7ff;
    }

    .role-badge {
        background: #f1f5f9; color: #475569; font-weight: 600;
        font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.02em;
        padding: 4px 10px; border-radius: 6px;
    }

    .status-pill {
        display: inline-flex; align-items: center; gap: 6px;
        font-size: 0.8rem; font-weight: 700; padding: 4px 12px; border-radius: 20px;
    }
    .status-on { background: #ecfdf5; color: #065f46; }
    .status-off { background: #f1f5f9; color: #475569; }
    .dot { width: 8px; height: 8px; border-radius: 50%; }
    .dot-on { background: #10b981; box-shadow: 0 0 6px #10b981; }
    .dot-off { background: #94a3b8; }

    /* Filters */
    .filter-select {
        border: 1px solid #e2e8f0; border-radius: 8px; padding: 0.5rem 1rem;
        background-color: #fff; font-weight: 500; color: #1e293b;
    }

    /* Action buttons */
    .btn-action { border-radius: 8px; font-weight: 600; padding: 0.5rem 1rem; transition: all 0.2s; }
    .btn-edit-outline { 
        color: var(--primary-indigo); background: transparent; 
        border: 1px solid #e2e8f0; 
    }
    .btn-edit-outline:hover { 
        background: #f5f3ff; border-color: var(--primary-indigo); 
    }

       :root {
        --glass-bg: rgba(255, 255, 255, 0.9);
        --admin-bg: #f4f7fa;
        --primary-indigo: #4f46e5;
    }
    body { background-color: var(--admin-bg); font-family: 'Inter', system-ui, -apple-system, sans-serif; }

    .dashboard-card {
        background: white; border: none; border-radius: 12px;
        box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    }

    .table thead th {
        background: #f8fafc; color: #64748b; font-weight: 600;
        text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.05em;
        padding: 15px; border-bottom: 2px solid #edf2f7;
    }

    .ticket-id { font-weight: 700; color: var(--primary-indigo); font-family: monospace; }

    .status-pill { font-size: 0.75rem; font-weight: 600; padding: 5px 12px; border-radius: 20px; }

    .priority-indicator {
        width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px;
    }
    .prio-1 { background: #ef4444; box-shadow: 0 0 5px #ef4444; }
    .prio-2 { background: #f59e0b; }
    .prio-3 { background: #10b981; }

    .img-thumb-admin {
        width: 50px; height: 50px; object-fit: cover; border-radius: 8px;
        transition: transform 0.2s; cursor: pointer; border: 1px solid #eee;
    }
    .img-thumb-admin:hover { transform: scale(1.1); }

    .truncate-multiline {
        display: -webkit-box;  -webkit-box-orient: vertical;
        overflow: hidden; font-size: 0.85rem; color: #475569;
    }

    .action-btn { border-radius: 8px; padding: 6px 12px; transition: all 0.2s; }

    /* Custom Scrollbar */
    ::-webkit-scrollbar { width: 6px; height: 6px; }
    ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

    /* ✅ Fix: éviter le retour chariot moche */
    .filter-bar form { margin: 0; }
    .filter-bar .filter-select { min-width: 170px; }

    /* ✅ Label jamais cassé avant ":" */
    .filter-bar .filter-label{
      white-space: nowrap;
      display: inline-flex;
      align-items: center;
      line-height: 1;
    }
    .filter-bar .filter-label::after{
      content: " :";
    }

    @media (max-width: 576px) {
      .filter-bar { gap: 10px !important; }
      .filter-bar .filter-select { min-width: 140px; }
    }

    /* =========================
       Mobile: table -> cards
       ========================= */
    @media (max-width: 768px) {
      .container-fluid { padding-left: 12px; padding-right: 12px; }
      h1.h3 { font-size: 1.25rem; }

      .dashboard-card { padding: 12px !important; }
      .action-btn { padding: 8px 12px; }

      #ticketsTable thead { display: none; }

      #ticketsTable tbody tr {
        display: block;
        margin: 0 0 12px 0;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        overflow: hidden;
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
      }

      #ticketsTable tbody td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 12px;
        border-top: 1px solid #f1f5f9;
        white-space: normal;
      }
      #ticketsTable tbody td:first-child {
        border-top: 0;
        background: #f8fafc;
      }

      #ticketsTable tbody td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        font-weight: 700;
        color: #64748b;
        text-transform: uppercase;
        font-size: 0.65rem;
        letter-spacing: 0.06em;
        padding-top: 2px;
      }

      #ticketsTable tbody td > * {
        flex: 1 1 auto;
        min-width: 0;
      }

      .img-thumb-admin { width: 44px; height: 44px; border-radius: 10px; }

      #ticketsTable tbody td[data-label="Actions"] { justify-content: flex-end; }
      #ticketsTable tbody td[data-label="Actions"] a { width: 100%; }

      .truncate-multiline { font-size: 0.9rem; }
    }

    /* ✅ Modal image */
    #photoModalImg{
      width: 100%;
      height: auto;
      max-height: 80vh;
      object-fit: contain;
      display: block;
    }

    /* =========================================
   FIX: ne pas écraser les badges Bootstrap
   (garde les couleurs sur la home)
   ========================================= */

/* Base pill = forme uniquement (pas de couleur imposée) */
.status-pill{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: .75rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.20);
  background: transparent;    /* ✅ laisse Bootstrap gérer bg */
  color: inherit;             /* ✅ laisse Bootstrap gérer color */
}

/* Fallback seulement si AUCUNE couleur Bootstrap n’est appliquée */
.status-pill:not(.badge):not([class*="bg-"]):not([class*="text-bg-"]){
  background: rgba(248,250,252,.85);
  color: rgba(51,65,85,.95);
}

[data-bs-theme="dark"] .status-pill:not(.badge):not([class*="bg-"]):not([class*="text-bg-"]){
  background: rgba(2,6,23,.25);
  color: var(--app-title);
}

/* Optionnel: si tu utilises role-badge avec des couleurs Bootstrap */
.role-badge{
  font-weight: 800;
  font-size: .70rem;
  text-transform: uppercase;
  letter-spacing: .02em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.18);
  background: transparent;  /* ✅ */
  color: inherit;           /* ✅ */
}
.role-badge:not(.badge):not([class*="bg-"]):not([class*="text-bg-"]){
  background: rgba(148,163,184,.14);
  color: rgba(51,65,85,.95);
}
