/* ====== GLOBAL LAYOUT ====== */

* {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f4f6fa;
    color: #1a1a1a;
    margin: 0;
    padding: 2rem;
    display: flex;
    justify-content: center;
    overflow-x: hidden; /* tue les scrollbars horizontales globales */
}

/* Conteneur principal */
.container {
    width: 95%;
    max-width: 1800px;        /* <--- AU LIEU de 700px / 1200px / etc */
    margin: 0 auto;
    background: #fff;
    padding: 2rem 3rem;
    border-radius: 1rem;
    box-shadow: 0 30px 60px rgba(0,0,0,.06);
    box-sizing: border-box;
    overflow-x: hidden;
}


/* ====== HEADER / TOP BAR ====== */
.site-header {
  background-image: url('images/fond_terrain.png'); /* change le chemin selon ton dossier */
  background-size: cover;
  background-position: center;
  height: 300px;
  position: relative;
  color: white;
}

.site-header .overlay {
  background: rgba(0, 0, 0, 0.5); /* assombrit un peu l’image */
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.site-header h1 {
  font-size: 3em;
  margin: 0;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
}

.navbar ul {
  list-style: none;
  padding: 0;
  margin: 15px 0 0;
  display: flex;
  gap: 20px;
}

.navbar a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s;
}

.navbar a:hover {
  color: #FFD700; /* jaune doré */
}



.header-row {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1rem;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.header-left {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111;
    line-height: 1.4;
}

.header-right {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    line-height: 1.2;
}

/* badge utilisateur */
.session-chip {
    font-size:.8rem;
    color:#444;
    background:#f9fafc;
    border:1px solid #d0d5dd;
    padding:.45rem .6rem;
    border-radius:.5rem;
    line-height:1.2;
    font-weight:500;
}

/* bouton générique style pill */
.button-link {
    font-size: .9rem;
    text-decoration: none;
    background:#1a73e8;
    color:#fff;
    padding:.55rem .8rem;
    border-radius:.5rem;
    font-weight:500;
    display:inline-block;
    line-height:1.2;
    border:0;
    cursor:pointer;
}

.button-link:hover {
    background:#1558b3;
}

.button-logout {
    background:#6b7280;
}

.button-logout:hover {
    background:#4b5563;
}

/* ====== TABLE BLOCK ====== */

.table-wrapper {
    width: 100%;
    max-width: 100%;
    border: 1px solid #eee;
    border-radius: .75rem;
    background:#fff;
    overflow-x: hidden; /* pas de scroll horizontal */
}

/* TABLE */
table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: auto;
}

/* En-tête */
th {
    background:#f9fafc;
    font-weight:600;
    color:#444;
    text-align:left;
    padding:0.75rem 1rem;
    border-bottom:1px solid #eee;
    line-height:1.3;
    white-space:nowrap;
}

/* Cellules */
td {
    padding:0.75rem 1rem;
    border-bottom:1px solid #eee;
    vertical-align:top;
    color:#111;
    line-height:1.4;

    /* Autoriser les retours à la ligne naturels */
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Première ligne après header un peu plus aérée */
tbody tr:first-child td {
    padding-top:1rem;
}

/* logo */
.logo-cell {
    width:10px;
}
.logo-cell img {
    max-height:5px;
    max-width:5px;
    border-radius:.4rem;
    box-shadow:0 8px 16px rgba(0,0,0,.08);
    display:block;
}

/* adresse multi-lignes */
.td-adresse {
    white-space: normal;
}

/* email : lien bleu type web */
.td-email a {
    word-break: break-word;
    color:#1a0dab;
}

/* téléphone + mise en forme */
.td-tel {
    font-family: ui-monospace, Consolas, monospace;
    font-size:.85rem;
    white-space:nowrap;
    color:#111;
    line-height:1.4;
}

/* date : un peu plus discret */
.td-date {
    font-size:.8rem;
    color:#555;
    white-space:nowrap;
    line-height:1.4;
}

/* colonne actions */
.td-actions {
    white-space:nowrap;
    text-align:right;
    width:1%;
}

/* ====== ACTION BUTTONS ====== */

.action-btn {
    font-size:.75rem;
    font-weight:500;
    text-decoration:none;
    border-radius:.4rem;
    padding:.4rem .6rem;
    display:inline-block;
    line-height:1.2;
    border:0;
    cursor:pointer;
    margin-left:.25rem;
    margin-bottom:.4rem;
}

.btn-edit {
    background:#1a73e8;
    color:#fff;
}
.btn-edit:hover {
    background:#1558b3;
}

.btn-delete {
    background:#d93025;
    color:#fff;
}
.btn-delete:hover {
    background:#b12218;
}

/* ====== RESPONSIVE ====== */

/* Sur très petits écrans : on cache l'adresse si elle casse trop la ligne */
@media (max-width: 600px) {
    .col-adresse,
    .td-adresse {
        display:none;
    }
}

/* ====== Jauge entreprises ====== */

.jauge-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: .75rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.03);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    max-width: 400px;
    font-family: inherit;
}

