/* ================================================================
 * ProVsup Design System — pv-param.css
 * Page Gestion des paramètres (app_param & app_param2).
 * ================================================================ */


/* ── Barre d'onglets (style shadcn Tabs) ────────────────────────── */

.pv-theme .pv-param-tabs {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 0 12px;
  gap: 2px;
  flex-wrap: wrap;
}

.pv-theme .pv-param-tab-wrap {
  display: flex;
  align-items: stretch;
  position: relative;
}

.pv-theme .pv-param-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: color 0.12s, border-color 0.12s, background 0.10s;
  white-space: nowrap;
  margin-bottom: -1px;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  line-height: 1;
}

.pv-theme .pv-param-tab:hover {
  color: var(--text);
  background: var(--surface-2);
}

.pv-theme .pv-param-tab--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.pv-theme .pv-param-tab-caret {
  opacity: 0.65;
}

.pv-theme .open .pv-param-tab-caret {
  transform: rotate(180deg);
}


/* ── Zone de formulaire ─────────────────────────────────────────── */

.pv-theme .pv-param-form {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.pv-theme .pv-param-form::-webkit-scrollbar { width: 4px; }
.pv-theme .pv-param-form::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}


/* ── Barre d'en-tête de colonnes ────────────────────────────────── */

.pv-theme .pv-form-col-header {
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

.pv-theme .pv-form-col-label {
  width: 280px;
  flex: none;
  text-align: right;
  padding-right: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-family: var(--font-ui);
}

.pv-theme .pv-form-col-value {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-family: var(--font-ui);
  padding-left: 4px;
}


/* ── Titre de section (type 3) ──────────────────────────────────── */

.pv-theme .pv-param-section {
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 30px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-2);
  font-family: var(--font-ui);
}


/* ── Séparateur (type 8) ────────────────────────────────────────── */

.pv-theme .pv-param-divider {
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 34px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border-bottom: 2px solid var(--accent);
}

.pv-theme .pv-param-divider span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font-ui);
}


/* ── Ligne de paramètre ─────────────────────────────────────────── */

.pv-theme .pv-param-field {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 20px;
  border-bottom: 1px solid var(--divider);
  overflow: visible;
}

.pv-theme .pv-param-field:last-child {
  border-bottom: none;
}

/* Types pleine largeur (section / séparateur / custom) */
.pv-theme .pv-param-field--auto {
  height: auto;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-bottom: none;
  overflow: hidden;
}

.pv-theme .pv-param-field:hover {
  background: var(--surface-2);
}

/* Étiquette */
.pv-theme .pv-param-label {
  width: 280px;
  flex: none;
  text-align: right;
  padding-right: 20px;
  font-size: 13px;
  color: var(--text-2);
  font-family: var(--font-ui);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pv-theme .pv-param-label--empty {
  width: 280px;
}

/* Contrôle */
.pv-theme .pv-param-control {
  flex: none;
  width: 200px;
  position: relative;
}

/* Variantes de largeur pour certains types */
.pv-theme .pv-param-control--btn {
  width: auto;
}

.pv-theme .pv-param-control--btns {
  width: 200px;
}

.pv-theme .pv-param-control--btns-mid {
  width: 300px;
}

.pv-theme .pv-param-control--btns-wide {
  width: 420px;
}

.pv-theme .pv-param-control--time-range {
  width: 320px;
}

/* Table interne pour TouchSpin (préserve le layout plugin) */
.pv-theme .pv-param-ctrl-table {
  width: 100%;
  border-collapse: collapse;
}

.pv-theme .pv-param-ctrl-table td {
  padding: 0;
  vertical-align: middle;
}

/* Afficheur lecture seule */
.pv-theme .pv-param-display {
  height: 30px;
  line-height: 30px;
  padding: 0 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text);
  font-family: var(--font-mono);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
}

.pv-theme .pv-param-display--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Badge statut (type 5 & 20) */
.pv-theme .pv-param-status {
  height: 30px;
  line-height: 30px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font-ui);
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.10);
}

