/* ============================================================
   BDC CLOUD — Design System v2.0
   Remplace style.css + stylenavbar.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --font: 'Inter', system-ui, Arial, sans-serif;

  /* Couleurs de marque */
  --brand:        #1a3a5c;
  --brand-light:  #2257a0;
  --brand-accent: #0ea5e9;

  /* Sémantiques */
  --ok:           #16a34a;
  --ok-bg:        #dcfce7;
  --ok-border:    #86efac;
  --warn:         #d97706;
  --warn-bg:      #fef3c7;
  --warn-border:  #fcd34d;
  --crit:         #dc2626;
  --crit-bg:      #fee2e2;
  --crit-border:  #fca5a5;
  --info:         #0284c7;
  --info-bg:      #e0f2fe;
  --info-border:  #7dd3fc;
  --ghost:        #7c3aed;
  --ghost-bg:     #ede9fe;
  --ghost-border: #c4b5fd;

  /* Neutres */
  --bg:           #f8fafc;
  --surface:      #ffffff;
  --surface2:     #f1f5f9;
  --border:       #e2e8f0;
  --border-strong:#cbd5e1;
  --text:         #0f172a;
  --text-2:       #475569;
  --text-3:       #94a3b8;

  /* Espacements */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
}

/* ── Reset léger ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--brand-light); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

/* ── Header / Navbar ────────────────────────────────────────── */
header.container {
  background: var(--brand);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.wrapper-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: 56px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Logo + marque */
.bdc-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.bdc-logo {
  width: 32px;
  height: 32px;
  background: var(--brand-accent);
  border-radius: var(--r-sm);
  display: block;
  position: relative;
}
.bdc-logo::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 2.5px solid white;
  border-radius: 3px;
}
.bdc-brandTitle {
  font-size: 15px;
  font-weight: 600;
  color: white;
  letter-spacing: .02em;
  line-height: 1.2;
}
.bdc-brandTitle span {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: #93c5fd;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Navigation links */
.hdr-drawer {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
}
.hdr-drawer a.square {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.hdr-drawer a.square:hover {
  background: rgba(255,255,255,.12);
  color: white;
}
.hdr-drawer a.square .deco { display: none; }

/* User info dans le drawer */
.user-info {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 12px;
  color: #94a3b8;
  flex-shrink: 0;
}
.user-info strong { color: #e2e8f0; font-weight: 500; }

/* Bouton hamburger (mobile) */
.hdr-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  margin-left: auto;
}

@media (max-width: 768px) {
  .hdr-btn { display: block; }
  .hdr-drawer {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--brand);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0;
    box-shadow: var(--shadow-md);
  }
  .hdr-drawer.open { display: flex; }
  .hdr-drawer a.square { border-radius: 0; padding: 10px 20px; }
  .user-info { margin-left: 0; align-items: flex-start; padding: 8px 20px; }
}

/* ── Page layout ─────────────────────────────────────────────── */
main#loginPage {
  flex: 1;
  padding: 24px 0 80px;
  overflow: auto;
}
#center {
  width: min(1300px, 96vw);
  margin: 0 auto;
  padding: 0 12px;
}

/* ── KPI Cards (compteurs en haut des dashboards) ───────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s;
}
.kpi-card:hover { box-shadow: var(--shadow-md); }
.kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-2);
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}
.kpi-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}
.kpi-card.ok   { border-left: 3px solid var(--ok);   }
.kpi-card.warn { border-left: 3px solid var(--warn);  }
.kpi-card.crit { border-left: 3px solid var(--crit);  }
.kpi-card.info { border-left: 3px solid var(--brand-accent); }

/* ── Panel (carte avec header) ──────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}
.panel-header {
  background: var(--brand);
  color: white;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.panel-header h2 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
.panel-body { padding: 16px 18px; }

/* ── Tableaux ────────────────────────────────────────────────── */
.bdc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.bdc-table thead th {
  background: var(--surface2);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  position: sticky;
  top: 0;
}
.bdc-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.bdc-table tbody tr:hover { background: var(--surface2); }
.bdc-table tbody tr:last-child { border-bottom: none; }
.bdc-table td {
  padding: 10px 12px;
  vertical-align: middle;
  color: var(--text);
}
.bdc-table .col-name { font-weight: 500; }
.bdc-table .col-muted { color: var(--text-2); }

