/* ========== WRAP ========== */
.admin-wrap {
  max-width: 100%;
  margin: 20px auto;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ========== LOGIN PAGE ========== */
.admin-login-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  padding: 20px;
}

.admin-login-card {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  padding: 32px 28px;
  width: 100%;
  max-width: 400px;
}

.admin-login-card h1 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 22px;
}

.admin-login-card form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 8px;
}

.admin-back-btn {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: #888;
  text-decoration: none;
  transition: color 0.2s;
}
.admin-back-btn:hover {
  color: #F48FB1;
}

/* ========== HERO — simple titre de page, sans carte ========== */
.admin-hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  background: transparent;
  border: none;
  padding: 8px 2px 0;
}

.admin-hero-left h1 {
  margin: 0;
  font-size: clamp(24px, 5vw, 30px);
  font-weight: 800;
}

.admin-hero-left .muted { margin-top: 6px; }

.hl {
  color: #F48FB1;
  font-weight: 700;
}

.admin-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ========== GRILLE ========== */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

/* ========== CARD ========== */
.card {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 16px;
}

.card h2 {
  font-size: 18px;
  margin: 0 0 14px 0;
}

.card h3 {
  margin: 14px 0 8px 0;
  font-size: 14px;
  opacity: 0.95;
}

/* ========== SÉPARATEUR ========== */
.sep {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.10);
  margin: 14px 0;
}

/* ========== TEXTES ========== */
.muted { opacity: 0.85; margin: 6px 0 0 0; }
.small { font-size: 12px; }

/* ========== LISTE réservations ========== */
.list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.list li:last-child { border-bottom: none; }

.res-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2px;
}

