/* Administration — Aéro-Club de Ouaga */
:root { --night:#111111; --night-2:#2a2f36; --laterite:#c62f2f; --gold:#0459b1; --bg:#f2f5f9; --line:#e2ddd3; --ink:#1d2733; --muted:#66707c; --ok:#1f7a4d; --err:#c62f2f; --r:10px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; --mono: ui-monospace, "SFMono-Regular", Consolas, monospace; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--night-2); }
h1 { font-size: 1.6rem; margin: 0; } h2 { font-size: 1.15rem; margin: 0 0 .8rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .mono, code { font-family: var(--mono); } .right { text-align: right; white-space: nowrap; }
img { max-width: 100%; }

.with-side { padding-left: 250px; }
.side { position: fixed; inset: 0 auto 0 0; width: 250px; background: var(--night); color: #cfd9e3; display: flex; flex-direction: column; z-index: 20; }
.side-brand { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1.2rem 1rem; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.08); border-top: 5px solid var(--gold); } .side-brand img { width: 56px; height: 56px; } .side-brand span { display: flex; flex-direction: column; line-height: 1.1; } .side-brand strong { font-size: 1.15rem; } .side-brand small { color: #7fb6ee; text-transform: uppercase; letter-spacing: .14em; font-size: .68rem; }
.side-brand span { display: flex; flex-direction: column; line-height: 1.1; } .side-brand small { color: #9fb0c2; }
.side nav { flex: 1; overflow-y: auto; padding: .8rem .6rem; display: grid; align-content: start; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: 8px; color: #cfd9e3; text-decoration: none; }
.side nav a svg { width: 19px; height: 19px; flex: none; }
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side nav a.active { background: var(--gold); color: #fff; font-weight: 600; }
.badge { margin-left: auto; background: var(--laterite); color: #fff; border-radius: 999px; font-size: .72rem; padding: 0 .5rem; }
.side-foot { padding: 1rem 1.2rem; border-top: 1px solid rgba(255,255,255,.08); display: grid; gap: .4rem; font-size: .9rem; }
.side-foot a, .linklike { color: #cfd9e3; text-decoration: none; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-align: left; }
.side-foot a:hover, .linklike:hover { color: #fff; }
.side-toggle { display: none; }
@media (max-width: 900px) {
  .with-side { padding-left: 0; }
  .side { transform: translateX(-100%); transition: transform .2s; }
  .side-open .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .side-toggle { display: block; position: fixed; top: .7rem; right: .7rem; z-index: 30; background: var(--night); color: #fff; border: 0; border-radius: 8px; width: 42px; height: 42px; font-size: 1.3rem; }
}
.admin-main { padding: 2rem 2.2rem 4rem; max-width: 1280px; }
@media (max-width: 600px) { .admin-main { padding: 1.2rem 1rem 3rem; } }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.page-head > div { display: flex; gap: .5rem; flex-wrap: wrap; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.3rem; margin-bottom: 1.2rem; }
.narrow-panel { max-width: 560px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; margin: 0 0 1.2rem; background: #fff; }
legend { font-weight: 700; padding: 0 .4rem; }
.stack { display: grid; gap: .9rem; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; } @media (max-width: 1000px) { .cols { grid-template-columns: 1fr; } }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; } .row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
@media (max-width: 700px) { .row2, .row3 { grid-template-columns: 1fr; } }
.row-actions { display: flex; gap: 1rem; align-items: end; flex-wrap: wrap; justify-content: space-between; margin-top: .6rem; }
.row-actions .field { margin: 0; min-width: 280px; }
.edit-form { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.2rem; align-items: start; }
@media (max-width: 1050px) { .edit-form { grid-template-columns: 1fr; } }
.edit-side { position: sticky; top: 1rem; }
.edit-side .panel { display: grid; gap: .8rem; }

.field { display: grid; gap: .3rem; margin-bottom: .9rem; }
.field > span { font-weight: 600; font-size: .88rem; }
.field small { color: var(--muted); font-size: .8rem; }
input, select, textarea { font: inherit; padding: .6rem .7rem; border: 1px solid #cfc8bb; border-radius: 8px; background: #fff; width: 100%; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
textarea.mono { font-size: .88rem; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; cursor: pointer; }
.check input { width: auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; background: var(--night); color: #fff; border: 1px solid var(--night); padding: .55rem 1rem; border-radius: 8px; font: 600 .92rem var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--night-2); color: #fff; }
.btn-ghost { background: #fff; color: var(--night); border-color: #cfc8bb; } .btn-ghost:hover { background: #f6f3ee; color: var(--night); }
.btn-sm { padding: .35rem .7rem; font-size: .84rem; }
.btn-danger { background: #fff; color: var(--err); border-color: #e6b4b4; } .btn-danger:hover { background: var(--err); color: #fff; }
.btn-block { width: 100%; padding: .75rem; }
form.inline { display: inline; }

.flash { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; border-left: 4px solid; background: #fff; transition: opacity .4s; }
.flash-ok { border-color: var(--ok); background: #eaf6ef; } .flash-error { border-color: var(--err); background: #fbeaea; } .flash-warn { border-color: var(--gold); background: #fdf5e6; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .5rem .6rem; border-bottom: 2px solid var(--line); }
.table td { padding: .65rem .6rem; border-bottom: 1px solid #f0ece5; vertical-align: middle; }
.table tr:hover td { background: #fbfaf7; }
.table tr.unread td { font-weight: 600; background: #fffaf0; }
.thumb-cell { width: 64px; } .thumb-cell img { width: 56px; height: 40px; object-fit: cover; border-radius: 5px; }
.pill { font-size: .75rem; padding: .15rem .55rem; border-radius: 999px; background: #eee9e0; } .pill.ok { background: #def2e6; color: #155b38; }
.list { list-style: none; margin: 0 0 1rem; padding: 0; } .list li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid #f0ece5; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 0 0 1rem; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.msg-body { background: #faf8f4; border-radius: 8px; padding: 1rem 1.2rem; margin: 1rem 0; white-space: normal; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.2rem; text-decoration: none; color: var(--ink); }
.tile strong { display: block; font-size: 2rem; line-height: 1; color: var(--night); } .tile span { color: var(--muted); font-size: .88rem; }
.tile-hl { border-color: var(--laterite); } .tile-hl strong { color: var(--laterite); }
.quick { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }

/* Éditeur */
.editor { border: 1px solid #cfc8bb; border-radius: 10px; background: #fff; overflow: hidden; }
.editor-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: .4rem; background: #f7f4ef; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.editor-bar button { border: 1px solid transparent; background: transparent; border-radius: 6px; padding: .3rem .55rem; cursor: pointer; font: 500 .85rem var(--font); color: var(--ink); }
.editor-bar button:hover, .editor-bar button.on { background: #fff; border-color: var(--line); }
.editor-area { min-height: 320px; padding: 1rem 1.3rem; outline: none; font-size: 1rem; line-height: 1.65; }
.editor-area h2 { font-size: 1.45rem; margin: 1.2em 0 .4em; } .editor-area h3 { font-size: 1.2rem; margin: 1em 0 .3em; }
.editor-area blockquote { border-left: 4px solid var(--gold); margin: 1em 0; padding: .5em 1em; background: #faf6ee; }
.editor-area img { max-width: 100%; border-radius: 6px; } .editor-area figure { margin: 1em 0; } .editor-area figcaption { font-size: .85rem; color: var(--muted); }
.editor-src { border: 0; border-radius: 0; min-height: 320px; font-size: .85rem; }

/* Médias */
.media-pick { display: grid; gap: .5rem; }
.mp-preview { aspect-ratio: 16/9; background: repeating-linear-gradient(135deg, #f4f0e8 0 10px, #efe9de 10px 20px); border-radius: 8px; display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: .85rem; }
.mp-preview img { width: 100%; height: 100%; object-fit: cover; }
.mp-actions { display: flex; gap: .4rem; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; }
.media-grid.big { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.media-grid a, .media-grid button { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 2px solid transparent; padding: 0; background: #eee; cursor: pointer; display: block; }
.media-grid a:hover, .media-grid button:hover { border-color: var(--gold); }
.media-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-grid span { position: absolute; left: 4px; bottom: 4px; background: rgba(11,31,51,.8); color: #fff; font-size: .7rem; padding: .1rem .4rem; border-radius: 4px; }
.media-big { border-radius: 8px; display: block; margin: 0 auto; max-height: 70vh; }
.dropzone { text-align: center; border: 2px dashed #cfc8bb; background: #fcfbf8; }
.dropzone.over { border-color: var(--gold); background: #fdf6e8; }
.dropzone p { margin: .4rem 0; }
.dz-progress { height: 6px; background: #eee; border-radius: 3px; margin-top: .8rem; overflow: hidden; } .dz-progress div { height: 100%; width: 0; background: var(--laterite); transition: width .2s; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.album-tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--ink); display: grid; gap: .2rem; padding-bottom: .8rem; }
.album-tile strong, .album-tile > span { padding: 0 .9rem; }
.at-img { aspect-ratio: 16/10; background: #efe9de; display: grid; place-items: center; color: var(--muted); font-size: .85rem; margin-bottom: .5rem; }
.at-img img { width: 100%; height: 100%; object-fit: cover; }
.photo-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem; }
.pa-item { background: #faf8f4; border: 1px solid var(--line); border-radius: 10px; padding: .5rem; display: grid; gap: .35rem; cursor: grab; }
.pa-item.dragging { opacity: .4; }
.pa-item img { aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; width: 100%; pointer-events: none; }
.pa-item input:not([type=radio]):not([type=checkbox]) { padding: .35rem .5rem; font-size: .85rem; }
.pa-opts { display: flex; justify-content: space-between; font-size: .8rem; }
.pa-opts label { display: flex; align-items: center; gap: .25rem; cursor: pointer; } .pa-opts input { width: auto; }
.danger { color: var(--err); }

.modal { position: fixed; inset: 0; background: rgba(5,12,20,.6); z-index: 100; display: grid; place-items: center; padding: 1rem; }
.modal[hidden] { display: none; }
.modal-box { background: #fff; border-radius: 14px; width: min(900px, 100%); max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-box header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.modal-box header h2 { margin: 0; }
.modal-close { background: none; border: 0; font-size: 1.8rem; cursor: pointer; line-height: 1; }
.modal-tools { display: flex; align-items: center; gap: 1rem; padding: .8rem 1.2rem; }
.modal-box .media-grid { padding: 0 1.2rem 1.2rem; overflow-y: auto; }

.login-page { min-height: 100vh; display: grid; place-items: center; background: var(--night); border-top: 8px solid var(--gold); }
.login-page .admin-main { padding: 1rem; width: 100%; }
.login-box { border-bottom: 6px solid var(--gold); background: #fff; border-radius: 16px; padding: 2.2rem; width: min(400px, 100%); margin: 0 auto; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-box img { margin: 0 auto .6rem; display: block; }
.login-box form { text-align: left; margin: 1.2rem 0; }
.edit-main .media-pick { max-width: 440px; }

/* Ligne de vie */
.tl-upload-date { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin: .8rem 0 .2rem; }
.tl-upload-date label { display: flex; align-items: center; gap: .4rem; font-weight: 600; }
.tl-upload-date input { width: 7.5rem; }
.tl-admin-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
.tl-admin-decade { font-size: 1.1rem; margin: 1.6rem 0 .6rem; padding-left: .7rem; border-left: 4px solid #0459b1; }
.tl-row { display: grid; grid-template-columns: 210px 1fr; gap: 1.2rem; align-items: start; }
.tl-row-photo small { display: block; margin-top: .3rem; word-break: break-all; }
.tl-row-undated { border-color: #d9822b; box-shadow: inset 4px 0 0 #d9822b; }
.tl-row-hidden { opacity: .65; }
.tl-row-fields .field { margin-bottom: .6rem; }
.tl-date-row { display: grid; grid-template-columns: 7.5rem 1fr 5.5rem; gap: .8rem; }
.tl-date-row em { font-weight: 400; color: #888; font-style: normal; }
.tl-row-opts { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: center; }
.check.danger { color: #b42318; }
@media (max-width: 760px) { .tl-row { grid-template-columns: 1fr; } }