/* Boutons d'action (type 6) */
.pv-theme .pv-param-btn-group {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.pv-theme .pv-param-btn-group .btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 34px !important;
  padding: 0 10px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  font-family: var(--font-ui) !important;
  border-radius: var(--r-sm) !important;
  line-height: 1 !important;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.12s;
}

/* Type 15 — toggle : centrage texte */
.pv-theme .pv-param-control > button.btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* Plage horaire (type 10) */
.pv-theme .pv-param-time-range {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pv-theme .pv-param-time-hhmm {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pv-theme .pv-param-time-input {
  width: 52px !important;
  height: 30px !important;
  min-height: 30px !important;
  text-align: center;
  padding: 0 6px !important;
}

.pv-theme .pv-param-time-sep {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-ui);
  flex: none;
}

/* Boutons radio (type 14) */
.pv-theme .pv-param-radio {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-2);
  font-family: var(--font-ui);
  cursor: pointer;
  margin-right: 12px;
  margin-bottom: 0;
  user-select: none;
}

.pv-theme .pv-param-radio input[type="radio"] {
  accent-color: var(--accent);
  flex: none;
  margin: 0;
}


/* ── Colonne suffixe + indicateur non-sauvegardé ────────────────── */

.pv-theme .pv-param-suffix {
  flex: none;
  min-width: 60px;
  padding-left: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-ui);
}

.pv-theme .pv-param-unit {
  white-space: nowrap;
}

.pv-theme .pv-param-unsaved {
  font-size: 7px;
  color: var(--warn, #f59e0b);
  flex: none;
  animation: pv-pulse 1.5s ease-in-out infinite;
}

@keyframes pv-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}


/* ── Info au survol ─────────────────────────────────────────────── */

.pv-theme .pv-param-info {
  flex: 1;
  padding-left: 14px;
  min-width: 0;
}

.pv-theme .pv-param-info-box {
  background: oklch(0.96 0.02 268);
  border: 1px solid oklch(0.55 0.17 268 / 0.18);
  border-radius: var(--r-sm);
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-2);
  font-family: var(--font-ui);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ── Badge toggle "Retenir l'onglet" ────────────────────────────── */

.pv-theme .pv-savecb-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  margin: 0;
  font-family: var(--font-ui);
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}

.pv-theme .pv-savecb-badge:hover {
  background: color-mix(in srgb, var(--border) 40%, var(--surface-2));
  color: var(--text-2);
}

.pv-theme .pv-savecb-badge--on {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent);
}

.pv-theme .pv-savecb-badge--on:hover {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
}

/* Séparateur vertical dans pv-page-actions */
.pv-theme .pv-page-actions-sep {
  display: inline-block;
  width: 1px;
  height: 20px;
  background: var(--border);
  flex: none;
  align-self: center;
}


/* ── Resizer draggable entre form et panneau édition ────────────── */

.pv-theme .pv-param-resizer {
  flex: none;
  height: 8px;
  cursor: ns-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  user-select: none;
  transition: background 0.12s;
  z-index: 2;
}

.pv-theme .pv-param-resizer:hover,
.pv-theme .pv-param-resizer--dragging {
  background: color-mix(in srgb, var(--accent) 15%, var(--surface-2));
}

.pv-theme .pv-param-resizer-grip {
  width: 36px;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  transition: background 0.12s;
}

.pv-theme .pv-param-resizer:hover .pv-param-resizer-grip,
.pv-theme .pv-param-resizer--dragging .pv-param-resizer-grip {
  background: var(--accent);
}


/* ── Panneau d'édition (mode debug) ─────────────────────────────── */

.pv-theme .pv-param-edit-panel {
  background: var(--surface-2);
  overflow-y: auto;
  padding: 0;
  color: var(--text);
}

/* ── Bandeau d'en-tête du panel (2 lignes) ──────────────────────── */
.pv-theme .pv-param-edit-panel .pv-edit-header {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

/* Ligne 1 : badge + description */
.pv-theme .pv-param-edit-panel .pv-edit-header-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  border-bottom: 1px solid var(--divider);
}

