/* =============================================
 * MORPHOSE ACCOUNT - PREMIUM DESIGN (RG 2026)
 * Complete alignment with RG design system
 * ============================================= */

/* Force Black Color Global */
.morphose-account,
.morphose-account p,
.morphose-account label,
.morphose-account strong,
.morphose-account span:not(.rg-badge):not(.btn-text):not(.dashicons),
.rg-stat-card__label,
.rg-connected-info p,
.rg-connected-info h3 {
  color: #000 !important;
}

.morphose-account h2,
.morphose-account h3 {
  color: #1e293b !important;
  /* Slightly distinct but very dark */
}

/* ---------- Container & Layout ---------- */
.rg-container {
  width: 100% !important;
  max-width: 1400px !important;
  margin: 30px auto !important;
  background: #fff !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}

.rg-connected-info {
  padding: 0 25px !important;
  background: none !important;
  border: none !important;
}

.morphose-account__panel {
  width: 100% !important;
  padding: 30px 25px !important;
}

#panel-new-sale {
  padding: 0 !important;
}

#panel-new-sale .morphose-calculator-wrapper .rg-container {
  padding: 20px 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

.rg-form-container {
  width: 100% !important;
}

.rg-fournisseur-section {
  width: 100% !important;
  max-width: 100% !important;
}

.rg-form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.rg-form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rg-form-group label {
  font-size: 13px;
  font-weight: 700;
  color: #000 !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rg-form-group input {
  height: 48px !important;
  padding: 0 16px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  font-size: 14px !important;
  width: 100% !important;
  background: #fff !important;
  color: #000 !important;
}

.rg-form-group input::placeholder {
  color: #999 !important;
}

.rg-form-group input:focus {
  border-color: #f05a2b !important;
  background: #fff !important;
}

/* ---------- Header & Logout ---------- */
.rg-header {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px !important;
  background: #f05a2b !important;
  border-radius: 12px 12px 0 0 !important;
}

.rg-header h2 {
  margin: 0 !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  display: flex;
  align-items: center;
  gap: 10px;
}

.rg-logout-link {
  color: #fff !important;
  text-decoration: none !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.rg-logout-link:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ---------- Welcome Section ---------- */
.rg-welcome-section {
  padding: 30px 25px 0 !important;
}

.rg-welcome-section .rg-connected-info h3 {
  font-size: 22px !important;
  margin-bottom: 8px !important;
  color: #1e293b;
}

.rg-welcome-section .rg-connected-info p {
  color: #000 !important;
  font-size: 15px;
}

/* ---------- Navigation Tabs (Pills) ---------- */
.rg-tabs-navigation {
  display: flex !important;
  gap: 10px !important;
  padding: 15px 25px !important;
  margin: 0 0 20px 0 !important;
  background: #fcfcfc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  overflow-x: auto;
  scrollbar-width: none;
}

.rg-tab-btn {
  flex: 1 !important;
  /* Stretch to full width */
  justify-content: center !important;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px !important;
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  color: #000 !important;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.rg-tab-btn--active {
  background: #1e293b !important;
  color: #fff !important;
  border-color: #1e293b !important;
}

.rg-tab-btn--new-sale {
  border-color: #10b981 !important;
  color: #059669;
}

.rg-tab-btn--new-sale.rg-tab-btn--active {
  background: #10b981 !important;
  color: #fff !important;
  border-color: #10b981 !important;
}

/* ---------- Stats Grid ---------- */
.rg-stats-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px !important;
  padding: 0 25px;
  margin-bottom: 40px;
}

.rg-stat-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 25px;
  border-radius: 16px !important;
  border: 1px solid #e2e8f0;
  background: #fff;
  transition: all 0.3s ease;
}

.rg-stat-card:hover {
  border-color: #cbd5e1;
}

.rg-stat-card__icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.rg-stat-card__content {
  display: flex;
  flex-direction: column;
}

.rg-stat-card__value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
}

.rg-stat-card__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #000 !important;
}

/* Stat Colors */
.rg-stat-card--orange .rg-stat-card__icon {
  background: #fff7ed;
  color: #f05a2b;
}

.rg-stat-card--orange .rg-stat-card__value {
  color: #f05a2b;
}

.rg-stat-card--emerald .rg-stat-card__icon {
  background: #ecfdf5;
  color: #10b981;
}

.rg-stat-card--emerald .rg-stat-card__value {
  color: #10b981;
}

.rg-stat-card--indigo .rg-stat-card__icon {
  background: #eef2ff;
  color: #6366f1;
}

.rg-stat-card--indigo .rg-stat-card__value {
  color: #6366f1;
}

/* ---------- Activity List ---------- */
.rg-activity-list {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.rg-activity-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.2s;
}

.rg-activity-item:last-child {
  border-bottom: none;
}

.rg-activity-item:hover {
  background: #f8fafc;
}

.rg-activity-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 50px;
  padding-right: 20px;
  border-right: 1px solid #f1f5f9;
  margin-right: 20px;
}

