/* ─────────────────────────────────────────────
   SNO TELECOM — LIGHT UI (Green Sidebar)
   Modern, contrasté, lisible
───────────────────────────────────────────── */

:root{
  /* Page */
  --bg: #f6f7fb;
  --text: #0f172a;
  --text-main: #0f172a;
  --text-dim: #475569;
  --text-muted: #94a3b8;

  /* Cards / borders */
  --panel: #ffffff;
  --bg-panel: #ffffff;
  --panel-2: #fbfcff;
  --border: #d7dde8;
  --border-strong: #c7cfdd;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);

  /* Brand (SNO) */
  --accent: #16a34a;         /* vert SNO */
  --accent-2: #0ea5e9;       /* bleu tech */
  --danger: #ef4444;
  --warning: #f59e0b;
  --purple: #8b5cf6;

  /* Sidebar */
  --sidebar-w: 260px;
  --sidebar-bg: #0b1f14;     /* vert très sombre */
  --sidebar-bg-2:#0a2a19;
  --sidebar-text: #e7f8ee;
  --sidebar-dim: rgba(231,248,238,.65);
  --sidebar-border: rgba(255,255,255,.10);

  --radius: 14px;
  --radius-lg: 18px;

  font-family: "DM Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  overflow: hidden; /* on scroll uniquement dans .main-content */
}

/* Scrollbar */
::-webkit-scrollbar{ width: 10px; height:10px; }
::-webkit-scrollbar-thumb{ background:#cfd6e5; border-radius:8px; }
::-webkit-scrollbar-thumb:hover{ background:#b8c2d8; }

/* ── LOGIN ─────────────────────────────────── */
.login-screen{
  position: fixed; inset: 0;
  display:flex; align-items:center; justify-content:center;
  background:
    radial-gradient(800px 500px at 20% 10%, rgba(22,163,74,.16), transparent 60%),
    radial-gradient(900px 600px at 80% 0%, rgba(14,165,233,.12), transparent 60%),
    linear-gradient(#f7f8fc, #f3f6fb);
}

.login-card{
  width: 420px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-logo{ display:flex; align-items:center; gap:16px; margin-bottom:18px; }
.login-logo img{ width: 120px; height:auto; display:block; }
.login-brand{ font-weight:800; letter-spacing:.6px; }
.login-sub{ color: var(--text-dim); font-size: 12px; margin-top:2px; }

.form-group{ margin: 12px 0; }
.form-group label{ display:block; font-size: 12px; color: var(--text-dim); margin-bottom:6px; font-weight:700; letter-spacing:.5px; text-transform:uppercase; }
.form-group input{
  width:100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  outline:none;
}
.form-group input:focus{
  border-color: rgba(22,163,74,.45);
  box-shadow: 0 0 0 4px rgba(22,163,74,.12);
}

.btn-login{
  width:100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(22,163,74,.45);
  background: linear-gradient(180deg, rgba(22,163,74,.95), rgba(22,163,74,.82));
  color:#fff;
  font-weight:800;
  cursor:pointer;
}
.btn-login:hover{ filter: brightness(.98); }
.login-hint{ margin-top:10px; font-size: 12px; color: var(--text-dim); text-align:center; }

.login-error{
  background: rgba(239,68,68,.10);
  border: 1px solid rgba(239,68,68,.45);
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 10px;
}

/* ── APP LAYOUT ─────────────────────────────── */
#app{
  height: 100vh;
  display: flex;
}

.sidebar{
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar-bg), #07160f);
  border-right: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
  display:flex;
  flex-direction: column;
}

.sidebar-header{
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo{
  display:flex;
  gap: 12px;
  align-items:center;
}

.logo-mark-sm{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  padding: 6px;
  object-fit: contain;
  display:block;
}

.brand-name{
  font-weight: 900;
  letter-spacing: .8px;
  font-size: 14px;
  line-height: 1.1;
}

.brand-tag{
  margin-top: 2px;
  font-size: 11px;
  color: var(--sidebar-dim);
  font-weight: 700;
}

.sidebar-nav{
  padding: 14px 10px;
  overflow:auto;
}

.nav-section-label{
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(231,248,238,.55);
  font-weight: 800;
  padding: 10px 10px 6px;
}

.nav-item{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 10px;
  margin: 6px 6px;
  border-radius: 12px;
  cursor:pointer;
  user-select:none;
  color: rgba(231,248,238,.92);
  border: 1px solid transparent;
  text-decoration:none;
}

.nav-item:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.10);
}

.nav-item.active{
  background: linear-gradient(180deg, rgba(22,163,74,.20), rgba(22,163,74,.10));
  border-color: rgba(22,163,74,.35);
  box-shadow: 0 0 0 3px rgba(22,163,74,.10) inset;
}

.nav-icon{ width:18px; text-align:center; opacity:.95; }

/* ── STATISTIQUES ───────────────────────────────────── */

/* KPIs globaux */
.stats-kpi-row {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px;
}
.stats-kpi {
  flex: 1; min-width: 160px;
  background: #fff; border-radius: 14px;
  border: 1px solid var(--border);
  padding: 16px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow);
}
.stats-kpi-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.stats-kpi-val {
  font-size: 20px; font-weight: 900; color: var(--text);
  line-height: 1;
}
.stats-kpi-lab {
  font-size: 11px; color: var(--text-dim); margin-top: 3px;
  font-weight: 500;
}

/* Grid équipes */
.stats-eq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stats-eq-card {
  background: #fff; border-radius: 16px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--eq-color, var(--accent));
  padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}
