/**
 * Styles démo : la dialog vit dans <body> (pas dans .r-root),
 * et .section button écrase les contrôles agenda.
 */

/* ---------- Champs globaux (date / number / time / search) ---------- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
textarea {
  min-height: 38px;
  padding: 0 0.65rem;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 10px;
  background-color: var(--bg-surface-2);
  color: var(--text-primary);
  font-size: 0.9375rem;
  line-height: 1.4;
  font-family: inherit;
}

textarea {
  min-height: 72px;
  padding: 0.55rem 0.65rem;
  resize: vertical;
}

input[type="color"] {
  width: 48px;
  height: 38px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface-2);
  cursor: pointer;
}

.r-root .lot-table td input[type="number"],
.r-root .lot-table td input[type="date"],
.r-root .lot-table td input[type="time"] {
  min-height: 32px;
  width: 100%;
  border-radius: var(--radius-small, 8px);
}

/* ---------- Modales hors .r-root (dialog #demo-modal) ---------- */
html[data-theme-dark="1"] dialog.universal-modal .modal-content {
  background: #131a26;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  color: #e8ecf4;
}

html[data-theme-dark="1"] dialog.universal-modal .modal-header {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme-dark="1"] dialog.universal-modal .modal-header h2 {
  color: #f4f7fb;
  font-size: 1.05rem;
  font-weight: 600;
}

html[data-theme-dark="1"] dialog.universal-modal .modal-header h2 i {
  color: #7c9cff;
}

html[data-theme-dark="1"] dialog.universal-modal .modal-close-btn {
  color: rgba(215, 223, 236, 0.7);
  background: transparent;
  border: none;
  box-shadow: none;
}

html[data-theme-dark="1"] dialog.universal-modal .modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f4f7fb;
}

html[data-theme-dark="1"] dialog.universal-modal .modal-body,
html[data-theme-dark="1"] dialog.universal-modal .form-group label {
  color: rgba(215, 223, 236, 0.88);
}

html[data-theme-dark="1"] dialog.universal-modal .modal-body label,
html[data-theme-dark="1"] dialog.universal-modal .form-group label {
  color: rgba(157, 181, 255, 0.95);
  font-size: 0.8125rem;
  font-weight: 600;
}

