/* Administration d'un site municipal Municipolis. */
:root {
    --mp-brand: #1f6f8b;
    --ad-ink: #1b2430;
    --ad-muted: #5b6573;
    --ad-line: #dfe3e8;
    --ad-bg: #f3f5f8;
    --ad-ok: #1e7b4f;
    --ad-err: #b42318;
}

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

body {
    margin: 0;
    background: var(--ad-bg);
    color: var(--ad-ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 17px;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
}

.ad-header { background: var(--mp-brand); color: #fff; }
.ad-header-in { width: min(980px, 100% - 32px); margin: 0 auto; padding: 14px 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.ad-site { display: block; font-weight: 700; font-size: 1.15rem; }
.ad-sub { font-size: 0.9rem; opacity: 0.9; }
.ad-header-actions { display: flex; gap: 8px; }
.ad-header .ad-btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.5); }

.ad-main { width: min(980px, 100% - 32px); margin: 24px auto 64px; }

.ad-banner { width: min(980px, 100% - 32px); margin: 16px auto 0; padding: 12px 16px; border-radius: 10px; font-weight: 600; }
.ad-banner-error { background: #fdecea; color: var(--ad-err); border: 1px solid #f5c2bc; }
.ad-banner-success { background: #e7f6ee; color: var(--ad-ok); border: 1px solid #b7e2c8; }

.ad-card { background: #fff; border: 1px solid var(--ad-line); border-radius: 14px; padding: 22px 24px; }
.ad-card h1 { margin: 0 0 12px; font-size: 1.4rem; }
.ad-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; }
.ad-card-head h1 { margin: 0; }
.ad-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ad-prop { margin: 0 0 18px; padding: 16px 18px; border: 1px solid var(--ad-line); border-radius: 12px; background: #f6f8fa; }
.ad-prop-note { margin: 0 0 16px; padding: 12px 16px; border-left: 4px solid #b7791f; border-radius: 8px; background: #fffaf0; }
.ad-prop-note p { margin: 0 0 6px; }
.ad-prop-note ul { margin: 6px 0 0; padding-left: 20px; color: var(--ad-muted); font-size: 0.92rem; }
.ad-login { max-width: 460px; margin: 40px auto 0; }
.ad-muted { color: var(--ad-muted); }

.ad-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.ad-tab { padding: 9px 16px; border: 1px solid var(--ad-line); border-radius: 999px; background: #fff; color: var(--ad-ink); font: inherit; font-weight: 600; cursor: pointer; user-select: none; }
.ad-tab.is-active { background: var(--mp-brand); border-color: var(--mp-brand); color: #fff; }

.ad-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 18px; border: 1px solid var(--mp-brand); border-radius: 10px; background: var(--mp-brand); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; user-select: none; }
.ad-btn:disabled { opacity: 0.55; cursor: default; }
.ad-btn-ghost { background: transparent; color: var(--mp-brand); }
.ad-btn-danger { background: var(--ad-err); border-color: var(--ad-err); }
.ad-btn-danger-ghost { background: transparent; border-color: var(--ad-err); color: var(--ad-err); }
.ad-btn:focus-visible, .ad-tab:focus-visible, .ad-item:focus-visible { outline: 3px solid var(--mp-brand); outline-offset: 2px; }

/* Action en cours : chrome sombre et contour aurore (UX.borderProgress, mêmes règles que /ux/ux-components.css). */
.ad-btn.ux-busy, .ad-btn.ux-busy:disabled { background: #0d0d0d; border-color: transparent; color: #fff; opacity: 1; cursor: default; }
.ux-border-progress { position: absolute; pointer-events: none; z-index: 2; overflow: hidden; opacity: 0; transition: opacity 0.15s ease; }
.ux-border-progress.is-visible { opacity: 1; }
.ux-border-progress__svg { display: block; max-width: none !important; max-height: none !important; overflow: hidden; filter: saturate(1.35); }
.ux-border-progress__track { stroke: rgba(255, 255, 255, 0.08); }
.ux-border-progress.is-looping .ux-border-progress__bar,
.ux-border-progress.is-determinate .ux-border-progress__bar { opacity: 0; }
.ux-border-progress:not(.is-looping):not(.is-determinate) .ux-border-progress__segs,
.ux-border-progress:not(.is-looping):not(.is-determinate) .ux-border-progress__bar { opacity: 0; }

.ad-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ad-item { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 14px; border: 1px solid var(--ad-line); border-radius: 10px; background: #fff; color: var(--ad-ink); font: inherit; text-align: left; cursor: pointer; user-select: none; }
.ad-item:hover { border-color: var(--mp-brand); }
.ad-item-title { font-weight: 700; }
.ad-item-meta { grid-column: 1; color: var(--ad-muted); font-size: 0.92rem; }
.ad-status { grid-column: 2; grid-row: 1 / span 2; align-self: center; padding: 3px 10px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; }
.ad-status-published { background: #e7f6ee; color: var(--ad-ok); }
.ad-status-draft { background: #eef0f3; color: var(--ad-muted); }

.ad-form { display: flex; flex-wrap: wrap; gap: 14px 18px; }
.ad-field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 100%; font-weight: 600; }
.ad-field-short { flex: 1 1 200px; }
.ad-field small { font-weight: 400; }
.ad-field input[type="text"], .ad-field input[type="email"], .ad-field input[type="tel"], .ad-field input[type="date"],
.ad-field input[type="time"], .ad-field input[type="number"], .ad-field input[type="url"], .ad-field select, .ad-field textarea {
    width: 100%; padding: 10px 12px; border: 1px solid #c9d0d8; border-radius: 10px; background: #fff; color: var(--ad-ink); font: inherit; font-weight: 400;
}
.ad-field textarea { resize: none; overflow: hidden; min-height: 60px; }
.ad-field input:focus, .ad-field select:focus, .ad-field textarea:focus { outline: none; border-color: var(--mp-brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--mp-brand) 25%, transparent); }
.ad-field input[type="number"]::-webkit-inner-spin-button, .ad-field input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ad-file { margin: 0; font-weight: 400; }
.ad-field-note { flex: 1 1 100%; margin-top: -8px; font-size: 0.85rem; }
.ad-field[hidden], .ad-field-note[hidden] { display: none; }
.ad-inline { display: flex; align-items: center; gap: 10px; }
.ad-inline select { max-width: 220px; }
.ad-check { flex: 1 1 100%; display: flex; align-items: flex-start; gap: 10px; font-weight: 400; }
.ad-identity { flex: 1 1 100%; margin: 8px 0 0; padding: 16px 18px; border: 1px solid var(--ad-line, #dfe3e8); border-radius: 10px; display: flex; flex-direction: column; gap: 14px; }
.ad-identity legend { padding: 0 6px; font-weight: 700; }
.ad-identity-fields { display: flex; flex-wrap: wrap; gap: 14px; }
.ad-identity-fields[hidden] { display: none; }
.ad-field-color { flex: 1 1 180px; }
.ad-field-color input[type="color"] { width: 72px; height: 44px; padding: 2px; border: 1px solid var(--ad-line, #dfe3e8); border-radius: 8px; background: #fff; cursor: pointer; }
.ad-check input { margin-top: 4px; width: 18px; height: 18px; }
.ad-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: #b42318; color: #fff; font-size: 0.8rem; text-align: center; }
.ad-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.ad-chip { padding: 6px 14px; border: 1px solid var(--ad-line); border-radius: 999px; background: #fff; color: var(--ad-ink); font: inherit; font-weight: 600; cursor: pointer; user-select: none; }
.ad-chip.is-active { background: var(--mp-brand); border-color: var(--mp-brand); color: #fff; }
.ad-req { border-top: 1px solid var(--ad-line); }
.ad-req-body { padding: 12px 4px 16px; }
.ad-req-body p { margin: 0 0 10px; }
.ad-ad-title { margin: 0 0 8px; font-size: 1.1rem; }
.ad-history { margin: 0 0 12px; padding-left: 18px; color: var(--ad-muted); }
.ad-photo { max-width: 100%; max-height: 420px; border-radius: 10px; display: block; margin: 0 0 12px; }
.ad-req-nouvelle { background: #fdecea; color: #8a1c12; }
.ad-req-en_cours { background: #fff4d6; color: #7a5300; }
.ad-btn-danger { background: #b42318; border-color: #b42318; color: #fff; }
.ad-subtitle { margin: 24px 0 8px; font-size: 1.1rem; }
.ad-quote { margin: 0 0 10px; padding: 8px 14px; border-left: 4px solid var(--ad-line); color: var(--ad-muted); font-style: italic; }
.ad-map { height: 320px; border: 1px solid #c9d0d8; border-radius: 10px; z-index: 0; }
.ad-bulk { margin: 0 0 14px; padding: 12px 14px; border: 1px solid #c9d0d8; border-radius: 10px; }
.ad-bulk .ad-actions { justify-content: flex-start; }
.ad-items li.ad-has-pick { display: flex; align-items: stretch; gap: 8px; }
.ad-items li.ad-has-pick .ad-item { flex: 1 1 auto; min-width: 0; }
.ad-pick { display: flex; align-items: center; padding: 0 4px; cursor: pointer; }
.ad-pick input { width: 20px; height: 20px; }
.ad-zones { border: 0; padding: 0; margin: 0; }
.ad-zones legend { padding: 0; margin-bottom: 6px; font-weight: 600; }
.ad-zones .ad-check { margin-bottom: 4px; }
#ad-audience { margin: 6px 0 0; font-weight: 600; }

.ad-actions { flex: 1 1 100%; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.ad-delete { margin-right: auto; display: inline-flex; gap: 10px; }