/* ========== BADGES ========== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(244,143,177,0.18);
  border: 1px solid rgba(244,143,177,0.35);
  font-size: 12px;
  white-space: nowrap;
}

.badge-grey {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
}

/* ── Badges statut réservation ── */
.statut {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.statut.confirmee  { background: rgba(62,207,106,0.15); color: #3ecf6a; border: 1px solid rgba(62,207,106,0.3); }
.statut.en_attente { background: rgba(255,193,7,0.15);  color: #f9c84a; border: 1px solid rgba(255,193,7,0.3); }
.statut.annulee    { background: rgba(224,80,80,0.12);  color: #e05050; border: 1px solid rgba(224,80,80,0.25); }

/* ========== KV ========== */
.kv .k {
  display: inline-block;
  width: 90px;
  opacity: 0.8;
}
.kv .v {
  font-weight: 600;
  margin-left: 40px;
}

/* ========== FORMULAIRES ========== */
.form-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.form-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.form-col label { font-size: 12px; opacity: 0.85; }

.form-row input,
.form-col input,
.modal-body .input-group input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  font-size: 14px;
  font-family: inherit;
}

.form-row input:focus,
.form-col input:focus,
.modal-body .input-group input:focus {
  border-color: rgba(244,143,177,0.55);
}

.form-row .btn,
.form-col .btn {
  margin-top: 0;
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 14px;
  width: auto;
  box-shadow: 0 6px 14px rgba(244,143,177,0.25);
  white-space: nowrap;
  flex-shrink: 0;
}

.modal-body .input-group label {
  font-size: 12px;
  opacity: 0.85;
  display: block;
  margin-bottom: 4px;
}

.modal-body .input-group { margin-bottom: 12px; }

/* ========== TABLE ========== */
.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table thead tr { background: rgba(244,143,177,0.12); }

.admin-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: rgba(244,143,177,0.05); }

.desc-cell {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.8;
}

.actions-cell {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ========== DÉCONNEXION ADMIN ========== */
.admin-logout-wrap {
  padding: 0 10px 20px;
}

.admin-btn-logout {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  text-align: center !important;
  background: transparent !important;
  border: 1.5px solid rgba(224,80,80,0.55) !important;
  color: #e05050 !important;
  box-shadow: none !important;
  font-size: 14px !important;
  padding: 10px !important;
  margin-top: 0 !important;
  border-radius: 14px !important;
}
.admin-btn-logout:hover {
  background: rgba(224,80,80,0.1) !important;
  border-color: #e05050 !important;
}

/* ========== BOUTONS ========== */
.btn-settings {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}
.btn-settings:hover {
  background: rgba(255,255,255,0.1) !important;
  border-color: rgba(244,143,177,0.6) !important;
}

.btn-small {
  padding: 6px 14px !important;
  font-size: 13px !important;
  border-radius: 10px !important;
  margin-top: 0 !important;
  width: auto !important;
  min-height: unset !important;
}

.btn-danger {
  background: rgba(231,76,60,0.10) !important;
  border: 1px solid rgba(231,76,60,0.35) !important;
  color: #ff8a7a !important;
  box-shadow: none !important;
}
.btn-danger:hover { background: rgba(231,76,60,0.22) !important; }

/* En-tête de carte avec lien à droite */
.card-head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.card-head-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.card-head-link:hover { text-decoration: underline; }

/* ========== PROCHAINE RÉSERVATION ========== */
.next-resa {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 0;
}

.next-resa-date {
  font-size: 18px;
  font-weight: 800;
}

.next-resa-client {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.next-resa-name { font-weight: 600; }

.next-resa-tel {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}
.next-resa-tel:hover { text-decoration: underline; }

.next-resa-statut { margin-top: 2px; }

/* ========== RÉSERVATIONS EN ATTENTE ========== */
.pending-count {
  background: rgba(249,200,74,0.15);
  border-color: rgba(249,200,74,0.4);
  color: #f9c84a;
  margin-left: 6px;
  vertical-align: middle;
}

.pending-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.pending-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
}

.pending-item:last-child { border-bottom: none; padding-bottom: 4px; }

.pending-info {
  display: flex;
  align-items: baseline;
  gap: 6px 14px;
  flex-wrap: wrap;
  min-width: 0;
}

.pending-date {
  font-weight: 700;
  white-space: nowrap;
}

.pending-name {
  font-size: 14px;
  color: var(--muted);
}

.pending-tel {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.pending-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.pending-actions form { margin: 0; }

.btn-confirm {
  background: rgba(62,207,106,0.12) !important;
  border: 1px solid rgba(62,207,106,0.45) !important;
  color: #3ecf6a !important;
  box-shadow: none !important;
}
.btn-confirm:hover { background: rgba(62,207,106,0.25) !important; }

/* ========== COMMANDES ========== */
.commandes-list {
  display: flex;
  flex-direction: column;
  padding: 0;
  list-style: none;
  margin: 0;
}

.commande-item {
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text);
  border-bottom: 1px solid var(--border-soft);
}

.commande-item:last-child { border-bottom: none; padding-bottom: 4px; }

.commande-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.commande-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.commande-client {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.commande-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.commande-item .badge {
  color: white; /* numéro de commande en blanc sur fond sombre */
}

.commande-total {
  font-weight: 700;
  color: var(--accent);
  font-size: 1rem;
  white-space: nowrap;
}

.commande-date {
  font-size: 0.8rem;
  opacity: 0.5;
}

.commande-lines {
  list-style: none;
  padding: 8px 0 0;
  margin: 0;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.commande-lines li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: #bbb;
}

.line-nom   { flex: 1; }
.line-qty   { color: var(--muted); white-space: nowrap; }
.line-price { color: var(--accent); white-space: nowrap; font-weight: 500; }

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay.hidden { display: none; }

.modal-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.modal-title { font-size: 16px; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  opacity: 0.6;
  line-height: 1;
  width: auto !important;
  min-height: unset !important;
}
.modal-close:hover { opacity: 1; }

.modal-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ========== CARTE RÉSERVATION (modal calendrier) ========== */
.resa-modal-body {
  display: flex;
  flex-direction: column;
}

.resa-modal-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}
.resa-modal-row:last-child { border-bottom: none; }

.resa-modal-row .k {
  width: 90px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--muted);
}

.resa-modal-row .v { font-weight: 600; }

.resa-modal-tel {
  color: var(--accent);
  text-decoration: none;
}
.resa-modal-tel[href]:hover { text-decoration: underline; }

/* ========== ALERTS ========== */
.alert {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  box-sizing: border-box;
  font-size: 0.9rem;
  font-weight: 500;
}
.alert.success { background: rgba(46,204,113,0.4);  border-color: rgba(46,204,113,0.25); color: white; }
.alert.error   { background: rgba(231,76,60,0.4);   border-color: rgba(231,76,60,0.25);  color: white; }

/* ========== FEEDBACK CRÉNEAUX ========== */
.slot-feedback { min-height: 0; margin-bottom: 10px; transition: all 0.2s ease; }

/* ========== CALENDRIER ========== */
.week-picker {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15);
  background: #1a1a2e;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.week-picker-scroll {
  overflow-x: visible;
}

.week-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(26,26,46,0.98) 100%);
}

.week-title {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  letter-spacing: 0.04em;
  text-transform: capitalize;
}
.week-nav { display: flex; gap: 8px; flex-shrink: 0; }

.week-nav-btn {
  width: 34px;
  height: 34px;
  min-height: unset;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0;
  margin: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none;
  box-sizing: content-box;
}
.week-nav-btn:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.6);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255,255,255,0.1);
}
.week-nav-btn svg { stroke: rgba(255,255,255,0.8); flex-shrink: 0; pointer-events: none; display: block; }
.week-nav-btn:hover svg { stroke: white; }

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  width: 100%;
  overflow: visible;
}

.week-head, .week-row { display: contents; }

.cell {
  padding: 5px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  border-right:  1px solid rgba(255,255,255,0.07);
}

