/**
 * Dashboard Dokan – Thème Châteaux France
 * Style unifié pour le dashboard vendeur (legacy + fullwidth).
 * Scope: .dokan-dashboard (body class sur la page dashboard).
 *
 * Inclut l’annulation du reset Hello Elementor (bordures/couleurs #c36
 * sur button / [type=submit]) et la correction du texte qui dépasse dans les boutons.
 */

/* -------------------------------------------------------------------------
   Annulation du reset Hello Elementor (reset.css)
   Le thème parent applique border: 1px solid #c36 et color: #c36 aux boutons.
   On restaure des styles neutres / thème pour tout le dashboard.
   ------------------------------------------------------------------------- */
.dokan-dashboard button,
.dokan-dashboard [type="button"],
.dokan-dashboard [type="submit"],
.dokan-dashboard [type="reset"],
.dokan-dashboard input[type="button"],
.dokan-dashboard input[type="submit"],
.dokan-dashboard input[type="reset"] {
  border: 1px solid rgba(73, 113, 75, 0.25) !important;
  color: var(--ikn-text, #2d3b2a) !important;
  background-color: #fff !important;
  line-height: 1.4 !important;
  padding: 0.5rem 1rem !important;
  min-height: 2.5rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
}

.dokan-dashboard input:not([type="button"]):not([type="submit"]):not([type="reset"]),
.dokan-dashboard select,
.dokan-dashboard textarea {
  border-color: rgba(73, 113, 75, 0.2) !important;
  color: var(--ikn-text, #2d3b2a) !important;
}

/* Focus : pas de rouge, utiliser la couleur thème */
.dokan-dashboard button:focus,
.dokan-dashboard [type="button"]:focus,
.dokan-dashboard [type="submit"]:focus,
.dokan-dashboard input:focus,
.dokan-dashboard select:focus,
.dokan-dashboard textarea:focus {
  outline-color: var(--ikn-primary-light, #8BA981) !important;
  border-color: rgba(73, 113, 75, 0.4) !important;
}

/* Boutons verts du thème (Filtre, Recherche, Appliquer, etc.) */
.dokan-dashboard .dokan-btn-theme,
.dokan-dashboard .dokan-add-product-link .dokan-btn-theme,
.dokan-dashboard button.dokan-btn-theme,
.dokan-dashboard input.dokan-btn-theme,
.dokan-dashboard [type="submit"].dokan-btn-theme {
  background: var(--ikn-primary) !important;
  border-color: var(--ikn-primary) !important;
  color: #fff !important;
}

/* Rapports / React : mêmes corrections bordure + texte (variables déjà définies plus bas) */
.dokan-dashboard .dokan-layout button[type="button"]:not(.components-tab-panel__tabs-item),
.dokan-dashboard #dokan-dashboard-fullwidth-wrapper button[type="button"] {
  border-color: rgba(73, 113, 75, 0.25) !important;
  color: #2d3b2a !important;
  background-color: #fff !important;
  line-height: 1.4 !important;
  min-height: 2.5rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* -------------------------------------------------------------------------
   Variables & fond global
   ------------------------------------------------------------------------- */
.dokan-dashboard {
  --ikn-primary: #49714b;
  --ikn-primary-light: #8BA981;
  --ikn-primary-rgb: 73, 113, 75;
  --ikn-primary-light-rgb: 139, 169, 129;
  --ikn-sidebar: #3d5a3e;
  --ikn-sidebar-hover: #4a6b4b;
  --ikn-sidebar-active: #5a7d5c;
  --ikn-bg: #f7f9f6;
  --ikn-card-bg: #fff;
  --ikn-card-border: rgba(73, 113, 75, 0.12);
  --ikn-text: #2d3b2a;
  --ikn-text-muted: #5c6b59;
  --ikn-dokan-primary: #8BA981;
  --ikn-dokan-primary-rgb: 139, 169, 129;
  --ikn-dokan-text: #374151;
  --ikn-dokan-text-muted: #6b7280;
  --ikn-dokan-border: rgba(17, 24, 39, 0.1);
  --ikn-dokan-border-hover: rgba(0, 0, 0, 0.22);
  --ikn-radius: 14px;
  --ikn-radius-sm: 10px;
  --ikn-shadow: 0 2px 12px rgba(45, 59, 42, 0.06);
  --ikn-shadow-hover: 0 6px 24px rgba(45, 59, 42, 0.1);
}

/* Override variables Dokan pour boutons / focus */
.dokan-dashboard .dokan-dashboard-wrap {
  --dokan-sidebar-background-color: var(--ikn-sidebar);
  --dokan-button-background-color: var(--ikn-primary);
}

.dokan-dashboard .dokan-dashboard-wrap a:focus {
  outline-color: var(--ikn-primary-light);
}

/* Fond page dashboard */
.dokan-dashboard .dokan-dashboard-wrap {
  background: var(--ikn-bg);
  min-height: 60vh;
}

/* -------------------------------------------------------------------------
   Sidebar (menu latéral)
   ------------------------------------------------------------------------- */
.dokan-dashboard .dokan-dash-sidebar {
  background: var(--ikn-sidebar) !important;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.06);
}

.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu {
  background: transparent !important;
  margin: 0;
  padding: 12px 0 20px;
}

.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li a {
  color: rgba(255, 255, 255, 0.92);
  padding: 12px 18px 12px 20px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}

.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li a i {
  opacity: 0.9;
}

.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li:hover {
  background: var(--ikn-sidebar-hover) !important;
}

.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li:hover a {
  color: #fff;
}

.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li.active {
  background: var(--ikn-sidebar-active) !important;
}

.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li.active a {
  color: #fff;
  font-weight: 600;
}

.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li.dokan-common-links {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li.dokan-common-links a:hover {
  background: var(--ikn-sidebar-hover) !important;
}

.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li ul.navigation-submenu {
  background: var(--ikn-sidebar-hover) !important;
  border-radius: 0 var(--ikn-radius-sm) var(--ikn-radius-sm) 0;
  box-shadow: var(--ikn-shadow);
}

.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li ul.navigation-submenu li:hover a,
.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li ul.navigation-submenu li.current a {
  color: #fff;
}

/* -------------------------------------------------------------------------
   Zone contenu principale
   ------------------------------------------------------------------------- */
.dokan-dashboard .dokan-dashboard-content {
  padding: 28px 28px 28px 32px !important;
  background: var(--ikn-bg);
}

.dokan-dashboard header.dokan-dashboard-header {
  margin-bottom: 24px;
}

.dokan-dashboard header.dokan-dashboard-header h1.entry-title {
  color: var(--ikn-text);
  font-size: 1.5rem;
  font-weight: 700;
}

/* -------------------------------------------------------------------------
   Widgets (cartes Dashboard, Commandes, Produits, etc.)
   ------------------------------------------------------------------------- */
.dokan-dashboard .dokan-dashboard-content article.dashboard-content-area .dashboard-widget {
  background: var(--ikn-card-bg) !important;
  border: 1px solid var(--ikn-card-border) !important;
  border-radius: var(--ikn-radius) !important;
  padding: 20px 22px !important;
  box-shadow: var(--ikn-shadow) !important;
  margin-bottom: 20px !important;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.dokan-dashboard .dokan-dashboard-content article.dashboard-content-area .dashboard-widget:hover {
  box-shadow: var(--ikn-shadow-hover) !important;
  border-color: rgba(var(--ikn-primary-rgb), 0.18) !important;
}

.dokan-dashboard .dokan-dashboard-content article.dashboard-content-area .dashboard-widget .widget-title {
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  color: var(--ikn-text) !important;
  border-bottom: 1px solid var(--ikn-card-border) !important;
  padding-bottom: 12px !important;
  margin-bottom: 14px !important;
}

.dokan-dashboard .dokan-dashboard-content article.dashboard-content-area .dashboard-widget .widget-title i {
  color: var(--ikn-primary) !important;
  padding-right: 8px;
}

.dokan-dashboard .dokan-dashboard-content article.dashboard-content-area .dashboard-widget .widget-title .pull-right a {
  color: var(--ikn-primary) !important;
  font-weight: 500;
}

.dokan-dashboard .dokan-dashboard-content article.dashboard-content-area .dashboard-widget .widget-title .pull-right a:hover {
  color: var(--ikn-primary-light) !important;
}

/* Big counter (chiffres clés) */
.dokan-dashboard .dokan-dashboard-content article.dashboard-content-area .dashboard-widget.big-counter ul.list-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-around;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dokan-dashboard .dokan-dashboard-content article.dashboard-content-area .dashboard-widget.big-counter li {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 12px 8px;
  border-radius: var(--ikn-radius-sm);
  background: rgba(var(--ikn-primary-rgb), 0.06);
  border: 1px solid rgba(var(--ikn-primary-rgb), 0.1);
}

.dokan-dashboard .dokan-dashboard-content article.dashboard-content-area .dashboard-widget.big-counter .title {
  font-size: 13px !important;
  color: var(--ikn-text-muted) !important;
  padding-top: 0 !important;
}

.dokan-dashboard .dokan-dashboard-content article.dashboard-content-area .dashboard-widget.big-counter .count {
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  color: var(--ikn-primary) !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

/* Listes (commandes, produits) */
.dokan-dashboard .dokan-dashboard-content article.dashboard-content-area .dashboard-widget .list-count a,
.dokan-dashboard .dokan-dashboard-content article.dashboard-content-area .dashboard-widget .list-unstyled.list-count a {
  color: var(--ikn-text) !important;
  padding: 6px 0;
  display: block;
  transition: color 0.15s ease;
}

.dokan-dashboard .dokan-dashboard-content article.dashboard-content-area .dashboard-widget .list-count a:hover,
.dokan-dashboard .dokan-dashboard-content article.dashboard-content-area .dashboard-widget .list-unstyled.list-count a:hover {
  color: var(--ikn-primary) !important;
}

.dokan-dashboard .dokan-dashboard-content article.dashboard-content-area .dashboard-widget .list-count .count,
.dokan-dashboard .dokan-dashboard-content article.dashboard-content-area .dashboard-widget .list-unstyled .count {
  font-weight: 600;
  color: var(--ikn-text-muted);
}

/* -------------------------------------------------------------------------
   Boutons
   ------------------------------------------------------------------------- */
.dokan-dashboard .dokan-btn-theme,
.dokan-dashboard .dokan-btn-theme:hover,
.dokan-dashboard .dokan-add-product-link .dokan-btn-theme {
  background: var(--ikn-primary) !important;
  border-color: var(--ikn-primary) !important;
  color: #fff !important;
  border-radius: var(--ikn-radius-sm) !important;
  padding: 10px 20px !important;
  font-weight: 600 !important;
  transition: background 0.2s ease, transform 0.15s ease;
}

.dokan-dashboard .dokan-btn-theme:hover,
.dokan-dashboard .dokan-add-product-link .dokan-btn-theme:hover {
  background: var(--ikn-primary-light) !important;
  border-color: var(--ikn-primary-light) !important;
  transform: translateY(-1px);
}

.dokan-dashboard .dokan-add-product-link .dokan-btn-theme {
  box-shadow: var(--ikn-shadow);
}

/* -------------------------------------------------------------------------
   Formulaires & champs (éviter texte qui dépasse)
   ------------------------------------------------------------------------- */
.dokan-dashboard .dokan-form-group label,
.dokan-dashboard .dokan-form-inline label,
.dokan-dashboard label.dokan-control-label {
  line-height: 1.4 !important;
  padding-top: 0;
  padding-bottom: 0;
  display: inline-block;
  vertical-align: middle;
}

.dokan-dashboard select.dokan-form-control,
.dokan-dashboard select.chosen {
  line-height: 1.4 !important;
  padding: 10px 14px !important;
  min-height: 2.5rem !important;
}

.dokan-dashboard .dokan-form-inline .dokan-form-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.dokan-dashboard .dokan-form-inline .dokan-form-group label {
  margin-bottom: 0;
}

.dokan-dashboard .dokan-form-control {
  border-radius: var(--ikn-radius-sm) !important;
  border-color: var(--ikn-card-border) !important;
  padding: 10px 14px !important;
}

.dokan-dashboard .dokan-form-control:focus {
  border-color: var(--ikn-primary-light) !important;
  box-shadow: 0 0 0 3px rgba(var(--ikn-primary-rgb), 0.15) !important;
  outline: none !important;
}

/* -------------------------------------------------------------------------
   Alertes (succès, erreur, info)
   ------------------------------------------------------------------------- */
.dokan-dashboard .dokan-alert {
  border-radius: var(--ikn-radius-sm) !important;
  padding: 16px 20px !important;
}

.dokan-dashboard .dokan-alert-success {
  background-color: rgba(var(--ikn-primary-rgb), 0.12) !important;
  border-color: rgba(var(--ikn-primary-rgb), 0.25) !important;
  color: #2d4a2a !important;
}

.dokan-dashboard .dokan-alert-info {
  background-color: rgba(139, 169, 129, 0.15) !important;
  border-color: rgba(var(--ikn-primary-rgb), 0.2) !important;
  color: var(--ikn-text) !important;
}

.dokan-dashboard .dokan-alert-danger {
  background-color: #fef3f3 !important;
  border-color: #fcdbe1 !important;
  color: #bc1c21 !important;
}

.dokan-dashboard .dokan-alert-warning {
  background-color: #fffbeb !important;
  border-color: #ffeed1 !important;
  color: #9d5425 !important;
}

/* -------------------------------------------------------------------------
   Onglets Subscription (Packs d'abonnement) – React
   ------------------------------------------------------------------------- */
.dokan-dashboard .dokan-tab-panel .components-tab-panel__tabs {
  gap: 10px;
  border-bottom: 1px solid var(--ikn-dokan-border);
  padding-bottom: 6px;
}

.dokan-dashboard .dokan-tab-panel .components-tab-panel__tabs > button.components-button.components-tab-panel__tabs-item {
  background: transparent !important;
  border: 1px solid transparent !important;
  border-bottom: 1px solid transparent !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  color: var(--ikn-dokan-text-muted) !important;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.dokan-dashboard .dokan-tab-panel .components-tab-panel__tabs > button.components-button.components-tab-panel__tabs-item:hover {
  background: rgba(17, 24, 39, 0.04) !important;
  border-color: var(--ikn-dokan-border) !important;
  color: #111827 !important;
}

.dokan-dashboard .dokan-tab-panel .components-tab-panel__tabs > button.components-button.components-tab-panel__tabs-item[aria-selected="true"],
.dokan-dashboard .dokan-tab-panel .components-tab-panel__tabs > button.components-button.components-tab-panel__tabs-item[data-active-item="true"],
.dokan-dashboard .dokan-tab-panel .components-tab-panel__tabs > button.components-button.components-tab-panel__tabs-item.dokan-active-tab {
  background: rgba(var(--ikn-dokan-primary-rgb), 0.14) !important;
  border-color: rgba(var(--ikn-dokan-primary-rgb), 0.45) !important;
  color: #111827 !important;
}

.dokan-dashboard .dokan-tab-panel .components-tab-panel__tabs .components-tab-panel__tabs-item {
  color: var(--ikn-dokan-text) !important;
}

.dokan-dashboard .dokan-tab-panel .components-tab-panel__tabs .components-tab-panel__tabs-item[aria-selected="true"],
.dokan-dashboard .dokan-tab-panel .components-tab-panel__tabs .components-tab-panel__tabs-item[data-active-item="true"],
.dokan-dashboard .dokan-tab-panel .components-tab-panel__tabs .components-tab-panel__tabs-item.dokan-active-tab {
  color: var(--ikn-dokan-primary) !important;
}

.dokan-dashboard .dokan-tab-panel .components-tab-panel__tabs button.components-tab-panel__tabs-item:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(var(--ikn-dokan-primary-rgb), 0.25) !important;
}

/* -------------------------------------------------------------------------
   Liste produits (tableau / grille)
   ------------------------------------------------------------------------- */
.dokan-dashboard .dokan-product-listing .product-listing-top {
  margin-bottom: 20px;
}

.dokan-dashboard .dokan-dashboard-product-listing-wrapper {
  background: var(--ikn-card-bg);
  border: 1px solid var(--ikn-card-border);
  border-radius: var(--ikn-radius);
  box-shadow: var(--ikn-shadow);
  overflow: hidden;
}

.dokan-dashboard .dokan-product-listing .dokan-table {
  border-radius: 0 0 var(--ikn-radius-sm) var(--ikn-radius-sm);
}

.dokan-dashboard .dokan-product-listing .dokan-table th {
  background: rgba(var(--ikn-primary-rgb), 0.08) !important;
  color: var(--ikn-text) !important;
  font-weight: 600;
  padding: 14px 16px;
}

.dokan-dashboard .dokan-product-listing .dokan-table td {
  padding: 12px 16px;
}

/* Tables globales (commandes, retraits, etc.) */
.dokan-dashboard .dokan-dashboard-content .dokan-table {
  border-radius: var(--ikn-radius-sm);
  overflow: hidden;
  border: 1px solid var(--ikn-card-border);
}

.dokan-dashboard .dokan-dashboard-content .dokan-table th {
  background: rgba(var(--ikn-primary-rgb), 0.08) !important;
  color: var(--ikn-text) !important;
  font-weight: 600;
  padding: 14px 16px;
  border-color: var(--ikn-card-border);
}

.dokan-dashboard .dokan-dashboard-content .dokan-table td {
  padding: 12px 16px;
  border-color: var(--ikn-card-border);
}

.dokan-dashboard .dokan-dashboard-content .dokan-table-striped tbody tr:nth-child(odd) {
  background: rgba(var(--ikn-primary-rgb), 0.03);
}

/* -------------------------------------------------------------------------
   Fullwidth template (React dashboard)
   ------------------------------------------------------------------------- */
.dokan-dashboard.dokan-dashboard-fullwidth-template {
  background: var(--ikn-bg);
}

.dokan-dashboard #dokan-dashboard-fullwidth-wrapper {
  background: var(--ikn-bg);
}

.dokan-dashboard #dokan-dashboard-fullwidth-wrapper .dokan-dashboard-wrap .dokan-dashboard-content {
  padding: 28px 32px 48px !important;
}

@media screen and (max-width: 768px) {
  .dokan-dashboard .dokan-dashboard-content {
    padding: 20px 16px !important;
  }

  .dokan-dashboard .dokan-dashboard-content article.dashboard-content-area .dashboard-widget.big-counter ul.list-inline {
    flex-direction: column;
  }

  .dokan-dashboard .dokan-dashboard-content article.dashboard-content-area .dashboard-widget.big-counter li {
    min-width: 100%;
  }
}
