/* ============================================================
   OVEYO V11 — Dashboard redesign
   Basé sur la maquette v3 validée. Override léger d'oveyo.css.
   N'affecte que le dashboard (classes .v11-* scopées).
   ============================================================ */

:root {
  --v11-orange:      #F4632B;
  --v11-orange-dk:   #D54F1C;
  --v11-orange-soft: #FCEDE5;
  --v11-navy:        #102A43;
  --v11-bg:          #E9ECEF;
  --v11-bg-2:        #F2F4F7;
  --v11-surface:     #FFFFFF;
  --v11-surface-alt: #F7F8FA;
  --v11-border:      #DCE0E5;
  --v11-border-2:    #C7CCD3;
  --v11-text:        #0F172A;
  --v11-text-2:      #475569;
  --v11-text-3:      #94A3B8;
  --v11-green:       #047857;
  --v11-green-soft:  #D1FAE5;
  --v11-red:         #B91C1C;
  --v11-red-soft:    #FEE2E2;
  --v11-yellow:      #A16207;
  --v11-yellow-soft: #FEF3C7;
}

/* ---- FOND GLOBAL ---- */
body.dashboard-v11,
body.dashboard-v11 .app-shell,
body.dashboard-v11 .app-main { background: var(--v11-bg); }
body.dashboard-v11 { font-family: 'Inter', -apple-system, sans-serif; color: var(--v11-text); }
body.dashboard-v11 .app-main { padding: 24px 32px 64px; }
@media (max-width: 768px) { body.dashboard-v11 .app-main { padding: 18px 14px 40px; } }

/* Reset font et fond des sections existantes pour ne pas hériter */
body.dashboard-v11 .v11-tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
body.dashboard-v11 .v11-display { font-family: 'Bricolage Grotesque', sans-serif; letter-spacing: -0.02em; }

/* ---- TODO BAR ---- */
.v11-todo {
  background: var(--v11-surface);
  border: 1px solid var(--v11-border);
  border-left: 3px solid var(--v11-red);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.v11-todo__text { flex: 1; min-width: 200px; }
.v11-todo__title { font-size: 14px; font-weight: 600; color: var(--v11-text); }
.v11-todo__title strong { color: var(--v11-red); margin-right: 4px; font-weight: 700; }
.v11-todo__sub { font-size: 12.5px; color: var(--v11-text-2); margin-top: 2px; }
.v11-todo__chips { display: flex; gap: 6px; flex-wrap: wrap; }
.v11-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 12.5px;
  background: var(--v11-surface-alt);
  border: 1px solid var(--v11-border);
  color: var(--v11-text);
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.1s ease;
}
.v11-chip:hover {
  background: white;
  border-color: var(--v11-border-2);
}
.v11-chip__num { font-weight: 700; color: var(--v11-orange); }

/* ---- PAGE HEADER ---- */
.v11-pagehead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.v11-pagehead h1 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--v11-text);
  margin: 0;
}
.v11-pagehead__sub { font-size: 13.5px; color: var(--v11-text-2); margin-top: 4px; }
.v11-pagehead__actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

.v11-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.1s ease;
  cursor: pointer;
}
.v11-btn svg { width: 14px; height: 14px; }
.v11-btn--primary {
  background: var(--v11-orange);
  color: white;
  box-shadow: 0 1px 2px rgba(244,99,43,0.2);
}
.v11-btn--primary:hover { background: var(--v11-orange-dk); }
.v11-btn--ghost {
  background: var(--v11-surface);
  color: var(--v11-text);
  border-color: var(--v11-border);
}
.v11-btn--ghost:hover { background: var(--v11-surface-alt); border-color: var(--v11-border-2); }

/* ---- KPIs ---- */
.v11-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
@media (max-width: 980px) { .v11-kpis { grid-template-columns: repeat(2, 1fr); } }
.v11-kpi {
  background: var(--v11-surface);
  border: 1px solid var(--v11-border);
  border-radius: 10px;
  padding: 16px 18px;
  position: relative;
}
.v11-kpi__icon {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--v11-text-3);
}
.v11-kpi__icon svg { width: 16px; height: 16px; }
.v11-kpi__label { font-size: 12.5px; color: var(--v11-text-2); font-weight: 500; }
.v11-kpi__value {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.02em;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  color: var(--v11-text);
}

/* ---- SECTION ---- */
.v11-section {
  background: var(--v11-surface);
  border: 1px solid var(--v11-border);
  border-radius: 10px;
  margin-bottom: 14px;
  overflow: visible;
}
.v11-section__head {
  padding: 14px 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.v11-section__title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--v11-text);
}
.v11-section__sub { font-size: 12px; color: var(--v11-text-3); margin-top: 2px; }
.v11-section__link {
  font-size: 13px;
  color: var(--v11-orange-dk);
  font-weight: 600;
  text-decoration: none;
}
.v11-section__link:hover { text-decoration: underline; }