.cell.day {
  font-weight: 700;
  font-size: 11px;
  text-align: center;
  padding: 10px 4px;
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.18);
  border-right:  1px solid rgba(255,255,255,0.07);
  letter-spacing: 0.03em;
}

.slot {
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  user-select: none;
  color: rgba(255,255,255,0.75);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  transition: all 0.12s ease;
}
.slot.free:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255,255,255,0.08);
}
.slot.disabled {
  opacity: 0.2;
  cursor: not-allowed;
  background: transparent;
  border-color: transparent;
}
/* Réservé client : rouge vif, cliquable pour voir la réservation */
.slot.taken {
  background: rgba(231,76,60,0.35);
  border: 1px solid rgba(231,76,60,0.7);
  color: #ff8a7a;
  font-weight: 700;
  cursor: pointer;
}
.slot.taken:hover {
  background: rgba(231,76,60,0.55);
  color: #fff;
  transform: translateY(-1px);
}
/* Bloqué manuellement : orange/jaune */
.slot.blocked {
  background: rgba(255,160,0,0.22);
  border: 1px solid rgba(255,160,0,0.6);
  color: #ffc145;
  font-weight: 600;
  cursor: pointer;
}
.slot.blocked:hover {
  background: rgba(255,160,0,0.38);
  border-color: #ffc145;
  color: #fff;
  transform: translateY(-1px);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {

  .pending-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .pending-actions form { flex: 1; }
  .pending-actions .btn { width: 100% !important; min-height: 44px !important; }

  .admin-grid        { grid-template-columns: 1fr; }

  .admin-hero-card   { flex-direction: column; align-items: center; }
  .admin-hero-actions { width: 100%; flex-direction: column; }
  .admin-hero-actions .btn { width: 100%; box-sizing: border-box; text-align: center; }

  .form-row { flex-direction: column; align-items: stretch; }
  .form-row .btn,
  .form-col .btn { width: 100%; box-sizing: border-box; }

  /* Tables → cartes produits colorées */
  .table-wrap { border: none; border-radius: 0; background: transparent; overflow: visible; }
  .admin-table { display: block; }
  .admin-table thead { display: none; }
  .admin-table tbody { display: flex; flex-direction: column; gap: 10px; }

  .admin-table tbody tr {
    display: flex; flex-direction: column;
    border-radius: 14px;
    border: none;
    padding: 14px 14px 10px;
    overflow: hidden;
    position: relative;
  }

  /* Toutes les cartes produits en rose uniforme */
  .admin-table tbody tr {
    background: #fce4ec;
    border-left: 4px solid #F48FB1;
  }

  .admin-table tbody tr:nth-child(6n+1),
  .admin-table tbody tr:nth-child(6n+2),
  .admin-table tbody tr:nth-child(6n+3),
  .admin-table tbody tr:nth-child(6n+4),
  .admin-table tbody tr:nth-child(6n+5),
  .admin-table tbody tr:nth-child(6n+6) {
    background: #fce4ec;
    border-left: 4px solid #F48FB1;
  }

  .admin-table td {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 5px 0; border-bottom: 1px solid rgba(0,0,0,0.07);
    font-size: 13px;
    color: #222;
    gap: 8px;
    text-align: right;
  }
  .admin-table td:last-child { border-bottom: none; padding-top: 8px; }

  .admin-table td::before {
    content: attr(data-label);
    font-weight: 700; font-size: 10px; color: rgba(0,0,0,0.45);
    text-transform: uppercase; letter-spacing: 0.06em;
    flex-shrink: 0; padding-top: 1px;
    white-space: nowrap;
    text-align: left;
  }

  .desc-cell { display: flex; justify-content: space-between; align-items: flex-start; }
  .desc-cell span { white-space: normal; text-align: right; word-break: break-word; flex: 1; }

  .actions-cell { flex-direction: column; align-items: stretch; gap: 8px; }
  .actions-cell::before { display: none; }
  .actions-cell .btn,
  .actions-cell form,
  .actions-cell form .btn {
    width: 100% !important; box-sizing: border-box;
    padding: 13px 16px !important; font-size: 15px !important;
    text-align: center; margin: 0;
  }

  /* Modal */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-card { width: 100%; max-width: 100%; border-radius: 20px 20px 0 0; padding: 20px 16px; max-height: 90vh; overflow-y: auto; }
  .modal-actions { flex-direction: column; gap: 8px; }
  .modal-actions .btn { width: 100% !important; box-sizing: border-box; padding: 13px !important; text-align: center; }

  /* Calendrier compact mobile */
  .cell { padding: 2px 1px; }
  .cell.day { font-size: 9px; padding: 6px 1px; }
  .slot { height: 20px; font-size: 9px; border-radius: 6px; }
  .week-title { font-size: 12px; }
}