* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Arial, sans-serif; background: #f1f4f9; color: #1f2937; }

header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
         padding: 16px 24px; background: #0f172a; color: #fff; }
header h1 { margin: 0; font-size: 20px; }
#maj { font-size: 13px; color: #cbd5e1; }

main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.titre { font-size: 15px; color: #64748b; text-transform: uppercase; letter-spacing: .05em; margin: 20px 0 10px; }

.grille { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.carte { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 16px; }
.carte h3 { margin: 0; font-size: 13px; font-weight: 600; color: #64748b; }
.valeur { margin: 6px 0; font-size: 32px; font-weight: 700; }
small { color: #64748b; }

.ok { color: #16a34a; }
.ko { color: #dc2626; }

.barre { height: 10px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.barre span { display: block; height: 100%; width: 0; background: #2563eb; transition: width .5s; }
.barre span.alerte { background: #dc2626; }

/* ---------- Navigation ---------- */
nav { display: flex; gap: 6px; }
nav a { color: #cbd5e1; text-decoration: none; padding: 6px 12px; border-radius: 6px; }
nav a.actif, nav a:hover { background: #1e293b; color: #fff; }

/* ---------- Tableaux et formulaires (Partie III) ---------- */
.panneau { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 16px; margin-bottom: 18px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: 8px; border-bottom: 1px solid #e2e8f0; }
th { font-size: 12px; color: #64748b; text-transform: uppercase; }
form.ligne { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
form.ligne label { display: flex; flex-direction: column; font-size: 12px; color: #64748b; }
input, select { padding: 7px 9px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; }
button { padding: 7px 12px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; cursor: pointer; font: inherit; }
button.principal { background: #2563eb; border-color: #2563eb; color: #fff; }
button.danger { color: #dc2626; border-color: #fecaca; }
.badge { padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.ko { background: #fee2e2; color: #991b1b; }
.badge.gris { background: #e5e7eb; color: #374151; }
#message { min-height: 22px; font-weight: 600; }
.badge { white-space: nowrap; }

/* ---------- Services (Partie V) ---------- */
.carte.aide p { margin: 8px 0 0; }
code { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 4px; padding: 1px 5px; font-size: 13px; }
.panneau h3 { margin: 0 0 10px; font-size: 15px; }
audio { height: 32px; max-width: 260px; }

/* ---------- Centre d'appels (Partie VI) ---------- */
fieldset.agents { border: 1px solid #e2e8f0; border-radius: 8px; margin: 12px 0; padding: 8px 12px; }
fieldset.agents legend { font-size: 12px; color: #64748b; padding: 0 4px; }
label.case { display: inline-flex; align-items: center; gap: 4px; margin: 4px 14px 4px 0; font-size: 14px; }
.grille.petite { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 12px; }
.grille.petite .valeur { font-size: 22px; }
.badge.bleu { background: #dbeafe; color: #1e40af; }
.badge.orange { background: #ffedd5; color: #9a3412; }
.petit { color: #64748b; font-size: 13px; }
.titre small { text-transform: none; letter-spacing: 0; }
div.ligne { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
div.ligne label { display: flex; flex-direction: column; font-size: 12px; color: #64748b; }

/* ---------- Navigation commune (nav.js) et IVR (Partie VII) ---------- */
nav { flex-wrap: wrap; }
.options td input, .options td select { width: 100%; }
.options .touche { width: 60px; }
textarea { padding: 7px 9px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; width: 100%; min-height: 60px; }
label.bloc { display: flex; flex-direction: column; font-size: 12px; color: #64748b; margin: 10px 0; }

/* ---------- Supervision (Partie VIII) ---------- */
section.deux { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.bleu-texte { color: #1d4ed8; }

/* ---------- CDR (Partie IX) ---------- */
svg.graphe { width: 100%; height: auto; }
svg.graphe .axe { font-size: 10px; fill: #64748b; }
svg.graphe .grille-graphe { stroke: #e2e8f0; }
.legende { display: flex; gap: 14px; font-size: 12px; color: #475569; margin-top: 4px; }
.legende span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--c); margin-right: 5px; }
.hbarre { display: grid; grid-template-columns: 150px 1fr 40px; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; }
.hpiste { background: #f1f5f9; border-radius: 4px; height: 12px; overflow: hidden; }
.hval { display: block; height: 100%; border-radius: 4px; }
.hnb { text-align: end; font-weight: 600; }

/* ---------- Securite (Partie X) ---------- */
body.page-connexion main { display: grid; place-items: center; min-height: 90vh; }
form.connexion { width: 100%; max-width: 360px; }
form.connexion h1 { margin: 0 0 4px; font-size: 22px; }
form.connexion button { width: 100%; margin-top: 8px; }
form.connexion input { width: 100%; }
nav a.compte { margin-inline-start: 12px; border: 1px solid #334155; }

/* ---------- Acces rapide (tableau de bord) ---------- */
.raccourcis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
a.raccourci { display: flex; flex-direction: column; gap: 4px; padding: 14px; background: #fff; border: 1px solid #e2e8f0;
              border-radius: 10px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.raccourci:hover, a.raccourci:focus { border-color: #2563eb; transform: translateY(-2px); outline: none; }
a.raccourci .icone { font-size: 26px; }
a.raccourci strong { font-size: 15px; }
a.raccourci small { color: #64748b; }
a.raccourci .badge { align-self: flex-start; margin-top: 4px; }
h2.titre[id], a[id] { scroll-margin-top: 80px; }

/* ---------- Langue arabe (i18n.js) ---------- */
html[lang="ar"] body { font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif; }
html[dir="rtl"] svg.graphe { direction: ltr; }
html[dir="rtl"] input[type="number"], html[dir="rtl"] input[pattern] { direction: ltr; text-align: end; }
html[dir="rtl"] a.raccourci:hover { transform: translateY(-2px); }
.bouton-langue { background: #1e293b; color: #fff; border-color: #334155; font-weight: 600; }
.bouton-langue.flottant { position: fixed; top: 16px; inset-inline-end: 16px; background: #fff; color: #0f172a; border-color: #cbd5e1; }