.stats-eq-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,.1);
  transform: translateY(-2px);
}
.stats-eq-header {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 4px;
}
.stats-eq-rank {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--eq-color, var(--accent));
  color: #fff; font-size: 13px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stats-eq-name {
  font-size: 16px; font-weight: 800; color: var(--text);
}
.stats-eq-badge {
  font-size: 11px; font-weight: 700; padding: 4px 10px;
  border-radius: 999px; white-space: nowrap; flex-shrink: 0;
}
.stats-eq-bar-track {
  height: 10px; background: var(--border);
  border-radius: 99px; overflow: hidden; position: relative;
}
.stats-eq-bar-fill {
  height: 100%; border-radius: 99px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.stats-eq-kpis {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 8px; margin-top: 14px;
  border-top: 1px solid var(--border); padding-top: 14px;
}
.stats-eq-kpi { text-align: center; }
.stats-eq-kpi-val {
  font-size: 18px; font-weight: 900; color: var(--text);
  line-height: 1;
}
.stats-eq-kpi-lab {
  font-size: 10px; color: var(--text-dim);
  margin-top: 3px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px;
}

/* Podium */
.stats-podium {
  display: flex; align-items: flex-end;
  justify-content: center; gap: 8px;
  padding: 8px 16px 0;
}
.stats-podium-slot {
  display: flex; flex-direction: column;
  align-items: center; flex: 1; max-width: 160px;
}
.stats-podium-medal { font-size: 28px; margin-bottom: 6px; }
.stats-podium-name {
  font-size: 13px; font-weight: 800; color: var(--text);
  margin-bottom: 2px; text-align: center;
}
.stats-podium-equipe {
  font-size: 10px; color: var(--text-dim);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: .4px; margin-bottom: 4px;
}
.stats-podium-valo {
  font-size: 12px; font-weight: 700; color: var(--green);
  margin-bottom: 8px;
}
.stats-podium-bar {
  width: 100%; border-radius: 10px 10px 0 0;
  display: flex; align-items: flex-start;
  justify-content: center; padding-top: 10px;
}
.stats-podium-rank {
  font-size: 20px; font-weight: 900; color: #fff;
  opacity: .8;
}

/* Top 3 rows dans le tableau */
.stats-top3-row td:first-child {
  border-left: 3px solid var(--accent);
}
.stats-top3-row:nth-child(1) td:first-child { border-color: #fbbf24; }
.stats-top3-row:nth-child(2) td:first-child { border-color: #94a3b8; }
.stats-top3-row:nth-child(3) td:first-child { border-color: #b45309; }
.workspace-summary.stats-summary{
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stats-section-note{
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
}
.stats-tech-table{
  min-width: 920px;
}
.stats-forecast-panel{
  margin-top: 20px;
}
.stats-forecast-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap:16px;
}
.stats-forecast-card{
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  border:1px solid var(--border);
  border-radius:16px;
  padding:18px 20px;
  display:flex;
  flex-direction:column;
  gap:14px;
  box-shadow: 0 10px 24px rgba(15,23,42,.05);
}
.stats-forecast-foot{
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-muted);
}
.workspace-summary.carte-summary{
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.carte-filter-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.carte-filter-btn{
  border-radius:999px;
}
.carte-filter-btn.active{
  background: linear-gradient(180deg, rgba(22,163,74,.95), rgba(22,163,74,.85));
  border-color: rgba(22,163,74,.45);
  color:#fff;
  box-shadow: 0 0 0 4px rgba(22,163,74,.12);
}
.carte-map-shell{
  padding:16px;
  background: linear-gradient(180deg, #ffffff, #fbfcff);
}
.carte-map-note{
  margin-bottom:12px;
  font-size:12px;
  color:var(--text-dim);
  font-weight:600;
}
.carte-map{
  height:560px;
  border-radius:18px;
  overflow:hidden;
  border:1px solid var(--border);
  box-shadow: var(--shadow);
}
.carte-popup{
  min-width:240px;
}
.carte-popup-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.carte-popup-title{
  font-size:14px;
  font-weight:900;
  color:var(--text);
}
.carte-popup-meta{
  margin-top:6px;
  font-size:12px;
  color:var(--text-dim);
  font-weight:700;
}
.carte-popup-address{
  margin-top:8px;
  font-size:12px;
  line-height:1.5;
  color:var(--text);
}
.carte-popup-actions{
  margin-top:12px;
  display:flex;
}

/* Badge alerte rouge dans sidebar */
.nav-badge-alert {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px rgba(239,68,68,.25);
  animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
  0%,100% { box-shadow: 0 0 0 2px rgba(239,68,68,.25); }
  50%      { box-shadow: 0 0 0 5px rgba(239,68,68,.0); }
}

/* Cards alertes dashboard */
.alert-card {
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  border: 1px solid transparent;
}
.alert-card.danger  { background:#fef2f2; border-color:#fecaca; }
.alert-card.warning { background:#fffbeb; border-color:#fde68a; }
.alert-card.info    { background:#eff6ff; border-color:#bfdbfe; }
.alert-card-icon { font-size:20px; flex-shrink:0; margin-top:1px; }
.alert-card-title { font-weight:700; font-size:13px; margin-bottom:3px; }
.alert-card-body  { font-size:12px; color:var(--text-dim); line-height:1.5; }

/* Dashboard section absences */
.absence-chip {
  display:inline-flex; align-items:center; gap:6px;
  padding:5px 10px; border-radius:8px;
  background:#f0fdf4; border:1px solid #bbf7d0;
  font-size:12px; font-weight:600; margin:3px;
}

/* Historique timeline */
.timeline { display:flex; flex-direction:column; gap:0; }
.timeline-item {
  display:flex; gap:14px; padding:10px 0;
  border-bottom:1px solid var(--border);
  font-size:13px;
}
.timeline-item:last-child { border-bottom:none; }
.timeline-dot {
  width:8px; height:8px; border-radius:50%;
  background:var(--accent); flex-shrink:0; margin-top:5px;
}
.timeline-time { color:var(--text-muted); font-size:11px; white-space:nowrap; min-width:110px; }
.timeline-actor { font-weight:700; color:var(--accent); }
.timeline-detail { color:var(--text-dim); margin-top:1px; font-size:12px; }


.sidebar-footer{
  margin-top:auto;
  padding: 14px 12px;
  border-top: 1px solid var(--sidebar-border);
  display:flex;
  align-items:center;
  gap: 10px;
}

.user-info{ display:flex; align-items:center; gap:10px; flex:1; min-width:0; }
.user-avatar{
  width: 36px; height: 36px;
  border-radius: 12px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14);
  display:flex; align-items:center; justify-content:center;
  font-weight: 900;
}
.user-name{ font-weight: 900; font-size: 12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.user-role{ font-size: 11px; color: var(--sidebar-dim); font-weight: 700; }

.btn-logout{
  width: 40px; height: 36px;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(231,248,238,.95);
  cursor:pointer;
}
.btn-logout:hover{ background: rgba(255,255,255,.12); }

/* ── MAIN ───────────────────────────────────── */

/* Header page */
.page-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.page-title{
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -.5px;
}

.page-subtitle{
  margin-top: 3px;
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
}

.page-actions{ display:flex; gap:10px; flex-wrap:wrap; }

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor:pointer;
  font-weight: 800;
}
.btn:hover{ background: #f8fafc; }

.btn-primary{
  background: linear-gradient(180deg, rgba(22,163,74,.95), rgba(22,163,74,.85));
  border-color: rgba(22,163,74,.45);
  color:#fff;
}
.btn-danger{
  background: #fff;
  border-color: rgba(239,68,68,.45);
  color: #b91c1c;
}
.btn-secondary{
  background: #fff;
}
.btn-sm{ padding: 8px 10px; border-radius: 11px; font-weight: 900; font-size: 12px; }

button:disabled{
  opacity: .55;
  cursor: not-allowed;
}

/* Panels / grids distincts */
.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 1100px){
  .grid-2{ grid-template-columns: 1fr; }
  .interventions-hero-body,
  .workspace-hero-body{
    grid-template-columns: 1fr;
  }
  .stats-summary{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.panel{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
}
.panel-title{
  font-weight: 950;
}
.panel-body{ padding: 14px; }

/* KPI cards */
.kpi-grid{
  display:grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 6px;
}
@media (max-width: 1300px){
  .kpi-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px){
  .kpi-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .interventions-summary,
  .workspace-summary{
    grid-template-columns: 1fr;
  }
  .stats-summary,
  .carte-summary{
    grid-template-columns: 1fr;
  }
}

.kpi-card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  position:relative;
  overflow:hidden;
}
.kpi-card::before{
  content:"";
  position:absolute;
  left:0; top:0; bottom:0;
  width: 5px;
  background: var(--kpi-color, var(--accent));
}
.kpi-label{
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  font-weight: 900;
}
.kpi-value{
  margin-top: 6px;
  font-size: 28px;
  font-weight: 950;
}
.kpi-sub{
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}

/* Bar chart */
.bar-chart{ display:grid; gap: 10px; }
.bar-row{
  display:grid;
  grid-template-columns: 140px 1fr 120px;
  gap: 10px;
  align-items:center;
}
.bar-label{
  font-weight: 800;
  font-size: 12px;
  color: var(--text);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.bar-track{
  height: 10px;
  border-radius: 999px;
  background: #eef2f7;
  border: 1px solid #d8e0ee;
  overflow:hidden;
}
.bar-fill{
  height:100%;
  border-radius: 999px;
  background: var(--accent);
}
.bar-value{
  text-align:right;
  font-weight: 900;
  color: var(--text);
}

/* Sessions */
.session-list{ display:grid; gap: 10px; }
.session-item{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
}
.session-dot{
  width: 10px; height: 10px;
  border-radius: 999px;
  background: rgba(22,163,74,.85);
  box-shadow: 0 0 0 4px rgba(22,163,74,.15);
}
.session-name{ font-weight: 950; font-size: 12px; }
.session-ip{ font-size: 11px; color: var(--text-dim); font-weight: 700; }

/* Empty state */
.empty-state{
  padding: 26px;
  text-align:center;
  color: var(--text-dim);
}
.empty-icon{ font-size: 28px; margin-bottom: 8px; }

/* ── TECHNICIENS CARDS ──────────────────────── */
.tech-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(300px,1fr));
  gap: 12px;
}

.tech-card{
  padding:0;
  cursor:pointer;
  transition: transform .08s ease, box-shadow .12s ease, border-color .12s ease;
}
.tech-card:hover{
  transform: translateY(-1px);
  border-color: var(--border-strong);
}

.tech-card.is-selected{
  border-color: rgba(22,163,74,.55) !important;
  box-shadow: 0 0 0 4px rgba(22,163,74,.15), var(--shadow);
}

.badge{
  display:inline-flex;
  align-items:center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(22,163,74,.25);
  background: rgba(22,163,74,.10);
  color: #0f5132;
  font-weight: 950;
  font-size: 11px;
}
.badge-ok{
  background: rgba(22,163,74,.12);
  border-color: rgba(22,163,74,.24);
  color: #166534;
}
.badge-en-cours,
.badge-en-cours-f{
  background: rgba(245,158,11,.14);
  border-color: rgba(245,158,11,.28);
  color: #92400e;
}
.badge-nouveau{
  background: rgba(14,165,233,.12);
  border-color: rgba(14,165,233,.24);
  color: #0369a1;
}
.badge-reo,
.badge-non-attachee{
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.24);
  color: #b91c1c;
}
.badge-gc{
  background: rgba(139,92,246,.12);
  border-color: rgba(139,92,246,.22);
  color: #6d28d9;
}
.badge-consolidee,
.badge-attachee,
.badge-chef{
  background: rgba(15,23,42,.08);
  border-color: rgba(15,23,42,.12);
  color: #334155;
}
.badge-tech{
  background: rgba(14,165,233,.10);
  border-color: rgba(14,165,233,.20);
  color: #075985;
}

.table-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
}
.search-box{
  position:relative;
  flex: 1 1 320px;
  min-width: 220px;
}
.search-icon{
  position:absolute;
  left:14px;
  top:50%;
  transform:translateY(-50%);
  color:var(--text-muted);
  pointer-events:none;
  font-size:14px;
}
.search-box input{
  width:100%;
  height:46px;
  padding: 0 14px 0 40px;
  border:1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  color: var(--text);
  font: inherit;
  outline:none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.search-box input:focus{
  border-color: rgba(14,165,233,.38);
  box-shadow: 0 0 0 4px rgba(14,165,233,.10);
}
.table-toolbar .filter-select{
  min-width: 190px;
  height:46px;
  border:1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%),
    linear-gradient(180deg, #ffffff, #f8fafc);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px),
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
  color: var(--text);
  font: inherit;
  padding: 0 40px 0 14px;
  appearance:none;
  outline:none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.table-toolbar .filter-select:focus{
  border-color: rgba(22,163,74,.4);
  box-shadow: 0 0 0 4px rgba(22,163,74,.10);
}

.pagination{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:12px;
}
.pagination-info{
  font-size:13px;
  font-weight:700;
  color:var(--text-dim);
}
.pagination-btns{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.pagination-btns button{
  min-width:40px;
  height:40px;
  border:1px solid var(--border);
  border-radius: 12px;
  background:#fff;
  color:var(--text);
  font-weight:800;
  cursor:pointer;
  transition: transform .14s ease, border-color .14s ease, background .14s ease, color .14s ease;
}
.pagination-btns button:hover:not(:disabled){
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background:#f8fafc;
}
.pagination-btns button.active{
  background: var(--accent);
  border-color: var(--accent);
  color:#fff;
}
.pagination-btns button:disabled{
  opacity:.45;
  cursor:not-allowed;
}

/* Table (Users etc) */
.data-table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow:hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background:#fff;
}
.data-table th{
  text-align:left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px;
  color: var(--text-dim);
  background: #f2f5fb;
  border-bottom: 1px solid var(--border);
}
.data-table td{
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}
.data-table tbody tr:hover td{
  background:#fbfdff;
}
.data-table tr:last-child td{ border-bottom: 0; }

.interventions-hero,
.workspace-hero{
  overflow:hidden;
  position:relative;
}
.interventions-hero::before,
.workspace-hero::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(520px 180px at 0% 0%, rgba(22,163,74,.10), transparent 70%),
    radial-gradient(480px 180px at 100% 0%, rgba(14,165,233,.10), transparent 70%);
  pointer-events:none;
}
.interventions-hero-body,
.workspace-hero-body{
  position:relative;
  display:grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap:18px;
  align-items:stretch;
}
.interventions-hero-copy,
.workspace-hero-copy{
  padding: 6px 2px;
}
.interventions-hero-kicker,
.workspace-hero-kicker{
  font-size:11px;
  font-weight:900;
  letter-spacing:1.4px;
  text-transform:uppercase;
  color:var(--accent);
  margin-bottom:8px;
}
.interventions-hero-title,
.workspace-hero-title{
  font-size:24px;
  line-height:1.18;
  font-weight:900;
  color:var(--text);
  max-width:760px;
}
.interventions-hero-text,
.workspace-hero-text{
  margin-top:10px;
  font-size:13px;
  line-height:1.6;
  color:var(--text-dim);
  max-width:760px;
}
.interventions-hero-text strong,
.workspace-hero-text strong{
  color:var(--text);
}
.interventions-summary,
.workspace-summary{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:10px;
}
.int-summary-card{
  position:relative;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.84);
  box-shadow: 0 10px 24px rgba(15,23,42,.05);
  padding: 14px;
}
.int-summary-card::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:4px;
  background: var(--summary-color, var(--accent));
}
.int-summary-card.accent-green{ --summary-color: #16a34a; }
.int-summary-card.accent-amber{ --summary-color: #f59e0b; }
.int-summary-card.accent-sky{ --summary-color: #0ea5e9; }
.int-summary-card.accent-slate{ --summary-color: #475569; }
.int-summary-card.accent-red{ --summary-color: #dc2626; }
.int-summary-card.accent-blue{ --summary-color: #2563eb; }
.int-summary-card.accent-purple{ --summary-color: #7c3aed; }
.int-summary-label{
  font-size:11px;
  font-weight:900;
  letter-spacing:1.1px;
  text-transform:uppercase;
  color:var(--text-dim);
}
.int-summary-value{
  margin-top:8px;
  font-size:24px;
  line-height:1.1;
  font-weight:900;
  color:var(--text);
}
.int-summary-sub{
  margin-top:6px;
  font-size:12px;
  color:var(--text-dim);
}

.interventions-panel,
.workspace-panel{
  overflow:hidden;
}
.interventions-toolbar-shell,
.workspace-toolbar-shell{
  padding-bottom: 12px;
  border-bottom:1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, #fbfcff);
}
.interventions-toolbar-note,
.workspace-toolbar-note{
  margin-top:10px;
  font-size:12px;
  color:var(--text-dim);
}
.interventions-table-host,
.workspace-table-host{
  padding: 0 16px 16px;
}
.interventions-table-scroll,
.workspace-table-scroll{
  overflow:auto;
  padding-top: 16px;
}
.interventions-table,
.workspace-table{
  width: 100%;
  border-radius: 18px;
  table-layout: auto;
}
.interventions-table th,
.workspace-table th{
  background: #f6f8fc;
}
.interventions-table td,
.workspace-table td{
  vertical-align: middle;
}
.int-identity{
  display:flex;
  flex-direction:column;
  gap:5px;
  min-width: 180px;
}
.int-ot-link{
  padding:0;
  border:none;
  background:none;
  color:var(--accent);
  font: inherit;
  font-size:13px;
  font-weight:900;
  text-align:left;
  cursor:pointer;
}
.int-ot-link:hover{
  color:#15803d;
}
.int-ref{
  font-size:11px;
  color:var(--text-muted);
  font-weight:700;
}
.activity-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:56px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(14,165,233,.10);
  border:1px solid rgba(14,165,233,.18);
  color:#075985;
  font-size:11px;
  font-weight:900;
  letter-spacing:.5px;
  text-transform:uppercase;
}
.int-tech{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 170px;
}
.int-avatar{
  width:38px;
  height:38px;
  border-radius: 14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background: linear-gradient(135deg, rgba(22,163,74,.16), rgba(14,165,233,.16));
  border:1px solid rgba(22,163,74,.18);
  color:var(--text);
  font-size:12px;
  font-weight:900;
  flex-shrink:0;
}
.int-tech-name{
  font-size:13px;
  font-weight:800;
  color:var(--text);
}
.int-tech-meta{
  margin-top:3px;
  font-size:11px;
  color:var(--text-dim);
  font-weight:700;
}
.int-chip{
  display:inline-flex;
  align-items:center;
  padding: 7px 10px;
  border-radius: 999px;
  background:#f8fafc;
  border:1px solid var(--border);
  color:var(--text-dim);
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
}
.int-site{
  min-width: 220px;
}
.int-site-name{
  font-size:13px;
  font-weight:800;
  color:var(--text);
}
.int-site-address{
  margin-top:4px;
  font-size:11px;
  line-height:1.5;
  color:var(--text-dim);
}
.int-date-main{
  font-size:13px;
  font-weight:800;
  color:var(--text);
}
.int-date-sub{
  margin-top:4px;
  font-size:11px;
  color:var(--text-dim);
}
.int-value{
  color:#15803d;
  font-size:14px;
  font-weight:900;
  white-space:nowrap;
}
.priority-pill{
  display:inline-flex;
  align-items:center;
  padding: 7px 10px;
  border-radius: 999px;
  border:1px solid var(--border);
  background:#f8fafc;
  color:var(--text);
  font-size:11px;
  font-weight:900;
  white-space:nowrap;
}
.priority-pill.is-high{
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.18);
  color:#b91c1c;
}
.priority-pill.is-medium{
  background: rgba(245,158,11,.10);
  border-color: rgba(245,158,11,.18);
  color:#92400e;
}
.priority-pill.is-low{
  background: rgba(14,165,233,.10);
  border-color: rgba(14,165,233,.18);
  color:#075985;
}
.int-actions{
  display:flex;
  gap:6px;
  justify-content:flex-end;
}
.interventions-empty,
.workspace-empty{
  padding: 44px 24px;
}
.interventions-pagination-wrap{
  padding-top: 0;
}

.workspace-footer-bar{
  padding-top: 0;
}
.workspace-footer-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  padding-top: 12px;
}
.workspace-footer-item{
  font-size:12px;
  color:var(--text-dim);
  font-weight:700;
}
.workspace-footer-item strong{
  color:#15803d;
  font-family:'DM Mono', monospace;
}
.facture-select{
  width:100%;
  min-width: 150px;
  height:40px;
  border:1px solid var(--border);
  border-radius: 12px;
  background:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%),
    linear-gradient(180deg, #ffffff, #f8fafc);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 10px) calc(50% - 2px),
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
  padding: 0 34px 0 12px;
  color:var(--text);
  font: inherit;
  font-size:12px;
  font-weight:700;
  appearance:none;
  outline:none;
}
.facture-select:focus{
  border-color: rgba(22,163,74,.4);
  box-shadow: 0 0 0 4px rgba(22,163,74,.10);
}
.workspace-table.synthese-table{
  min-width: 980px;
}

.planning-legend{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  align-items:center;
}
.planning-legend-item{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  font-weight:700;
  color:var(--text-dim);
}
.planning-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap:16px;
}
.planning-team-card{
  overflow:hidden;
}
.planning-team-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding: 18px 18px 0;
}
.planning-team-kicker{
  font-size:11px;
  font-weight:900;
  letter-spacing:1.2px;
  text-transform:uppercase;
  color:var(--text-muted);
}
.planning-team-title{
  margin-top:4px;
  font-size:20px;
  font-weight:900;
  color:var(--text);
}
.planning-team-meta{
  margin-top:6px;
  font-size:12px;
  color:var(--text-dim);
}
.planning-team-side{
  flex-shrink:0;
}
.planning-team-table{
  padding: 0 18px 18px;
}
.planning-team-table .workspace-table{
  min-width: 760px;
}
.planning-notes{
  min-width: 180px;
  font-size:12px;
  line-height:1.5;
  color:var(--text-dim);
}
.planning-empty{
  padding: 26px 18px 20px;
  text-align:left;
}

@media (max-width: 760px){
  .search-box,
  .table-toolbar .filter-select{
    min-width: 0;
    width: 100%;
  }
  .interventions-table-host{
    padding-left: 12px;
    padding-right: 12px;
  }
  .workspace-table-host{
    padding-left: 12px;
    padding-right: 12px;
  }
  .interventions-hero-title,
  .workspace-hero-title{
    font-size:20px;
  }
  .pagination{
    align-items:flex-start;
  }
  .workspace-footer-row{
    align-items:flex-start;
  }
  .planning-grid{
    grid-template-columns: 1fr;
  }
  .planning-team-head{
    flex-direction:column;
  }
  .stats-forecast-grid{
    grid-template-columns: 1fr;
  }
  .carte-filter-btn{
    width:100%;
  }
  .carte-map{
    height:440px;
  }
}

/* ── MODAL OVERLAY ──────────────────────────── */
.modal-overlay{
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal{
  width: min(720px, 96vw);
  background:#fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  max-height: calc(100vh - 40px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.modal-header{ padding: 14px 16px; border-bottom: 1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }
.modal-header h3{
  margin:0;
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -.02em;
}
.modal-body{ padding: 16px; overflow:auto; }
.modal-footer{ padding: 14px 16px; border-top: 1px solid var(--border); display:flex; justify-content:flex-end; gap: 10px; }
.modal-close{
  border:1px solid var(--border);
  background:#fff;
  border-radius:12px;
  width:36px;
  height:36px;
  cursor:pointer;
  font-weight:900;
  color: var(--text-dim);
  transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}
.modal-close:hover{
  background:#f8fafc;
  border-color:#cbd5e1;
  color:var(--text);
  transform: translateY(-1px);
}
.modal.modal-ot{
  width:min(1120px, 96vw);
}
.modal.modal-ot .modal-header{
  padding: 18px 22px;
  background:
    radial-gradient(500px 140px at 0% 0%, rgba(22,163,74,.14), transparent 65%),
    radial-gradient(420px 160px at 100% 0%, rgba(14,165,233,.12), transparent 65%),
    linear-gradient(180deg, #ffffff, #f8fbff);
}
.modal.modal-ot .modal-body{
  padding: 22px;
  background: linear-gradient(180deg, #f8fafc 0%, #f3f6fb 100%);
}
.modal.modal-ot .modal-footer{
  padding: 16px 22px;
  background:#fff;
}
.modal.modal-ot .modal-header h3{
  font-size: 26px;
}
/* Toast container */
#toast-container{
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast{ background:#fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 12px; font-weight: 800; }
.toast.info{ border-left: 4px solid var(--accent-2); }
.toast.success{ border-left: 4px solid var(--accent); }
.toast.error{ border-left: 4px solid var(--danger); }

/* ==== FIX SCROLL / LAYOUT ==== */

/* Le conteneur principal doit occuper toute la hauteur */
#app{
  height: 100vh;
  display: flex;
  overflow: hidden; /* on évite le scroll global */
}

/* Sidebar garde sa taille */
.sidebar{
  flex: 0 0 var(--sidebar-w);
  height: 100vh;
  overflow: hidden;
}


/* La view prend la largeur et évite les effets "compressés" */
.view{
  min-height: 100%;
  width: 100%;
  padding: 24px;
}

/* ====== LAYOUT SAFE (sidebar fixe + main scroll) ====== */

html, body {
  height: 100%;
}

/* On garde le body bloqué, mais on scroll dans le main */
body{
  overflow: hidden;
}


/* Les vues : par défaut cachées, active affichée */
.view{
  display: none;
  width: 100%;
  min-height: calc(100vh - 48px);
}

.view.active{
  display: block;                 /* ✅ obligatoire */
}

/* Petit plus : évite l’impression “tout collé en haut” */
.page-header{
  margin-bottom: 16px;
}

/* ===== FIX OVERLAP sidebar/main ===== */
:root { --sidebar-w: 280px; } /* ajuste si besoin */



/* ===== THEME WHITE MODERNE + SNO GREEN SIDEBAR ===== */

:root{
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #fbfcfe;
  --border: #e6ebf2;
  --border-strong: #d7deea;

  --text: #0f172a;
  --text-dim: #475569;
  --text-muted: #64748b;

  --accent: #16a34a;        /* vert SNO */
  --accent-2: #22c55e;

  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow-md: 0 10px 30px rgba(15,23,42,.10);
  --radius: 14px;
  --radius-lg: 18px;
}

/* Global */
html, body{ background: var(--bg); color: var(--text); }
*{ box-sizing: border-box; }

/* Sidebar vert sombre */
.sidebar{
  background: radial-gradient(1200px 600px at 20% -10%, rgba(34,197,94,.20), transparent 60%),
              linear-gradient(180deg, #071a12 0%, #06130e 100%);
  border-right: 1px solid rgba(255,255,255,.08);
}

.sidebar .brand-name{ color:#fff; font-weight:800; letter-spacing:.4px; }
.sidebar .brand-tag{ color: rgba(255,255,255,.65); }

.nav-section-label{ color: rgba(255,255,255,.35); }

.nav-item{
  color: rgba(255,255,255,.80);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 12px;
  margin: 6px 10px;
}

.nav-item:hover{
  background: rgba(34,197,94,.08);
  border-color: rgba(34,197,94,.18);
}

.nav-item.active{
  background: rgba(34,197,94,.14);
  border-color: rgba(34,197,94,.35);
  box-shadow: 0 0 0 3px rgba(34,197,94,.10);
  color: #fff;
}

/* Header page */
.page-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom: 18px;
}

.page-title{ font-size: 28px; font-weight: 850; letter-spacing: -.3px; }
.page-subtitle{ color: var(--text-dim); margin-top: 4px; }

/* Panels (les grosses cartes) */
.panel{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.panel-header{
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.panel-title{ font-weight: 800; }
.panel-body{ padding: 16px; }

/* KPI cards plus distinctes */
.kpi-grid{ gap: 14px; }
.kpi-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.kpi-card:before{
  content:"";
  position:absolute;
  left:0; top:0; bottom:0;
  width: 5px;
  background: var(--kpi-color, var(--accent));
}
.kpi-label{ color: var(--text-muted); font-weight: 700; letter-spacing:.5px; }
.kpi-value{ font-weight: 900; letter-spacing: -.2px; }

/* Bar chart plus joli */
.bar-track{
  background: #eef2f7;
  border: 1px solid #e2e8f0;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill{
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

/* Boutons */
.btn{
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.btn-primary{
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border-color: rgba(0,0,0,.08);
  color: #04210f;
  font-weight: 800;
}

.btn-secondary{ color: var(--text); }

/* Views full width */
.view{ width: 100%; }

.panel.is-selected{
  border-color: rgba(34,197,94,.65) !important;
  box-shadow: 0 0 0 4px rgba(34,197,94,.18), var(--shadow-md) !important;
  transform: translateY(-1px);
}


.panel{
  transition: all .18s ease;
}
/* ─────────────────────────────
   LAYOUT (centrage + pleine largeur)
───────────────────────────── */

#app{
  display:flex;
  height:100vh;
  width:100vw;
}

/* sidebar reste fixe */
.sidebar{
  flex: 0 0 var(--sidebar-w);
}


/* chaque vue prend toute la largeur possible, mais centrée avec un max */
.view{
  width: 100%;
  max-width: 1250px;         /* ajuste 1200/1300/1400 selon ton écran */
  padding: 28px 28px 80px;
  margin: 0 auto;
}

/* ─────────────────────────────
   LOGO SIDEBAR (meilleure lisibilité)
───────────────────────────── */

.sidebar-header{
  padding: 18px 16px;
}

.sidebar-logo{
  display:flex;
  align-items:center;
  gap: 12px;
}

/* le badge blanc derrière le logo */
.logo-mark-sm{
  width: 44px;
  height: 44px;
  object-fit: contain;
  padding: 6px;
  border-radius: 12px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 8px 18px rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.25);
}

.brand-name{ color: #eafff1; font-weight: 800; letter-spacing:.3px; }
.brand-tag{ color: rgba(234,255,241,.75); font-weight: 600; }

#app{
  display:flex;
  height:100vh;
}

.sidebar{
  width:280px;
  flex-shrink:0;
}


.view{
  width:100%;
  max-width:1300px;
  margin:40px auto;
}

/* ===== LAYOUT PROPRE ET CENTRÉ ===== */

:root{
  --sidebar-w: 280px;
}

/* Structure globale */
#app{
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar{
  width: var(--sidebar-w);
  flex-shrink: 0;
}

/* Zone principale */
.main-content{
  flex: 1;
  overflow-y: auto;
  background: #f6f8fb;

  /* centrage */
  display: flex;
  justify-content: center;
}

/* Chaque page */
.view{
  width: 100%;
  max-width: 1300px;   /* largeur max centrée */
  padding: 40px 32px 80px;
}

/* ===== LAYOUT WRAPPER ===== */
.layout{
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* Zone de contenu principale */
.content{
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

/* Topbar */
.topbar{
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--surface, #fff);
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.topbar-title{ font-size: 18px; font-weight: 850; }
.topbar-sub{ font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.topbar-right{ display:flex; gap:8px; }

/* Les vues scrollent dans .content */
.view{
  display: none;
  overflow-y: auto;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 28px 32px 80px;
}

.view.active{
  display: block;
}
/* ─── FICHE TECHNICIEN ───────────────────────── */

/* Onglets */
.fiche-tab {
  padding: 10px 20px;
  border: none;
  border-bottom: 3px solid transparent;
  background: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: 0;
  transition: color .15s, border-color .15s;
  margin-bottom: -2px;
}

.fiche-tab:hover {
  color: var(--text);
  background: rgba(22,163,74,.05);
}

.fiche-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 800;
}

/* Champ formulaire interne */
.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.form-row{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.form-row.single{
  grid-template-columns: 1fr;
}
.field{
  min-width:0;
}
.field input,
.field select,
.field textarea{
  width:100%;
  border:1px solid var(--border);
  border-radius: 12px;
  background:#fff;
  color:var(--text);
  font-size:14px;
  font-family: inherit;
  padding: 11px 12px;
  min-height: 46px;
  outline:none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}
.field select{
  appearance:none;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%),
    linear-gradient(180deg, #ffffff, #f8fafc);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px),
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
}
.field input::placeholder,
.field textarea::placeholder{
  color:#94a3b8;
}
.field textarea{
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}
.field input[type="file"]{
  padding: 10px 12px;
  background:#f8fafc;
  border-style:dashed;
}
.field input:focus,
.field select:focus,
.field textarea:focus{
  border-color: rgba(22,163,74,.5);
  box-shadow: 0 0 0 4px rgba(22,163,74,.12);
}
.field input:disabled,
.field select:disabled,
.field textarea:disabled{
  background:#eef2f7;
  color:#64748b;
}

.ot-form{
  display:flex;
  flex-direction:column;
  gap: 16px;
}
.ot-form-intro{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(22,163,74,.14);
  background:
    radial-gradient(340px 180px at 0% 0%, rgba(22,163,74,.13), transparent 70%),
    radial-gradient(280px 160px at 100% 0%, rgba(14,165,233,.10), transparent 72%),
    linear-gradient(135deg, #ffffff, #f3fbf6 55%, #f2f8ff 100%);
  box-shadow: 0 8px 24px rgba(15,23,42,.05);
}
.ot-form-kicker{
  font-size:11px;
  font-weight:900;
  letter-spacing:1.4px;
  text-transform:uppercase;
  color:var(--accent);
  margin-bottom:6px;
}
.ot-form-title{
  font-size:24px;
  line-height:1.1;
  font-weight:900;
  color:var(--text);
  margin-bottom:6px;
}
.ot-form-copy{
  font-size:13px;
  color:var(--text-dim);
  max-width:640px;
  line-height:1.55;
}
.ot-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
}
.ot-meta-pill{
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.08);
  background:rgba(255,255,255,.78);
  font-size:11px;
  font-weight:800;
  color:var(--text-dim);
  white-space:nowrap;
}
.ot-meta-pill strong{
  color:var(--text);
  margin-left:4px;
}
.ot-tab-shell{
  display:flex;
  flex-direction:column;
  gap:16px;
}
.ot-tabs{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap:10px;
}
.ot-tab{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:4px;
  padding:14px 16px;
  border-radius:16px;
  border:1px solid rgba(148,163,184,.26);
  background:rgba(255,255,255,.82);
  color:var(--text-dim);
  cursor:pointer;
  text-align:left;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease;
  box-shadow: 0 8px 20px rgba(15,23,42,.04);
}
.ot-tab:hover{
  transform: translateY(-1px);
  border-color: rgba(22,163,74,.22);
  color:var(--text);
}
.ot-tab:focus-visible{
  outline:none;
  border-color: rgba(22,163,74,.45);
  box-shadow: 0 0 0 4px rgba(22,163,74,.12);
}
.ot-tab.active{
  color:var(--text);
  border-color: rgba(22,163,74,.28);
  background:
    radial-gradient(180px 80px at 0% 0%, rgba(22,163,74,.12), transparent 75%),
    radial-gradient(160px 70px at 100% 0%, rgba(14,165,233,.10), transparent 78%),
    linear-gradient(135deg, #ffffff, #f4fbf6 55%, #f4f8ff);
  box-shadow: 0 12px 24px rgba(15,23,42,.06);
}
.ot-tab-label{
  font-size:13px;
  font-weight:900;
  line-height:1.25;
}
.ot-tab-help{
  font-size:12px;
  line-height:1.45;
  color:var(--text-muted);
}
.ot-tab.active .ot-tab-help{
  color:var(--text-dim);
}
.ot-tab-panel[hidden]{
  display:none !important;
}
.ot-section{
  background:#fff;
  border:1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(15,23,42,.05);
  padding: 18px;
}
.ot-section:hover{
  box-shadow: 0 14px 30px rgba(15,23,42,.07);
}
.ot-section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.ot-section-title{
  font-size:12px;
  font-weight:900;
  letter-spacing:1.2px;
  text-transform:uppercase;
  color:var(--text-dim);
  margin-bottom:4px;
}
.ot-section-note{
  font-size:13px;
  color:var(--text-muted);
  line-height:1.45;
}
.ot-field-help{
  margin-top:8px;
  font-size:12px;
  color:var(--text-muted);
  line-height:1.45;
}
.field input.is-auto{
  background:#f0fdf4;
  border-color:rgba(22,163,74,.25);
  color:#166534;
  font-weight:800;
}
.ot-articles-toolbar{
  display:grid;
  grid-template-columns: minmax(0, 1fr) 120px auto;
  gap:12px;
  align-items:end;
  margin-bottom:14px;
}
.ot-articles-picker-field,
.ot-articles-qty-field{
  margin-bottom:0;
}
.ot-articles-add-btn{
  min-height:46px;
}
.ot-articles-summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 16px;
  border:1px solid rgba(22,163,74,.14);
  border-radius:16px;
  background:linear-gradient(135deg, #f8fff9, #f6fbff);
  margin-bottom:14px;
}
.ot-articles-summary-card{
  display:flex;
  flex-direction:column;
  gap:4px;
  color:var(--text-dim);
  font-size:12px;
  font-weight:700;
}
.ot-articles-summary-card strong{
  font-size:24px;
  line-height:1;
  color:var(--text);
  letter-spacing:-.02em;
}
.ot-articles-summary-note{
  max-width:520px;
  font-size:12px;
  color:var(--text-muted);
  line-height:1.5;
}
.ot-article-empty{
  padding:14px 16px;
  border:1px dashed var(--border);
  border-radius:14px;
  background:#f8fafc;
  color:var(--text-muted);
  font-size:12px;
  margin-bottom:12px;
}
.ot-article-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.ot-article-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding:14px 16px;
  border:1px solid var(--border);
  border-radius:16px;
  background:linear-gradient(180deg, #ffffff, #fbfdff);
}
.ot-article-main{
  min-width:0;
  flex:1;
}
.ot-article-title{
  font-size:14px;
  font-weight:900;
  color:var(--text);
  line-height:1.35;
}
.ot-article-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:6px;
  font-size:11px;
  color:var(--text-dim);
}
.ot-article-meta span{
  padding:4px 8px;
  border-radius:999px;
  background:#f8fafc;
  border:1px solid rgba(148,163,184,.18);
}
.ot-article-fields{
  display:flex;
  align-items:end;
  gap:10px;
  flex-shrink:0;
}
.ot-article-mini-field{
  width:120px;
}
.ot-article-total-box{
  min-width:130px;
  padding:10px 12px;
  border:1px solid rgba(148,163,184,.22);
  border-radius:14px;
  background:#f8fafc;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.ot-article-total-box span{
  font-size:11px;
  font-weight:700;
  color:var(--text-dim);
  text-transform:uppercase;
  letter-spacing:.6px;
}
.ot-article-total-box strong{
  font-size:16px;
  color:var(--text);
}
.ot-upload-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.ot-upload-card{
  border:1px solid var(--border);
  border-radius: 16px;
  overflow:hidden;
  background: linear-gradient(180deg, #fbfcff, #f8fafc);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.ot-upload-card-head{
  padding: 14px 16px 12px;
  border-bottom:1px solid var(--border);
  background:rgba(255,255,255,.8);
}
.ot-upload-card-title{
  font-size:15px;
  font-weight:900;
  color:var(--text);
}
.ot-upload-card-sub{
  font-size:12px;
  color:var(--text-dim);
  margin-top:4px;
  line-height:1.45;
}
.ot-upload-card-body{
  padding: 14px 16px 16px;
}
.ot-file-empty{
  padding: 16px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.ot-file-item{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding: 12px 0;
  border-bottom:1px solid var(--border);
}
.ot-file-item:last-child{
  border-bottom:none;
}
.ot-file-main{
  min-width:0;
}
.ot-file-title{
  font-size:13px;
  font-weight:800;
  color:var(--text);
  word-break:break-word;
}
.ot-file-meta{
  font-size:11px;
  color:var(--text-dim);
  margin-top:4px;
  line-height:1.45;
}
.ot-file-actions{
  display:flex;
  gap:6px;
  flex-shrink:0;
}
.ot-upload-actions{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:14px;
}

@media (min-width: 761px){
  .modal.modal-ot .modal-footer{
    position: sticky;
    bottom: 0;
    z-index: 2;
  }
}

@media (max-width: 920px){
  .ot-form-intro{
    flex-direction:column;
  }
  .ot-meta{
    justify-content:flex-start;
  }
  .ot-articles-toolbar{
    grid-template-columns: 1fr;
  }
  .ot-articles-summary,
  .ot-article-row{
    flex-direction:column;
  }
  .ot-article-fields{
    width:100%;
    flex-wrap:wrap;
  }
  .ot-tabs{
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
  .ot-upload-grid{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px){
  .form-row{
    grid-template-columns: 1fr;
  }
  .ot-articles-toolbar{
    grid-template-columns: 1fr;
  }
  .ot-article-mini-field,
  .ot-article-total-box,
  .ot-articles-add-btn{
    width:100%;
  }
  .ot-tabs{
    grid-template-columns: 1fr;
  }
  .modal.modal-ot{
    width:min(96vw, 96vw);
  }
  .modal.modal-ot .modal-header,
  .modal.modal-ot .modal-body,
  .modal.modal-ot .modal-footer{
    padding-left:16px;
    padding-right:16px;
  }
  .ot-form-title{
    font-size:20px;
  }
  .ot-section{
    padding:14px;
  }
}
/* ─── Groupes nav collapsibles ──────────────────────────────── */
.nav-group-header {
  cursor: pointer;
  user-select: none;
}
.nav-group-header .nav-chevron {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-dim);
  transition: transform .2s;
  flex-shrink: 0;
}
.nav-group-header.open .nav-chevron {
  transform: rotate(180deg);
}
.nav-sub-group {
  display: none;
  padding-left: 10px;
}
.nav-sub-group.open {
  display: block;
}
.nav-item.nav-sub {
  font-size: 13px;
  padding-left: 10px;
  border-left: 2px solid rgba(255,255,255,.1);
  margin-left: 4px;
}
.nav-item.nav-sub.active {
  border-left-color: var(--accent);
}