.pv-theme .pv-param-edit-panel .pv-edit-header-badge {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: oklch(0.45 0.18 260);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  flex: none;
}

.pv-theme .pv-param-edit-panel .pv-edit-header-desc {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-ui);
}

/* Ligne 2 : labels de colonnes alignés sur les données */
.pv-theme .pv-param-edit-panel .pv-edit-header-cols {
  display: flex;
  align-items: center;
  gap: 12px; /* même gap que .pv-edit-row */
  padding: 4px 16px; /* même padding horizontal que .pv-edit-rows */
}

.pv-theme .pv-param-edit-panel .pv-edit-col-lbl {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

/* ── Lignes de données ──────────────────────────────────────────── */
.pv-theme .pv-param-edit-panel .pv-edit-rows {
  padding: 4px 16px;
}

.pv-theme .pv-param-edit-panel .pv-edit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 38px;
  border-bottom: 1px solid var(--divider);
}

/* Champ id — compact, largeur fixe */
.pv-theme .pv-param-edit-panel .pv-edit-field--id {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  width: 140px;
}

/* Sélecteur de type — largeur fixe, centré entre id et valeur */
.pv-theme .pv-param-edit-panel .pv-edit-type {
  flex: none;
  width: 260px;
}

/* Bootstrap input-group en flex — corrige width:1% sur input-group-btn */
.pv-theme .pv-param-edit-panel .pv-edit-type .input-group {
  display: flex !important;
  width: 100%;
}

.pv-theme .pv-param-edit-panel .pv-edit-type .input-group-btn {
  flex: none !important;
  width: auto !important;
  display: flex !important;
  align-items: center;
}

.pv-theme .pv-param-edit-panel .pv-edit-type .form-control {
  flex: 1;
  min-width: 0;
}

/* Champ valeur — compact, largeur fixe, poussé à droite */
.pv-theme .pv-param-edit-panel .pv-edit-field--val {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  width: 220px;
  margin-left: auto;
}

/* Labels id / Valeur / Adresse */
.pv-theme .pv-param-edit-panel .pv-edit-label {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
  flex: none;
  width: 44px;
  text-align: right;
}

.pv-theme .pv-param-edit-panel .pv-edit-input {
  flex: 1;
  min-width: 0;
  height: 28px !important;
}

