@charset "UTF-8";

/* =====================================================================
   Centre Ados Riviera — console d'administration
   ===================================================================== */

@font-face {
  font-family: "Krona One";
  src: url("../fonts/krona-one-latin.woff") format("woff"),
       url("../fonts/krona-one-latin.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Raleway";
  src: url("../fonts/raleway-latin-var.woff") format("woff"),
       url("../fonts/raleway-latin-var.ttf") format("truetype");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --deep: #1e6373;
  --deep-dark: #154c59;
  --teal: #1f9391;
  --teal-dark: #197c7a;
  --teal-soft: #e3f2f1;
  --ink: #10333c;
  --body: #3d5a61;
  --muted: #6d8288;
  --paper: #f4f7f7;
  --surface: #fff;
  --mist: #dbe7e8;
  --line: #eaf0f1;
  --alert: #c8553d;
  --alert-ink: #8d3322;
  --alert-bg: #fbeae6;
  --warn: #d9a441;
  --warn-bg: #fdf4e3;
  --warn-ink: #7a5714;

  --display: "Krona One", "Trebuchet MS", sans-serif;
  --text: "Raleway", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 250px;
  --shadow: 0 1px 2px rgba(16,51,60,.05), 0 10px 26px -16px rgba(16,51,60,.3);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--teal-dark); }

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 4px;
}

h1, h2, h3 { color: var(--ink); margin: 0 0 .55em; line-height: 1.25; }
h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; font-weight: 700; }
h3 { font-size: .98rem; font-weight: 700; }
p { margin: 0 0 1em; } p:last-child { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Écran de connexion ---------------------------------------------- */

.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  background:
    radial-gradient(1100px 520px at 50% -12%, #2b7789 0%, transparent 62%),
    var(--deep);
}

.login-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border-radius: 18px;
  padding: 2.4rem 2.2rem;
  box-shadow: 0 30px 70px -30px rgba(0,0,0,.55);
}
.login-card__head { text-align: center; margin-bottom: 1.9rem; }
.login-card__head svg { width: 54px; height: 54px; margin: 0 auto .9rem; color: var(--deep); }
.login-card__head b {
  display: block; font-size: .68rem; letter-spacing: .24em;
  text-transform: uppercase; color: var(--teal-dark); margin-bottom: .35rem;
}
.login-card__head span { font-family: var(--display); font-size: 1.08rem; color: var(--ink); }
.login-foot { text-align: center; margin-top: 1.5rem; font-size: .87rem; }

/* --- Structure -------------------------------------------------------- */

.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100dvh; }

.sidebar {
  background: var(--deep);
  color: #b9d5da;
  padding: 1.4rem 1rem 2rem;
  display: flex; flex-direction: column; gap: 1.5rem;
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
}

