/* ── Bouton principal (Profil, Équipe, index.html) ── */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  background: #5B4FE8;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  line-height: normal;
  box-sizing: border-box;
  text-align: center;
}

.btn:hover {
  background: #4338ca;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* ── Bouton principal formulaire app ── */
.primary {
  align-self: flex-start;
  border: none;
  background-color: #5B4FE8;
  color: #fff;
  padding: 0.7rem 1.4rem;
  font-weight: 600;
  border-radius: 0.8rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.primary:hover,
.primary:focus {
  background-color: #4338ca;
  transform: translateY(-1px);
}

/* ── Bouton secondaire outline ── */
.ghost {
  border: 1px solid rgba(55, 48, 163, 0.25);
  background-color: transparent;
  color: #3730a3;
  padding: 0.6rem 1.2rem;
  border-radius: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.ghost:hover,
.ghost:focus {
  background-color: rgba(55, 48, 163, 0.08);
  transform: translateY(-1px);
  outline: none;
}

/* ── Bouton secondaire neutre ── */
.btn-secondary {
  padding: 0.65rem 1.25rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  line-height: normal;
}

.btn-secondary:hover {
  background: #f8f9fc;
}

/* ── Bouton édition permissions ── */
.btn-edit-perms {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  padding: 0.22rem 0.6rem;
  border-radius: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s;
}

.btn-edit-perms:hover {
  background: #f1f3f8;
  color: #3730a3;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Boutons action (paramètres, plan) ── */
.action-buttons {
  display: inline-flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.action-button {
  border: none;
  background-color: rgba(55, 48, 163, 0.08);
  color: #3730a3;
  padding: 0.35rem 0.8rem;
  border-radius: 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.action-button:hover,
.action-button:focus {
  background-color: rgba(91, 79, 232, 0.25);
  transform: translateY(-1px);
  outline: none;
}

.action-button.danger {
  background-color: rgba(192, 57, 43, 0.14);
  color: #922b21;
}

.action-button.warning {
  background-color: rgba(243, 156, 18, 0.15);
  color: #9a6100;
}

.action-button.warning:hover {
  background-color: rgba(243, 156, 18, 0.28);
}

/* ── Bouton action inline (plan) ── */
.inline-action-button {
  border: none;
  background-color: rgba(55, 48, 163, 0.12);
  color: #3730a3;
  padding: 0.3rem 0.7rem;
  border-radius: 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.inline-action-button:hover,
.inline-action-button:focus {
  background-color: rgba(91, 79, 232, 0.3);
  transform: translateY(-1px);
  outline: none;
}

.inline-action-button.danger {
  background-color: rgba(192, 57, 43, 0.18);
  color: #922b21;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background: rgba(91, 79, 232, 0.1);
  color: #5B4FE8;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Badges statut mouvement */
.badge--pending  { background-color: rgba(243, 156, 18, 0.18); color: #c47a06; }
.badge--validated { background-color: rgba(10, 138, 59, 0.15);  color: #0a8a3b; }
.badge--archived  { background-color: rgba(76, 90, 120, 0.15);  color: #475569; }
.badge--carried   { background-color: rgba(192, 57, 43, 0.16);  color: #922b21; }

/* Badges rôle équipe */
.badge-role-admin  { background: rgba(91,79,232,0.12); color: #3730a3; }
.badge-role-member { background: rgba(10,138,59,0.13);  color: #0a6e30; }
.badge-role-viewer { background: rgba(76,90,120,0.13);  color: #3f4f6b; }

/* ── Cards ── */
.card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
}

.card-featured {
  background: #ffffff;
  border: 1px solid #5B4FE8;
  border-radius: 12px;
  padding: 24px;
}

/* ── Section plate sans card (data-form) ── */
.data-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem 0;
}

.data-form:not(:last-child) {
  border-bottom: 0.5px solid #e2e8f0;
}

.data-form h2 {
  margin: 0;
  font-size: 1.25rem;
  color: #3730a3;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.form-actions {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Records (archives) ── */
.records {
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

.records h3 {
  margin: 0 0 0.75rem;
  color: #3730a3;
}

/* ── Bandeaux info / erreur ── */
.error-banner {
  padding: 0.8rem 1rem;
  background: rgba(192,57,43,0.1);
  border: 1px solid rgba(192,57,43,0.25);
  border-radius: 0.7rem;
  color: #922b21;
  font-size: 0.95rem;
  font-weight: 600;
}

.info-banner {
  padding: 0.8rem 1rem;
  background: rgba(91,79,232,0.06);
  border: 1px solid rgba(91,79,232,0.18);
  border-radius: 0.7rem;
  color: #3730a3;
  font-size: 0.95rem;
}

/* ── Panneau alerte ── */
.alert-panel {
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  border-left: 4px solid #c0392b;
  background-color: rgba(192, 57, 43, 0.12);
  color: #7a1f17;
  box-shadow: 0 10px 20px rgba(192, 57, 43, 0.18);
}

.alert-panel h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  color: #922b21;
}

.alert-panel ul {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.4rem;
}

.alert-panel li { font-size: 0.92rem; }

.alert-panel li strong {
  font-weight: 700;
  color: #7a1f17;
}

/* ── Toggle type Encaissement / Décaissement ── */
.type-toggle-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.type-toggle-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
}

.type-toggle {
  display: flex;
  border-radius: 8px;
  border: 1px solid var(--gray-200, #e2e8f0);
  overflow: hidden;
}

.type-toggle-btn {
  flex: 1;
  padding: 0.45rem 0.75rem;
  border: none;
  background: var(--gray-100, #f1f3f8);
  color: var(--gray-600, #475569);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: normal;
}

.type-toggle-btn + .type-toggle-btn {
  border-left: 1px solid var(--gray-200, #e2e8f0);
}

.type-toggle-btn--active-in  { background: #edfef6; color: #047857; }
.type-toggle-btn--active-out { background: #fff2f2; color: #be123e; }

.type-toggle-btn:hover:not(.type-toggle-btn--active-in):not(.type-toggle-btn--active-out) {
  background: rgba(83, 74, 183, 0.08);
  color: #534AB7;
}

/* ── Status chip & menu déroulant ── */
.status-menu-wrapper {
  position: relative;
}

.status-chip {
  border: 1px solid #e2e8f0;
  background: rgba(91, 79, 232, 0.06);
  color: #3730a3;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  position: relative;
  z-index: 1;
}

.status-chip__chevron {
  font-size: 0.7rem;
  opacity: 0.7;
}

.status-chip--icon {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
}
.status-chip--icon:hover {
  background: var(--gray-100);
  border-color: var(--border);
  color: var(--accent);
}

.status-menu {
  position: fixed;
  top: auto;
  left: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 28px rgba(30, 41, 59, 0.16);
  border-radius: 0.65rem;
  padding: 0.35rem;
  display: none;
  gap: 0.15rem;
  min-width: 160px;
  z-index: 3000;
  overflow: visible;
}

.status-menu[hidden] { display: none !important; }

.status-menu--open { display: grid; }

.status-menu__item {
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.4rem 0.55rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  color: #3730a3;
  cursor: pointer;
}

.status-menu__item:hover,
.status-menu__item:focus {
  background: rgba(91, 79, 232, 0.12);
  outline: none;
}

/* ── Bouton + panneau quick-add (plan) ── */
.quick-add-button {
  border: 1px solid #e2e8f0;
  background: rgba(91, 79, 232, 0.06);
  color: #3730a3;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  line-height: 1;
  padding: 0;
}

.quick-add-button:hover,
.quick-add-button:focus {
  background: rgba(91, 79, 232, 0.12);
  transform: translateY(-1px);
  outline: none;
}

.quick-add-panel {
  display: none;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #f8f9fc;
  box-shadow: 0 12px 24px rgba(30, 41, 59, 0.12);
}

.quick-add-panel.open { display: grid; }

.quick-add-panel label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
  color: #3730a3;
}

.quick-add-panel input {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--input-border);
  border-radius: 0.55rem;
  font-size: 0.9rem;
}

.quick-add-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.quick-add-save {
  border: none;
  background: #5B4FE8;
  color: #fff;
  border-radius: 0.55rem;
  padding: 0.45rem 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.quick-add-cancel {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #3730a3;
  border-radius: 0.55rem;
  padding: 0.45rem 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

/* ── Boutons navigation slider ── */
.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 38px;
  width: 38px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #3730a3;
  box-shadow: 0 12px 24px rgba(30, 41, 59, 0.18);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.slider-nav:hover:not(:disabled) {
  transform: translateY(-50%) scale(1.04);
  box-shadow: 0 16px 30px rgba(30, 41, 59, 0.22);
}

.slider-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.slider-nav.prev { left: -12px; }
.slider-nav.next { right: -12px; }

/* ── Modal limite de plan ── */
#plan-limit-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

#plan-limit-overlay[hidden] { display: none; }

.plan-limit-modal {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
  padding: 2rem 2.2rem 1.8rem;
  max-width: 400px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  animation: modal-in 0.18s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.plan-limit-icon { font-size: 2rem; line-height: 1; text-align: center; }

.plan-limit-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  text-align: center;
  margin: 0;
}

.plan-limit-msg {
  font-size: 0.9rem;
  color: #475569;
  text-align: center;
  line-height: 1.5;
}

.plan-limit-err {
  font-size: 0.82rem;
  color: #ef4444;
  text-align: center;
  min-height: 1.1rem;
}

.plan-limit-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.3rem;
}

.plan-limit-actions .btn-upgrade {
  background: linear-gradient(135deg, #5b4fe8, #7c6ff7);
  color: #fff;
  border: none;
  border-radius: 0.6rem;
  padding: 0.7rem 1.2rem;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.14s;
}

.plan-limit-actions .btn-upgrade:hover:not(:disabled) { opacity: 0.88; }
.plan-limit-actions .btn-upgrade:disabled { opacity: 0.55; cursor: not-allowed; }

.plan-limit-actions .btn-cancel-modal {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 0.6rem;
  padding: 0.55rem 1rem;
  font-size: 0.87rem;
  color: #64748b;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s;
}

.plan-limit-actions .btn-cancel-modal:hover { background: #f8fafc; }