.pv-theme .pv-param-edit-panel .form-control {
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
  background: var(--field-bg) !important;
  border: 1px solid var(--field-border) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

.pv-theme .pv-param-edit-panel .form-control:focus {
  border-color: var(--accent) !important;
  outline: none !important;
}

/* Boutons ◄ ► */
.pv-theme .pv-param-edit-panel .btn,
.pv-theme .pv-param-edit-panel .btn-default {
  background: var(--surface-2) !important;
  border: 1px solid var(--field-border) !important;
  color: var(--text-2) !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  height: 28px !important;
  width: 30px;
  padding: 0 !important;
  flex: none;
}

.pv-theme .pv-param-edit-panel .btn:hover {
  background: var(--surface-3, oklch(0.85 0 0)) !important;
  color: var(--text) !important;
}

.pv-theme .pv-param-edit-panel .input-group-addon {
  background: var(--surface-2) !important;
  border-color: var(--field-border) !important;
  color: var(--muted) !important;
}

/* ── Dark mode — panneau d'édition ─────────────────────────────── */

:root[data-theme="dark"] .pv-theme .pv-param-edit-panel {
  background: oklch(0.10 0 0) !important;
  border-top-color: oklch(0.25 0.08 260);
  color: oklch(0.82 0 0);
}

:root[data-theme="dark"] .pv-theme .pv-param-edit-panel .pv-edit-header {
  background: oklch(0.14 0.03 260) !important;
  border-bottom-color: oklch(0.25 0 0) !important;
}

:root[data-theme="dark"] .pv-theme .pv-param-edit-panel .pv-edit-header-top {
  border-bottom-color: oklch(0.20 0 0) !important;
}

:root[data-theme="dark"] .pv-theme .pv-param-edit-panel .pv-edit-header-desc {
  color: oklch(0.50 0 0);
}

:root[data-theme="dark"] .pv-theme .pv-param-edit-panel .pv-edit-col-lbl {
  color: oklch(0.38 0 0);
}

:root[data-theme="dark"] .pv-theme .pv-param-edit-panel .pv-edit-row {
  border-bottom-color: oklch(0.16 0 0);
}

:root[data-theme="dark"] .pv-theme .pv-param-edit-panel .pv-edit-label {
  color: oklch(0.42 0 0);
}

:root[data-theme="dark"] .pv-theme .pv-param-edit-panel .form-control {
  background: oklch(0.17 0 0) !important;
  border-color: oklch(0.28 0 0) !important;
  color: oklch(0.82 0 0) !important;
}

:root[data-theme="dark"] .pv-theme .pv-param-edit-panel .form-control:focus {
  border-color: oklch(0.55 0.18 260) !important;
}

:root[data-theme="dark"] .pv-theme .pv-param-edit-panel .btn,
:root[data-theme="dark"] .pv-theme .pv-param-edit-panel .btn-default {
  background: oklch(0.20 0 0) !important;
  border-color: oklch(0.28 0 0) !important;
  color: oklch(0.70 0 0) !important;
}

:root[data-theme="dark"] .pv-theme .pv-param-edit-panel .btn:hover {
  background: oklch(0.28 0 0) !important;
  color: #fff !important;
}

:root[data-theme="dark"] .pv-theme .pv-param-edit-panel .input-group-addon {
  background: oklch(0.17 0 0) !important;
  border-color: oklch(0.28 0 0) !important;
  color: oklch(0.50 0 0) !important;
}


/* Harmonise la hauteur des champs à 30px dans les lignes de formulaire */
.pv-theme .pv-param-control .pv-input,
.pv-theme .pv-param-control .pv-select {
  height: 30px;
  min-height: 30px;
  line-height: 28px;
}

/* Override form-control inside pv-param-control to match pv-input look */
.pv-theme .pv-param-control .form-control {
  height: 30px;
  border: 1.5px solid var(--field-border);
  border-radius: var(--r-sm);
  background: var(--field-bg);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-ui);
  text-align: center;
  box-shadow: none;
}

.pv-theme .pv-param-control .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  outline: none;
}


/* ── Lignes alternées ───────────────────────────────────────────── */

.pv-theme .pv-param-field:nth-child(even) {
  background: color-mix(in srgb, var(--surface-2) 40%, var(--bg));
}

.pv-theme .pv-param-field:nth-child(even):hover {
  background: var(--surface-2);
}


/* ── Dark mode ──────────────────────────────────────────────────── */

:root[data-theme="dark"] .pv-theme .pv-param-tabs {
  background: var(--surface);
  border-bottom-color: var(--border);
}

:root[data-theme="dark"] .pv-theme .pv-param-form {
  background: var(--bg);
}

:root[data-theme="dark"] .pv-theme .pv-param-field:hover {
  background: var(--surface-2);
}