.jauge-top-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    row-gap: .25rem;
    font-size: .9rem;
    font-weight: 500;
    color: #111;
}

.jauge-top-row .jauge-label {
    font-size: .9rem;
    font-weight: 600;
    color: #111;
}

.jauge-top-row .jauge-value {
    font-size: .9rem;
    font-weight: 500;
    color: #444;
}

.jauge-bar-wrapper {
    margin-top: .6rem;
    background: #f1f5f9;
    border-radius: .5rem;
    height: 10px;
    overflow: hidden;
    border: 1px solid #dbe2ea;
}

.jauge-bar-fill {
    height: 100%;
    background: linear-gradient(to right, #1a73e8, #1558b3);
    border-radius: .5rem;
    transition: width .3s ease;
}

.jauge-footer {
    font-size: .75rem;
    color: #666;
    margin-top: .5rem;
    line-height: 1.3;
}
/* ====== DASHBOARD STATS ====== */

.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    flex: 1 1 250px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: .75rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.03);
    padding: 1rem 1.25rem;
    min-width: 0; /* évite les débordements en flex */
}

/* titre + valeur à droite */
.stat-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    row-gap: .25rem;
}

.stat-label {
    font-size: .8rem;
    font-weight: 600;
    color: #444;
    line-height: 1.3;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

/* sous-texte petit gris */
.stat-sub {
    font-size: .75rem;
    color: #666;
    margin-top: .5rem;
    line-height: 1.3;
    word-break: break-word;
}

/* barre de progression (pour la carte Entreprises) */
.stat-progress-wrap {
    margin-top: .6rem;
    background: #f1f5f9;
    border-radius: .5rem;
    height: 10px;
    overflow: hidden;
    border: 1px solid #dbe2ea;
}

.stat-progress-bar {
    height: 100%;
    background: linear-gradient(to right, #1a73e8, #1558b3);
    border-radius: .5rem;
    transition: width .3s ease;
}

/* petit accent de couleur à gauche du titre si tu veux un repère visuel */
.stat-accent {
    display: inline-block;
    width: .5rem;
    height: .5rem;
    border-radius: .25rem;
    margin-right: .4rem;
}

.stat-accent-blue  { background:#1a73e8; }
.stat-accent-green { background:#20a050; }
.stat-accent-red   { background:#d93025; }

/* responsive: empile proprement les cartes si l'écran est étroit */
@media (max-width: 600px) {
    .stats-row {
        flex-direction: column;
    }
}

/* ===========================
   DASHBOARD HEADER MODERNE
   =========================== */

.dash-top {
    margin-bottom: 2rem;
    display: grid;
    gap: 1rem;
}

/* Carte de header avec fond dégradé sombre / effet panneau */
.dash-header-card {
    background: radial-gradient(circle at 0% 0%, #1e293b 0%, #0f172a 60%);
    color: #fff;
    border-radius: 1rem;
    padding: 1.5rem 1.5rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.5rem;
    box-shadow: 0 30px 60px rgba(0,0,0,.4);
}

/* partie gauche du header */
.dash-header-left {
    min-width: 200px;
    flex: 1 1 250px;
}

.dash-eyebrow {
    font-size: .7rem;
    font-weight: 500;
    color: #93a3c9;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .4rem;
}

.dash-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .5rem .75rem;
    margin-bottom: .5rem;
}

.dash-title {
    font-size: 1.1rem;
    line-height: 1.3;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.dash-pill {
    background: rgba(255,255,255,.1);
    color:#fff;
    font-size:.8rem;
    line-height:1.2;
    font-weight:600;
    padding:.4rem .6rem;
    border-radius:.5rem;
    border: 1px solid rgba(255,255,255,.2);
}

.dash-sub {
    font-size: .8rem;
    color: #c9d3ff;
    line-height: 1.4;
}

/* Partie droite : jauge circulaire */
.dash-header-right {
    min-width: 160px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ----- Jauge circulaire ----- */

.gauge-ring {
    position: relative;
    width: 90px;
    height: 90px;
    flex-shrink: 0;
}

.gauge-svg {
    width: 90px;
    height: 90px;
    transform: rotate(-90deg); /* pour que ça démarre en haut */
    display: block;
}

.gauge-bg {
    fill: none;
    stroke: rgba(255,255,255,.15);
    stroke-width: 4;
    stroke-linecap: round;
}

.gauge-fg {
    fill: none;
    stroke: #38bdf8; /* bleu cyan clair */
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dasharray .3s;
}

.gauge-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.gauge-main {
    font-size: .9rem;
    font-weight: 600;
    color:#fff;
    line-height:1.2;
}
.gauge-sub {
    font-size: .6rem;
    color:#93a3c9;
    line-height:1.2;
}

/* ====== DASHBOARD STATS CLASSIQUE ====== */

.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    flex: 1 1 250px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: .75rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.03);
    padding: 1rem 1.25rem;
    min-width: 0;
}

/* titre + valeur */
.stat-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    row-gap: .25rem;
}

.stat-label {
    font-size: .8rem;
    font-weight: 600;
    color: #444;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111;
    font-variant-numeric: tabular-nums;
}

/* sous-texte */
.stat-sub {
    font-size: .75rem;
    color: #666;
    margin-top: .5rem;
    line-height: 1.3;
}

/* barre de progression */
.stat-progress-wrap {
    margin-top: .6rem;
    background: #f1f5f9;
    border-radius: .5rem;
    height: 10px;
    overflow: hidden;
    border: 1px solid #dbe2ea;
}

.stat-progress-bar {
    height: 100%;
    background: linear-gradient(to right, #1a73e8, #1558b3);
    border-radius: .5rem;
    transition: width .3s ease;
}

/* petits accents de couleur */
.stat-accent {
    display: inline-block;
    width: .5rem;
    height: .5rem;
    border-radius: .25rem;
    margin-right: .4rem;
}

.stat-accent-blue  { background:#1a73e8; }
.stat-accent-green { background:#20a050; }
.stat-accent-red   { background:#d93025; }

/* responsive */
@media (max-width: 600px) {
    .stats-row {
        flex-direction: column;
    }
}

/* ===== Jauge circulaire ===== */

.jauge-mini-wrapper{
    display:inline-grid;
    place-items:center;
    gap:.4rem;
    width:120px;
    user-select:none;
    font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

.jauge-mini-ring{
    position:relative;
    width:120px;
    height:120px;
}

.jauge-mini-ring svg{
    width:100%;
    height:100%;
    transform:rotate(-90deg); /* départ en haut */
}

.jauge-bg{
    stroke:#eef1f4;
}

.jauge-val{
    stroke:#ED3326; /* rouge USCB par défaut */
    stroke-linecap:round;
    transition:stroke-dashoffset .6s ease, stroke .2s ease;
    filter:drop-shadow(0 1px 2px rgba(0,0,0,.08));
}

.jauge-center{
    position:absolute;
    inset:0;
    display:grid;
    place-items:center;
    text-align:center;
}

.jauge-pct{
    font-weight:800;
    font-size:1.3rem;
    color:#213570; /* bleu USCB */
    line-height:1;
}

.jauge-meta{
    font-size:.75rem;
    color:#6b7280;
    line-height:1.2;
}