.rg-activity-date .day {
  font-size: 18px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1;
}

.rg-activity-date .month {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #000 !important;
  margin-top: 2px;
}

.rg-activity-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.rg-activity-info strong {
  font-size: 14px;
  color: #1e293b;
}

.rg-activity-info span {
  font-size: 12px;
  color: #000 !important;
  margin-top: 2px;
}

.rg-activity-amount {
  font-weight: 700;
  color: #1e293b;
  font-size: 15px;
  min-width: 100px;
  text-align: right;
}

/* ---------- History Items Refinement ---------- */
.rg-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px !important;
  background: #fff;
  overflow: hidden;
  margin-bottom: 15px;
  transition: border-color 0.2s;
}

.rg-card:hover {
  border-color: #cbd5e1;
}

.morphose-submission__header {
  padding: 18px 25px !important;
  background: #fcfcfc !important;
}

.morphose-submission__date {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #1e293b;
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.morphose-submission__summary {
  font-size: 12px !important;
  color: #000 !important;
  margin-top: 4px;
  display: block;
}

.morphose-submission__details {
  padding: 25px !important;
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0;
}

/* ---------- Tickets Grid ---------- */
.rg-tickets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.rg-inner-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 15px;
}

.morphose-ticket__header {
  border-bottom: 1px dashed #e2e8f0;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.rg-ticket-type {
  font-size: 11px;
  font-weight: 800;
  color: #f05a2b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rg-ticket-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.rg-ticket-field label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #000 !important;
  margin-bottom: 4px;
}

.rg-ticket-field input {
  width: 100%;
  height: 36px !important;
  padding: 0 10px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  background: #fff !important;
  color: #000 !important;
  border: 1px solid #e2e8f0 !important;
}

.rg-ticket-field input:focus {
  border-color: #f05a2b !important;
}

.rg-input-group {
  display: flex;
  gap: 4px;
}

/* ---------- Profile & Password ---------- */
.rg-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.rg-section-header h2 {
  font-size: 18px !important;
  margin: 0 !important;
  color: #1e293b;
}

.rg-section-divider {
  margin-top: 40px !important;
  padding-top: 40px !important;
  border-top: 2px solid #f1f5f9 !important;
}

.rg-input-readonly {
  background: #f1f5f9 !important;
  cursor: not-allowed;
  color: #000 !important;
}

/* ---------- Panel Title (H3 par onglet) ---------- */
.morphose-panel-title {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  margin: 0 0 24px 0 !important;
  padding: 0 0 16px 0 !important;
  border-bottom: 2px solid #f1f5f9 !important;
  letter-spacing: 0.3px;
}

/* ---------- History Full Width ---------- */
#panel-history {
  width: 100% !important;
}

#panel-history .rg-tickets-section {
  width: 100% !important;
  max-width: 100% !important;
}

#panel-history .morphose-submissions-list {
  width: 100% !important;
}

#panel-history .morphose-submission {
  width: 100% !important;
}

/* ---------- Submission Footer (Save / Excel) ---------- */
.rg-submission-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 25px;
  border-top: 1px solid #e2e8f0;
  background: #fcfcfc;
  margin-top: 20px;
  border-radius: 0 0 12px 12px;
}

.rg-footer-total {
  margin-right: auto;
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
}

.rg-download-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #fff;
  color: #000 !important;
  border: 1px solid #10b981;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.2s;
}

.rg-download-link:hover {
  background: #10b981;
  color: #fff !important;
}

/* ---------- Smaller Buttons in Nouvelle Vente ---------- */
.morphose-calculator-wrapper .rg-button {
  padding: 7px 14px !important;
  font-size: 11px !important;
  gap: 5px !important;
  border-radius: 6px !important;
}

.morphose-calculator-wrapper .rg-button i {
  font-size: 11px !important;
}

/* ---------- Alert Messages ---------- */
.rg-alert {
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
}

.rg-alert-info {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.rg-alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.rg-alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.rg-alert-fadeout {
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .rg-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .rg-stats-grid {
    grid-template-columns: 1fr;
  }

  .rg-tickets-grid {
    grid-template-columns: 1fr;
  }

  .rg-header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .rg-logout-link {
    width: 100%;
    text-align: center;
  }

  .rg-tabs-navigation {
    padding: 10px !important;
    gap: 8px !important;
  }

  .rg-tab-btn {
    padding: 10px 12px !important;
    font-size: 11px !important;
    flex: none !important;
  }

  .rg-activity-item {
    flex-wrap: wrap;
  }

  .rg-activity-amount {
    width: 100%;
    text-align: left;
    margin-top: 10px;
    padding-left: 70px;
  }

  .morphose-panel-title {
    font-size: 17px !important;
    margin-bottom: 18px !important;
    padding-bottom: 12px !important;
  }

  .morphose-calculator-wrapper .rg-button {
    padding: 6px 10px !important;
    font-size: 10px !important;
  }

  .rg-submission-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .rg-footer-total {
    margin-right: 0;
    text-align: center;
  }
}
