/* assets/style.css (définitif v7 — modal sombre/non transparent) */
:root{
  --bg:#0b1220;
  --muted:#91a0b8;
  --text:#e9eef8;
  --line:rgba(255,255,255,.08);
  --accent:#4f8cff;
  --accent2:#25c2a0;
  --danger:#ff5c5c;
  --warning:#ffcc66;
  --shadow:0 10px 30px rgba(0,0,0,.35);
  --radius:14px;
  --pad:16px;
  --font: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial;

  --cell: rgba(10, 14, 25, .85);
  --rowHover: rgba(79, 140, 255, .10);
  --thead: #0e172a;
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family:var(--font);
  background: radial-gradient(1200px 600px at 20% 0%, #162447 0%, var(--bg) 45%, #070b14 100%);
  color:var(--text);
}

a{color:inherit;text-decoration:none}
a:hover{opacity:.9}

/* ======= Largeur par défaut (Dashboard, Packs, etc.) ======= */
.container{
  width: min(1200px, 96vw);
  max-width:1200px;
  margin:0 auto;
  padding:24px;
}

/* ======= Largeur uniquement pour la page Assignements ======= */
body.page-assignments .container{
  width: min(1600px, 96vw);
  max-width:1600px;
}

.topbar{
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(11,18,32,.90), rgba(11,18,32,.70));
  border-bottom:1px solid var(--line);
}

.nav{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 24px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  font-weight:700;
  font-size:16px;
}

.badge{
  font-size:12px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.05);
  color:var(--muted);
}

.menu{display:flex;gap:10px;flex-wrap:wrap}
.menu a{
  padding:8px 12px;
  border-radius:10px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  font-size:14px;
}
.menu a.active{
  border-color:rgba(79,140,255,.6);
  background:rgba(79,140,255,.15);
}
.menu a.danger{
  border-color:rgba(255,92,92,.6);
  background:rgba(255,92,92,.15);
}

h1{margin:20px 0 15px;font-size:26px}
h2{margin:0 0 14px;font-size:18px;color:#dbe6ff}
.muted{color:var(--muted)}

.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:16px;
}

.card{
  grid-column:span 12;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:var(--pad);
}

@media(min-width:900px){
  .span-4{grid-column:span 4}
  .span-6{grid-column:span 6}
  .span-8{grid-column:span 8}
}

.kpi{display:flex;justify-content:space-between;align-items:center}
.kpi .value{font-size:28px;font-weight:700}
.kpi .label{font-size:13px;color:var(--muted)}

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

.table-wrap{overflow:auto;border-radius:12px}

/* Neutralise CSS “responsive table” externe */
.table thead{display:table-header-group !important;}
.table tbody{display:table-row-group !important;}
.table tr{display:table-row !important;}
.table th{display:table-cell !important;}
.table td{display:table-cell !important;}
.table td::before{content:none !important; display:none !important;}

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.02);
}

/* Table large UNIQUEMENT sur Assignements */
body.page-assignments .table{
  min-width: 1200px;
}

.table th,.table td{
  padding:10px 12px;
  border-bottom:1px solid var(--line);
  text-align:left;
  vertical-align:middle;
  font-size:14px;
  white-space:nowrap;
}

.table td{
  background: var(--cell);
  background-clip: padding-box;
}

.table tr:nth-child(even) td{
  background: rgba(10,14,25,.70);
}

.table th{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:var(--muted);
  background:var(--thead);
  position:relative;
  z-index:1;
}

.table tr:last-child td{border-bottom:0}
.table tr:hover td{background: var(--rowHover)}

.table th:first-child,.table td:first-child{
  max-width: 260px;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Alignements */
.table th:nth-child(2), .table td:nth-child(2),
.table th:nth-child(4), .table td:nth-child(4),
.table th:nth-child(5), .table td:nth-child(5){
  text-align:right;
}
.table th:nth-child(3), .table td:nth-child(3){text-align:center}

/* ===================== */
/* PILLS / STATUS        */
/* ===================== */
.pill{
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.05);
  white-space:nowrap;
}
.pill.ok{border-color:rgba(37,194,160,.6);background:rgba(37,194,160,.15)}
.pill.warn{border-color:rgba(255,204,102,.6);background:rgba(255,204,102,.15)}
.pill.bad{border-color:rgba(255,92,92,.6);background:rgba(255,92,92,.15)}

