/* Administration HALLAL */
:root { --navy:#0b3b8f; --navy-dark:#072a68; --royal:#1d4ed8; --sky:#3b82f6; --ice:#e8f1ff; --bg:#f3f6fc; --ink:#16213a; --ink-2:#5b6683; --line:#dde5f3; --danger:#c62828; --ok:#1b8a4a; }
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 15px; color: var(--ink); background: var(--bg); }
a { color: var(--royal); text-decoration: none; }
h1, h2, h3 { color: var(--navy); margin: 0 0 .6em; line-height: 1.2; }
h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }

/* Connexion */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #072a68, #1d4ed8); padding: 1.5rem; }
.login { background: #fff; border-radius: 18px; padding: 2.2rem; width: min(100%, 400px); box-shadow: 0 30px 80px rgba(0,0,0,.3); text-align: center; }
.login img { width: 96px; margin: 0 auto 1rem; display: block; }
.login h1 { font-size: 1.3rem; }
.login p { color: var(--ink-2); font-size: .9rem; }
.login form { text-align: left; margin-top: 1.2rem; }

/* Structure */
.admin { display: flex; min-height: 100vh; }
.side { width: 250px; background: var(--navy-dark); color: #cfe0ff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: .7rem; padding: 1.2rem 1.2rem 1rem; color: #fff; border-bottom: 1px solid rgba(255,255,255,.1); }
.side-brand img { background: #fff; border-radius: 10px; padding: 3px; }
.side-brand span { display: flex; flex-direction: column; line-height: 1.1; }
.side-brand strong { font-size: 1.1rem; letter-spacing: .06em; }
.side-brand small { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: #9fbcf5; }
.side nav { padding: .8rem; display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.side nav a { display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; border-radius: 10px; color: #cfe0ff; font-weight: 500; }
.side nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side nav a.active { background: var(--royal); color: #fff; }
.pill { margin-left: auto; background: #f59e0b; color: #fff; font-size: .72rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; }
.side-foot { padding: 1rem 1.2rem; border-top: 1px solid rgba(255,255,255,.1); display: flex; flex-direction: column; gap: .4rem; font-size: .9rem; }
.side-foot a { color: #9fbcf5; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-head { background: #fff; border-bottom: 1px solid var(--line); padding: 1rem 1.8rem; display: flex; align-items: center; gap: 1rem; }
.main-head h1 { font-size: 1.3rem; margin: 0; flex: 1; }
.who { font-size: .85rem; color: var(--ink-2); }
.side-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; font-size: 1.2rem; padding: .2rem .6rem; cursor: pointer; }
.content { padding: 1.8rem; }
@media (max-width: 900px) {
  .side { position: fixed; left: -260px; z-index: 40; transition: left .2s; }
  body.side-open .side { left: 0; }
  .side-toggle { display: block; }
  .content { padding: 1.2rem; }
}

/* Composants */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.8rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem 1.4rem; }
.stat span { color: var(--ink-2); font-size: .85rem; }
.stat strong { display: block; font-size: 2rem; color: var(--navy); }
.box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.5rem; margin-bottom: 1.5rem; }
.box-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.box-head h2 { margin: 0; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: .92rem; }
.table th { color: var(--ink-2); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.table tr:hover td { background: #f8faff; }
.table .thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--ice); display: block; }
.table .thumb.builtin { object-fit: contain; }
.table-wrap { overflow-x: auto; }
.actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.actions form { display: inline; }
.tag { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--ice); color: var(--navy); }
.tag-off { background: #f1f1f1; color: #777; }
.tag-new { background: #fff3cd; color: #8a5a00; }
.tag-devis { background: #e6f9ee; color: #146c3a; }

.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .6rem 1.1rem; border-radius: 9px; font-weight: 600; font-size: .9rem; border: 1px solid transparent; cursor: pointer; font-family: inherit; line-height: 1.2; background: var(--royal); color: #fff; }
.btn:hover { background: var(--navy); }
.btn-sm { padding: .4rem .75rem; font-size: .82rem; }
.btn-light { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-light:hover { background: var(--ice); }
.btn-danger { background: #fff; color: var(--danger); border-color: #f3c4c4; }
.btn-danger:hover { background: #fdecec; }
.btn-block { width: 100%; justify-content: center; padding: .8rem; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: .3rem; color: var(--navy); }
.field input[type=text], .field input[type=password], .field input[type=email], .field input[type=number], .field input[type=datetime-local], .field textarea, .field select {
  width: 100%; padding: .65rem .85rem; border: 1.5px solid var(--line); border-radius: 9px; font: inherit; color: var(--ink); background: #fff;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.field textarea { min-height: 120px; resize: vertical; }
.field textarea.tall { min-height: 220px; }
.field small { color: var(--ink-2); font-size: .8rem; display: block; margin-top: .25rem; }
.field input[type=file] { font-size: .9rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
@media (max-width: 700px) { .form-row, .form-row-3 { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; margin-bottom: 1rem; }
.preview { max-width: 240px; max-height: 180px; border-radius: 10px; border: 1px solid var(--line); background: var(--ice); margin-bottom: .6rem; display: block; object-fit: contain; }
.form-foot { display: flex; gap: .6rem; align-items: center; margin-top: .5rem; flex-wrap: wrap; }

.alert { padding: .9rem 1.1rem; border-radius: 10px; margin-bottom: 1.2rem; font-weight: 500; }
.alert-success { background: #e6f9ee; color: #146c3a; border: 1px solid #b7ebcb; }
.alert-error, .alert-danger { background: #fdecec; color: #9b1c1c; border: 1px solid #f5c2c2; }
.alert-info { background: var(--ice); color: var(--navy); border: 1px solid var(--line); }
.alert-warn { background: #fff8e1; color: #7a4d00; border: 1px solid #ffe4a3; }

.msg { border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.3rem; margin-bottom: .8rem; background: #fff; }
.msg.unread { border-left: 4px solid #f59e0b; }
.msg-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; margin-bottom: .4rem; }
.msg-head strong { font-size: 1.02rem; }
.msg-meta { font-size: .85rem; color: var(--ink-2); }
.msg-body { white-space: pre-wrap; color: #2a3350; margin: .5rem 0; }
.msg-contact { font-size: .9rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.gallery-grid .item { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.gallery-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.gallery-grid .item-body { padding: .6rem .8rem; font-size: .85rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.help { color: var(--ink-2); font-size: .9rem; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; margin: 0 0 1.2rem; }
legend { font-weight: 700; color: var(--navy); padding: 0 .5rem; }