html[data-theme-dark="1"] dialog.universal-modal .modal-body input,
html[data-theme-dark="1"] dialog.universal-modal .modal-body select,
html[data-theme-dark="1"] dialog.universal-modal .modal-body textarea {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #edf2fa !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

html[data-theme-dark="1"] dialog.universal-modal .modal-body input::placeholder,
html[data-theme-dark="1"] dialog.universal-modal .modal-body textarea::placeholder {
  color: rgba(215, 223, 236, 0.45);
}

html[data-theme-dark="1"] dialog.universal-modal .modal-footer {
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.lots-modal .lots-modal__field {
  margin-bottom: var(--unit-3, 12px);
}

.lots-modal .lots-modal__field:last-child {
  margin-bottom: 0;
}

.lots-modal .lots-modal__input,
.lots-modal .lots-modal__body select,
.lots-modal .lots-modal__body input,
.lots-modal .lots-modal__body textarea {
  width: 100%;
  min-height: 40px;
  padding: 0 var(--unit-3, 12px);
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 0.9375rem;
  background: rgba(255, 255, 255, 0.04);
  color: #edf2fa;
}

html[data-theme-dark="0"] .lots-modal .lots-modal__input,
html[data-theme-dark="0"] .lots-modal .lots-modal__body select,
html[data-theme-dark="0"] .lots-modal .lots-modal__body input,
html[data-theme-dark="0"] .lots-modal .lots-modal__body textarea {
  background: #ffffff;
  color: #0d1117;
  border: 1px solid rgba(13, 17, 23, 0.14);
}

.lots-modal .lots-modal__input:focus,
.lots-modal .lots-modal__body select:focus,
.lots-modal .lots-modal__body input:focus,
.lots-modal .lots-modal__body textarea:focus {
  outline: none;
  border-color: rgba(124, 156, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(124, 156, 255, 0.16);
}

.lots-modal .lots-modal__footer {
  padding: var(--unit-3, 12px) var(--unit-4, 16px);
  gap: var(--unit-2, 8px);
}

.lots-modal .lots-modal__btn,
dialog.universal-modal .lots-modal__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 var(--unit-4, 16px);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  box-shadow: none;
}

.lots-modal .lots-modal__btn--cancel,
dialog.universal-modal .lots-modal__btn--cancel {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(215, 223, 236, 0.88);
}

html[data-theme-dark="0"] .lots-modal .lots-modal__btn--cancel,
html[data-theme-dark="0"] dialog.universal-modal .lots-modal__btn--cancel {
  background: #eef0f4;
  border-color: rgba(13, 17, 23, 0.14);
  color: #1a1a1a;
}

.lots-modal .lots-modal__btn--cancel:hover,
dialog.universal-modal .lots-modal__btn--cancel:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f4f7fb;
}

.lots-modal .lots-modal__btn--submit,
dialog.universal-modal .lots-modal__btn--submit {
  background: linear-gradient(180deg, #90adff 0%, #6f91ff 100%);
  color: #0d1420;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(111, 145, 255, 0.28);
}

html[data-theme-dark="0"] .lots-modal .lots-modal__btn--submit,
html[data-theme-dark="0"] dialog.universal-modal .lots-modal__btn--submit {
  background: #3e3b8c;
  color: #fff;
  box-shadow: none;
}

.lots-modal .lots-modal__btn--submit:hover,
dialog.universal-modal .lots-modal__btn--submit:hover {
  filter: brightness(1.06);
}

.lots-modal .lots-modal__btn--danger,
dialog.universal-modal .lots-modal__btn--danger {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fecaca;
  font-weight: 600;
}

html[data-theme-dark="0"] .lots-modal .lots-modal__btn--danger,
html[data-theme-dark="0"] dialog.universal-modal .lots-modal__btn--danger {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.35);
  color: #b91c1c;
}

/* ---------- Agenda : .section button ne doit plus tout écraser ---------- */
#dashboard-calendar.section .calendar-view-btn,
#dashboard-calendar.section .calendar-nav-btn {
  background: transparent;
  color: inherit;
  box-shadow: none;
  min-width: 0;
  border: none;
}

#dashboard-calendar.section .calendar-view-btn {
  padding: 0.45rem 0.9rem;
  color: rgba(215, 223, 236, 0.7);
}

#dashboard-calendar.section .calendar-view-btn:hover {
  color: #f3f6fb;
  background: rgba(255, 255, 255, 0.05);
}

#dashboard-calendar.section .calendar-view-btn.is-active {
  background: rgba(124, 156, 255, 0.2);
  color: #dbe4ff;
}

#dashboard-calendar.section .calendar-nav-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  color: #9db5ff;
}

#dashboard-calendar.section .calendar-nav-btn:hover {
  background: rgba(124, 156, 255, 0.12);
  color: #9db5ff;
}

#dashboard-calendar.section .agenda-action .btn-primary {
  background-color: var(--valid);
  color: var(--blanc, #fff);
  min-height: 40px;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: var(--shadow-small);
}

#dashboard-calendar.section .agenda-action .btn-primary:hover {
  filter: brightness(1.08);
  color: var(--blanc, #fff);
  background-color: var(--valid);
}

#dashboard-calendar.section .agenda-action .btn-danger {
  background-color: var(--error);
  color: #fff;
}

html[data-theme-dark="0"] #dashboard-calendar.section .calendar-view-btn {
  color: #4b5563;
}

html[data-theme-dark="0"] #dashboard-calendar.section .calendar-view-btn.is-active {
  background: rgba(62, 59, 140, 0.12);
  color: #3e3b8c;
}

html[data-theme-dark="0"] #dashboard-calendar.section .calendar-nav-btn {
  color: #3e3b8c;
}

/* Réception — boutons icône de ligne (filet de sécurité) */
.r-root .lot-table .btn-delete-row,
.r-root .lot-table .btn-remove-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted, #8b95a8);
  box-shadow: none;
}

.r-root .lot-table .btn-delete-row:hover,
.r-root .lot-table .btn-remove-line:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

html[data-theme-dark="0"] .r-root .lot-table .btn-delete-row,
html[data-theme-dark="0"] .r-root .lot-table .btn-remove-line {
  border-color: rgba(13, 17, 23, 0.14);
  color: #4b5563;
}
