/* Trustena Back-office — console d'exploitation. Hérite des tokens du design
   system (trustena.css) ; ajoute la mise en page dense propre à une console
   (barre latérale + contenu, tuiles, tableaux, pastilles de santé). */

body { background: #eef3f8; }
.bo { display: grid; grid-template-columns: 15.5rem 1fr; min-height: 100vh; }
.bo-loading { padding: 3rem; color: var(--muted); }

/* --- Barre latérale --- */
.bo-side { background: linear-gradient(180deg, var(--navy) 0%, #0a1f38 100%); color: #cfe0ef; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.bo-side .brand { padding: 1.3rem 1.4rem 1rem; font-size: 1rem; letter-spacing: .16em; text-transform: uppercase; color: #9fd4d4; }
.bo-side .brand b { color: #fff; font-weight: 700; }
.bo-side .brand small { display: block; letter-spacing: .04em; text-transform: none; color: #7f9bb8; font-size: .72rem; margin-top: .2rem; }
.bo-nav { list-style: none; padding: .4rem 0; flex: 1; }
.bo-nav a { display: flex; align-items: center; gap: .6rem; padding: .62rem 1.4rem; color: #cfe0ef; text-decoration: none; font-size: .93rem; border-left: 3px solid transparent; }
.bo-nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.bo-nav a.on { background: rgba(15,163,163,.16); color: #fff; border-left-color: var(--teal); font-weight: 600; }
.bo-nav a .ic { width: 1.1rem; text-align: center; opacity: .85; }
.bo-nav a .n { margin-left: auto; background: rgba(255,255,255,.14); border-radius: 999px; font-size: .72rem; padding: .05rem .5rem; }
.bo-side .side-foot { padding: 1rem 1.4rem; font-size: .76rem; color: #7f9bb8; border-top: 1px solid rgba(255,255,255,.08); }

/* --- Zone de contenu --- */
.bo-main { padding: 0 0 3rem; min-width: 0; }
.bo-top { background: var(--card); border-bottom: 1px solid var(--line); padding: 1rem 1.8rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 5; }
.bo-top h1 { font-size: 1.25rem; color: var(--navy); }
.bo-top .sub { color: var(--muted); font-size: .88rem; }
.bo-top .spacer { flex: 1; }

/* Sélecteur de profil (démo) */
.role-switch { display: flex; gap: .3rem; background: #eef3f8; border-radius: 10px; padding: .25rem; }
.role-switch button { border: 0; background: transparent; padding: .4rem .8rem; border-radius: 8px; font-weight: 600; font-size: .85rem; color: var(--muted); cursor: pointer; }
.role-switch button.on { background: var(--card); color: var(--navy); box-shadow: 0 1px 3px rgba(11,36,64,.14); }

.bo-body { padding: 1.6rem 1.8rem; max-width: 74rem; }
.demo-banner { background: #fff7e6; border: 1px solid #f2dfb0; color: #7a5b12; border-radius: 10px; padding: .6rem .9rem; font-size: .84rem; margin-bottom: 1.3rem; }
.demo-banner b { color: #6a4e0e; }

h2.sec { font-size: 1.05rem; color: var(--navy); margin: 1.6rem 0 .8rem; }
h2.sec:first-child { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }

/* --- Tuiles de statistiques --- */
.tiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.tile { background: var(--card); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.tile .k { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tile .v { font-size: 1.7rem; font-weight: 700; color: var(--navy); margin-top: .3rem; line-height: 1.1; }
.tile .d { font-size: .82rem; color: var(--muted); margin-top: .2rem; }
.tile.good .v { color: var(--ok); } .tile.warn .v { color: var(--warn); } .tile.bad .v { color: var(--ko); }

/* --- Cartes & tableaux --- */
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem 1.3rem; margin-bottom: 1.2rem; }
.panel > .hd { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .8rem; }
.panel > .hd h3 { font-size: 1rem; color: var(--navy); }
.panel > .hd .muted { font-size: .82rem; }
table.bo-tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.bo-tbl th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
table.bo-tbl td { padding: .6rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.bo-tbl tr:last-child td { border-bottom: 0; }
table.bo-tbl td.num, table.bo-tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.b { font-weight: 600; color: var(--navy); }

/* Pastilles santé & statut */
.hp { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .86rem; }
.hp .d { width: .62rem; height: .62rem; border-radius: 50%; flex: none; }
.hp.up { color: var(--ok); } .hp.up .d { background: var(--ok); box-shadow: 0 0 0 3px rgba(11,122,75,.15); }
.hp.down { color: var(--ko); } .hp.down .d { background: var(--ko); box-shadow: 0 0 0 3px rgba(176,0,32,.14); }
.hp.na { color: var(--muted); } .hp.na .d { background: #b7c3d0; }
.tag { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .04em; border-radius: 999px; padding: .16rem .55rem; }
.tag.ga { background: #e9f7ee; color: #23794a; } .tag.beta { background: #e7f6f6; color: #0b7a7a; }
.tag.draft { background: #eef1f5; color: #6a7c90; } .tag.internal { background: #efe9fb; color: #5b3fa0; }
.tag.actif { background: #e9f7ee; color: #23794a; } .tag.pilote { background: #e7f6f6; color: #0b7a7a; }
.tag.essai { background: #fff3e0; color: #8a5a00; }
.pl { display: inline-block; background: #eef3f8; border: 1px solid #dbe6f0; border-radius: 7px; padding: .1rem .5rem; font-size: .78rem; color: var(--navy); margin: .1rem .15rem .1rem 0; }

/* --- Graphe revenus (SVG barres empilées, zéro dépendance) --- */
.chart { width: 100%; height: 190px; }
.chart .bar-d { fill: var(--navy); } .chart .bar-c { fill: var(--teal); }
.chart .axis { stroke: var(--line); } .chart text { fill: var(--muted); font-size: 10px; }
.legend { display: flex; gap: 1.1rem; margin-top: .6rem; font-size: .82rem; color: var(--muted); }
.legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.legend .ld { background: var(--navy); } .legend .lc { background: var(--teal); }

/* Matrice de conformité */
.mx { width: 100%; border-collapse: collapse; font-size: .84rem; }
.mx th { padding: .45rem .4rem; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
.mx th.p { text-align: left; } .mx td { text-align: center; padding: .45rem .4rem; border-bottom: 1px solid var(--line); }
.mx td.p { text-align: left; font-weight: 600; color: var(--navy); }
.cx { display: inline-block; width: 1.35rem; height: 1.35rem; line-height: 1.35rem; border-radius: 6px; font-size: .78rem; font-weight: 700; }
.cx.ok { background: #e3f5ea; color: #1c7a49; } .cx.partiel { background: #fdf1de; color: #8a5a00; }
.cx.na { background: #eef1f5; color: #90a0b2; }

.actor { display: inline-block; font-size: .72rem; font-weight: 600; border-radius: 6px; padding: .1rem .45rem; }
.actor.soloji { background: #e7f6f6; color: #0b7a7a; } .actor.deep { background: #e6ecfb; color: #33499e; }
.actor.système { background: #eef1f5; color: #647689; }

@media (max-width: 820px) {
  .bo { grid-template-columns: 1fr; }
  .bo-side { position: static; height: auto; flex-direction: column; }
  .bo-nav { display: flex; flex-wrap: wrap; }
  .bo-nav a { border-left: 0; border-bottom: 3px solid transparent; padding: .5rem .8rem; }
  .bo-nav a.on { border-left: 0; border-bottom-color: var(--teal); }
  .side-foot { display: none; }
}
