:root{
  --ink:#16120C; --bronze:#9E7233; --cream:#F3EDE2; --paper:#FCF9F3;
  --line:#E3DACB; --stone:#7A7160; --danger:#B03A2E; --ok:#3C7A4E;
}
*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color:var(--ink);background:var(--paper);font-size:15px;line-height:1.55}
a{color:var(--bronze);text-decoration:none}
a:hover{text-decoration:underline}
h1{font-size:1.6rem;margin:0 0 18px}
h2{font-size:1.15rem;margin:30px 0 12px}
.muted{color:var(--stone)}
.small{font-size:.85rem}
.nowrap{white-space:nowrap}
.ta-r{text-align:right}

/* top bar */
.adm-top{display:flex;align-items:center;gap:26px;padding:14px 26px;background:var(--ink);color:#fff;flex-wrap:wrap}
.adm-brand{color:#fff;font-weight:600;font-size:1.05rem;letter-spacing:.04em}
.adm-brand span{display:inline-block;margin-left:8px;padding:2px 8px;border:1px solid rgba(255,255,255,.35);border-radius:3px;font-size:.6rem;letter-spacing:.18em;text-transform:uppercase;vertical-align:middle;color:rgba(255,255,255,.8)}
.adm-nav{display:flex;gap:20px;margin-right:auto}
.adm-nav a{color:rgba(255,255,255,.82)}
.adm-nav a:hover{color:#fff;text-decoration:none}
.adm-logout button{background:none;border:1px solid rgba(255,255,255,.4);color:#fff;padding:7px 14px;border-radius:4px;cursor:pointer;font-size:.85rem}
.adm-logout button:hover{background:rgba(255,255,255,.12)}

.adm-main{max-width:1000px;margin:34px auto;padding:0 22px}

.head-row{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap}

/* cards */
.cards{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin:8px 0 10px}
.card{background:#fff;border:1px solid var(--line);border-radius:8px;padding:22px}
.card .num{font-size:2.1rem;font-weight:600;line-height:1}
.card .lbl{color:var(--stone);font-size:.85rem;margin-top:6px}
.card.alert{border-color:var(--bronze);background:#FBF4E8}

/* tables */
table{width:100%;border-collapse:collapse;background:#fff;border:1px solid var(--line);border-radius:8px;overflow:hidden;margin-top:8px}
th,td{padding:12px 14px;text-align:left;border-bottom:1px solid var(--line);vertical-align:middle}
th{background:var(--cream);font-size:.74rem;letter-spacing:.08em;text-transform:uppercase;color:var(--stone)}
tr:last-child td{border-bottom:none}
.thumb{width:54px;height:40px;object-fit:cover;border-radius:4px;display:block}
.thumb.empty{background:var(--cream);border:1px dashed var(--line)}
.thumb-lg{max-width:240px;border-radius:6px;margin:6px 0}
.tag{font-size:.72rem;padding:3px 9px;border-radius:20px}
.tag.on{background:#E7F2EB;color:var(--ok)}
.tag.off{background:#F0ECE4;color:var(--stone)}
.actions{display:flex;gap:14px;align-items:center;justify-content:flex-end}
.actions form{margin:0}

/* buttons / links */
.btn{display:inline-block;background:var(--bronze);color:#fff;border:none;padding:11px 20px;border-radius:5px;cursor:pointer;font-size:.9rem;text-decoration:none}
.btn:hover{filter:brightness(.95);text-decoration:none}
button.link{background:none;border:none;color:var(--bronze);cursor:pointer;font-size:.9rem;padding:0;font-family:inherit}
button.link.danger,.danger{color:var(--danger)}

/* forms */
.adm-form{background:#fff;border:1px solid var(--line);border-radius:8px;padding:24px;margin-top:10px;max-width:680px}
.adm-form label{display:block;margin-bottom:16px;font-size:.85rem;color:var(--stone)}
.adm-form input,.adm-form textarea{display:block;width:100%;margin-top:6px;padding:10px 12px;border:1px solid var(--line);border-radius:5px;font-size:.95rem;color:var(--ink);font-family:inherit;background:var(--paper)}
.adm-form input:focus,.adm-form textarea:focus{outline:none;border-color:var(--bronze)}
.grid4{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:14px;align-items:end}
.adm-form .check{display:flex;align-items:center;gap:8px}
.adm-form .check input{width:auto;margin:0}
.form-actions{display:flex;align-items:center;gap:18px;margin-top:8px}

/* messages */
.msg{background:#fff;border:1px solid var(--line);border-radius:8px;padding:18px 20px;margin-bottom:14px}
.msg-head{font-size:.9rem;color:var(--stone)}
.msg-head .date{float:right;font-size:.8rem}
.msg-body{margin:10px 0 12px;color:var(--ink);white-space:pre-wrap}

/* login */
.login-page{display:flex;align-items:center;justify-content:center;min-height:100vh;background:var(--ink)}
.login-box{background:var(--paper);padding:40px 34px;border-radius:10px;width:340px;max-width:90vw}
.login-box h1{margin:0;font-size:1.4rem}
.login-box .muted{margin:4px 0 22px}
.login-box label{display:block;font-size:.82rem;color:var(--stone);margin-bottom:14px}
.login-box input{display:block;width:100%;margin-top:6px;padding:11px 12px;border:1px solid var(--line);border-radius:5px;font-size:.95rem}
.login-box .btn{width:100%;margin-top:6px;text-align:center}
.err{background:#FBE9E7;color:var(--danger);padding:10px 12px;border-radius:5px;font-size:.85rem;margin-bottom:16px}

@media(max-width:680px){
  .cards{grid-template-columns:1fr}
  .grid4{grid-template-columns:1fr 1fr}
  .adm-nav{gap:14px}
}

/* --- Ajouts : contenu, avantages, photos multiples --- */
.adm-form select{display:block;width:100%;margin-top:6px;padding:10px 12px;border:1px solid var(--line);border-radius:5px;font-size:.95rem;color:var(--ink);font-family:inherit;background:var(--paper)}
.adm-form select:focus{outline:none;border-color:var(--bronze)}
.form-section{font-size:1rem;margin:26px 0 12px;padding-bottom:6px;border-bottom:1px solid var(--line);color:var(--ink)}
.form-section:first-of-type{margin-top:8px}
.field-label{font-size:.85rem;color:var(--stone);margin:6px 0 8px}
.photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:12px;margin-bottom:18px}
.photo-keep{display:block;margin:0;font-size:.8rem;color:var(--stone)}
.photo-keep img{display:block;width:100%;height:90px;object-fit:cover;border-radius:6px;border:1px solid var(--line);margin-bottom:6px}
.photo-keep span{display:flex;align-items:center;gap:6px}
.photo-keep input{width:auto;margin:0}
.saved-note{background:#E8F5E9;color:#2E7D32;padding:10px 12px;border-radius:5px;font-size:.88rem;margin-bottom:14px}

/* Éditeur de typologies */
.typo-list{display:flex;flex-direction:column;gap:8px;margin:8px 0}
.typo-row{display:grid;grid-template-columns:0.9fr 1.1fr 0.9fr 1.1fr 1.1fr 1.3fr auto;gap:6px;align-items:center}
.typo-row input{width:100%}
.typo-del{border:1px solid #d8cfc0;background:#fff;border-radius:6px;cursor:pointer;padding:7px 10px;color:#a3392b;line-height:1}
.typo-del:hover{background:#faf4ee}
@media(max-width:900px){.typo-row{grid-template-columns:1fr 1fr}}

/* Éditeur de typologies (cartes) */
.typo-cards-admin{display:flex;flex-direction:column;gap:14px;margin:8px 0}
.typo-card-admin{border:1px solid #e2dccf;border-radius:8px;padding:14px;background:#fbf9f4;display:flex;flex-direction:column;gap:10px}
.tc-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px}
.typo-card-admin label.sm{display:flex;flex-direction:column;gap:4px;font-size:.82rem}
.typo-card-admin input,.typo-card-admin textarea{width:100%}
.typo-del{align-self:flex-start;border:1px solid #e0b4ac;background:#fff;color:#a3392b;border-radius:6px;padding:7px 12px;cursor:pointer}
.typo-del:hover{background:#faf1ee}
@media(max-width:820px){.tc-grid{grid-template-columns:1fr}}