/* ---- FILTERS ---- */
.v11-filters {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 18px 12px;
  border-bottom: 1px solid var(--v11-border);
}
.v11-filters__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--v11-text-3);
  margin-right: 4px;
}
.v11-fbtn {
  font-size: 12.5px;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--v11-surface-alt);
  border: 1px solid transparent;
  color: var(--v11-text-2);
  font-weight: 500;
  transition: all 0.08s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.v11-fbtn:hover { background: white; border-color: var(--v11-border); color: var(--v11-text); }
.v11-fbtn.is-active {
  background: white;
  border-color: var(--v11-border-2);
  color: var(--v11-text);
  font-weight: 600;
}
.v11-fbtn__count {
  font-size: 11px;
  color: var(--v11-text-3);
  font-feature-settings: "tnum";
  margin-left: 2px;
}

.v11-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.v11-dot--boutique  { background: #2563EB; }
.v11-dot--enseigne  { background: #7C3AED; }
.v11-dot--station   { background: #F4632B; }
.v11-dot--pharmacie { background: #059669; }

/* ---- TABLE ---- */
.v11-table { width: 100%; border-collapse: collapse; }
.v11-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--v11-text-3);
  padding: 10px 16px;
  background: var(--v11-bg-2);
  border-bottom: 1px solid var(--v11-border);
}
.v11-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--v11-border);
  font-size: 13.5px;
  vertical-align: middle;
  color: var(--v11-text);
}
.v11-table tbody tr:last-child td { border-bottom: none; }
.v11-table tbody tr { transition: background 0.08s; }
.v11-table tbody tr:hover { background: var(--v11-surface-alt); }
.v11-table tbody tr:hover .v11-menu__trigger { opacity: 1; }

.v11-prod {
  display: flex;
  align-items: center;
  gap: 10px;
}
.v11-prod__mark {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--v11-bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--v11-text-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.v11-prod__name { font-weight: 600; line-height: 1.2; color: var(--v11-text); }
.v11-prod__unit { font-size: 11.5px; color: var(--v11-text-3); margin-top: 2px; }

.v11-cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--v11-surface-alt);
  color: var(--v11-text-2);
  text-transform: capitalize;
}

.v11-price {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.v11-price--abuse { color: var(--v11-red); }
.v11-price__ref {
  display: block;
  font-size: 11px;
  color: var(--v11-text-3);
  font-weight: 400;
  margin-top: 2px;
}

.v11-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}
.v11-tag__dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.v11-tag--green  { background: var(--v11-green-soft);  color: var(--v11-green); }
.v11-tag--red    { background: var(--v11-red-soft);    color: var(--v11-red); }
.v11-tag--yellow { background: var(--v11-yellow-soft); color: var(--v11-yellow); }
.v11-tag--gray   { background: var(--v11-surface-alt); color: var(--v11-text-2); }

.v11-muted { color: var(--v11-text-2); }
.v11-faint { color: var(--v11-text-3); font-size: 12px; }

/* ---- MENU 3-POINTS ---- */
.v11-menu { position: relative; display: inline-block; }
.v11-menu__trigger {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--v11-text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.4;
  transition: all 0.1s;
  padding: 0;
}
.v11-menu__trigger:hover {
  background: var(--v11-surface-alt);
  color: var(--v11-text);
  opacity: 1;
}
.v11-menu__trigger svg { width: 14px; height: 14px; }
.v11-menu__popup {
  display: none;
  position: absolute;
  right: 0;
  top: 32px;
  background: white;
  border: 1px solid var(--v11-border);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(15,23,42,0.12), 0 0 0 1px rgba(15,23,42,0.06);
  min-width: 200px;
  padding: 4px;
  z-index: 100;
}
.v11-menu__popup.is-open { display: block; animation: v11-popin 0.12s ease; }
@keyframes v11-popin {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.v11-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 5px;
  font-size: 13px;
  color: var(--v11-text);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.08s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.v11-menu__item:hover { background: var(--v11-surface-alt); }
.v11-menu__item svg { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.7; }
.v11-menu__item--danger { color: var(--v11-red); }
.v11-menu__item--danger:hover { background: var(--v11-red-soft); }
.v11-menu__item--success { color: var(--v11-green); }
.v11-menu__item--success:hover { background: var(--v11-green-soft); }
.v11-menu__divider {
  height: 1px;
  background: var(--v11-border);
  margin: 4px 0;
}
.v11-menu__form { margin: 0; padding: 0; display: block; width: 100%; }

/* ---- EMPTY STATE ---- */
.v11-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--v11-text-3);
}
.v11-empty__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  color: var(--v11-text-3);
  opacity: 0.5;
}
.v11-empty__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--v11-text-2);
  margin-bottom: 4px;
}
.v11-empty__sub {
  font-size: 13px;
  color: var(--v11-text-3);
}
.v11-empty a { color: var(--v11-orange-dk); font-weight: 600; }

