/* Administration USIA — reprend les couleurs du site */
body.admin { background: #f3f5f2; }
.admin-shell { display: grid; grid-template-columns: 16.5rem minmax(0, 1fr); min-height: 100vh; }

/* Menu latéral */
.admin-side { background: var(--forest-900) var(--star); color: #cfe0d4; padding: 1.25rem 0.9rem 2rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand-mini { display: flex; gap: 0.7rem; align-items: center; color: var(--white); text-decoration: none; margin: 0 0.3rem 1.5rem; font-weight: 600; line-height: 1.3; }
.brand-mini img { height: 3.4rem; width: auto; }
.brand-mini small { display: block; font-weight: 400; color: var(--gold-300); font-size: 0.78rem; }
.admin-side h2 { font-family: var(--font-body); font-size: 0.8rem; color: #8fb39b; margin: 1.1rem 0.6rem 0.35rem; font-weight: 600; }
.admin-side ul { list-style: none; margin: 0; padding: 0; }
.admin-side a, .admin-side button.side-link {
  display: flex; align-items: center; gap: 0.65rem; width: 100%; padding: 0.5rem 0.65rem; border-radius: 8px;
  color: #e3eee6; text-decoration: none; font: inherit; font-size: 0.93rem; background: none; border: 0; cursor: pointer; text-align: start;
}
.admin-side a svg, .admin-side button.side-link svg { width: 1.1rem; height: 1.1rem; flex: none; color: var(--gold-300); }
.admin-side a:hover, .admin-side button.side-link:hover { background: rgba(255, 255, 255, 0.08); color: var(--white); }
.admin-side a[aria-current] { background: rgba(255, 255, 255, 0.12); color: var(--white); box-shadow: inset 3px 0 0 var(--gold); }
[dir="rtl"] .admin-side a[aria-current] { box-shadow: inset -3px 0 0 var(--gold); }
.admin-side .badge { margin-inline-start: auto; background: var(--gold); color: var(--white); border-radius: 999px; padding: 0 0.5rem; font-size: 0.75rem; line-height: 1.5; }
.admin-user { margin-top: 1.5rem; padding: 0.8rem; border-radius: 10px; background: rgba(255, 255, 255, 0.06); font-size: 0.85rem; }
.admin-user strong { display: block; color: var(--white); }

/* Zone principale */
.admin-main { padding: 1.75rem clamp(1rem, 3vw, 2.5rem) 4rem; max-width: 84rem; }
.admin-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.admin-top h1 { font-size: 1.7rem; margin: 0; }
.admin-top p { margin: 0.3rem 0 0; color: var(--ink-soft); font-size: 0.92rem; max-width: 44rem; }
.admin-top__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

.panel { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem; margin-bottom: 1.25rem; box-shadow: 0 1px 3px rgba(6, 67, 33, 0.04); }
.panel > h2 { font-size: 1.2rem; margin: 0 0 1rem; }
.panel__sub { color: var(--ink-soft); font-size: 0.88rem; margin: -0.6rem 0 1rem; }

.admin .stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 0.9rem; margin-bottom: 1.5rem; background: none; border: 0; }
.stat { display: flex; gap: 0.8rem; align-items: center; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; text-decoration: none; color: var(--ink-soft); font-size: 0.88rem; }
.stat:hover { border-color: var(--gold-300); }
.stat__icon { width: 2.6rem; height: 2.6rem; border-radius: 10px; background: var(--cream); color: var(--forest-900); display: grid; place-items: center; flex: none; }
.stat__icon svg { width: 1.3rem; height: 1.3rem; }
.stat strong { display: block; font-size: 1.6rem; font-family: var(--font-display); color: var(--forest-900); line-height: 1.1; }

.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.75rem; }
.quick a { display: flex; gap: 0.7rem; align-items: center; padding: 0.9rem 1rem; border-radius: 10px; border: 1px dashed var(--gold-300); text-decoration: none; color: var(--forest-900); font-weight: 600; background: #fffdf8; }
.quick a:hover { background: var(--cream); border-style: solid; }
.quick svg { width: 1.2rem; height: 1.2rem; color: var(--gold); }

/* Tableaux */
.table-wrap { background: var(--white); border: 1px solid var(--line); border-radius: 12px; overflow: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--white); }
.table th, .table td { text-align: start; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: #f8f7f2; font-size: 0.78rem; color: var(--ink-soft); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fcfbf7; }
.table td.actions { white-space: nowrap; text-align: end; }
.table td.actions > * { display: inline-flex; vertical-align: middle; }
.table .muted, .muted { color: var(--ink-soft); font-size: 0.85rem; }
.table tr.is-hidden td { opacity: 0.55; }
.table tr.is-hidden td.actions { opacity: 1; }
.group-title { font-family: var(--font-body); font-size: 0.95rem; font-weight: 700; color: var(--forest-900); margin: 1.6rem 0 0.6rem; display: flex; align-items: center; gap: 0.5rem; }
.group-title svg { width: 1.1rem; height: 1.1rem; color: var(--gold); }

.pill { display: inline-block; padding: 0.05rem 0.6rem; border-radius: 999px; font-size: 0.76rem; font-weight: 600; background: #e7f2ea; color: var(--forest-800); white-space: nowrap; }
.pill--warn { background: #fbf1dc; color: var(--bronze-700); }
.pill--off { background: #eceeec; color: #5f6862; }
.pill--new { background: #eef1fb; color: #2f4a8a; }

.thumb { width: 4rem; height: 3rem; object-fit: cover; border-radius: 6px; display: block; }
.order-btns { display: inline-flex; gap: 0.2rem; }
.order-btns form { display: inline; }
.icon-action { width: 2rem; height: 2rem; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--forest-900); cursor: pointer; padding: 0; }
.icon-action:hover { border-color: var(--gold); color: var(--gold); }
.icon-action svg { width: 0.9rem; height: 0.9rem; }
.icon-action--up svg { transform: rotate(-90deg); }
.icon-action--down svg { transform: rotate(90deg); }

/* Formulaires */
.bilingual { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.form-actions { position: sticky; bottom: 0; background: var(--white); border-top: 1px solid var(--line); padding: 0.9rem 1.25rem; margin: 0 -1.25rem -1.25rem; display: flex; gap: 0.75rem; align-items: center; border-radius: 0 0 12px 12px; }
.check { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.75rem; }
.check input { width: 1.1rem; height: 1.1rem; }
.btn--small { padding: 0.35rem 0.75rem; font-size: 0.85rem; border-radius: 8px; }
.btn--danger { background: none; border-color: #e3b5b0; color: #a4271b; }
.btn--danger:hover { background: #a4271b; color: var(--white); }
.btn--ghost-dark { background: var(--white); border-color: var(--line); color: var(--forest-900); }
.btn--ghost-dark:hover { border-color: var(--gold); color: var(--gold); }
.tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a { padding: 0.4rem 0.85rem; border-radius: 999px; border: 1px solid var(--line); background: var(--white); text-decoration: none; color: var(--ink); font-size: 0.88rem; display: inline-flex; gap: 0.4rem; align-items: center; }
.tabs a small { color: var(--ink-soft); }
.tabs a[aria-current] { background: var(--forest-900); color: var(--white); border-color: var(--forest-900); }
.tabs a[aria-current] small { color: var(--gold-300); }
.search { display: flex; gap: 0.5rem; }
.search input { font: inherit; padding: 0.45rem 0.75rem; border: 1.5px solid var(--line); border-radius: 8px; min-width: 14rem; }
.help { background: #f7faf6; border: 1px solid #dfe9e1; border-radius: 10px; padding: 0.8rem 1rem; font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 1.25rem; }
.help strong { color: var(--forest-900); }
.photo-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.photo-admin__item { border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem; background: var(--white); }
.photo-admin__item.is-hidden { opacity: 0.55; }
.photo-admin__item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; margin-bottom: 0.5rem; }
.photo-admin__actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.dropzone { border: 2px dashed var(--gold-300); border-radius: 12px; padding: 1.5rem; text-align: center; background: #fffdf8; }
.dropzone input { margin-top: 0.6rem; }
.login-box { max-width: 24rem; margin: 10vh auto; background: var(--white); padding: 2rem; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(6, 67, 33, 0.08); }
.login-box img { height: 7rem; width: auto; margin: 0 auto 1rem; }

@media (max-width: 60rem) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-side { position: static; height: auto; }
  .bilingual { grid-template-columns: minmax(0, 1fr); }
}

/* Arabe : textes un peu plus grands pour la lisibilité */
[dir="rtl"] body.admin { font-size: 1rem; }
[dir="rtl"] .table th { font-size: 0.85rem; }
