/* ==========================================================
   CYBERSAS+ — Admin
   Charte : Inter, cyan (accent), deep-navy, ink, fond blanc.
   Pour caler exactement sur le site, remplace les 4 valeurs
   ci-dessous par celles de src/styles/global.css.
   ========================================================== */
:root {
  --cyan: #06b6d4;
  --cyan-dark: #0891b2;
  --cyan-soft: #e6f8fb;
  --deep-navy: #0b1f3a;
  --ink: #1f2937;

  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f4f7fb;
  --card: #ffffff;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --red: #dc2626;
  --red-soft: #fee2e2;

  --sidebar-w: 264px;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(11, 31, 58, .05), 0 4px 14px rgba(11, 31, 58, .05);

  /* Motif : points discrets */
  --pattern: radial-gradient(rgba(255, 255, 255, .13) 1.5px, transparent 1.5px);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; }
svg.i { flex-shrink: 0; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  z-index: 50;
  transition: transform .25s ease;
}
.sidebar .brand { padding: 22px 22px 18px; border-bottom: 1px solid var(--line); }
.sidebar .brand img { height: 46px; display: block; }
.sidebar .brand small {
  display: block; margin-top: 8px;
  font-size: 10px; letter-spacing: .14em; font-weight: 700; color: var(--cyan-dark);
  text-transform: uppercase;
}

.nav { padding: 16px 14px; flex: 1; overflow-y: auto; }
.nav-title {
  font-size: 10.5px; letter-spacing: .12em; font-weight: 700;
  color: #9ca3af; text-transform: uppercase; padding: 14px 12px 8px;
}
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 2px;
  border-radius: 10px; text-decoration: none;
  font-weight: 600; color: #4b5563;
  transition: background .15s, color .15s;
}
.nav a:hover { background: #f3f6fa; color: var(--deep-navy); }
.nav a.active { background: var(--cyan-soft); color: var(--cyan-dark); }
.nav a.active svg { color: var(--cyan-dark); }

.sidebar .user {
  border-top: 1px solid var(--line);
  padding: 14px; display: flex; align-items: center; gap: 12px;
}
.avatar {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--deep-navy); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
  text-transform: uppercase;
}
.sidebar .user .who { flex: 1; min-width: 0; }
.sidebar .user .who b { display: block; font-size: 13px; color: var(--deep-navy); }
.sidebar .user .who span { font-size: 11px; color: var(--cyan-dark); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sidebar .user a.logout {
  width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  color: var(--muted); border: 1px solid var(--line); text-decoration: none;
}
.sidebar .user a.logout:hover { color: var(--red); border-color: var(--red); background: var(--red-soft); }

.content { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: rgba(255, 255, 255, .85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 14px 32px; display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 30;
}
.topbar .menu-btn {
  display: none; border: 1px solid var(--line); background: #fff;
  width: 38px; height: 38px; border-radius: 8px; cursor: pointer;
  place-items: center; color: var(--ink);
}
.topbar .titles { flex: 1; min-width: 0; }
.topbar .eyebrow { font-size: 10.5px; letter-spacing: .14em; font-weight: 700; color: var(--cyan-dark); text-transform: uppercase; }
.topbar h1 { margin: 0; font-size: 22px; color: var(--deep-navy); letter-spacing: -.01em; }
.topbar .right { display: flex; align-items: center; gap: 12px; }
.topbar .date { color: var(--muted); font-size: 13px; }
.topbar .status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.topbar .status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

main.page { padding: 28px 32px 48px; max-width: 1240px; width: 100%; }

.overlay { display: none; position: fixed; inset: 0; background: rgba(11, 31, 58, .45); z-index: 40; }

/* ---------- Composants ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; font-size: 15px; color: var(--deep-navy); display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }

.banner {
  background-color: var(--deep-navy);
  background-image: var(--pattern), linear-gradient(120deg, var(--deep-navy) 0%, #12345f 100%);
  background-size: 22px 22px, cover;
  color: #fff; border-radius: var(--radius);
  padding: 28px 30px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-bottom: 22px; position: relative; overflow: hidden;
}
.banner::after {
  content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  border-radius: 50%; background: radial-gradient(circle, rgba(6, 182, 212, .45), transparent 70%);
}
.banner h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.01em; }
.banner h2 em { font-style: normal; color: #67e8f9; }
.banner p { margin: 0; color: rgba(255, 255, 255, .72); }
.banner .btn { position: relative; z-index: 1; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat { padding: 18px; display: flex; align-items: center; gap: 14px; }
.stat .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; }
.stat .ico.cyan { background: var(--cyan-soft); color: var(--cyan-dark); }
.stat .ico.green { background: var(--green-soft); color: var(--green); }
.stat .ico.amber { background: var(--amber-soft); color: var(--amber); }
.stat .ico.navy { background: #e4eaf3; color: var(--deep-navy); }
.stat b { display: block; font-size: 26px; line-height: 1.1; color: var(--deep-navy); }
.stat span { font-size: 12.5px; color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 22px; }

/* Barres d'activité */
.bars { display: flex; align-items: flex-end; gap: 14px; height: 190px; padding-top: 10px; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 8px; }
.bars .bar { width: 100%; max-width: 46px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--cyan), var(--cyan-dark)); min-height: 4px; position: relative; }
.bars .bar.zero { background: var(--line); }
.bars .bar em { position: absolute; top: -20px; left: 0; right: 0; text-align: center; font-style: normal; font-size: 12px; font-weight: 700; color: var(--deep-navy); }
.bars .lbl { font-size: 11.5px; color: var(--muted); text-transform: capitalize; }