/* Classe legacy DisplayScrollViewStyle → remappée */
.DisplayScrollViewStyle {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.DisplayScrollViewStyle thead th {
  background: var(--surface2);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  position: sticky;
  top: 0;
}
.DisplayScrollViewStyle .sticky-header { position: sticky; top: 0; }
.DisplayScrollViewStyle tbody tr { border-bottom: 1px solid var(--border); }
.DisplayScrollViewStyle tbody tr:hover { background: var(--surface2); }
.DisplayScrollViewStyle .even { background: var(--bg); }
.DisplayScrollViewStyle td {
  padding: 10px 12px;
  vertical-align: middle;
}

/* ── Badges de statut ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge-ok   { background: var(--ok-bg);   color: var(--ok);   border: 1px solid var(--ok-border);   }
.badge-warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-border); }
.badge-crit { background: var(--crit-bg); color: var(--crit); border: 1px solid var(--crit-border); }
.badge-info { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }
.badge-ghost{ background: var(--ghost-bg);color: var(--ghost);border: 1px solid var(--ghost-border);}
.badge-off  { background: var(--surface2);color: var(--text-3);border: 1px solid var(--border);     }

/* ── Alertes inline ──────────────────────────────────────────── */
.alert-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  margin-bottom: 12px;
}
.alert-box.ok   { background: var(--ok-bg);   border: 1px solid var(--ok-border);   color: #14532d; }
.alert-box.warn { background: var(--warn-bg); border: 1px solid var(--warn-border); color: #78350f; }
.alert-box.crit { background: var(--crit-bg); border: 1px solid var(--crit-border); color: #7f1d1d; }
.alert-box.info { background: var(--info-bg); border: 1px solid var(--info-border); color: #075985; }
.alert-icon { font-size: 16px; flex-shrink: 0; }

/* ── Barre de progression (espace disque) ───────────────────── */
.disk-bar {
  height: 8px;
  background: var(--border);
  border-radius: 9999px;
  overflow: hidden;
  min-width: 80px;
}
.disk-bar-fill {
  height: 100%;
  border-radius: 9999px;
  background: var(--ok);
  transition: width .3s;
}
.disk-bar-fill.warn { background: var(--warn); }
.disk-bar-fill.crit { background: var(--crit); }

/* ── Formulaires / Inputs ────────────────────────────────────── */
.bdc-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 16px;
}
.bdc-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 140px;
}
.bdc-form-group label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-2);
}
.bdc-form-group input,
.bdc-form-group select {
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s;
}
.bdc-form-group input:focus,
.bdc-form-group select:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(14,165,233,.15);
}

/* ── Boutons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, opacity .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--brand-light);
  color: white;
  border-color: var(--brand-light);
}
.btn-primary:hover { background: var(--brand); border-color: var(--brand); color: white; text-decoration: none; }
.btn-secondary {
  background: var(--surface);
  color: var(--text-2);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--surface2); }
.btn-danger {
  background: var(--crit-bg);
  color: var(--crit);
  border-color: var(--crit-border);
}
.btn-danger:hover { background: var(--crit); color: white; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ── Page title ──────────────────────────────────────────────── */
.page-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 22px;
}

/* ── Sections expandables (détails dealer/licence) ──────────── */
.expand-toggle {
  cursor: pointer;
  user-select: none;
  background: none;
  border: none;
  color: var(--brand-light);
  font-size: 12px;
  font-weight: 500;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.expand-toggle:hover { text-decoration: underline; }
.expand-content { display: none; }
.expand-content.open { display: block; }

/* ── Footer ──────────────────────────────────────────────────── */
footer, .footer {
  background: var(--brand);
  color: #94a3b8;
  font-size: 12px;
  padding: 14px 24px;
  text-align: center;
  margin-top: auto;
}

/* ── Loader ──────────────────────────────────────────────────── */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 6px;
}
.loader .lettre {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-light);
  animation: bdc-bounce .8s infinite;
}
.loader .lettre:nth-child(2)  { animation-delay: .1s; }
.loader .lettre:nth-child(3)  { animation-delay: .2s; }
.loader .lettre:nth-child(4)  { animation-delay: .3s; }
.loader .lettre:nth-child(5)  { animation-delay: .4s; }
.loader .lettre:nth-child(6)  { animation-delay: .5s; }
.loader .lettre:nth-child(7)  { animation-delay: .6s; }
.loader .lettre:nth-child(8)  { animation-delay: .7s; }
.loader .lettre:nth-child(9)  { animation-delay: .8s; }
.loader .lettre:nth-child(10) { animation-delay: .9s; }
@keyframes bdc-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%           { transform: translateY(-8px); }
}

/* ── Responsive helpers ──────────────────────────────────────── */
.hidden-mobile { display: block; }
@media (max-width: 640px) {
  .hidden-mobile { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .bdc-table thead th:nth-child(n+4) { display: none; }
  .bdc-table td:nth-child(n+4) { display: none; }
}

/* ── Utilitaires ─────────────────────────────────────────────── */
.text-ok   { color: var(--ok);   }
.text-warn { color: var(--warn); }
.text-crit { color: var(--crit); }
.text-muted{ color: var(--text-2); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
