/* ============================================================
   StockPilote — Design System
   ============================================================ */

:root {
  --sidebar-w:       260px;
  --sidebar-bg:      #0f172a;
  --sidebar-text:    #94a3b8;
  --sidebar-active:  #6366f1;
  --topbar-h:        64px;
  --accent:          #6366f1;
  --accent-hover:    #4f46e5;
  --bg:              #f1f5f9;
  --card-bg:         #ffffff;
  --card-border:     #e2e8f0;
  --text:            #1e293b;
  --text-muted:      #64748b;
  --radius:          12px;
  --radius-sm:       8px;
  --shadow-sm:       0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:          0 4px 16px rgba(0,0,0,.08);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
}

/* ── App Layout ─────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  overflow-y: auto;
  transition: transform .25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand i { font-size: 1.5rem; color: var(--accent); }

.sidebar-company {
  padding: 12px 20px;
  font-size: .75rem;
  color: var(--sidebar-text);
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  list-style: none;
  padding: 12px 0;
  margin: 0;
  flex: 1;
}

.sidebar-nav .nav-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(148,163,184,.5);
  padding: 16px 20px 6px;
}

.sidebar-nav .nav-divider {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: 6px 0;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  border-radius: 0;
  transition: all .15s;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
}

.sidebar-nav li a i { font-size: 1.1rem; width: 20px; flex-shrink: 0; }

.sidebar-nav li a:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}

.sidebar-nav li.active a {
  background: rgba(99,102,241,.15);
  color: #a5b4fc;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--sidebar-text);
  font-size: .875rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all .15s;
}
.btn-logout:hover { background: rgba(239,68,68,.1); color: #fca5a5; }
.btn-logout i { font-size: 1.1rem; }

/* ── Main Content ─────────────────────────────────────────── */
#main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-breadcrumb { font-size: .875rem; color: var(--text-muted); }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.btn-icon {
  width: 38px;
  height: 38px;
  border: 1px solid var(--card-border);
  background: #fff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .15s;
  padding: 0;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); background: rgba(99,102,241,.05); }

