/* ============================================================
   Fichier  : assets/css/dashboard.css
   Version  : 2.6.73
   Date     : 2026-07-11
   Description : Tableau de bord responsive, libellés longs et RTL

   Changelog :
   v2.6.73 — I18N MODULES SAFE ARCHI1 : adaptation des textes traduits et du sens RTL.
   ============================================================ */

/* ═══════ WELCOME HEADER ═══════ */
.dash-welcome {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: var(--sp-5);
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--blue) 0%, #6366f1 100%);
  border-radius: var(--r-xl);
  color: #fff;
}
.dash-welcome-h1 { font-size: 22px; font-weight: 800; margin: 0; line-height: 1.3; }
.dash-welcome-sub { font-size: 13px; opacity: 0.8; margin-top: 2px; }

.dash-shortcuts { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-sc {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 16px; border-radius: 12px;
  background: rgba(255,255,255,0.15); backdrop-filter: blur(4px);
  color: #fff; text-decoration: none; font-size: 11px; font-weight: 700;
  transition: background .15s, transform .15s;
  min-width: 72px; text-align: center;
}
.dash-sc:hover { background: rgba(255,255,255,0.25); transform: translateY(-2px); }
.dash-sc span:last-child { overflow-wrap:anywhere; }
.dash-sc-ico { font-size: 22px; line-height: 1; }

/* ═══════ KPI GRID (6 cards) ═══════ */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: var(--sp-5);
}
.dash-kpi {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.dash-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.dash-kpi::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.dash-kpi[data-c="blue"]::before { background: var(--blue); }
.dash-kpi[data-c="green"]::before { background: var(--green); }
.dash-kpi[data-c="orange"]::before { background: var(--orange); }
.dash-kpi[data-c="red"]::before { background: var(--red); }
.dash-kpi[data-c="purple"]::before { background: #8b5cf6; }
.dash-kpi[data-c="cyan"]::before { background: #06b6d4; }

.dash-kpi-ico {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 10px;
}
.dash-kpi[data-c="blue"] .dash-kpi-ico { background: var(--blue-pale); }
.dash-kpi[data-c="green"] .dash-kpi-ico { background: var(--green-pale); }
.dash-kpi[data-c="orange"] .dash-kpi-ico { background: var(--orange-pale); }
.dash-kpi[data-c="red"] .dash-kpi-ico { background: var(--red-pale); }
.dash-kpi[data-c="purple"] .dash-kpi-ico { background: rgba(139,92,246,0.12); }
.dash-kpi[data-c="cyan"] .dash-kpi-ico { background: rgba(6,182,212,0.12); }

.dash-kpi-val { font-size: 24px; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.dash-kpi-lbl { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-weight: 600; overflow-wrap:anywhere; }

/* ═══════ CHARTS ═══════ */
.dash-charts {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-bottom: var(--sp-5);
}
.dash-chart-card { overflow: hidden; }
.dash-chart-wrap {
  position: relative; height: 220px; padding: 8px 0;
}

/* ═══════ BOTTOM ROW ═══════ */
.dash-bottom {
  display: grid; grid-template-columns: 3fr 2fr;
  gap: 16px; align-items: start;
}

/* ═══════ ACTIVITY FEED ═══════ */
.dash-activity {
  max-height: 400px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.dash-act {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background .15s;
}
.dash-act:last-child { border-bottom: none; }
.dash-act:hover { background: var(--bg-hover); }

.dash-act-ico {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.dash-act-ico.add, .dash-act-ico.entry { background: var(--green-pale); }
.dash-act-ico.remove { background: var(--red-pale); }
.dash-act-ico.transfer { background: var(--blue-pale); }
.dash-act-ico.inventory { background: var(--orange-pale); }

.dash-act-body { flex: 1; min-width: 0; }
.dash-act-title { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.dash-act-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.dash-act-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

.dash-act-empty {
  padding: 40px 16px; text-align: center;
  color: var(--text-muted); font-size: 14px; font-weight: 600;
}

/* Feed footer — pagination */
.dash-feed-footer {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 10px 16px;
  border-top: 1px solid var(--border);
}
.dash-feed-footer:empty { display: none; }
.dash-pg-btn {
  appearance: none; border: 1.5px solid var(--border); background: var(--bg-card);
  color: var(--text-primary); font-size: 12px; font-weight: 700;
  padding: 5px 12px; border-radius: 8px; cursor: pointer; transition: all .15s;
}
.dash-pg-btn:hover:not(:disabled) { border-color: var(--blue); background: var(--blue-pale); }
.dash-pg-btn:disabled { opacity: 0.35; cursor: default; }
.dash-pg-info { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* ═══════ RESPONSIVE ═══════ */

/* Tablette */
@media (max-width: 1100px) {
  .dash-kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .dash-charts { grid-template-columns: 1fr; }
  .dash-bottom { grid-template-columns: 1fr; }
}

/* Mobile */
@media (max-width: 640px) {
  .dash-welcome { flex-direction: column; align-items: flex-start; padding: 16px; }
  .dash-welcome-h1 { font-size: 18px; }
  .dash-shortcuts { width: 100%; }
  .dash-sc { flex: 1; min-width: 0; padding: 8px 10px; }

  .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .dash-kpi { padding: 12px 14px; }
  .dash-kpi-val { font-size: 20px; }
  .dash-kpi-ico { width: 30px; height: 30px; font-size: 15px; }

  .dash-charts { grid-template-columns: 1fr; }
  .dash-chart-wrap { height: 180px; }

  .dash-bottom { grid-template-columns: 1fr; }
  .dash-activity { max-height: 300px; }
}

/* RTL — aucune inversion JavaScript, uniquement des propriétés logiques */
html[dir="rtl"] .dash-welcome-txt,
html[dir="rtl"] .dash-kpi,
html[dir="rtl"] .dash-act-body,
html[dir="rtl"] .dash-alert-body { text-align:right; }
html[dir="rtl"] .dash-act-time { margin-inline-start:auto; }
