/* Espace formateurs — complète /styles.css du site vitrine */
body.espace { background: var(--bg-alt); min-height: 100vh; display: flex; flex-direction: column; }
.espace-main { flex: 1; padding: 40px 0 72px; }
.espace-nav { display: flex; align-items: center; gap: 1.4em; }
.espace-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
.espace-nav a:not(.btn):hover { color: var(--blue); }
.espace-nav form { margin: 0; }
.espace-footer { padding: 22px 0; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); background: #fff; }
.espace-footer a { color: var(--muted); }
.espace h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
.espace h2 { font-size: 1.3rem; }
.eyebrow a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.warn { color: #b4540a; font-weight: 700; white-space: nowrap; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 28px 30px; margin-bottom: 22px; }
.narrow-card { max-width: 520px; margin: 32px auto; }
.card.center { text-align: center; }
.flash { background: #ecf8f1; color: #13693f; border: 1px solid #c8ead6; padding: 12px 16px; border-radius: 12px; margin-bottom: 20px; font-weight: 600; }
.flash.error { background: #fdf0ef; color: #a3352b; border-color: #f3d0cc; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin-bottom: .2em; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.stack { display: grid; gap: 14px; margin: 20px 0; }
.espace label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--navy); }
.espace input:not([type=checkbox]):not([type=file]), .espace select, .espace textarea {
  font: inherit; padding: .7em .9em; border: 1px solid var(--line); border-radius: 11px; background: var(--bg-alt); color: var(--ink); width: 100%; }
.espace input:focus, .espace select:focus, .espace textarea:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(16, 17, 133, .12); }
.espace input[type=file] { font: inherit; font-size: .9rem; padding: .5em; border: 1px dashed var(--line); border-radius: 11px; background: var(--bg-alt); }
.espace label.check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.grid-form .span2 { grid-column: span 2; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 16px; }
.inline-form label { flex: 1 1 220px; }
form.inline { display: inline; }
.search { display: flex; gap: 8px; }
.search input { min-width: 280px; }

/* Tableau de bord client */
.lic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.lic-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; }
.lic-card.expired { opacity: .75; }
.lic-card h2 { font-size: 1.25rem; margin: .6em 0 .2em; }
.lic-card .btn { margin-top: auto; }
.lic-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tag-type { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--blue); }
.status { display: inline-block; font-size: .8rem; font-weight: 700; padding: .25em .8em; border-radius: 999px; }
.status.ok { background: #e3f7ee; color: #13693f; }
.status.off { background: #fdf0ef; color: #a3352b; }
.status-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.lic-meta { list-style: none; padding: 0; margin: .4em 0 1.4em; color: var(--muted); font-size: .92rem; display: grid; gap: 4px; }

/* Lecteur de diaporama */
.viewer-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.viewer { background: #0b0c2e; border-radius: 16px; overflow: hidden; margin-bottom: 10px; user-select: none; -webkit-user-select: none; }
.stage { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; background: #0b0c2e; }
.stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; display: block; pointer-events: none; -webkit-user-drag: none; }
.shield { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 2fr; }
.shield .zone { cursor: pointer; }
.shield .zone.prev { cursor: w-resize; }
.shield .zone.next { cursor: e-resize; }
.loading { position: absolute; bottom: 12px; right: 14px; color: #bfc0e6; font-size: .8rem; }
.controls { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #12134a; color: #e3e4f7; transition: opacity .3s; }
.controls .spacer { flex: 1; }
.ctl { width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.ctl:disabled { opacity: .35; cursor: default; }
.goto { display: flex !important; align-items: center; gap: 8px; color: #e3e4f7 !important; grid-auto-flow: column; }
.goto select { width: auto !important; padding: .35em .5em !important; background: rgba(255,255,255,.1) !important; color: #fff !important; border-color: rgba(255,255,255,.2) !important; }
.goto select option { color: var(--ink); }
.viewer.is-fs { border-radius: 0; display: flex; flex-direction: column; width: 100vw; height: 100vh; background: #000; }
.viewer.is-fs .stage { flex: 1; aspect-ratio: auto; background: #000; }
.viewer.is-fs .controls { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); border-radius: 14px; background: rgba(18, 19, 74, .85); }
.viewer.is-fs.idle .controls { opacity: 0; }
.viewer.is-fs.idle .stage { cursor: none; }

/* Documents, équipe */
.doc-list, .team-list, .plain-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.doc-list li, .team-list li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; }
.doc-ico { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-weight: 800; font-size: .72rem; }
.doc-name, .team-list li > span { flex: 1; font-weight: 700; color: var(--navy); }
.doc-name small, .team-list small, .table small { display: block; font-weight: 500; color: var(--muted); font-size: .82rem; }
.team-list form { margin: 0; }
.plain-list li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .95rem; }

/* Tableaux d'administration */
.table-card { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--bg-alt); }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.inactive td { opacity: .6; }
code { background: var(--bg-alt); padding: .1em .4em; border-radius: 6px; }

@media (max-width: 760px) {
  .espace-main { padding: 24px 0 56px; }
  .espace-nav { gap: .9em; }
  .espace-nav .hide-sm { display: none; }
  .card { padding: 22px 18px; }
  .grid-form { grid-template-columns: 1fr; }
  .grid-form .span2 { grid-column: auto; }
  .search input { min-width: 0; }
  .controls { flex-wrap: wrap; }
}

/* Administration : fiche détaillée */
.espace textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem; line-height: 1.5; }
.save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 12px; align-items: center; padding: 14px 0; margin-bottom: 22px; background: linear-gradient(180deg, rgba(246,246,251,0), var(--bg-alt) 35%); }
.cover-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.cover-preview { width: 240px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.todo-card { border-color: #f3c98b; background: #fffaf0; }
.todo-card textarea { background: #fff !important; }
#a-valider h2 { display: flex; align-items: center; gap: 10px; }
.espace-subnav { background: var(--navy); color: #e3e4f7; }
.espace-subnav-inner { display: flex; align-items: center; gap: 22px; height: 46px; font-size: .92rem; }
.espace-subnav strong { color: var(--accent); margin-right: auto; }
.espace-subnav a { color: #e3e4f7; text-decoration: none; font-weight: 600; }
.espace-subnav a:hover { color: #fff; }
.espace-subnav form { margin: 0; }
.linklike { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: #e3e4f7; cursor: pointer; }
.linklike:hover { color: #fff; }
