@font-face { font-family: 'Jakarta'; src: url('/font.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
:root {
  --plum: #75174c; --plum-600: #8c2460; --plum-50: #f8eef3; --plum-100: #f0dbe6; --ink: #1d0a17; --orange: #df7b25;
  --muted: #6f5d68; --line: #eadfe5; --bg: #f6f2f4; --card: #fff; --ok: #1f7a4d; --ok-bg: #e6f4ec; --warn: #a35a00; --warn-bg: #fdf0e1;
  --err: #b42318; --err-bg: #fdecea; --unread: #e4dde1; --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 'Jakarta', system-ui, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--plum); }
[hidden] { display: none !important; }
h1 { font-size: 1.45rem; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.icon { width: 1.15rem; height: 1.15rem; flex: none; }

/* Connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: radial-gradient(circle at 80% 10%, rgba(223,123,37,.35), transparent 40%), linear-gradient(135deg, var(--plum), #3d0b28); }
.login form { width: min(100%, 24rem); background: #fff; border-radius: 18px; padding: 2rem; box-shadow: 0 30px 60px rgba(0,0,0,.25); display: grid; gap: 1rem; }
.login img { height: 46px; justify-self: center; }
.login p { margin: 0; text-align: center; }

/* Structure */
.shell { display: grid; grid-template-columns: 15rem 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #e9dce4; padding: 1.25rem .75rem; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1.25rem; }
.side img { height: 34px; filter: brightness(0) invert(1); margin: 0 .5rem; align-self: flex-start; }
.side nav { display: grid; gap: .15rem; }
.side .sep { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #a58e9b; margin: .9rem .75rem .25rem; }
.side a { display: flex; align-items: center; gap: .65rem; padding: .55rem .75rem; border-radius: 9px; color: inherit; text-decoration: none; }
.side a:hover { background: rgba(255,255,255,.07); }
.side a[aria-current="page"] { background: var(--plum); color: #fff; }
.side .count { margin-left: auto; background: var(--orange); color: #fff; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 0 .45rem; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .5rem; padding: .7rem 1.5rem; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .who { margin-right: auto; color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ibtn.menu-btn { display: none; }
.content { padding: 1.5rem; max-width: 72rem; width: 100%; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.head p { margin: 0; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 0; border-radius: 10px; padding: .6rem 1rem; font-weight: 650; cursor: pointer; background: var(--plum); color: #fff; text-decoration: none; }
.btn:hover { background: var(--plum-600); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.light { background: var(--plum-50); color: var(--plum); }
.btn.light:hover { background: var(--plum-100); }
.ibtn { position: relative; display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); text-decoration: none; flex: none; }
.ibtn:hover { background: var(--plum-50); border-color: var(--plum-100); color: var(--plum); }
.ibtn.danger:hover { background: var(--err-bg); color: var(--err); border-color: #f5c6c0; }
.ibtn.primary { background: var(--plum); border-color: var(--plum); color: #fff; }
.ibtn.primary:hover { background: var(--plum-600); color: #fff; }
.ibtn:disabled { opacity: .4; cursor: default; }
.ibtn .dot { position: absolute; top: -4px; right: -4px; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem; border-radius: 999px; background: var(--orange); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Cartes et tableaux */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.grid { display: grid; gap: 1rem; }
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); margin-bottom: 1.25rem; }
.stat { display: flex; gap: .9rem; align-items: center; text-decoration: none; color: inherit; }
.stat .ico { width: 2.8rem; height: 2.8rem; border-radius: 12px; display: grid; place-items: center; background: var(--plum-50); color: var(--plum); }
.stat b { font-size: 1.6rem; line-height: 1; display: block; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
.table td { padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { white-space: nowrap; text-align: right; }
.table-wrap { overflow-x: auto; }
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 650; background: var(--plum-50); color: var(--plum); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.err { background: var(--err-bg); color: var(--err); }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }

/* Formulaires */
label.f { display: grid; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], select, textarea {
  width: 100%; border: 1px solid #dccfd6; border-radius: 9px; padding: .55rem .7rem; background: #fff; color: var(--ink); font-weight: 500;
}
textarea { min-height: 5.5rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--plum-100); border-color: var(--plum); }
.row { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.check { display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; font-weight: 600; cursor: pointer; }
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--plum); }
.err-msg { background: var(--err-bg); color: var(--err); border-radius: 9px; padding: .6rem .8rem; font-size: .9rem; }
.savebar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: .5rem; align-items: center; padding: .8rem 0; background: linear-gradient(transparent, var(--bg) 35%); }
.savebar .muted { margin-right: auto; }

/* Éditeurs */
.plan { display: grid; gap: .8rem; }
.plan .title { display: flex; align-items: center; gap: .6rem; }
.plan .title h3 { margin: 0; font-size: 1rem; }
.specs { display: grid; gap: .4rem; }
.specs .spec { display: grid; grid-template-columns: 6rem 1fr auto; gap: .4rem; }
.ext { display: grid; grid-template-columns: 7rem 1fr 9rem auto auto; gap: .5rem; align-items: center; }
.faq-item { display: grid; gap: .6rem; }
.faq-item .bar { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.faq-item .bar select { width: auto; }
.faq-item .bar .spacer { flex: 1; }
.filters { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .3rem .8rem; cursor: pointer; font-size: .85rem; font-weight: 600; }
.filters button[aria-pressed="true"] { background: var(--plum); color: #fff; border-color: var(--plum); }
.avatar { width: 2.6rem; height: 2.6rem; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, var(--orange), var(--plum)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.person { display: flex; gap: .7rem; align-items: center; }
.photo-edit { display: flex; gap: 1rem; align-items: center; }
.photo-edit .avatar { width: 6rem; height: 6rem; font-size: 1.6rem; }
.log { background: var(--ink); color: #e9dce4; border-radius: 10px; padding: 1rem; font: 12.5px/1.45 ui-monospace, Menlo, monospace; max-height: 28rem; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.detail dl { display: grid; grid-template-columns: 9rem 1fr; gap: .4rem 1rem; margin: 0 0 1rem; }
.detail dt { color: var(--muted); font-weight: 600; font-size: .85rem; }
.detail dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.banner { display: flex; gap: .7rem; align-items: center; background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1rem; font-weight: 600; }
.banner .btn { margin-left: auto; }

/* Notifications */
.bell-wrap { position: relative; }
.notifs { position: absolute; right: 0; top: calc(100% + .5rem); width: min(24rem, calc(100vw - 2rem)); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 40px rgba(29,10,23,.18); overflow: hidden; }
.notifs header { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.notifs header button { background: none; border: 0; color: var(--plum); font-weight: 650; cursor: pointer; font-size: .85rem; }
.notifs ul { list-style: none; margin: 0; padding: 0; max-height: 26rem; overflow: auto; }
.notifs li button { display: grid; gap: .1rem; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); padding: .75rem 1rem; background: #fff; cursor: pointer; }
.notifs li.unread button { background: var(--unread); }
.notifs li.unread button b::before { content: ''; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--orange); margin-right: .45rem; vertical-align: middle; }
.notifs li button:hover { filter: brightness(.97); }
.notifs li small { color: var(--muted); }

#toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 10px; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: calc(100vw - 2rem); }
#toast.err { background: var(--err); }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 16rem; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .shell.open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .ibtn.menu-btn { display: inline-grid; }
  .content { padding: 1rem; }
  .top { padding: .6rem 1rem; }
  .ext { grid-template-columns: 1fr 1fr; }
  .detail dl { grid-template-columns: 1fr; }
  .notifs { position: fixed; left: .75rem; right: .75rem; top: 3.6rem; width: auto; }
}
.row-actions { display: flex; gap: .5rem; align-items: center; }
