:root{
  --bg:#f6f7fb;
  --sidebar:#0b1220;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --line:#e2e8f0;
  --radius:18px;
  --shadow:0 18px 55px rgba(2,6,23,.10);

  /* accents */
  --blue:#1d4ed8;
  --blue-soft:#eff6ff;
  --green:#16a34a;
  --green-soft:#ecfdf5;
  --amber:#b45309;
  --amber-soft:#fffbeb;
  --red:#dc2626;
  --red-soft:#fef2f2;
  --indigo:#4f46e5;
  --indigo-soft:#eef2ff;
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family:Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}

/* =========================================================
   Layout
========================================================= */
.pst-layout{
  display:grid;
  grid-template-columns:260px 1fr;
  min-height:100vh;
}

/* =========================================================
   SIDEBAR (⚠️ INCHANGÉE)
========================================================= */
.pst-sidebar{
  background:var(--sidebar);
  color:#fff;
  display:flex;
  flex-direction:column;
  padding:18px 14px;
}

.pst-sidebar-brand{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:20px;
}

.pst-logo{
  width:42px;
  height:42px;
  border-radius:14px;
  background:linear-gradient(135deg,#3b82f6,#6366f1);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
}

.pst-brand-name{
  font-weight:900;
}
.pst-brand-role{
  font-size:12px;
  opacity:.7;
  font-weight:700;
}

.pst-user-block{
  display:flex;
  gap:10px;
  align-items:center;
  padding:12px;
  border-radius:14px;
  background:rgba(255,255,255,.05);
  margin-bottom:20px;
}

.pst-user-avatar{
  width:36px;
  height:36px;
  border-radius:12px;
  background:rgba(255,255,255,.08);
  display:flex;
  align-items:center;
  justify-content:center;
}

.pst-user-name{font-weight:900}
.pst-user-role-label{font-size:12px;opacity:.7}

.pst-nav-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:12px;
  text-decoration:none;
  color:#fff;
  font-weight:800;
}
.pst-nav-item--active{
  background:rgba(59,130,246,.2);
}

.pst-sidebar-bottom{
  margin-top:auto;
}

.pst-logout{
  width:100%;
  border:none;
  padding:10px;
  border-radius:12px;
  background:rgba(255,255,255,.08);
  color:#fff;
  font-weight:900;
  cursor:pointer;
}
.pst-logout:hover{
  background:rgba(255,255,255,.15);
}

/* =========================================================
   MAIN (style “tables V3”)
========================================================= */
.pst-main{
  padding:22px;
}

/* Topbar */
.pst-topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  margin-bottom:16px;
}

.pst-title{
  margin:0;
  font-size:22px;
  font-weight:900;
  letter-spacing:-.2px;
}

.pst-count{
  margin-top:4px;
  font-size:12px;
  color:var(--muted);
  font-weight:800;
}

/* Controls */
.pst-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.pst-select,
.pst-input{
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px 12px;
  font-weight:800;
  background:#fff;
  outline:none;
  transition: box-shadow .15s ease, border-color .15s ease;
}

.pst-input{ min-width:280px; }

.pst-select:focus,
.pst-input:focus{
  border-color:#cbd5e1;
  box-shadow:0 0 0 3px rgba(29,78,216,.12);
}

/* Buttons */
.pst-btn{
  border:1px solid var(--line);
  background:#fff;
  border-radius:14px;
  padding:10px 12px;
  font-weight:900;
  cursor:pointer;
  transition:transform .06s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  display:inline-flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
}

.pst-btn:hover{
  background:#f8fafc;
  border-color:#d1d5db;
}

.pst-btn:active{ transform:translateY(1px); }

.pst-btn--ghost{
  background:#fff;
}

.pst-btn--ghost:hover{
  background:#f1f5f9;
}

.pst-btn--soft{
  background:var(--blue-soft);
  border-color:#bfdbfe;
  color:#0b3aa6;
}
.pst-btn--soft:hover{
  background:#dbeafe;
  border-color:#93c5fd;
  box-shadow:0 10px 24px rgba(29,78,216,.12);
}

