/* Panneau d'administration — Centre Aloumi */
.admin-body { background: var(--cream-deep); min-height: 100vh; }

.admin-top {
  background: var(--olive); color: var(--cream);
  padding: 16px 0; position: sticky; top: 0; z-index: 20;
  box-shadow: var(--shadow-md);
}
.admin-top .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-top h1 { color: var(--cream); font-size: 1.25rem; }
.admin-top .actions { display: flex; gap: 12px; align-items: center; }

.admin-main { max-width: 880px; margin: 32px auto; padding: 0 20px 80px; }

.login-box {
  max-width: 400px; margin: 12vh auto; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 38px;
  box-shadow: var(--shadow-lg); text-align: center;
}
.login-box .brand__mark { width: 56px; height: 56px; margin: 0 auto 18px; font-size: 1.6rem; }
.login-box h2 { margin-bottom: 6px; }
.login-box p { color: var(--espresso-soft); margin-bottom: 22px; font-size: 0.95rem; }

.panel {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 26px; margin-bottom: 22px; box-shadow: var(--shadow-sm);
}
.panel > h2 {
  font-size: 1.3rem; margin-bottom: 4px; display: flex; align-items: center; gap: 10px;
}
.panel > .hint { color: var(--espresso-soft); font-size: 0.9rem; margin-bottom: 20px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

.fld { margin-bottom: 16px; }
.fld label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 6px; color: var(--espresso); }
.fld input, .fld textarea {
  width: 100%; font-family: var(--font-body); font-size: 0.98rem; color: var(--espresso);
  padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--cream);
}
.fld input:focus, .fld textarea:focus { outline: none; border-color: var(--olive-soft); box-shadow: 0 0 0 3px rgba(60,74,58,.12); }
.fld--ar input, .fld--ar textarea { direction: rtl; text-align: right; }

.svc-item { border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; margin-bottom: 16px; background: var(--cream); position: relative; }
.svc-item .row-actions { position: absolute; inset-inline-end: 14px; top: 14px; }

.day-row { display: grid; grid-template-columns: 150px 90px 1fr 1fr; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.day-row:last-child { border-bottom: 0; }
.day-row .dname { font-weight: 700; }
.day-row input[type="time"] { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); font-family: var(--font-body); }
.day-row.closed input[type="time"] { opacity: .4; pointer-events: none; }
@media (max-width: 640px) { .day-row { grid-template-columns: 1fr 1fr; } .day-row .dname { grid-column: 1 / -1; } }

/* Interrupteur */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: .2s; }
.switch .track::before { content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: var(--shadow-sm); }
.switch input:checked + .track { background: #1fa556; }
.switch input:checked + .track::before { transform: translateX(20px); }
html[dir="rtl"] .switch input:checked + .track::before { transform: translateX(-20px); }

.btn--sm { padding: 9px 16px; font-size: 0.9rem; }
.btn--danger { background: transparent; color: var(--terracotta); border: 1px solid var(--terracotta); }
.btn--danger:hover { background: var(--terracotta); color: #fff; }

/* Créneaux réservables */
.cn-add { background: var(--cream); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; margin-bottom: 18px; }
.cn-add__grid { display: grid; grid-template-columns: 1.4fr 1fr 0.8fr 0.8fr 1fr; gap: 12px; align-items: end; margin-bottom: 12px; }
.cn-add .fld { margin-bottom: 0; }
.cn-add select, .cn-add input { background: var(--white); }
@media (max-width: 720px) { .cn-add__grid { grid-template-columns: 1fr 1fr; } }

.cn-list { display: grid; gap: 18px; }
.cn-daygroup { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.cn-daygroup__head { background: var(--olive); color: var(--cream); padding: 10px 16px; font-weight: 700; font-family: var(--font-display); }
.cn-slots { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 16px; }
.cn-slot { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 7px 8px 7px 14px; background: var(--white); font-size: 0.9rem; }
.cn-slot.reserved { background: rgba(189,93,58,0.08); border-color: var(--terracotta); }
.cn-slot .h { font-weight: 700; font-variant-numeric: tabular-nums; }
.cn-slot .svc { color: var(--espresso-soft); font-size: 0.8rem; }
.cn-slot .who { color: var(--terracotta); font-size: 0.8rem; }
.cn-slot .badge { font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.cn-slot .badge.libre { background: rgba(31,165,86,0.14); color: #178a48; }
.cn-slot .badge.reserve { background: rgba(189,93,58,0.16); color: var(--terracotta-dark); }
.cn-slot button { border: 0; cursor: pointer; background: transparent; font-size: 0.78rem; padding: 3px 7px; border-radius: 8px; color: var(--espresso-soft); }
.cn-slot button:hover { background: var(--cream-deep); color: var(--terracotta); }
.cn-empty { color: var(--espresso-soft); padding: 8px 2px; }

.save-bar {
  position: sticky; bottom: 0; background: rgba(247,241,230,.92); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); padding: 14px 0; margin-top: 10px;
}
.save-bar .container { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.toast { font-weight: 700; }
.toast.ok { color: #1fa556; }
.toast.err { color: var(--terracotta); }