/* ===================== */
/* BUTTONS               */
/* ===================== */
.btn{
  display:inline-block;
  padding:8px 14px;
  border-radius:10px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  color:var(--text);
  cursor:pointer;
  font-size:14px;
}
.btn.primary{border-color:rgba(79,140,255,.6);background:rgba(79,140,255,.2)}
.btn.success{border-color:rgba(37,194,160,.6);background:rgba(37,194,160,.2)}
.btn.danger{border-color:rgba(255,92,92,.6);background:rgba(255,92,92,.2)}
.btn:hover{filter:brightness(1.1)}
.btn:active{transform:translateY(1px)}

/* ===================== */
/* FORMS                 */
/* ===================== */
input, select, textarea{
  width:100%;
  padding:9px 10px;
  border-radius:10px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  color:var(--text);
  outline:none;
}
input:focus, select:focus, textarea:focus{border-color:var(--accent)}
label{font-size:12px;color:var(--muted);display:block;margin-bottom:6px}
.field{margin-bottom:14px}
.form-row{display:grid;gap:14px}
@media(min-width:700px){.form-row{grid-template-columns:1fr 1fr}}

/* ===================== */
/* NOTICE                */
/* ===================== */
.notice{
  padding:12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.05);
  font-size:14px;
}
.notice.ok{border-color:rgba(37,194,160,.6);background:rgba(37,194,160,.15)}
.notice.bad{border-color:rgba(255,92,92,.6);background:rgba(255,92,92,.15)}

/* ===================== */
/* MODAL (POPUP)         */
/* ===================== */

/* Backdrop plus sombre */
.modal-backdrop{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.78);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:1000;
  padding:20px;
}
.modal-backdrop.open{display:flex}

/* Fenêtre NON transparente (noir profond) */
.modal{
  width:min(820px, 96vw);
  border-radius:16px;
  border:1px solid rgba(255,255,255,.10);
  background: #0a0f1d;              /* <-- opaque */
  box-shadow: 0 35px 90px rgba(0,0,0,.75);
  padding:16px;
}

/* Liseré/relief léger */
.modal::before{
  content:"";
  display:block;
  height:1px;
  background: linear-gradient(90deg, transparent, rgba(79,140,255,.35), transparent);
  margin:-16px -16px 14px;
}

.modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.modal-title{font-size:18px;font-weight:700}
.modal-close{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color:var(--text);
  border-radius:10px;
  padding:6px 10px;
  cursor:pointer;
}

.modal-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
  margin-top:12px;
}

/* Inputs dans modal un peu plus lisibles */
.modal input, .modal select{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
}
.modal input:focus, .modal select:focus{
  border-color: rgba(79,140,255,.6);
}

/* ===== FIX SELECT DROPDOWN (options) : fond sombre + texte clair ===== */
/* À ajouter en FIN de votre assets/style.css (ou remplacez les règles existantes select) */

select{
  appearance:auto;
  color: var(--text);
}

/* Le champ fermé (déjà OK chez vous, mais on renforce) */
select,
.modal select{
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  color: var(--text);
}

/* IMPORTANT : les options du menu déroulant (fond + texte) */
select option{
  background:#0a0f1d;   /* fond sombre */
  color:#e9eef8;        /* texte clair */
}

/* Option sélectionnée / survolée (selon navigateur) */
select option:checked,
select option:hover{
  background:#18325f;   /* bleu sombre */
  color:#ffffff;
}

/* Sur certains navigateurs, le dropdown peut hériter d'un fond clair */
select:focus{
  outline:none;
  border-color: rgba(79,140,255,.6);
}