:root[data-theme="dark"] .pv-theme .pv-param-display {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

:root[data-theme="dark"] .pv-theme .pv-param-control .form-control {
  background: var(--field-bg);
  border-color: var(--field-border);
  color: var(--text);
}

:root[data-theme="dark"] .pv-theme .pv-param-info-box {
  background: oklch(0.55 0.17 268 / 0.10);
  border-color: oklch(0.55 0.17 268 / 0.25);
}

:root[data-theme="dark"] .pv-theme .pv-form-col-header {
  background: var(--surface);
  border-bottom-color: var(--border);
}

:root[data-theme="dark"] .pv-theme .pv-param-divider {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

:root[data-theme="dark"] .pv-theme .pv-param-field:nth-child(even) {
  background: color-mix(in srgb, var(--surface-2) 30%, var(--bg));
}


/* ── TouchSpin — boutons -/+ modernisés ─────────────────────────── */

.pv-theme .pv-param-control .bootstrap-touchspin.input-group {
  display: flex !important;
  width: 100%;
  margin: 0;
}

.pv-theme .pv-param-control .bootstrap-touchspin .input-group-btn {
  width: auto;
  flex: none;
  display: flex;
}

.pv-theme .pv-param-control .bootstrap-touchspin .input-group-btn .btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 30px !important;
  flex: none;
  padding: 0 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  font-family: var(--font-ui) !important;
  line-height: 1 !important;
  background: var(--surface-2) !important;
  border: 1.5px solid var(--field-border) !important;
  color: var(--text-2) !important;
  cursor: pointer;
  transition: background 0.10s, color 0.10s;
}

.pv-theme .pv-param-control .bootstrap-touchspin .bootstrap-touchspin-down.btn {
  border-radius: var(--r-sm) 0 0 var(--r-sm) !important;
  border-right-width: 0 !important;
}

.pv-theme .pv-param-control .bootstrap-touchspin .bootstrap-touchspin-up.btn {
  border-radius: 0 var(--r-sm) var(--r-sm) 0 !important;
  border-left-width: 0 !important;
}

.pv-theme .pv-param-control .bootstrap-touchspin .input-group-btn .btn:hover {
  background: var(--surface-3, oklch(0.85 0 0)) !important;
  color: var(--text) !important;
}

.pv-theme .pv-param-control .bootstrap-touchspin input.form-control {
  flex: 1 !important;
  min-width: 0;
  border-radius: 0 !important;
  border-left-width: 0 !important;
  border-right-width: 0 !important;
}


/* ── Dark mode — TouchSpin ──────────────────────────────────────── */

:root[data-theme="dark"] .pv-theme .pv-param-control .bootstrap-touchspin .input-group-btn .btn {
  background: oklch(0.22 0 0) !important;
  border-color: var(--field-border) !important;
  color: var(--text-2) !important;
}

:root[data-theme="dark"] .pv-theme .pv-param-control .bootstrap-touchspin .input-group-btn .btn:hover {
  background: oklch(0.30 0 0) !important;
  color: var(--text) !important;
}


/* ── Dark mode — tous les form-controls Bootstrap dans la page ───── */
/* Couvre les composants de type 99/100 et tout contenu dynamique */

:root[data-theme="dark"] .pv-theme .pv-param-form .form-control {
  background: var(--field-bg) !important;
  border-color: var(--field-border) !important;
  color: var(--text) !important;
}

:root[data-theme="dark"] .pv-theme .pv-param-form .form-control:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-ring) !important;
  outline: none;
}

:root[data-theme="dark"] .pv-theme .pv-param-form .form-control[disabled],
:root[data-theme="dark"] .pv-theme .pv-param-form .form-control[readonly] {
  background: oklch(0.18 0 0) !important;
  color: var(--muted) !important;
}

:root[data-theme="dark"] .pv-theme .pv-param-form .input-group-addon {
  background: oklch(0.22 0 0) !important;
  border-color: var(--field-border) !important;
  color: var(--text-2) !important;
}

:root[data-theme="dark"] .pv-theme .pv-param-form .btn-default {
  background: oklch(0.22 0 0) !important;
  border-color: var(--field-border) !important;
  color: var(--text-2) !important;
}

:root[data-theme="dark"] .pv-theme .pv-param-form .btn-default:hover {
  background: oklch(0.30 0 0) !important;
  color: var(--text) !important;
}

/* Conteneurs Bootstrap dans les composants custom (type 99/100) */
:root[data-theme="dark"] .pv-theme .pv-param-form .bg-light,
:root[data-theme="dark"] .pv-theme .pv-param-form .bg-white {
  background: var(--surface) !important;
}