/* ---- COLLAPSIBLE Analyse ---- */
.v11-collapse {
  background: var(--v11-surface);
  border: 1px solid var(--v11-border);
  border-radius: 10px;
  overflow: hidden;
}
.v11-collapse__head {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.v11-collapse__head::-webkit-details-marker { display: none; }
.v11-collapse__head:hover { background: var(--v11-surface-alt); }
.v11-collapse__icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--v11-orange-soft);
  color: var(--v11-orange);
  display: flex;
  align-items: center;
  justify-content: center;
}
.v11-collapse__icon svg { width: 16px; height: 16px; }
.v11-collapse__title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--v11-text);
}
.v11-collapse__sub {
  font-size: 12.5px;
  color: var(--v11-text-3);
  margin-top: 2px;
}
.v11-collapse__chev {
  margin-left: auto;
  color: var(--v11-text-3);
  transition: transform 0.2s;
}
.v11-collapse[open] .v11-collapse__chev { transform: rotate(180deg); }
.v11-collapse__body {
  padding: 16px 18px 18px;
  border-top: 1px solid var(--v11-border);
  background: var(--v11-bg-2);
}

/* Mobile : table → cards */
@media (max-width: 768px) {
  .v11-table thead { display: none; }
  .v11-table, .v11-table tbody, .v11-table tr, .v11-table td { display: block; width: 100%; }
  .v11-table tr { padding: 12px 14px; border-bottom: 1px solid var(--v11-border); }
  .v11-table td { padding: 4px 0; border: none; }
  .v11-table td::before {
    content: attr(data-label);
    display: inline-block;
    width: 80px;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--v11-text-3);
    font-weight: 600;
  }
}

/* Stagger animation entrée */
.v11-stagger > * {
  opacity: 0;
  animation: v11-fadeUp 0.4s ease forwards;
}
.v11-stagger > *:nth-child(1) { animation-delay: 0.04s; }
.v11-stagger > *:nth-child(2) { animation-delay: 0.08s; }
.v11-stagger > *:nth-child(3) { animation-delay: 0.12s; }
.v11-stagger > *:nth-child(4) { animation-delay: 0.16s; }
@keyframes v11-fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- FIX FORM ELEMENTS DANS V11 ---- */
body.dashboard-v11 .v11-section input,
body.dashboard-v11 .v11-section select {
  width: 100%;
  height: auto;
  background-image: none;
  box-shadow: none;
  margin: 0;
}
body.dashboard-v11 .v11-section select {
  appearance: auto;
}

/* ---- FIX FORM ELEMENTS V11 — !important pour battre oveyo.css ---- */
body.dashboard-v11 form input[type="text"],
body.dashboard-v11 form input[type="search"],
body.dashboard-v11 form select {
  width: 100% !important;
  height: auto !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
  border: 1px solid var(--v11-border) !important;
  border-radius: 7px !important;
  background: white !important;
  background-image: none !important;
  box-shadow: none !important;
  
  appearance: auto !important;
  -webkit-appearance: auto !important;
  margin: 0 !important;
  outline: none !important;
}
body.dashboard-v11 form input[type="text"]:focus,
body.dashboard-v11 form select:focus {
  border-color: var(--v11-orange) !important;
  outline: 2px solid var(--v11-orange-soft) !important;
}

/* ---- FIX UNIVERSEL inputs/selects V11 ---- */
body.dashboard-v11 input,
body.dashboard-v11 select,
body.dashboard-v11 textarea {
  width: 100% !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 0 12px !important;
  font-size: 13px !important;
  line-height: 38px !important;
  border: 1px solid var(--v11-border) !important;
  border-radius: 7px !important;
  background: white !important;
  background-image: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  
  box-sizing: border-box !important;
}
body.dashboard-v11 textarea {
  height: auto !important;
  max-height: none !important;
  min-height: 80px !important;
  line-height: 1.5 !important;
  padding: 8px 12px !important;
}

/* ---- FIX FILTRES OBSERVATIONS — flex layout ---- */
body.dashboard-v11 form > div:first-child > input,
body.dashboard-v11 form > div:first-child > select {
  flex: 1 1 180px !important;
  width: auto !important;
  min-width: 180px !important;
  max-width: 280px !important;
}

/* ---- FIX form labels v11 — réduit l'espace ---- */
body.dashboard-v11 form label {
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
}
body.dashboard-v11 form > div > select,
body.dashboard-v11 form > div > input {
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  line-height: 36px !important;
}

/* ---- SIDEBAR uniforme couleur navy du logo ---- */
.sidebar {
  background: #031B47 !important;
}
