:root {
  --bg: #070b14;
  --bg-elevated: #0d1424;
  --glass: rgba(16, 24, 42, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);
  --card: #ffffff;
  --card-muted: #f4f7fc;
  --text: #e8eef9;
  --text-dark: #0b1220;
  --muted: #8b9bb8;
  --accent: #2f7bff;
  --accent-glow: rgba(47, 123, 255, 0.35);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --font: "DM Sans", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: radial-gradient(ellipse 120% 80% at 10% -10%, #142040 0%, var(--bg) 55%);
  color: var(--text);
}

.hidden {
  display: none !important;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
}

.portal-app {
  min-height: 100vh;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  position: relative;
  width: min(420px, 100%);
  padding: 36px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo,
.sidebar-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--accent), #5aa2ff);
  color: #fff;
  box-shadow: 0 8px 28px var(--accent-glow);
}

.login-brand h1 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  color: #fff;
}

.login-brand p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.login-form label {
  display: block;
  margin-bottom: 14px;
  font-size: 0.85rem;
  color: var(--muted);
}

.login-form input {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font: inherit;
}

.form-error {
  color: #ff8f8f;
  font-size: 0.88rem;
  margin: 0 0 12px;
}

.register-intro {
  margin: 0 0 16px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.register-switch {
  margin: 16px 0 0;
  font-size: 0.88rem;
  text-align: center;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}

.lang-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.lang-btn:hover {
  color: #fff;
}

.lang-btn.active {
  background: linear-gradient(135deg, var(--accent), #5aa2ff);
  color: #fff;
}

#loginLangSwitch {
  position: absolute;
  top: 18px;
  right: 18px;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

.sidebar-footer .lang-switch {
  align-self: center;
}

.account-panel {
  margin-bottom: 16px;
}

.account-details {
  display: grid;
  gap: 12px;
  margin: 0;
}

.account-details div {
  display: grid;
  gap: 4px;
}

.account-details dt {
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.account-details dd {
  margin: 0;
  font-size: 1rem;
}

.account-form {
  display: grid;
  gap: 14px;
  max-width: 420px;
  margin-top: 16px;
}

.account-form label {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
}

.account-form input {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font: inherit;
}

.account-success {
  color: #86efac;
  font-size: 0.92rem;
  margin: 0;
}

.content .form-error {
  color: #ff8f8f;
}

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #4d93ff);
  color: #fff;
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--glass-border);
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.main-view {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: 1px solid var(--glass-border);
}

.sidebar-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 8px;
}

.sidebar-logo {
  margin: 0;
  width: 42px;
  height: 42px;
  font-size: 0.8rem;
}

.sidebar-brand strong {
  display: block;
  color: #fff;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  text-align: left;
  padding: 11px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(47, 123, 255, 0.14);
  color: #fff;
}

.content {
  padding: 24px 28px 40px;
  overflow: auto;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
  flex: 1;
  max-width: 100%;
}

.header-toolbar-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.header-toolbar-row .lang-switch {
  flex-shrink: 0;
}

.date-range-inline {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.date-range-inline .date-presets {
  flex-wrap: nowrap;
}

.date-field-inline {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.date-field-inline .date-field-label {
  white-space: nowrap;
  margin: 0;
}

.date-range-inline .date-input-wrap input[type="date"] {
  min-width: 132px;
  padding: 6px 34px 6px 8px;
}

.date-range-inline .btn-sm {
  min-height: 34px;
  flex-shrink: 0;
  white-space: nowrap;
}

.master-client-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(47, 123, 255, 0.12);
  border: 1px solid rgba(47, 123, 255, 0.35);
}

.master-client-switch label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.master-client-switch select {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font: inherit;
  min-width: 200px;
}

.master-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7eb6ff;
}

.content-header h2 {
  margin: 0 0 4px;
  font-size: 1.65rem;
  color: #fff;
}

.date-presets {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  flex-shrink: 0;
}

.date-preset-btn {
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.date-preset-btn:hover {
  color: #fff;
  border-color: rgba(47, 123, 255, 0.45);
  background: rgba(47, 123, 255, 0.12);
}

.date-preset-btn.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), #5aa2ff);
}

.date-range {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.date-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.date-field-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.date-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.date-input-wrap input[type="date"] {
  margin: 0;
  padding: 8px 38px 8px 10px;
  min-width: 156px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font: inherit;
  color-scheme: dark;
  cursor: pointer;
}

.date-input-wrap input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  position: absolute;
  right: 0;
  width: 36px;
  height: 100%;
  cursor: pointer;
}

.date-picker-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: rgba(47, 123, 255, 0.18);
  color: #9ec5ff;
  cursor: pointer;
}

.date-picker-btn:hover {
  background: rgba(47, 123, 255, 0.32);
  color: #fff;
}

.date-range .btn-sm {
  align-self: flex-end;
  min-height: 38px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.kpi-card {
  background: var(--card);
  color: var(--text-dark);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.kpi-card .label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 6px;
}

.kpi-card .value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
}

.kpi-card.accent .value {
  color: var(--accent);
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.chart-card {
  background: var(--card);
  color: var(--text-dark);
  border-radius: var(--radius);
  padding: 18px;
  min-height: 280px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.chart-card.wide {
  grid-column: 1 / -1;
}

.chart-card h3 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: #334155;
}

.chart-wrap {
  position: relative;
  height: 220px;
}

.panel-card {
  background: var(--card);
  color: var(--text-dark);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  margin-bottom: 16px;
}

.panel-card h3 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  table-layout: fixed;
}

.data-table tbody tr {
  white-space: nowrap;
}

