/* Dashboard clients Strix — palette de la marque (vert foncé / bleu canard / sarcelle / menthe) */
:root {
  --fonce: #043538; --canard: #0B545B; --sarcelle: #5AA395; --ciel: #E6F2FF; --menthe: #CCF8E1; --rouge: #E22239;
  --bg: #F4F7F7; --card: #fff; --line: #E2E8E8; --text: #12262A; --muted: #6B7C80; --amber: #B7791F; --amber-bg: #FFF7E0;
  --ok: #1F9D55; --ok-bg: #E6F7EC; --ko: #C8102E; --ko-bg: #FDECEE; --info-bg: #E6F2FF;
  --r: 12px; --shadow: 0 1px 2px rgba(4, 53, 56, .06), 0 4px 16px rgba(4, 53, 56, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 "DM Sans", system-ui, -apple-system, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--canard); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 600; }
p { margin: 0 0 .6em; }
code, .mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .88em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.flex { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.stack { display: grid; gap: 14px; }

/* --- Layout --- */
.layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--canard), var(--fonce)); color: #DCEBEA; padding: 18px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; color: #fff; }
.brand img { width: 42px; height: 42px; border-radius: 11px; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.brand b { display: block; font-size: 1.15rem; }
.brand span { font-size: .78rem; opacity: .75; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: #DCEBEA; font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.nav a.router-link-active { background: rgba(255, 255, 255, .16); color: #fff; }
.nav .badge { margin-left: auto; }
.nav .sep { height: 1px; background: rgba(255, 255, 255, .12); margin: 12px 8px; }
.sidebar .foot { margin-top: auto; padding: 10px 8px 0; font-size: .82rem; opacity: .8; }
.sidebar .foot a { color: #fff; }
.main { padding: 26px 32px 60px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

/* --- Cartes & grilles --- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; }
.card.tight { padding: 0; overflow: hidden; }
.card h2, .card h3 { margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.stat { padding: 16px 18px; }
.stat .label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat .value { font-size: 1.9rem; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; }
.stat .hint { font-size: .85rem; color: var(--muted); }
.stat.warn { border-color: #F3D9A4; background: var(--amber-bg); }
.stat.bad { border-color: #F5C2C7; background: var(--ko-bg); }

/* --- Tableaux --- */
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #FAFCFC; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #F6FAFA; }
.empty { padding: 36px; text-align: center; color: var(--muted); }

/* --- Badges & états --- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--ciel); color: var(--canard); white-space: nowrap; }
.badge.red { background: var(--ko-bg); color: var(--ko); }
.badge.green { background: var(--ok-bg); color: var(--ok); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.gray { background: #EEF1F1; color: var(--muted); }
.badge.purple { background: #F1EAFF; color: #6B3FD6; }
.badge.dark { background: var(--fonce); color: #fff; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #C4CDCD; display: inline-block; flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.dot.ko { background: var(--ko); box-shadow: 0 0 0 3px var(--ko-bg); }
.dot.na { background: #C4CDCD; }

/* --- Boutons & formulaires --- */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; transition: .15s; white-space: nowrap; }
.btn:hover { border-color: #C9D3D3; background: #F7FAFA; }
.btn.primary { background: var(--canard); border-color: var(--canard); color: #fff; }
.btn.primary:hover { background: var(--fonce); }
.btn.danger { color: var(--ko); border-color: #F5C2C7; }
.btn.danger:hover { background: var(--ko-bg); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 5px 10px; font-size: .85rem; }
.btn:disabled { opacity: .55; cursor: default; }
label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--text); outline: none; transition: .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--sarcelle); box-shadow: 0 0 0 3px rgba(90, 163, 149, .2); }
textarea { min-height: 90px; resize: vertical; }
.field { margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); font-size: .93rem; cursor: pointer; }
.check input { width: auto; }
.search { max-width: 340px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; margin-bottom: -1px; }
.tabs button.on { color: var(--canard); border-color: var(--canard); }
.tabs .cnt { font-weight: 500; opacity: .7; margin-left: 4px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; color: var(--muted); }
.pill.on { background: var(--fonce); color: #fff; border-color: var(--fonce); }

/* --- Détails --- */
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; font-size: .93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 14px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border: 0; }
.timeline .t-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sarcelle); margin-top: 6px; }
.timeline .t-dot.system { background: #C4CDCD; }
.timeline .meta { font-size: .8rem; color: var(--muted); }
.timeline .text { white-space: pre-wrap; }
.progress { height: 8px; background: #E8EEEE; border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--sarcelle), var(--canard)); border-radius: 99px; transition: width .3s; }
.onb { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; }
.msg-body { white-space: pre-wrap; background: #FAFCFC; border: 1px solid var(--line); border-radius: 9px; padding: 14px; }
.reply { background: var(--info-bg); border-radius: 9px; padding: 12px 14px; margin-top: 10px; white-space: pre-wrap; }

/* --- Modale, toasts, login --- */
.modal-bg { position: fixed; inset: 0; background: rgba(4, 53, 56, .45); display: grid; place-items: center; padding: 20px; z-index: 50; }
.modal { background: #fff; border-radius: 16px; width: min(760px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal header { padding: 18px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal .body { padding: 20px 24px; }
.modal footer { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 100; }
.toast { background: var(--fonce); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 500; animation: pop .2s; }
.toast.err { background: var(--ko); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.login { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 20% -10%, #0B545B, #043538); padding: 20px; }
.login .card { width: min(400px, 100%); padding: 32px; text-align: center; }
.login img { width: 72px; border-radius: 18px; margin-bottom: 8px; }
.login h1 { font-size: 1.3rem; margin-bottom: 4px; }
.login .field { text-align: left; }
.error { color: var(--ko); font-size: .9rem; margin: 8px 0; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(0, 0, 0, .15); border-top-color: var(--canard); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.menu-btn { display: none; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; width: 260px; transform: translateX(-100%); transition: .2s; }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .main { padding: 18px 16px 60px; }
  .g2, .g3, .g4, .form-grid, .onb { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 8px; }
  table { font-size: .88rem; }
  .table-wrap { overflow-x: auto; }
}
