/* SCPiNet — feuille de style
 *
 * Un seul niveau de fond, un filet à 1 px, et l'accent réservé à ce qui est
 * actif ou attend une action. Les tailles sont pensées pour trois supports :
 * poste (1480), tablette (1024, cibles à 48 px) et navigateur.
 */

:root {
  --accent: #B14BE8;
  --accent-dim: #7E2CAD;
  --accent-soft: rgba(177, 75, 232, 0.14);

  --bg: #0B0C0D;
  --panel: #0E0F11;
  --card: #101213;
  --card-hi: #131518;
  --deep: #0A0B0C;

  --line: #22252A;
  --line-hi: #3a3d42;

  --txt: #E8EAEC;
  --txt2: #8f9296;
  --txt3: #6F7276;
  --txt4: #4a4d50;

  --ok: #6DD58C;
  --warn: #E0A64B;
  --danger: #E05A4B;
  --info: #5AA9E0;
  --cmd: #7A8ED6;

  --sec: #B14BE8;
  --sci: #5AA9E0;
  --med: #E05A4B;
  --tec: #E0A64B;
  --adm: #7A8ED6;

  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --rail: 258px;
  --rail-fold: 78px;
}

* { box-sizing: border-box; }

/*
  L'attribut hidden passe par [hidden] { display: none } de la feuille du
  navigateur, qui perd contre n'importe quelle règle de classe. Or .login et
  .app déclarent display:flex — sans cette ligne, hidden n'a aucun effet et les
  deux écrans s'affichent l'un sous l'autre.
*/
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--txt);
  font-family: Rajdhani, 'Segoe UI Semibold', system-ui, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #cf85f0; }