:root[data-theme="dark"] .pv-theme .pv-param-form .panel,
:root[data-theme="dark"] .pv-theme .pv-param-form .panel-default {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

:root[data-theme="dark"] .pv-theme .pv-param-form .panel-heading {
  background: var(--surface-2) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

:root[data-theme="dark"] .pv-theme .pv-param-form table {
  color: var(--text);
}

:root[data-theme="dark"] .pv-theme .pv-param-form .table > thead > tr > th,
:root[data-theme="dark"] .pv-theme .pv-param-form .table > tbody > tr > td {
  border-color: var(--divider) !important;
  color: var(--text);
}

:root[data-theme="dark"] .pv-theme .pv-param-form .table-striped > tbody > tr:nth-of-type(odd) {
  background: oklch(0.18 0 0) !important;
}

:root[data-theme="dark"] .pv-theme .pv-param-form .text-muted {
  color: var(--muted) !important;
}

:root[data-theme="dark"] .pv-theme .pv-param-form .checkbox label,
:root[data-theme="dark"] .pv-theme .pv-param-form label {
  color: var(--text-2);
}

/* Input checkbox natif — accent couleur */
.pv-theme .pv-param-form input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
}


/* ── Uniformisation globale des .btn Bootstrap dans le formulaire ─── */
/* Couvre les composants custom (type 99/100) et rend tout cohérent    */

.pv-theme .pv-param-form .btn:not(.bootstrap-touchspin-down):not(.bootstrap-touchspin-up) {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px !important;
  border-radius: var(--r-sm) !important;
  font-family: var(--font-ui) !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  line-height: 1 !important;
  cursor: pointer;
  transition: filter 0.12s;
}

.pv-theme .pv-param-form .btn.w-full,
.pv-theme .pv-param-form .btn.w-md {
  width: 100% !important;
  justify-content: center;
}

/* Couleurs Bootstrap conservées, juste le rendu modernisé */
.pv-theme .pv-param-form .btn-success { background: #2FB84A; border-color: #2FB84A; color: #fff; }
.pv-theme .pv-param-form .btn-success:hover { filter: brightness(0.9); }

.pv-theme .pv-param-form .btn-primary { background: oklch(0.50 0.17 260); border-color: oklch(0.50 0.17 260); color: #fff; }
.pv-theme .pv-param-form .btn-primary:hover { filter: brightness(0.9); }

.pv-theme .pv-param-form .btn-danger { background: oklch(0.55 0.20 20); border-color: oklch(0.55 0.20 20); color: #fff; }
.pv-theme .pv-param-form .btn-danger:hover { filter: brightness(0.9); }

/* btn-block (utilisé par les composants type 100 / 99) */
.pv-theme .pv-param-form .btn-block {
  width: 100% !important;
  justify-content: center;
}

.pv-theme .pv-param-form .btn-info { background: oklch(0.55 0.17 220); border-color: oklch(0.55 0.17 220); color: #fff; }
.pv-theme .pv-param-form .btn-info:hover { filter: brightness(0.9); }

.pv-theme .pv-param-form .btn-warning { background: oklch(0.72 0.19 55); border-color: oklch(0.72 0.19 55); color: #fff; }
.pv-theme .pv-param-form .btn-warning:hover { filter: brightness(0.9); }

.pv-theme .pv-param-form .btn-default {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}
.pv-theme .pv-param-form .btn-default:hover {
  background: var(--surface-3, oklch(0.88 0 0));
  color: var(--text);
}


/* ── Type 100 — Tableau horaire (SPE_horaire) ───────────────────── */
/* Coins arrondis sur le bouton gauche et l'addon "min" à droite */

.pv-theme .pv-param-form [class^="type100_"] .input-group-btn:first-child > .btn {
  border-top-left-radius: var(--r-sm) !important;
  border-bottom-left-radius: var(--r-sm) !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.pv-theme .pv-param-form [class^="type100_"] .input-group > .input-group-addon:last-child {
  border-top-right-radius: var(--r-sm) !important;
  border-bottom-right-radius: var(--r-sm) !important;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

/* Espacement entre les lignes */
.pv-theme .pv-param-form [class^="type100_"] .row {
  padding: 3px 16px;
  margin-left: 0;
  margin-right: 0;
}

/* ── Éditeur d'onglets (paramNavEditor / navEditor) ─────────────── */

.pv-theme .pv-table-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.pv-theme .pv-debug-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.pv-theme .pv-debug-panel-title {
  flex: none;
}

.pv-theme .pv-debug-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
