:root {
  --bg: #F4F4F2;
  --card: #FFFFFF;
  --ink: #1C1D21;
  --muted: #74757B;
  --line: #E4E4E0;
  --arko: #00425D;
  --bruderlin: #173A86;
  --gold: #B08D2E;
  --ok: #1E7A45;
  --warn: #9A6A00;
  --bad: #A32633;
  --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg); color: var(--ink);
  min-height: 100vh;
}
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10; gap: 14px; flex-wrap: wrap;
}
.brand { font-weight: 800; font-size: 18px; letter-spacing: .5px; }
.brand span { font-weight: 400; color: var(--muted); }
nav { display: flex; gap: 8px; flex-wrap: wrap; }
nav button {
  border: 1px solid var(--line); background: transparent;
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 14px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
nav button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge {
  background: var(--bad); color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 700; padding: 1px 7px;
}
nav button.active .badge { background: #fff; color: var(--ink); }

.agent-ctrl { display: flex; align-items: center; gap: 12px; }
.agent-status { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.agent-status .led { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(30,122,69,.15); }
.agent-status.paused .led { background: var(--bad); box-shadow: 0 0 0 3px rgba(163,38,51,.15); }
.btn-agent {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 8px 16px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.btn-agent.stop { color: var(--bad); border-color: var(--bad); }
.btn-agent.start { color: #fff; background: var(--ok); border-color: var(--ok); }

.prod-bar {
  max-width: 1240px; margin: 20px auto 0; padding: 16px 24px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.prod-bar.paused { border-color: var(--bad); background: #FDF5F5; }
.prod-left { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.prod-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.run-log {
  width: 100%; background: #14151A; color: #C9E3D2; border-radius: 8px;
  padding: 14px; font-size: 12px; line-height: 1.5; max-height: 220px;
  overflow: auto; white-space: pre-wrap;
}
.hidden { display: none !important; }

main { max-width: 1240px; margin: 0 auto; padding: 28px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

.societe-block { margin-bottom: 40px; }
.societe-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.societe-head .dot { width: 14px; height: 14px; border-radius: 4px; }
.societe-head h2 { font-size: 20px; }
.dot.arko { background: var(--arko); }
.dot.bruderlin { background: var(--bruderlin); }

.week-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 0 10px; gap: 12px; flex-wrap: wrap;
}
.week-head .wt { font-size: 14.5px; font-weight: 600; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; cursor: pointer;
  transition: box-shadow .15s, transform .15s;
  display: flex; gap: 14px; align-items: flex-start; position: relative;
}
.card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.08); transform: translateY(-1px); }
.card img { width: 76px; height: 95px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.card .info { flex: 1; }
.card .label { font-weight: 600; font-size: 14.5px; margin-bottom: 4px; }
.card .meta { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.slides-badge {
  position: absolute; top: 10px; left: 10px; background: rgba(20,20,25,.75);
  color: #fff; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px;
}

.pill {
  display: inline-block; font-size: 11.5px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; margin-top: 8px;
}
.pill.a_valider { background: #FFF3D6; color: var(--warn); }
.pill.approuve { background: #DFF2E6; color: var(--ok); }
.pill.rejete { background: #FBE2E5; color: var(--bad); }
.pill.modification_demandee { background: #E4ECFB; color: var(--bruderlin); }
.pill.valide { background: #DFF2E6; color: var(--ok); }
.pill.programme { background: #E9E4FB; color: #5B3FA8; }

.cal-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.cal-card h3 { font-size: 16px; margin-bottom: 4px; }
.cal-week { padding: 12px 0; border-top: 1px solid var(--line); }
.cal-week:first-of-type { border-top: none; }
.cal-week .wk { font-weight: 600; font-size: 14px; }
.cal-week .why { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.cal-actions { margin-top: 14px; }

/* Planning */
.plan-day { margin-bottom: 22px; }
.plan-day h3 { font-size: 14px; text-transform: capitalize; margin-bottom: 8px; }
.plan-entry {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; display: flex; align-items: center; gap: 14px; margin-bottom: 8px;
  font-size: 14px;
}
.plan-entry .hour { font-weight: 700; min-width: 52px; }
.net {
  font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; color: #fff;
}
.net.linkedin { background: #0A66C2; }
.net.instagram { background: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF); }
.plan-entry .soc { font-weight: 600; }
.plan-entry .ext { color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-toolbar { display: flex; justify-content: flex-end; margin-bottom: 16px; }

.btn {
  display: block; width: 100%; border: none; border-radius: 8px;
  padding: 12px; font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; margin-bottom: 12px; color: #fff;
}
.btn.ok { background: var(--ok); }
.btn.warn { background: var(--warn); }
.btn.bad { background: var(--bad); }
.btn.neutral { background: var(--ink); }
.btn.inline { display: inline-block; width: auto; padding: 8px 18px; margin: 0; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.chip {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--muted); cursor: pointer;
}
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(20,20,25,.55); display: flex; align-items: flex-start; justify-content: center; padding: 24px; z-index: 50; overflow: auto; }
.modal-box {
  background: var(--bg); border-radius: 16px; width: min(1240px, 100%);
  padding: 26px; margin: auto;
}
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; gap: 10px; flex-wrap: wrap; }
.modal-title { font-size: 19px; font-weight: 700; }
.modal-head-actions { display: flex; gap: 10px; align-items: center; }
.close { border: none; background: var(--card); border-radius: 8px; width: 36px; height: 36px; cursor: pointer; font-size: 15px; }
.modal-grid { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
.previews { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1080px) { .modal-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .previews { grid-template-columns: 1fr; } }
.preview-label { font-size: 12.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.charcount { text-transform: none; letter-spacing: 0; font-weight: 500; }
.charcount.over { color: var(--bad); font-weight: 700; }

/* Aperçu LinkedIn */
.li-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.li-head { display: flex; gap: 10px; padding: 12px 14px 6px; }
.li-avatar {
  width: 44px; height: 44px; border-radius: 4px; color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center; font-size: 19px; flex: none;
}
.li-name { font-weight: 700; font-size: 13.5px; }
.li-meta { font-size: 11.5px; color: var(--muted); }
.li-text { padding: 6px 14px 12px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.li-img { width: 100%; display: block; }
.li-actions { padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* Aperçu Instagram */
.ig-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ig-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.ig-avatar {
  width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  border: 2px solid #DD2A7B; flex: none;
}
.ig-user { font-weight: 700; font-size: 13px; }
.ig-img-wrap { position: relative; }
.ig-img { width: 100%; display: block; }
.ig-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.85); font-size: 18px; cursor: pointer; line-height: 1;
}
.ig-nav.prev { left: 10px; }
.ig-nav.next { right: 10px; }
.ig-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.ig-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.55); }
.ig-dots span.on { background: #fff; }
.ig-actions { padding: 10px 12px 4px; font-size: 17px; }
.ig-save { float: right; }
.ig-caption { padding: 4px 12px 14px; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; }
.ig-caption .u { font-weight: 700; }
.ig-caption .tag { color: #0A66C2; }

aside h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 10px; }
textarea {
  width: 100%; font: inherit; font-size: 13.5px; line-height: 1.55;
  border: 1px solid var(--line); border-radius: 8px; padding: 12px;
  resize: vertical; background: #FDFDFC;
}
.field { margin: 4px 0 12px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.score { font-size: 12px; color: var(--gold); font-weight: 700; }
.fb { font-size: 12.5px; background: var(--card); border-radius: 8px; padding: 10px 12px; margin-top: 8px; }
.fb .d { color: var(--muted); font-size: 11px; }
.pub-info { background: #E9E4FB; color: #3D2B73; border-radius: 8px; padding: 12px; font-size: 13px; line-height: 1.6; margin-bottom: 12px; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px;
  font-size: 14px; font-weight: 600; z-index: 100; box-shadow: 0 8px 30px rgba(0,0,0,.25);
}

/* Pause & Journal */
.pause-box { width: min(480px, 100%); background: var(--card); }
.pause-options { display: flex; flex-direction: column; gap: 10px; }
.radio { display: flex; align-items: center; gap: 10px; font-size: 14.5px; cursor: pointer; }
.radio input[type="date"] { font: inherit; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; }
.text-input { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; }
.soc-pause { margin-left: auto; }
.soc-banner {
  background: #FDF0F1; border: 1px solid #F0CCD1; color: var(--bad);
  border-radius: 10px; padding: 10px 16px; font-size: 13.5px; font-weight: 600;
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.jr {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 8px; display: flex; gap: 14px; align-items: baseline;
  font-size: 14px;
}
.jr .jd { color: var(--muted); font-size: 12px; min-width: 118px; }
.jr .ji { font-size: 15px; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-box { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 40px; width: 360px; text-align: center; }
.login-box h1 { font-size: 20px; margin-bottom: 6px; }
.login-box p { font-size: 13.5px; color: var(--muted); margin-bottom: 20px; }
.login-box input {
  width: 100%; font: inherit; padding: 12px; border: 1px solid var(--line);
  border-radius: 8px; margin-bottom: 12px; text-align: center;
}

/* Mobile */
@media (max-width: 700px) {
  header { padding: 12px 16px; }
  main { padding: 16px; }
  .prod-bar { margin: 14px 16px 0; }
  .grid { grid-template-columns: 1fr; }
  .modal { padding: 8px; }
  .modal-box { padding: 16px; }
}