.sidebar__brand { display: flex; align-items: center; gap: .7rem; padding: 0 .5rem; text-decoration: none; }
.sidebar__brand svg { width: 34px; height: 34px; color: #fff; flex: none; }
.sidebar__brand b { display: block; color: #fff; font-family: var(--display); font-size: .82rem; line-height: 1.3; }
.sidebar__brand small { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: #7fc4c2; }

.sidebar nav { display: grid; gap: .15rem; }
.sidebar__group {
  font-size: .62rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
  color: #6da3ad; padding: 1.1rem .75rem .35rem;
}
.sidebar a.nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .58rem .75rem; border-radius: var(--radius-sm);
  color: #cfe2e6; text-decoration: none; font-size: .92rem; font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
.sidebar a.nav-item:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar a.nav-item[aria-current="page"] { background: var(--teal); color: #fff; }

.badge {
  min-width: 21px; padding: 0 .4rem; height: 21px;
  display: inline-grid; place-items: center;
  border-radius: 100px; background: rgba(255,255,255,.22);
  font-size: .7rem; font-weight: 800; color: #fff;
}
.badge--alert { background: var(--alert); }
.nav-item[aria-current="page"] .badge { background: rgba(0,0,0,.22); }

.sidebar__foot { margin-top: auto; padding: 1rem .75rem 0; border-top: 1px solid rgba(255,255,255,.14); font-size: .84rem; }
.sidebar__foot a { color: #cfe2e6; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--mist);
  padding: 1rem clamp(1rem, 3vw, 2.2rem);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.topbar h1 { margin: 0; }
.topbar__actions { display: flex; gap: .55rem; flex-wrap: wrap; }

.content { padding: clamp(1.25rem, 3vw, 2.2rem); flex: 1; }
.content--wide { max-width: none; }
.content > .inner { max-width: 980px; }
.content--wide > .inner { max-width: 1240px; }

.sidebar-toggle {
  display: none; width: 42px; height: 42px; flex: none;
  border: 1px solid var(--mist); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--deep); cursor: pointer;
}
.sidebar-toggle span { display: block; width: 18px; height: 2px; margin: 4px auto; background: currentColor; border-radius: 2px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 262px; z-index: 60;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .sidebar[data-open="true"] { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .sidebar-toggle { display: block; }
  .scrim { position: fixed; inset: 0; background: rgba(16,51,60,.45); z-index: 50; }
}

/* --- Cartes et tableaux ---------------------------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel + .panel { margin-top: 1.25rem; }
.panel__head {
  padding: 1rem 1.3rem;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.panel__head h2 { margin: 0; font-size: 1rem; }
.panel__body { padding: 1.3rem; }
.panel__intro { color: var(--muted); font-size: .92rem; margin: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat {
  background: var(--surface); border: 1px solid var(--mist);
  border-radius: var(--radius); padding: 1.15rem 1.3rem;
  text-decoration: none; color: inherit; display: block;
  transition: border-color .15s ease, transform .15s ease;
}
.stat:hover { border-color: var(--teal); transform: translateY(-2px); }
.stat__n { font-family: var(--display); font-size: 1.9rem; color: var(--deep); line-height: 1.1; }
.stat__l { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: .35rem; }
.stat--alert .stat__n { color: var(--alert); }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.data th, table.data td { padding: .8rem 1.3rem; text-align: left; vertical-align: middle; }
table.data thead th {
  font-size: .68rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase;
  color: var(--muted); background: var(--paper); border-bottom: 1px solid var(--mist); white-space: nowrap;
}
table.data tbody tr { border-bottom: 1px solid var(--line); }
table.data tbody tr:last-child { border-bottom: 0; }
table.data tbody tr:hover { background: #fafcfc; }
table.data td a { font-weight: 700; color: var(--ink); text-decoration: none; }
table.data td a:hover { color: var(--teal-dark); text-decoration: underline; }
td.actions { text-align: right; white-space: nowrap; }
.row-unread { background: #f6fbfb; }
.row-unread td:first-child { box-shadow: inset 3px 0 0 var(--teal); }

.pill {
  display: inline-block; padding: .2rem .6rem; border-radius: 100px;
  font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.pill--on { background: var(--teal-soft); color: #135f5d; }
.pill--off { background: #eef2f3; color: var(--muted); }
.pill--new { background: var(--teal); color: #fff; }
.pill--wip { background: var(--warn-bg); color: var(--warn-ink); }
.pill--done { background: #e8f0ee; color: #46685f; }
.pill--urgent { background: var(--alert); color: #fff; }

.drag-handle { cursor: grab; color: var(--muted); user-select: none; padding-right: .3rem; }
tr.dragging { opacity: .45; }

.empty { padding: 3rem 1.5rem; text-align: center; color: var(--muted); }
.empty svg { width: 54px; height: 54px; margin: 0 auto 1rem; color: var(--mist); }
.empty h3 { color: var(--ink); }

/* --- Boutons ---------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .62rem 1.15rem; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--teal); color: #fff; font-family: var(--text);
  font-size: .92rem; font-weight: 700; line-height: 1.3; text-decoration: none; cursor: pointer;
  transition: background .15s ease;
}
.btn:hover { background: var(--teal-dark); color: #fff; }
.btn--deep { background: var(--deep); } .btn--deep:hover { background: var(--deep-dark); }
.btn--ghost { background: transparent; color: var(--deep); border-color: var(--mist); }
.btn--ghost:hover { background: var(--paper); color: var(--deep); }
.btn--danger { background: transparent; color: var(--alert-ink); border-color: #edc9c0; }
.btn--danger:hover { background: var(--alert-bg); color: var(--alert-ink); }
.btn--sm { padding: .38rem .75rem; font-size: .82rem; }
.btn--wide { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* --- Formulaires ------------------------------------------------------ */

.field { margin-bottom: 1.15rem; }
.field:last-child { margin-bottom: 0; }
.field > label, .field-label {
  display: block; margin-bottom: .35rem;
  font-size: .84rem; font-weight: 700; color: var(--ink);
}
.field .req { color: var(--alert); }

.input, .select, textarea.input {
  width: 100%; padding: .62rem .8rem;
  border: 1px solid #c4d6d8; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font-family: var(--text); font-size: .95rem; line-height: 1.5;
}
.input:focus, .select:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(31,147,145,.16);
}
textarea.input { resize: vertical; min-height: 4.5rem; }
.select { appearance: none; padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%236d8288' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center; background-size: 10px; }

.hint { font-size: .82rem; color: var(--muted); margin: .3rem 0 0; }
.err { font-size: .82rem; color: var(--alert-ink); font-weight: 600; margin: .3rem 0 0; }
.field.is-invalid .input, .field.is-invalid .select { border-color: var(--alert); background: #fffbfa; }

.check { display: flex; align-items: flex-start; gap: .6rem; font-size: .93rem; cursor: pointer; }
.check input { accent-color: var(--teal); width: 1.05rem; height: 1.05rem; margin: .18rem 0 0; flex: none; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.1rem; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.form-foot {
  position: sticky; bottom: 0;
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  padding: 1rem 1.3rem;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--mist);
}
.form-foot .spacer { flex: 1; }

/* Éditeur de texte riche */
.editor { border: 1px solid #c4d6d8; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.editor__bar {
  display: flex; flex-wrap: wrap; gap: .2rem;
  padding: .4rem; background: var(--paper); border-bottom: 1px solid var(--mist);
}
.editor__bar button {
  min-width: 32px; height: 30px; padding: 0 .5rem;
  border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--body);
  font-size: .82rem; font-weight: 700; cursor: pointer;
}
.editor__bar button:hover { background: var(--surface); border-color: var(--mist); color: var(--deep); }
.editor__bar .sep { width: 1px; background: var(--mist); margin: .25rem .3rem; }
.editor__area {
  min-height: 260px; max-height: 620px; overflow-y: auto;
  padding: 1rem 1.1rem; font-size: .97rem; line-height: 1.7; color: var(--ink);
}
.editor__area:focus { outline: none; }
.editor__area:empty::before { content: attr(data-placeholder); color: #a5b7bb; }
.editor__area h2 { font-size: 1.2rem; margin: 1.2em 0 .4em; }
.editor__area h3 { font-size: 1.05rem; margin: 1.2em 0 .4em; color: var(--deep); }
.editor__area ul, .editor__area ol { padding-left: 1.4em; }
.editor__area p { margin: 0 0 .8em; }
.editor:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(31,147,145,.16); }

/* Image */
.media-field { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.media-preview {
  width: 116px; height: 84px; border-radius: var(--radius-sm);
  border: 1px solid var(--mist); background: var(--paper);
  overflow: hidden; display: grid; place-items: center; flex: none;
}
.media-preview img { width: 100%; height: 100%; object-fit: cover; }
.media-preview span { font-size: .7rem; color: var(--muted); text-align: center; padding: .3rem; }
.media-field__controls { flex: 1; min-width: 200px; }

/* --- Bandeaux -------------------------------------------------------- */

.flash { padding: .85rem 1.15rem; border-radius: var(--radius-sm); margin-bottom: 1.15rem; font-size: .93rem; }
.flash--ok { background: var(--teal-soft); color: #135f5d; border-left: 3px solid var(--teal); }
.flash--err { background: var(--alert-bg); color: var(--alert-ink); border-left: 3px solid var(--alert); }
.flash--warn { background: var(--warn-bg); color: var(--warn-ink); border-left: 3px solid var(--warn); }
.flash--info { background: #eef3f4; color: var(--deep); border-left: 3px solid var(--deep); }

/* --- Constructeur de formulaire -------------------------------------- */

.builder { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
@media (max-width: 1050px) { .builder { grid-template-columns: 1fr; } }

.builder__list { display: grid; gap: .55rem; }

.fld {
  background: var(--surface); border: 1px solid var(--mist);
  border-radius: var(--radius-sm); overflow: hidden;
}
.fld--section { border-color: var(--deep); background: #f7fbfb; }
.fld--note { background: #fbfdfd; }
.fld.dragging { opacity: .4; }
.fld.drop-target { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(31,147,145,.2); }

.fld__head {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .8rem; cursor: pointer; user-select: none;
}
.fld__grip { color: var(--muted); cursor: grab; font-size: .95rem; line-height: 1; }
.fld__type {
  font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--teal-dark); background: var(--teal-soft); padding: .18rem .5rem; border-radius: 100px;
  white-space: nowrap;
}
.fld--section .fld__type { background: var(--deep); color: #fff; }
.fld__name { flex: 1; font-weight: 700; color: var(--ink); font-size: .93rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fld__req { color: var(--alert); font-weight: 800; }
.fld__del {
  border: 0; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 1.05rem; line-height: 1; padding: .25rem .4rem; border-radius: 6px;
}
.fld__del:hover { background: var(--alert-bg); color: var(--alert-ink); }
.fld__body { padding: .3rem .8rem 1rem; border-top: 1px solid var(--line); display: none; }
.fld[data-open="true"] .fld__body { display: block; }
.fld__body .field { margin-bottom: .8rem; }

.palette { position: sticky; top: 82px; }
.palette__grid { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.palette__grid button {
  padding: .55rem .5rem; border: 1px solid var(--mist); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--body); font-family: var(--text);
  font-size: .8rem; font-weight: 600; cursor: pointer; text-align: left; line-height: 1.3;
}
.palette__grid button:hover { border-color: var(--teal); color: var(--deep); background: var(--teal-soft); }

/* --- Demande reçue ---------------------------------------------------- */

.sub-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
@media (max-width: 950px) { .sub-grid { grid-template-columns: 1fr; } }

.sub-section {
  font-size: .68rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--deep); padding: 1.6rem 0 .5rem; border-bottom: 1px solid var(--mist); margin-bottom: .9rem;
}
.sub-section:first-child { padding-top: 0; }

.sub-row { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: .6rem 1.2rem; padding: .42rem 0; }
@media (max-width: 620px) { .sub-row { grid-template-columns: 1fr; gap: .1rem; } }
.sub-row dt { font-size: .84rem; font-weight: 700; color: var(--muted); }
.sub-row dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.sub-row dd.block { white-space: pre-wrap; background: var(--paper); padding: .8rem 1rem;
  border-radius: var(--radius-sm); border: 1px solid var(--line); }
.sub-row dd .none { color: #a5b7bb; }

.file-row {
  display: flex; align-items: center; gap: .8rem;
  padding: .7rem .9rem; border: 1px solid var(--mist); border-radius: var(--radius-sm); margin-bottom: .5rem;
}
.file-row__name { flex: 1; font-weight: 700; color: var(--ink); font-size: .92rem; overflow-wrap: anywhere; }
.file-row__meta { font-size: .8rem; color: var(--muted); }

@media print {
  .sidebar, .topbar, .form-foot, .sub-aside, .sidebar-toggle { display: none !important; }
  .shell { grid-template-columns: 1fr; }
  body { background: #fff; font-size: 11pt; }
  .panel { border: 1px solid #ccc; }
}

/* --- Écran des traductions -------------------------------------------- */

.tr-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.tr-row:last-child { border-bottom: 0; }

@media (max-width: 820px) { .tr-row { grid-template-columns: 1fr; gap: .6rem; } }

.tr-source p {
  margin: .5rem 0 0;
  font-size: .95rem;
  line-height: 1.55;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.tr-meta { display: block; margin-top: .35rem; font-size: .78rem; color: var(--muted); }

.tr-target { display: grid; gap: .5rem; }
.tr-target textarea { font-size: .95rem; }
.tr-actions { display: flex; gap: .5rem; align-items: center; }
.tr-actions .select { width: auto; min-width: 150px; font-size: .85rem; padding: .38rem .8rem; }
