:root {
  --bg: #0f1117;
  --surface: #181b24;
  --surface2: #1e2230;
  --border: #2a3042;
  --text: #e8eaef;
  --muted: #8b92a8;
  --accent: #0d9488;
  --accent-soft: rgba(13, 148, 136, 0.15);
  --rh: #14b8a6;
  --font: 'DM Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); display: flex; min-height: 100vh; }

.sidebar {
  width: 240px; background: var(--surface); border-right: 1px solid var(--border);
  padding: 20px 14px; display: flex; flex-direction: column; flex-shrink: 0;
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; padding: 0 6px; }
.logo {
  width: 42px; height: 42px; background: linear-gradient(135deg, var(--rh), #0f766e);
  border-radius: 10px; color: #fff; font-size: 0.72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.brand strong { display: block; font-size: 0.88rem; }
.brand span { font-size: 0.68rem; color: var(--muted); }

.nav {
  display: block; width: 100%; text-align: left; padding: 10px 14px; margin-bottom: 4px;
  border: none; background: none; border-radius: 8px; color: var(--muted);
  font-family: inherit; font-size: 0.88rem; cursor: pointer;
}
.nav:hover { background: var(--surface2); color: var(--text); }
.nav.on { background: var(--accent-soft); color: var(--rh); font-weight: 600; }

.back-portail {
  margin-top: auto; padding: 12px 14px; font-size: 0.8rem; color: var(--muted);
  text-decoration: none; border-top: 1px solid var(--border); padding-top: 20px;
}
.back-portail:hover { color: var(--rh); }

.link-equipe {
  padding: 8px 14px; font-size: 0.75rem; color: var(--muted);
  text-decoration: none; margin-bottom: 8px;
}
.link-equipe:hover { color: #818cf8; }

.main { flex: 1; overflow: auto; }
.top {
  padding: 24px 28px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px;
}
.top h1 { font-size: 1.3rem; }
.top p { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }
.access-badge {
  font-size: 0.72rem; padding: 6px 12px; border-radius: 99px;
  background: var(--accent-soft); color: var(--rh); font-weight: 600;
}

.panel { display: none; padding: 24px 28px 40px; }
.panel.on { display: block; }

.toolbar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.btn {
  padding: 8px 16px; background: var(--rh); color: #fff; border: none;
  border-radius: 8px; font-family: inherit; font-weight: 600; font-size: 0.85rem; cursor: pointer;
}
.btn-ghost { padding: 8px 16px; background: transparent; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-family: inherit; cursor: pointer; }
.search, select.search { padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit; }
.xs { padding: 4px 10px; font-size: 0.72rem; border: 1px solid var(--border); background: var(--surface2); border-radius: 6px; color: var(--text); cursor: pointer; margin-left: 6px; }

.split { display: grid; grid-template-columns: 260px 1fr; gap: 20px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } body { flex-direction: column; } .sidebar { width: 100%; } }

.list { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.row {
  padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer;
  display: flex; gap: 10px; align-items: center;
}
.row:hover, .row.on { background: var(--accent-soft); }
.av { width: 32px; height: 32px; border-radius: 8px; background: #1d4ed8; font-size: 0.65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.row strong { display: block; font-size: 0.85rem; }
.row span { font-size: 0.72rem; color: var(--muted); }

.detail { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 22px; }
.detail h2 { font-size: 1.1rem; }
.sub { font-size: 0.88rem; margin: 20px 0 8px; color: var(--text); }
.muted { color: var(--muted); font-size: 0.85rem; }
.muted.small { font-size: 0.78rem; margin-bottom: 12px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; margin: 8px 0; cursor: pointer; }
.actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }

.perm, .data { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.perm th, .perm td, .data th, .data td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: center; }
.perm th:first-child, .perm td:first-child, .data th:first-child, .data td:first-child { text-align: left; }
.perm th, .data th { font-size: 0.68rem; text-transform: uppercase; color: var(--muted); background: var(--surface2); }
.data { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.data.compact td { padding: 8px 12px; }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.card.wide { grid-column: 1 / -1; }
.card h3 { font-size: 0.9rem; margin-bottom: 12px; color: var(--rh); }
.leave { list-style: none; font-size: 0.85rem; }
.leave li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.soldes { font-size: 0.9rem; line-height: 1.8; }

.cal { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-width: 520px; margin-top: 12px; }
.ch { text-align: center; font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.cd {
  aspect-ratio: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 0.85rem;
}
.cd.off { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.35); }
.cd span { font-size: 0.55rem; color: #fbbf24; margin-top: 2px; }
.login-screen { display:flex; min-height:100vh; align-items:center; justify-content:center; width:100%; }
.login-box { background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:28px; width:min(400px,92vw); }
.login-box h1 { font-size:1.2rem; }
.login-box label { display:block; font-size:0.72rem; color:var(--muted); margin:12px 0 4px; }
.login-box input { width:100%; padding:10px; background:var(--bg); border:1px solid var(--border); border-radius:8px; color:var(--text); font-family:inherit; }
.login-box .btn { width:100%; margin-top:16px; }
.err { color:#f87171; font-size:0.85rem; margin-top:8px; }
#app-screen { display:flex; width:100%; min-height:100vh; }

.alerts-bar { padding:12px 28px; display:flex; flex-wrap:wrap; gap:8px; border-bottom:1px solid var(--border); background:rgba(234,179,8,0.06); }
.alert-pill { font-size:0.8rem; padding:6px 12px; border-radius:99px; background:rgba(234,179,8,0.15); color:#fbbf24; border:1px solid rgba(234,179,8,0.3); }
.alert-pill.danger { background:rgba(239,68,68,0.12); color:#f87171; border-color:rgba(239,68,68,0.3); }

.people-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:14px; }
.person-card { background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:16px; cursor:pointer; transition:0.15s; }
.person-card:hover { border-color:var(--rh); background:var(--accent-soft); }
.person-card .av { width:40px; height:40px; border-radius:10px; background:linear-gradient(135deg,var(--rh),#0f766e); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:0.8rem; margin-bottom:10px; }
.person-card h4 { font-size:0.95rem; margin:0 0 4px; }
.person-card .job { font-size:0.78rem; color:var(--muted); margin-bottom:8px; }
.badge-row { display:flex; flex-wrap:wrap; gap:6px; }
.mini-badge { font-size:0.68rem; padding:3px 8px; border-radius:99px; background:var(--surface2); color:var(--muted); }
.mini-badge.warn { background:rgba(234,179,8,0.15); color:#fbbf24; }
.mini-badge.danger { background:rgba(239,68,68,0.12); color:#f87171; }

.field { margin-bottom:12px; }
.lbl { display:block; font-size:0.72rem; color:var(--muted); margin-bottom:4px; }
.field input, .field select, .field textarea, .card input, .card select, .card textarea {
  width:100%; padding:9px 11px; background:var(--bg); border:1px solid var(--border);
  border-radius:8px; color:var(--text); font-family:inherit;
}
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.quick-actions { display:flex; flex-direction:column; gap:8px; }
.quick-actions button { text-align:left; }
.todo-list { list-style:none; font-size:0.85rem; }
.todo-list li { padding:8px 0; border-bottom:1px solid var(--border); }
.warn-box { margin-top:14px; padding:12px 14px; border-radius:10px; background:rgba(234,179,8,0.1); border:1px solid rgba(234,179,8,0.3); color:#fbbf24; font-size:0.85rem; }

.heures-table { width:100%; border-collapse:collapse; font-size:0.82rem; background:var(--surface); border:1px solid var(--border); border-radius:12px; overflow:hidden; }
.heures-table th, .heures-table td { padding:8px 10px; border-bottom:1px solid var(--border); text-align:left; }
.heures-table th { font-size:0.68rem; text-transform:uppercase; color:var(--muted); background:var(--surface2); }
.heures-table input[type="number"] { width:64px; padding:6px; background:var(--bg); border:1px solid var(--border); border-radius:6px; color:var(--text); }
.status-pill { display:inline-block; font-size:0.72rem; padding:3px 10px; border-radius:99px; font-weight:600; }
.status-pill.draft { background:var(--surface2); color:var(--muted); }
.status-pill.submitted { background:rgba(59,130,246,0.15); color:#60a5fa; }
.status-pill.validated { background:rgba(34,197,94,0.15); color:#4ade80; }
.status-pill.rejected { background:rgba(239,68,68,0.12); color:#f87171; }
.status-pill.pending { background:rgba(234,179,8,0.15); color:#fbbf24; }
.status-pill.approved { background:rgba(34,197,94,0.15); color:#4ade80; }

.modal-bg { position:fixed; inset:0; background:rgba(0,0,0,0.65); z-index:1000; display:flex; align-items:center; justify-content:center; padding:20px; }
.modal-box { background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:22px; max-width:720px; width:100%; max-height:90vh; overflow-y:auto; }
.modal-box h3 { margin:0 0 14px; }
.modal-msg { font-size:0.85rem; min-height:1.2em; margin-top:8px; }
.dossier-tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:16px; }
.dossier-tabs button { padding:6px 12px; border-radius:8px; border:1px solid var(--border); background:transparent; color:var(--muted); cursor:pointer; font-family:inherit; font-size:0.8rem; }
.dossier-tabs button.on { background:var(--accent-soft); color:var(--rh); border-color:transparent; font-weight:600; }