/* Card container */
.pst-card{
  background:var(--card);
  border-radius:var(--radius);
  border:1px solid var(--line);
  box-shadow:var(--shadow);
  overflow:hidden;
}

/* Table wrapper */
.pst-table-wrap{
  overflow:auto;
}

/* =========================================================
   TABLE — même vibe que Clients / Utilisateurs / Interventions
========================================================= */
.pst-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
}

/* header comme tes screens: petit, uppercase, fond gris très clair */
.pst-table thead th{
  position:sticky;
  top:0;
  z-index:1;
  text-align:left;
  padding:14px 16px;
  background:#f8fafc;
  font-size:12px;
  font-weight:900;
  letter-spacing:.6px;
  text-transform:uppercase;
  color:#475569;
  border-bottom:1px solid #eef2f7;
}

.pst-table tbody td{
  padding:18px 16px;
  border-bottom:1px solid #eef2f7;
  vertical-align:middle;
  background:#fff;
}

/* hover très léger comme tes autres pages */
.pst-table tbody tr{
  transition:background .15s ease;
}
.pst-table tbody tr:hover td{
  background:#fbfdff;
}

/* Right align */
.pst-th-right,
.pst-td-right{
  text-align:right;
}

/* cell loading/empty */
.pst-td-center{
  text-align:center;
  font-weight:900;
  color:var(--muted);
  padding:22px 16px;
}

/* =========================================================
   Row title/meta (comme “PHARMACIE … / XANA … / inter n° …”)
========================================================= */
.pst-rowtitle{
  font-weight:900;
  color:#0f172a;
  display:flex;
  align-items:center;
  gap:10px;
  line-height:1.15;
}

.pst-rowmeta{
  margin-top:6px;
  color:var(--muted);
  font-weight:800;
  font-size:12px;
  line-height:1.25;
}

/* =========================================================
   BADGES (pills)
========================================================= */
.pst-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  border-radius:999px;
  font-weight:900;
  font-size:12px;
  border:1px solid transparent;
  white-space:nowrap;
}

.pst-badge i{ opacity:.9; }

/* neutre */
.pst-badge--neutral{
  background:#f1f5f9;
  color:#0f172a;
  border-color:#e2e8f0;
}

/* “en cours” */
.pst-badge--soft{
  background:var(--indigo-soft);
  color:#3730a3;
  border-color:#e0e7ff;
}

/* “clôturée” */
.pst-badge--ok{
  background:var(--green-soft);
  color:#065f46;
  border-color:#bbf7d0;
}

/* normal (warning doux) */
.pst-badge--warn{
  background:var(--amber-soft);
  color:#92400e;
  border-color:#fde68a;
}

/* urgent */
.pst-badge--danger{
  background:var(--red-soft);
  color:#991b1b;
  border-color:#fecaca;
}

/* =========================================================
   “NOUVELLE” badge (petit pill bleu)
========================================================= */
.pst-badge-new{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  font-weight:900;
  font-size:11px;
  letter-spacing:.25px;
  background:var(--blue-soft);
  color:var(--blue);
  border:1px solid #bfdbfe;
}

.pst-dot{
  width:8px;
  height:8px;
  border-radius:999px;
  background:var(--blue);
  box-shadow:0 0 0 3px rgba(29,78,216,.12);
}

/* =========================================================
   Responsive (sans casser la sidebar)
========================================================= */
@media (max-width: 980px){
  .pst-layout{ grid-template-columns: 240px 1fr; }
  .pst-input{ min-width:220px; }
}

@media (max-width: 760px){
  .pst-layout{ grid-template-columns: 1fr; }
  /* sidebar reste existante, mais passera au-dessus si besoin (sans la modifier) */
  .pst-main{ padding:16px; }
  .pst-topbar{ flex-direction:column; align-items:flex-start; }
  .pst-actions{ width:100%; }
  .pst-input{ width:100%; min-width:unset; }
}