/* Répartition */
.dist { list-style: none; margin: 0; padding: 0; }
.dist li { margin-bottom: 14px; }
.dist .top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.dist .top b { color: var(--deep-navy); }
.dist .track { height: 8px; background: #eef2f7; border-radius: 99px; overflow: hidden; }
.dist .track i { display: block; height: 100%; background: var(--cyan); border-radius: 99px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #9ca3af; font-weight: 700; padding: 12px 20px; background: #fafbfd; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 20px; border-bottom: 1px solid #f0f2f6; vertical-align: middle; }
tbody tr:hover { background: #fafcfe; }
tbody tr:last-child td { border-bottom: 0; }
.cell-title { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.cell-title b { color: var(--deep-navy); display: block; }
.cell-title small { color: var(--muted); font-size: 12px; }
.thumb { width: 54px; height: 40px; object-fit: cover; border-radius: 8px; background: #eef2f7; flex-shrink: 0; display: grid; place-items: center; color: #b6c0cf; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.badge.published { background: var(--green-soft); color: #166534; }
.badge.draft { background: var(--amber-soft); color: #92400e; }
.tag { background: #eef2f7; color: #475569; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--cyan); color: #fff; border: 1px solid var(--cyan);
  padding: 9px 16px; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--cyan-dark); border-color: var(--cyan-dark); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: #f3f6fa; }
.btn.danger { background: #fff; color: var(--red); border-color: #fecaca; }
.btn.danger:hover { background: var(--red-soft); }
.btn.light { background: #fff; color: var(--deep-navy); border-color: #fff; }
.btn.light:hover { background: #e6f8fb; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.icon-btn { width: 34px; height: 34px; padding: 0; }
.actions { display: flex; gap: 6px; justify-content: flex-end; }
.actions form { margin: 0; }

/* Filtres */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.search { position: relative; flex: 1; min-width: 220px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9ca3af; }
.search input { padding-left: 38px; }

/* Formulaires */
label { display: block; font-weight: 600; font-size: 13px; margin: 0 0 6px; color: var(--deep-navy); }
.field { margin-bottom: 18px; }
input[type=text], input[type=password], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  font: inherit; background: #fff; color: var(--ink);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(6, 182, 212, .18); }
input[type=file] { font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 5px; }
.form-grid { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.cover-preview { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; margin-bottom: 10px; background: #eef2f7; display: block; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }

.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.alert.error { background: var(--red-soft); color: #991b1b; }
.alert.success { background: var(--green-soft); color: #166534; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty svg { color: #cbd5e1; margin-bottom: 8px; }
.empty a { color: var(--cyan-dark); font-weight: 600; text-decoration: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
  body.nav-open .overlay { display: block; }
  .content { margin-left: 0; }
  .topbar { padding: 12px 18px; }
  .topbar .menu-btn { display: grid; }
  .topbar .date, .topbar .status { display: none; }
  main.page { padding: 20px 16px 40px; }
  .banner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
}