.data-table th,
.data-table td {
  padding: 10px 10px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.data-table .col-status {
  width: 9%;
  white-space: nowrap;
}

.data-table .col-url {
  width: 26%;
  max-width: 26%;
}

.data-table .col-host {
  width: 12%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table .col-ip {
  width: 13%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.8rem;
}

.data-table .col-date {
  width: 11%;
  min-width: 6.4rem;
  white-space: nowrap;
}

.data-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.data-table tr:hover td {
  background: var(--card-muted);
}

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-submit { background: #dbeafe; color: #1e40af; }
.status-removed { background: #dcfce7; color: #166534; }
.status-problem { background: #fee2e2; color: #991b1b; }

.cat-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.cat-pill.cat-pirate { background: #ffedd5; color: #9a3412; }
.cat-pill.cat-scam { background: #fee2e2; color: #991b1b; }
.cat-pill.cat-seller { background: #dbeafe; color: #1e40af; }
.cat-pill.cat-whitelist { background: #dcfce7; color: #166534; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.product-card {
  background: var(--card);
  color: var(--text-dark);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: #eef2ff;
}

.product-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
}

.product-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.product-card h4 {
  margin: 0 0 10px;
}

.product-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: #64748b;
}

.filters-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filters-row select,
.filters-row input,
.form-grid input,
.form-grid textarea,
.form-grid select {
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font: inherit;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
}

.form-grid textarea {
  min-height: 100px;
  resize: vertical;
}

.link-url {
  overflow: hidden;
}

.link-url-anchor {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
}

.link-url-anchor:hover {
  text-decoration: underline;
}

@media (max-width: 960px) {
  .main-view {
    grid-template-columns: 1fr;
  }

  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------------------
   Vendeurs à vérifier
   --------------------------------------------------------------------------- */
.vendor-intro p { margin: 0 0 14px; color: #475569; line-height: 1.5; }
.vendor-kpis { display: flex; flex-wrap: wrap; gap: 10px; }
.vendor-kpi {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-width: 130px; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0; background: var(--card-muted); color: var(--text-dark);
  font: 700 1.35rem var(--font); cursor: pointer; text-align: left;
}
.vendor-kpi span { font-size: 0.75rem; font-weight: 500; color: #64748b; }
.vendor-kpi:hover { border-color: var(--accent); }
.vendor-mode { display: inline-flex; gap: 4px; }
#vendorSearch { min-width: 260px; }
.vendor-group { border: 1px solid #e2e8f0; border-radius: var(--radius-sm); margin: 10px 0; background: #fff; }
.vendor-group > summary { cursor: pointer; padding: 12px 14px; color: var(--text-dark); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.vendor-group[open] > summary { border-bottom: 1px solid #e2e8f0; }
.vendor-group .data-table { margin: 0; }
.vendor-site-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; color: #334155; background: #faf5fb; }
.vendor-chip, .vendor-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.vendor-badge.ok { background: #dcfce7; color: #166534; }
.vendor-badge.warn { background: #fef3c7; color: #92400e; }
.vendor-badge.soft { background: #e0e7ff; color: #3730a3; }
.vendor-badge.new { background: #8e2b8d; color: #fff; margin-left: 6px; }
.vendor-status { padding: 4px 8px; border-radius: 8px; border: 1px solid #cbd5e1; font: inherit; font-size: 0.8rem; }
.vendor-status-a_verifier { background: #f1f5f9; color: #334155; }
.vendor-status-envoye_distributeur { background: #dbeafe; color: #1e40af; }
.vendor-status-non_autorise { background: #fee2e2; color: #991b1b; }
.vendor-status-autorise { background: #dcfce7; color: #166534; }
.vendor-price strong { white-space: nowrap; }
.vendor-cad { font-size: 0.78rem; color: #64748b; white-space: nowrap; }
.vendor-summary { font-size: 0.78rem; color: #64748b; margin-top: 4px; max-width: 360px; }
.vendor-scope { font-size: 0.72rem; }
.vendor-note-btn { display: block; margin-top: 6px; }
.vendor-note-form { margin-top: 6px; display: grid; gap: 6px; }
.vendor-note-form textarea { width: 100%; min-width: 220px; font: inherit; font-size: 0.85rem; padding: 6px; border-radius: 8px; border: 1px solid #cbd5e1; }
.vendor-notes { margin: 6px 0 0; padding-left: 16px; font-size: 0.78rem; color: #334155; max-width: 320px; }
.vendor-new td { background: #fdf8fd; }
.vendor-others > summary { cursor: pointer; color: var(--text-dark); font-weight: 600; }
@media (max-width: 760px) {
  #vendorSearch { min-width: 0; width: 100%; }
  .vendor-kpi { min-width: 0; flex: 1 1 45%; }
}
/* Les tableaux du portail ne passent pas à la ligne : ici, il le faut. */
.vendor-table tbody tr, .vendor-others .data-table tbody tr { white-space: normal; }
.vendor-table td { vertical-align: top; overflow-wrap: anywhere; }
.vendor-table th:nth-child(1) { width: 20%; }
.vendor-table th:nth-child(2) { width: 20%; }
.vendor-table th:nth-child(3) { width: 12%; }
.vendor-table th:nth-child(4) { width: 30%; }
.vendor-table th:nth-child(5) { width: 18%; }
.vendor-table .vendor-status { width: 100%; }
.vendor-summary { max-width: none; }
/* Page Liens : pages surveillées et pirates Google, deux sections. */
.links-section-title { margin: 18px 0 6px; font-size: 1rem; color: var(--text-dark); }
.links-section-title:first-of-type { margin-top: 12px; }
.links-section-help { margin: 0 0 8px; font-size: 0.82rem; }
