/* Mouv — back-office. Charte : orange #F58220, blanc #FFFFFF, noir #000000. */
:root {
  --orange: #F58220;
  --orange-600: #DD6F10;
  --orange-50: #FFF4EA;
  --black: #000000;
  --ink: #111111;
  --ink-2: #444444;
  --muted: #6B6B6B;
  --line: #E7E7E7;
  --bg: #F7F7F7;
  --white: #FFFFFF;
  --ok: #1E8E3E;
  --ok-bg: #E6F4EA;
  --warn: #B25E00;
  --warn-bg: #FFF1DD;
  --err: #C5221F;
  --err-bg: #FCE8E6;
  --info: #1A5FB4;
  --info-bg: #E8F0FE;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 1px 8px rgba(0,0,0,.04);
  --sidebar: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg);
}
a { color: var(--orange-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--black); margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 600; }
small, .muted { color: var(--muted); }
code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
:focus-visible { outline: 3px solid rgba(245,130,32,.45); outline-offset: 2px; }

/* --- Layout --- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex-shrink: 0; background: var(--black); color: #EDEDED;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; border-bottom: 1px solid #222; }
.sidebar .brand img { width: 40px; height: 40px; border-radius: 9px; background: #fff; object-fit: contain; }
.sidebar .brand b { font-size: 20px; letter-spacing: .5px; color: #fff; }
.sidebar .brand span { display: block; font-size: 11px; color: #AFAFAF; }
.nav { padding: 10px 8px 24px; }
.nav .group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8C8C8C; padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; color: #E2E2E2; padding: 8px 12px; border-radius: 8px; font-weight: 500;
}
.nav a:hover { background: #1C1C1C; text-decoration: none; color: #fff; }
.nav a.active { background: var(--orange); color: #fff; }
.nav a .ico { width: 18px; text-align: center; opacity: .9; }
.nav a .count { margin-left: auto; background: var(--orange); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; }
.nav a.active .count { background: #000; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--white); border-bottom: 1px solid var(--line); height: 60px; display: flex; align-items: center;
  justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.topbar .who { display: flex; align-items: center; gap: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-weight: 700; }
.content { padding: 24px; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.topbar .menu-toggle { display: none; }

/* --- Cards / grid --- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 18px; }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 16px; }
.kpi { padding: 16px 18px; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi .value { font-size: 26px; font-weight: 800; color: var(--black); margin-top: 4px; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi.accent { border-top: 4px solid var(--orange); }

/* --- Tables --- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #FBFBFB; white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid #F0F0F0; vertical-align: top; }
.table tr:hover td { background: #FFFBF6; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }
.table .actions { white-space: nowrap; text-align: right; }
.empty { padding: 36px; text-align: center; color: var(--muted); }
dl.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 500; }

/* --- Badges (texte + icône : jamais la couleur seule) --- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: "●"; font-size: 8px; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.ok::before { content: "✓"; font-size: 11px; }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.warn::before { content: "⏳"; font-size: 10px; }
.badge.err { background: var(--err-bg); color: var(--err); }
.badge.err::before { content: "✕"; font-size: 10px; }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.info::before { content: "➜"; font-size: 10px; }
.badge.neutral { background: #F1F1F1; color: #333; }
.badge.brand { background: var(--orange-50); color: var(--orange-600); border-color: #FBD3B0; }

/* --- Buttons --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer; line-height: 1.2; text-decoration: none; }
.btn:hover { text-decoration: none; border-color: #CFCFCF; background: #FAFAFA; }
.btn-primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-600); border-color: var(--orange-600); }
.btn-dark { background: var(--black); border-color: var(--black); color: #fff; }
.btn-dark:hover { background: #222; }
.btn-danger { background: #fff; color: var(--err); border-color: #F2B8B5; }
.btn-danger:hover { background: var(--err-bg); }
.btn-ok { background: #fff; color: var(--ok); border-color: #A8D5B5; }
.btn-ok:hover { background: var(--ok-bg); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* --- Forms --- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field .error { font-size: 12px; color: var(--err); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=search], input[type=tel], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #D5D5D5; border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--orange); outline: none; box-shadow: 0 0 0 3px rgba(245,130,32,.18); }
textarea { min-height: 90px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--orange); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.filters .field { min-width: 150px; }
.filters .field.grow { flex: 1; min-width: 220px; }

/* --- Alerts --- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; display: flex; gap: 10px; }
.alert-ok { background: var(--ok-bg); border-color: #B7DFC2; color: #0D5223; }
.alert-err { background: var(--err-bg); border-color: #F2B8B5; color: #7A1411; }
.alert-warn { background: var(--warn-bg); border-color: #F5D2A2; color: #6B3A00; }
.alert-info { background: var(--info-bg); border-color: #C6D8F6; color: #123E78; }

/* --- Timeline --- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--orange); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--orange); }
.timeline li:last-child { border-left-color: transparent; }
.timeline .t { font-weight: 600; }
.timeline .d { font-size: 12px; color: var(--muted); }

/* --- Pagination --- */
.pagination { display: flex; gap: 4px; padding: 14px 18px; flex-wrap: wrap; align-items: center; }
.pagination a, .pagination span { padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); font-size: 13px; }
.pagination .active { background: var(--orange); border-color: var(--orange); color: #fff; }
.pagination .disabled { color: #BBB; }
.pagination .info { border: none; color: var(--muted); margin-left: auto; }

/* --- Map --- */
.map { height: 420px; border-radius: var(--radius); border: 1px solid var(--line); }
.map.tall { height: calc(100vh - 200px); min-height: 480px; }

/* --- Login --- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #fff; }
.auth-side { background: var(--black); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 60px; }
.auth-side img { width: 320px; max-width: 100%; background: #fff; border-radius: 16px; padding: 18px; }
.auth-side h2 { color: #fff; font-size: 26px; margin-top: 28px; }
.auth-side p { color: #BDBDBD; max-width: 420px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-form .box { width: 100%; max-width: 380px; }
.auth-form .field { margin-bottom: 14px; }

.progress { height: 8px; background: #EEE; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--orange); }
.bar-row { display: grid; grid-template-columns: 110px 1fr 70px; gap: 10px; align-items: center; margin: 6px 0; font-size: 13px; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mb-0 { margin-bottom: 0; }
.nowrap { white-space: nowrap; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: -260px; z-index: 50; transition: left .2s; }
  .sidebar.open { left: 0; }
  .topbar .menu-toggle { display: inline-flex; }
  .grid-2, .form-grid, .grid-4 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  dl.kv { grid-template-columns: 1fr; }
}