input, textarea, select, button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}
input:focus, textarea:focus { outline: none; }
input::placeholder, textarea::placeholder { color: #5F5A63; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent-dim); border-radius: 3px; }

/* ------------------------------------------------------------------- marques */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 26px; height: 26px; flex: none;
  border: 2px solid var(--accent); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.brand-mark::after {
  content: ''; width: 8px; height: 8px;
  background: var(--accent); border-radius: 50%;
}
.brand-word { font-size: 21px; font-weight: 700; letter-spacing: 0.16em; white-space: nowrap; }

/* ----------------------------------------------------------------- connexion */
.login { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card { width: 490px; display: flex; flex-direction: column; gap: 22px; }
.login h1 { margin: 0; font-size: 34px; font-weight: 700; line-height: 1.15; }
.lede { margin: 8px 0 0; font-size: 19px; font-weight: 500; color: var(--txt2); line-height: 1.5; text-wrap: pretty; }

.btn {
  height: 52px; display: flex; align-items: center; justify-content: center; gap: 12px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.14em;
  cursor: pointer;
}
.btn-steam { background: var(--accent); color: #0B0C0D; }
.btn-steam:hover { background: #c05ff0; color: #0B0C0D; }
.steam-mark { width: 18px; height: 18px; border: 2px solid #0B0C0D; border-radius: 50%; }

.notes { margin: 0; padding: 15px; list-style: none; background: var(--card); border-left: 2px solid var(--accent); }
.notes li { position: relative; padding-left: 15px; font-size: 16px; font-weight: 500; color: #9A9EA2; line-height: 1.5; }
.notes li + li { margin-top: 9px; }
.notes li::before { content: ''; position: absolute; left: 0; top: 9px; width: 5px; height: 5px; background: var(--accent); }
.fine { margin: 0; font-family: var(--mono); font-size: 10px; line-height: 1.7; color: var(--txt4); }

/* --------------------------------------------------------------- application */
.app { display: flex; height: 100%; }

.rail {
  width: var(--rail); flex: none;
  background: var(--panel);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  display: flex; flex-direction: column;
  transition: width 160ms cubic-bezier(0.3, 0, 0.2, 1);
}
.rail.fold { width: var(--rail-fold); }
.rail.fold .brand-word,
.rail.fold .account-text,
.rail.fold .nav-label,
.rail.fold .nav-badge,
.rail.fold .nav-ro { opacity: 0; width: 0; overflow: hidden; }

.rail-head { height: 70px; display: flex; align-items: center; gap: 11px; padding: 0 16px; flex: none; }
.rail-fold { margin-left: auto; font-family: var(--mono); font-size: 13px; color: var(--txt3); cursor: pointer; }
.rail-fold:hover { color: var(--txt); }
.rail.fold .rail-fold { transform: rotate(180deg); }

.rail-rule {
  height: 1px; margin: 0 16px 14px; flex: none;
  background: linear-gradient(90deg, var(--accent) 0%, rgba(177, 75, 232, 0) 100%);
}

.rail-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 0 8px; overflow-y: auto; min-height: 0; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  height: 44px; padding: 0 8px;
  border-radius: 3px; cursor: pointer; text-align: left;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.045); }
.nav-item.on { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.nav-item.on:hover { background: rgba(177, 75, 232, 0.2); }

.nav-tile {
  width: 26px; height: 26px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 10px;
  border: 1px solid #2a2d30; color: var(--txt2);
}
.nav-item.on .nav-tile { background: var(--accent); border-color: var(--accent); color: #0B0C0D; }

.nav-label { flex: 1; min-width: 0; font-size: 18px; font-weight: 500; color: var(--txt2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item.on .nav-label { font-weight: 600; color: var(--txt); }
.nav-ro { flex: none; font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; color: var(--warn); }
.nav-badge {
  flex: none; min-width: 19px; height: 17px;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
  background: var(--accent); color: #0B0C0D;
  font-family: var(--mono); font-size: 10px;
}

.account {
  display: flex; align-items: center; gap: 11px; padding: 12px 16px; flex: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06); cursor: pointer; text-align: left;
}
.account:hover { background: rgba(255, 255, 255, 0.04); }
.avatar {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  border: 2px solid var(--cmd); background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--cmd);
}
.account-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.account-name { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-meta { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: var(--txt3); white-space: nowrap; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.crumbs {
  height: 46px; flex: none;
  display: flex; align-items: center; gap: 9px; padding: 0 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; color: var(--txt3);
}
.crumbs .here { color: var(--txt); }
.crumbs a:hover { color: var(--accent); }
.spacer { flex: 1; }
.offsite { display: flex; align-items: center; gap: 9px; font-size: 10px; letter-spacing: 0.12em; color: var(--cmd); }
.offsite i { width: 6px; height: 6px; background: var(--cmd); }

.view { flex: 1; overflow-y: auto; min-height: 0; }

/* ---------------------------------------------------------------- briques */
.pad { padding: 26px; display: flex; flex-direction: column; gap: 18px; }
.head { font-size: 28px; font-weight: 700; margin: 0; }
.overline { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; color: var(--txt3); }

.row { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.grid { display: grid; gap: 13px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

.card {
  display: flex; flex-direction: column; gap: 13px; padding: 16px;
  background: var(--card); border: 1px solid var(--line); cursor: pointer;
}
.card:hover { border-color: var(--line-hi); background: var(--card-hi); }
.card-title { font-size: 18px; font-weight: 600; line-height: 1.3; text-wrap: pretty; }
.card-foot {
  margin-top: auto; padding-top: 9px; border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: var(--txt3);
}

.line {
  display: flex; align-items: center; gap: 14px; padding: 13px 15px;
  background: var(--card); border: 1px solid var(--line);
}
.line.click { cursor: pointer; }
.line.click:hover { border-color: var(--line-hi); }
.line-title { flex: 1; min-width: 0; font-size: 19px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.field {
  height: 36px; display: flex; align-items: center; gap: 9px; padding: 0 13px;
  background: var(--panel); border: 1px solid #24272A; flex: 1; min-width: 220px;
}
.field input { width: 100%; }
.field-mark { font-family: var(--mono); font-size: 11px; color: #5F5A63; flex: none; }

.chip {
  height: 36px; display: flex; align-items: center; padding: 0 13px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid #24272A; background: var(--panel); color: var(--txt2);
  cursor: pointer; white-space: nowrap;
}
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip:hover { border-color: var(--line-hi); }

.action {
  height: 36px; display: flex; align-items: center; padding: 0 16px; flex: none;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  background: var(--accent); color: #0B0C0D; cursor: pointer; white-space: nowrap;
}
.action:hover { background: #c05ff0; }
.action[disabled] { background: none; border: 1px solid #24272A; color: var(--txt4); cursor: not-allowed; }

.pill {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 8px; flex: none; white-space: nowrap; border: 1px solid currentColor;
}
.pill.attente { color: var(--warn); }
.pill.cours { color: var(--info); }
.pill.fait { color: var(--ok); }
.pill.rejet { color: var(--danger); }

.avis {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px;
  font-size: 17px; font-weight: 500; line-height: 1.45; text-wrap: pretty;
}
.avis i { width: 6px; height: 6px; flex: none; background: currentColor; }
.avis.warn { color: var(--warn); background: rgba(224, 166, 75, 0.07); border: 1px solid var(--warn); }
.avis.info { color: var(--cmd); background: rgba(122, 142, 214, 0.07); border: 1px solid var(--cmd); }

.plate {
  background: repeating-linear-gradient(135deg, #16181A 0 9px, #121416 9px 18px);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; color: var(--txt3);
}

.vide { font-family: var(--mono); font-size: 12px; line-height: 1.7; color: #5F5A63; }

.stat { display: flex; flex-direction: column; gap: 5px; padding: 14px 15px; background: var(--card); border-left: 2px solid var(--accent); }
.stat-k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--txt3); line-height: 1.4; }
.stat-v { font-size: 30px; font-weight: 700; line-height: 1; }

/* -------------------------------------------------------------- messagerie */
.mail { display: flex; height: 100%; min-height: 0; }
.mail-list { width: 338px; flex: none; border-right: 1px solid rgba(255, 255, 255, 0.06); overflow-y: auto; }
.mail-item { display: flex; gap: 11px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid rgba(255, 255, 255, 0.045); }
.mail-item:hover { background: rgba(255, 255, 255, 0.04); }
.mail-item.on { background: rgba(177, 75, 232, 0.1); }
.mail-dot { width: 6px; height: 6px; flex: none; margin-top: 7px; border-radius: 50%; }
.mail-item.neuf .mail-dot { background: var(--accent); }
.mail-from { font-family: var(--mono); font-size: 11px; color: var(--txt2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-subj { font-size: 17px; font-weight: 500; color: var(--txt2); line-height: 1.3; }
.mail-item.neuf .mail-subj { font-weight: 600; color: var(--txt); }
.mail-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 24px 26px; gap: 16px; overflow-y: auto; }
.mail-body { font-size: 18px; font-weight: 500; color: #B6BABE; line-height: 1.6; white-space: pre-line; text-wrap: pretty; }

/* ------------------------------------------------------------- tablette */
@media (max-width: 1100px) {
  .rail { width: var(--rail-fold); }
  .rail .brand-word, .rail .account-text, .rail .nav-label,
  .rail .nav-badge, .rail .nav-ro { opacity: 0; width: 0; overflow: hidden; }
  .rail-fold { display: none; }
  .nav-item { height: 48px; padding: 0 14px; }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .mail-list { width: 100%; }
  .mail.lit .mail-list { display: none; }
  .mail:not(.lit) .mail-pane { display: none; }
}
