:root {
    --bg: #0b1220; --panel: #131e34; --panel-2: #16223a; --border: #243352;
    --text: #e8edf6; --muted: #9aa9c4; --accent: #2f7fff; --danger: #dc2626;
    --ok: #16a34a; --radius: 12px;
}
* { box-sizing: border-box; }
body {
    margin: 0; background: var(--bg); color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.admin-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px; background: var(--panel); border-right: 1px solid var(--border);
    padding: 24px 16px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { font-weight: 800; font-size: 1.3rem; margin: 0 8px 28px; }
.sidebar .brand span { color: var(--accent); }
.sidebar nav a {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
    color: var(--muted); font-weight: 600; margin-bottom: 4px;
}
.sidebar nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.sidebar nav a.active { background: var(--accent); color: #fff; }
.sidebar .foot { position: absolute; bottom: 20px; left: 16px; right: 16px; font-size: .82rem; color: var(--muted); }

.main { flex: 1; padding: 32px 40px; max-width: 1100px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.topbar h1 { margin: 0; font-size: 1.6rem; }

/* Cards / stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.stat .n { font-size: 2rem; font-weight: 800; }
.stat .l { color: var(--muted); font-size: .9rem; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.panel h2 { margin: 0 0 18px; font-size: 1.15rem; }

/* Table */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: .92rem; vertical-align: middle; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; }
tr:last-child td { border-bottom: none; }
td .muted { color: var(--muted); font-size: .85rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 9px; font-weight: 700; font-size: .9rem; border: 1px solid transparent; cursor: pointer; transition: .15s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #1f6dee; text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: .82rem; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--panel-2); text-decoration: none; }
.btn-danger { background: transparent; border-color: #5b2330; color: #f47171; }
.btn-danger:hover { background: rgba(220,38,38,.12); text-decoration: none; }

/* Forms */
.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; color: var(--text); }
input, textarea, select {
    width: 100%; padding: 10px 13px; border-radius: 9px; border: 1px solid var(--border);
    background: var(--bg); color: var(--text); font: inherit;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,127,255,.2); }
.checkbox { display: flex; align-items: center; gap: 8px; }
.checkbox input { width: auto; }
.actions { display: flex; gap: 10px; margin-top: 22px; }

/* Badges */
.badge { font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.badge.live { background: rgba(0,194,168,.15); color: #36e3c4; }
.badge.progress { background: rgba(255,193,7,.15); color: #ffce4d; }
.badge.archived { background: rgba(154,169,196,.15); color: var(--muted); }
.pill { font-size: .78rem; padding: 2px 9px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); }

/* Barres de stats */
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar { flex: 1; height: 10px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* Graphe d'évolution */
.chart { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 8px; }
.chart-col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.chart-bar { width: 100%; min-height: 2px; background: var(--accent); border-radius: 3px 3px 0 0; }
.chart-col:hover .chart-bar { background: #5b9bff; }
.chart-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: .78rem; margin-top: 8px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.panel-head h2 { margin: 0; }
.seg { display: flex; gap: 6px; }

/* Flash */
.flash { padding: 12px 18px; border-radius: 10px; margin-bottom: 22px; font-weight: 600; }
.flash.success { background: rgba(22,163,74,.15); color: #4ade80; border: 1px solid rgba(22,163,74,.4); }
.flash.error { background: rgba(220,38,38,.15); color: #f87171; border: 1px solid rgba(220,38,38,.4); }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 36px 32px; }
.login-card .brand { font-size: 1.8rem; font-weight: 800; text-align: center; margin-bottom: 6px; }
.login-card .brand span { color: var(--accent); }
.login-card .sub { text-align: center; color: var(--muted); margin-bottom: 26px; font-size: .92rem; }

.thumb { width: 46px; height: 34px; border-radius: 6px; object-fit: cover; background: var(--panel-2); display: inline-block; }

@media (max-width: 800px) {
    .admin-shell { flex-direction: column; }
    .sidebar { width: auto; height: auto; position: static; display: flex; flex-wrap: wrap; gap: 8px; }
    .sidebar .brand, .sidebar .foot { width: 100%; position: static; }
    .main { padding: 24px 18px; }
    .form-grid { grid-template-columns: 1fr; }
}