.badge-dot {
  width: 8px; height: 8px;
  background: #ef4444;
  border-radius: 50%;
  position: absolute;
  top: 4px; right: 4px;
  border: 2px solid #fff;
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-avatar-sm { width: 28px; height: 28px; font-size: .7rem; }

.alerts-dropdown { min-width: 320px; }
.dropdown-header { font-size: .8rem; font-weight: 600; color: var(--text-muted); padding: 12px 16px 8px; border-bottom: 1px solid var(--card-border); }
.alert-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 16px; border-bottom: 1px solid #f8fafc; font-size: .82rem; }
.alert-item:last-child { border-bottom: none; }
.alert-item i { margin-top: 2px; flex-shrink: 0; }

/* ── Flash ────────────────────────────────────────────────── */
.flash-container { padding: 16px 24px 0; }

/* ── Page Content ─────────────────────────────────────────── */
.page-content { padding: 24px; flex: 1; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-title { font-size: 1.5rem; font-weight: 700; color: var(--text); margin: 0; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── Cards ────────────────────────────────────────────────── */
.card-sp {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-header-sp {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--card-border);
}
.card-title-sp {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
}

/* ── KPI Cards ────────────────────────────────────────────── */
.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.kpi-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.kpi-total    .kpi-icon { background: rgba(99,102,241,.1);  color: #6366f1; }
.kpi-available .kpi-icon { background: rgba(34,197,94,.1);   color: #22c55e; }
.kpi-rented   .kpi-icon { background: rgba(245,158,11,.1);  color: #f59e0b; }
.kpi-maintenance .kpi-icon { background: rgba(239,68,68,.1); color: #ef4444; }

.kpi-value { font-size: 1.8rem; font-weight: 800; color: var(--text); line-height: 1; }
.kpi-label { font-size: .8rem; color: var(--text-muted); font-weight: 500; margin-top: 4px; }

/* ── Tables ───────────────────────────────────────────────── */
.table th {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--card-border);
  padding: 10px 16px;
}
.table td { padding: 12px 16px; border-color: #f1f5f9; vertical-align: middle; font-size: .875rem; }
.table-hover tbody tr:hover { background: #fafbff; }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 24px;
}
.empty-state i { font-size: 3rem; opacity: .3; display: block; margin-bottom: 12px; }
.empty-state p  { margin: 0 0 16px; }

/* ── Badges ───────────────────────────────────────────────── */
.badge-category {
  font-size: .75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

/* ── Item thumbnails ──────────────────────────────────────── */
.item-thumb,
.item-thumb-placeholder {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}

.item-photo-lg {
  width: 100px; height: 100px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
}
.item-photo-placeholder {
  width: 100px; height: 100px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Info list ────────────────────────────────────────────── */
.info-list { margin: 0; }
.info-list dt { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-top: 12px; }
.info-list dd { margin: 2px 0 0; font-size: .875rem; }

/* ── Qty boxes ────────────────────────────────────────────── */
.qty-box { background: #f8fafc; border-radius: var(--radius-sm); padding: 16px 8px; border: 1px solid var(--card-border); }
.qty-value { font-size: 1.5rem; font-weight: 800; }
.qty-label { font-size: .75rem; color: var(--text-muted); font-weight: 500; }
.qty-available { border-color: #86efac; background: #f0fdf4; }
.qty-available .qty-value { color: #16a34a; }
.qty-rented { border-color: #fcd34d; background: #fffbeb; }
.qty-rented .qty-value { color: #d97706; }
.qty-maintenance { border-color: #fca5a5; background: #fef2f2; }
.qty-maintenance .qty-value { color: #dc2626; }

/* ── Client cards ─────────────────────────────────────────── */
.client-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.client-avatar-lg { width: 72px; height: 72px; font-size: 1.5rem; }
.client-info div { font-size: .82rem; color: var(--text-muted); margin-bottom: 3px; display: flex; align-items: center; gap: 6px; }
.client-info a { color: var(--text-muted); text-decoration: none; }
.client-info a:hover { color: var(--accent); }

/* ── Category / Warehouse icons ──────────────────────────── */
.cat-icon, .wh-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ── Plan badge ───────────────────────────────────────────── */
.plan-badge {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .06em;
}
.plan-free     { background: linear-gradient(135deg, #0369a1, #0ea5e9); color: #fff; }
.plan-starter  { background: rgba(99,102,241,.1); color: var(--accent); }
.plan-pro      { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: white; }

/* ── Auth ─────────────────────────────────────────────────── */
.auth-body { background: var(--bg); }
.auth-wrapper { display: flex; min-height: 100vh; }

.auth-brand {
  width: 45%;
  background: linear-gradient(150deg, #312e81 0%, #4f46e5 40%, #7c3aed 100%);
  padding: 60px 48px 40px;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  position: relative;
}

.auth-brand-inner { max-width: 380px; flex: 1; display: flex; flex-direction: column; justify-content: center; }

.auth-brand-footer {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  padding-top: 2rem;
}
.auth-brand-footer .btn { font-size: .8rem; }

.auth-logo {
  display: flex; align-items: center; gap: 12px;
  font-size: 1.6rem; font-weight: 800; color: #fff;
}
.auth-logo i { font-size: 2rem; }

.auth-brand h2 { font-size: 1.8rem; font-weight: 800; margin: 0; }

.auth-features { display: flex; flex-direction: column; gap: 10px; }
.auth-feature { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: rgba(255,255,255,.8); }
.auth-feature i { color: #a5b4fc; }

.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.auth-form-inner { width: 100%; max-width: 420px; }

.auth-tfa-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(99,102,241,.35);
}
.auth-tfa-icon i { font-size: 2rem; color: #fff; }
.cgu-content h6 { border-left: 3px solid #6366f1; padding-left: .6rem; }

/* ── Responsive ───────────────────────────────────────────── */
#sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 999;
}

@media (max-width: 991.98px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  #sidebar-overlay.open { display: block; }
  #main-content { margin-left: 0; }
}

@media (max-width: 767.98px) {
  .page-header { flex-direction: column; }
  .page-actions { width: 100%; }
  .page-content { padding: 16px; }
}

/* ── Utilities ────────────────────────────────────────────── */
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 .2rem rgba(99,102,241,.15);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-outline-primary {
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* ============================================================
   NOUVEAUX COMPOSANTS — v1.1
   ============================================================ */

/* ── Topbar : utilisateur agrandi ────────────────────────── */
.topbar-user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 50px;
  padding: 6px 14px 6px 6px;
  cursor: pointer;
  transition: all .15s;
  text-align: left;
}
.topbar-user-btn:hover {
  border-color: var(--accent);
  background: rgba(99,102,241,.04);
}

.user-avatar-topbar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.user-info { line-height: 1.2; }
.user-name  { font-size: .875rem; font-weight: 600; color: var(--text); }
.user-role  { font-size: .72rem; color: var(--text-muted); }

.topbar-chevron { font-size: .75rem; color: var(--text-muted); }

.topbar-user-dropdown { min-width: 280px; border: 1px solid var(--card-border); }

.dropdown-user-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: #f8fafc;
}

/* ── KPI Revenue (CA aujourd'hui) ────────────────────────── */
.kpi-revenue .kpi-icon { background: rgba(16,185,129,.1); color: #10b981; }
.kpi-sub { font-size: .7rem; color: var(--text-muted); margin-top: 3px; }

/* ── Widget Personalizer ─────────────────────────────────── */
.customize-row:last-child { border-bottom: none !important; }
.customize-icon-preview {
  width: 40px; height: 40px;
  background: rgba(99,102,241,.1);
  color: var(--accent);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Photo format badges ─────────────────────────────────── */
.photo-format-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.photo-format-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #86efac;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 600;
}
.photo-format-limit {
  background: #fffbeb;
  color: #d97706;
  border-color: #fcd34d;
}

/* ── Icon Picker (catégories) ────────────────────────────── */
.icon-picker-preview {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-preview-box {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  border: 2px solid transparent;
  transition: all .15s;
}

.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 8px;
  background: #fafbfc;
}

.icon-picker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: all .12s;
  color: var(--text-muted);
  font-size: .65rem;
  text-align: center;
  line-height: 1.2;
}
.icon-picker-item i { font-size: 1.25rem; }
.icon-picker-item span { font-size: .6rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 64px; }
.icon-picker-item:hover { border-color: var(--accent); background: rgba(99,102,241,.05); color: var(--accent); }
.icon-picker-item.selected { border-color: var(--accent); background: rgba(99,102,241,.1); color: var(--accent); }

/* ── Event Price Calculator ──────────────────────────────── */
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  background: #fff;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .15s;
}
.cat-tab:hover { border-color: var(--accent); color: var(--accent); }
.cat-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.cat-tab i { font-size: .9rem; }

.item-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding: 2px;
}

.item-selector-card {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #fff;
  transition: all .15s;
  cursor: default;
}
.item-selector-card:hover { border-color: #c7d2fe; background: #fafbff; }
.item-selector-card.item-selected {
  border-color: var(--accent);
  background: rgba(99,102,241,.04);
  box-shadow: 0 0 0 2px rgba(99,102,241,.15);
}
.item-selector-card.item-unavailable { opacity: .55; }

.item-sel-header { display: flex; align-items: flex-start; gap: 10px; }
.item-sel-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.item-sel-name { font-size: .875rem; font-weight: 600; color: var(--text); }
.item-sel-ref  { font-size: .75rem; color: var(--text-muted); }
.item-sel-stock { font-size: .75rem; }

.item-sel-qty input[type="number"] { -moz-appearance: textfield; }
.item-sel-qty input::-webkit-inner-spin-button,
.item-sel-qty input::-webkit-outer-spin-button { -webkit-appearance: none; }

.price-total-display {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

/* ── Dashboard: alerte compacte ──────────────────────────── */
.alert-sm { padding: .5rem .75rem; font-size: .82rem; }

/* ══════════════════════════════════════════════════════════
   NOUVEAUX WIDGETS DASHBOARD
   ══════════════════════════════════════════════════════════ */

/* KPI supplémentaires */
.kpi-unpaid   { background: linear-gradient(135deg, #fff7ed, #ffedd5); border-left: 4px solid #f97316; }
.kpi-overdue  { background: linear-gradient(135deg, #fff1f2, #ffe4e6); border-left: 4px solid #ef4444; }
.kpi-occupancy{ background: linear-gradient(135deg, #f0fdf4, #dcfce7); border-left: 4px solid #22c55e; }
.kpi-deposits { background: linear-gradient(135deg, #f0f9ff, #e0f2fe); border-left: 4px solid #0ea5e9; }

/* Top produits */
.top-rank {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.top-count {
  font-size: .78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Produits jamais loués */
.never-rented-item {
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  transition: background .12s;
}
.never-rented-item:hover { background: var(--hover); }

/* Livraisons du jour */
.delivery-section { background: var(--hover); border-radius: var(--radius-sm); padding: 10px 12px; }
.delivery-section-header {
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.delivery-departure { color: #2563eb; }
.delivery-return    { color: #0891b2; }
.delivery-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--card-border);
}
.delivery-item:last-child { border-bottom: none; }

/* CA semaine & mois */
.ca-period-card {
  background: var(--hover);
  border-radius: var(--radius-sm);
  padding: 16px;
  height: 100%;
}
.ca-period-label {
  font-size: .78rem; color: var(--text-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px;
}
.ca-period-value {
  font-size: 1.6rem; font-weight: 800; color: var(--text); line-height: 1.1;
  margin-bottom: 6px;
}
.ca-evol { font-size: .78rem; }
.ca-up   { color: #16a34a; }
.ca-down { color: #dc2626; }

/* Rentabilité */
.profit-metric { padding: 10px; }
.profit-value  { font-size: 1.1rem; font-weight: 700; }
.profit-label  { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }

/* Mini calendrier */
.mini-cal { user-select: none; }
.mini-cal-head {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; font-size: .72rem; font-weight: 700;
  color: var(--text-muted); margin-bottom: 4px;
}
.mini-cal-head div { padding: 4px 0; }
.mini-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-cell {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 500;
  cursor: default;
  transition: transform .1s;
}
.cal-cell:hover { transform: scale(1.1); }
.cal-empty { background: transparent; }
.cal-level-0 { background: var(--hover); color: var(--text-muted); }
.cal-level-1 { background: #bfdbfe; color: #1e40af; }
.cal-level-2 { background: #60a5fa; color: #fff; }
.cal-level-3 { background: #1d4ed8; color: #fff; }
.cal-today   { outline: 2px solid var(--accent); outline-offset: -2px; font-weight: 800; }

.cal-legend  { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; color: var(--text-muted); }
.cal-dot     { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.cal-dot.cal-0 { background: var(--hover); border: 1px solid var(--card-border); }
.cal-dot.cal-1 { background: #bfdbfe; }
.cal-dot.cal-2 { background: #60a5fa; }
.cal-dot.cal-3 { background: #1d4ed8; }

/* Activité récente */
.activity-feed { padding: 4px 0; }
.activity-item {
  display: flex; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--card-border);
  transition: background .12s;
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--hover); }
.activity-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; flex-shrink: 0;
}
.activity-content { flex: 1; min-width: 0; }
.activity-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 2px; }
.activity-meta  { font-size: .78rem; color: var(--text-muted); margin-bottom: 2px; }
.activity-footer { display: flex; align-items: center; font-size: .75rem; color: var(--text-muted); }

/* Personnalisation — en-tête colonnes */
.customize-row .customize-icon-preview {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--hover);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--accent); flex-shrink: 0;
}


/* ══════════════════════════════════════════════════════════
   CORRECTIONS — PHOTOS / CALENDRIER / ACTIVITÉ
   ══════════════════════════════════════════════════════════ */

/* Photo article — bloc édition */
.photo-current-block { padding: 10px; background: var(--hover); border-radius: var(--radius-sm); }
.photo-current-thumb { max-height: 100px; max-width: 140px; object-fit: cover; border-radius: var(--radius-sm); }
.photo-placeholder-edit { display: flex; align-items: center; padding: 10px; background: var(--hover); border-radius: var(--radius-sm); }
.photo-default-icon { width: 60px; height: 60px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }

/* Miniature dans la liste stock */
.item-thumb     { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.item-thumb-placeholder { width:42px;height:42px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:1.2rem;flex-shrink:0; }

/* Photo article — fiche */
.item-photo-lg { max-height: 200px; border-radius: var(--radius-sm); object-fit: cover; }
.item-photo-placeholder { width: 120px; height: 120px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Calendrier — dot count dans cellule */
.cal-cell { position: relative; }
.cal-dot-count {
  position: absolute; top: 1px; right: 2px;
  font-size: .55rem; font-weight: 700; line-height: 1;
  opacity: .8;
}
.cal-cell a, a.cal-cell { text-decoration: none; color: inherit; }
a.cal-cell:hover { filter: brightness(.9); cursor: pointer; }

/* Activité récente — pas de hover global */
.activity-item { display:flex;gap:12px;padding:10px 16px;border-bottom:1px solid var(--card-border); }
.activity-item:last-child { border-bottom:none; }
.activity-icon { width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:.95rem;flex-shrink:0; }
.activity-content { flex:1;min-width:0; }
.activity-title { display:flex;align-items:center;flex-wrap:wrap;gap:4px;margin-bottom:2px; }
.activity-meta { font-size:.78rem;margin-bottom:2px; }
.activity-footer { display:flex;align-items:center; }

/* ── Tour guide pas à pas (v3) ─────────────────────────────── */
/* #spt-backdrop : overlay sombre z-index 100000 (inline via JS)  */
/* #spt-tip      : tooltip flottant z-index 100001               */
#spt-tip {
  position: fixed;
  z-index: 100001;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.30), 0 0 0 1px rgba(0,0,0,.06);
  overflow: hidden;
  pointer-events: auto;
  max-width: 320px;
}
.spt-hd {
  padding: 15px 18px 11px;
  font-weight: 700;
  font-size: .93rem;
  border-bottom: 1px solid #f0f2f5;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
}
.spt-icon { font-size: 1rem; opacity: .85; }
.spt-bd {
  padding: 13px 18px 8px;
  font-size: .855rem;
  line-height: 1.65;
  color: #444;
}
.spt-note {
  margin-top: 8px;
  padding: 7px 10px;
  background: #fff8e1;
  border-radius: 6px;
  font-size: .8rem;
  color: #92400e;
}
.spt-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 5px 18px 9px;
}
.spt-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #dde1e8;
}
.spt-dot-on { background: var(--primary); }
.spt-ft {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 18px 15px;
  border-top: 1px solid #f0f2f5;
  gap: 8px;
}
.spt-nav { display: flex; align-items: center; gap: 6px; }
.spt-skip {
  background: none;
  border: none;
  padding: 0;
  font-size: .76rem;
  color: #999;
  cursor: pointer;
  white-space: nowrap;
}
.spt-skip:hover { color: #555; }
.spt-counter {
  font-size: .71rem;
  color: #bbb;
  white-space: nowrap;
}

