/* =============================================================================
   panel.css — mise en page propre au panel (barre latérale, onglets, journaux…)
   Les couleurs, polices, boutons et cartes viennent de noxium-theme.css.
   ============================================================================= */

/* --- Structure --- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--bg-deep); border-right: 1px solid var(--line); padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { margin-bottom: 22px; }
.nav a { white-space: nowrap; display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 7px; color: var(--muted); font-size: 14px; }
.nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--panel-2); color: var(--text); }
.nav .sep { margin: 16px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.nav .pdot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--muted)); flex: none; }
.side form { margin-top: 20px; }
.side .who { font-size: 13px; margin-bottom: 6px; color: var(--muted); }
.main { padding: 26px 32px 60px; max-width: 1200px; width: 100%; min-width: 0; }
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.top .sub { color: var(--muted); margin-top: -6px; }
.section-title { margin-top: 28px; }

/* --- Indicateurs --- */
.metric .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.metric .value { font-family: var(--mono); font-size: 22px; margin: 4px 0 8px; }

/* --- Cartes de projet --- */
.proj { display: block; color: var(--text); border-left: 3px solid var(--muted); }
.proj:hover { text-decoration: none; border-color: var(--accent); background: var(--panel-2); }
.proj.ok { border-left-color: var(--accent); }
.proj.warn { border-left-color: var(--warn); }
.proj.off { border-left-color: var(--bad); }
.proj .name { font-weight: 600; font-size: 16px; }
.proj .desc { font-size: 13px; color: var(--muted); margin-top: 4px; }
.proj .meta { font-size: 13px; color: var(--muted); margin-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; }

/* --- Onglets --- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-size: 14px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }

/* --- Journaux --- */
.log { background: #05070a; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; height: 520px; overflow: auto;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; color: #c6d0dc; }
.log .e { color: #ff9a9a; }
.log .w { color: var(--warn); }
.log .k { color: var(--accent); }

/* --- Envoi de fichier --- */
.drop { border: 1.5px dashed #2c3747; border-radius: var(--radius); padding: 22px; text-align: center; background: #0c1118; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop .icon { font-size: 28px; }
.drop p { margin: 4px 0 10px; }

/* --- Connexion --- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(94, 224, 176, .09), transparent 60%), var(--bg); }
.login .box { width: 100%; max-width: 380px; text-align: center; }
.login .brand { margin-bottom: 22px; }
.login h1 { font-size: 20px; }

@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; }
  .side .brand { margin-bottom: 10px; }
  .nav { display: flex; gap: 4px; overflow-x: auto; }
  .nav .sep, .side form, .nav .proj-link { display: none; }
  .main { padding: 18px 16px 50px; }
  .top .btn { width: 100%; }
  td form.row { flex-wrap: wrap; }
  .log { height: 60vh; }
}

/* --- Double authentification --- */
.code-input { font-family: var(--mono); font-size: 26px !important; letter-spacing: .3em; text-align: center; padding: 12px !important; }
.qr { background: #fff; border-radius: var(--radius); padding: 10px; width: max-content; margin: 8px 0 12px; }
.qr img { display: block; }
.secret { background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; word-break: break-all; letter-spacing: .08em; }
.codes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.codes span { background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; text-align: center; font-size: 15px; }
@media (max-width: 760px) { .codes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* --- Formulaires dépliables dans les tableaux --- */
.inline-details { display: inline-block; position: relative; }
.inline-details > summary { list-style: none; }
.inline-details > summary::-webkit-details-marker { display: none; }
.restore-form { position: absolute; right: 0; z-index: 5; margin-top: 6px; width: 300px; text-align: left; background: var(--panel-2);
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); }
.restore-form select, .restore-form input[type=text] { margin: 4px 0; }
@media (max-width: 760px) { .restore-form { position: static; width: auto; } }

/* --- Assistant de création --- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.tpl { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--field); cursor: pointer; color: var(--text); margin: 0; }
.tpl:hover { border-color: var(--line-strong); }
.tpl:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.tpl input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-icon { font-size: 22px; }

/* --- Fichiers, éditeur --- */
.crumbs a { color: var(--text); }
.files td { padding: 6px 10px; }
.editor { width: 100%; min-height: 60vh; font-family: var(--mono); font-size: 13px; line-height: 1.55; tab-size: 4; white-space: pre; background: #05070a; }
.small-log { height: auto; max-height: 220px; font-size: 12px; margin: 6px 0 0; }

/* --- Surveillance --- */
.spark { width: 100%; height: 48px; display: block; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.spark.mem polyline { stroke: var(--info); }

/* --- Page de statut --- */
.status-page { max-width: 760px; margin: 0 auto; padding: 40px 16px; }
.status-banner.ok { border-color: rgba(94, 224, 176, .4); }
.status-banner.bad { border-color: var(--bad-line); }
.status-row { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.status-row:last-child { border-bottom: 0; }
.status-notice { border-left: 3px solid var(--info, #7aa7ff); }
.status-notice.maintenance { border-left-color: var(--warn); }
.status-notice.incident { border-left-color: var(--bad); }
.status-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 14px 0; }
.status-stats > div { display: flex; flex-direction: column; gap: 2px; }
.status-stats b { font-size: 18px; }
.status-days { display: flex; gap: 3px; height: 30px; margin: 6px 0 4px; }
.status-days .day { flex: 1; border-radius: 3px; }
.day { display: inline-block; background: var(--line-strong); }
.day.inline { width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }
.day.good { background: var(--accent); }
.day.warn { background: var(--warn); }
.day.bad { background: var(--bad); }
.day.none { background: var(--line); }
.load.normale { color: var(--accent); }
.load.élevée { color: var(--warn); }
.load.saturée { color: var(--bad); }

#wizard { counter-reset: step; }
#wizard h2.step::before { counter-increment: step; content: counter(step) ". "; }

/* --- Droits par projet --- */
.perm-table th.perm-col, .perm-table td.perm-col { text-align: center; white-space: nowrap; }
.perm-table td.perm-col input { width: 18px; height: 18px; accent-color: var(--accent); }
.perm-table select { min-width: 150px; }
.kv.plain dd { font-family: var(--sans); font-size: 14px; word-break: normal; }

form.inline { display: inline; }
